-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: API Consumer Testing #268
Comments
@LuchoTurtle please bas this PR off #263 which will be merged shortly. 👌 |
Posting this so I don't forget. https://github.com/hoppscotch/hoppscotch/tree/main/packages/hoppscotch-cli should be considered for running API definition tests and then However, |
@LuchoTurtle indeed What features does Yes, the CLI https://docs.hoppscotch.io/cli is "alpha": But there are enough "eyes" on it and it's based on the My biggest gripe with As noted in: dwyl/technology-stack#117 (comment) if you need to use |
I'm much more inclined to use Hoppscotch, it's FOSS and it's great. I just thought the CLI being in Again, I don't mind Hoppscotch and I will use it from now on, just thought that being "less-mature" would be an issue to you. I'm going to create tests in Hoppscotch and try to integrate CI with their CLI. |
Prefer Open Source to maturity in most cases. Look forward to seeing the tests. 👌 |
An update on this:
I'm now attempting to use https://github.com/nektos/act to run and test Github Actions locally. But it's failing trying to Setup elixir :/ |
The problem seems to be related to erlef/setup-beam#179 and https://stackoverflow.com/questions/71040681/qemu-x86-64-could-not-open-lib64-ld-linux-x86-64-so-2-no-such-file-or-direc. Producing ARM builds, due to using a M1 Mac, seems to be the culprit. |
@LuchoTurtle please don't waste time with trying to run the I've never run the |
Even if you have to do 100 commits to get this working and it takes 2 mins to run each one on |
Let |
According to the Review of: https://discussions.apple.com/thread/254319263?answerId=258100088022#258100088022 Indicates that this only works in That will create what looks like a "Native" App on your Which then opens full-screen an feels And you're off to the races! Having the |
It doesn't show in your Finder because it's hiding hidden files. You just have to type |
Yeah, I know about enabling hidden files in Mac. don't worry. |
In that case, I believe renaming to something along the lines of "_hoppscotch" is more intuitive, as it differentiates project files from CI files and shows in Finder. |
After reading through: hoppscotch/hoppscotch#1425 ⏳ |
@LuchoTurtle did you have to add the |
@LuchoTurtle judging from your screenshots, you appear to have the |
Having this documented in the |
This is how I eventually discovered that this was required: hoppscotch/hoppscotch#2256 (comment) |
Tried to install the npm i -g @hoppscotch/cli Got the error: npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/@hoppscotch
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@hoppscotch'
npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@hoppscotch'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/@hoppscotch'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/n/.npm/_logs/2023-01-22T02_32_54_836Z-debug-0.log |
As per: https://stackoverflow.com/a/51024493/1148249 ran:
Got a different error:
|
@nelsonic Thank you for the feedback on the PR and your issues, it is thoroughly appreciated! I have the extension installed, you are correct, but I did not manually do it. My Regarding importing environments and actually changing them, it's my fault it wasn't clear enough. I've grown so accustomed to using Postman that I assume that someone would need to change environments to get the variables to work. That's my fault, should have documented that process more thoroughly/shoshinier (?). Regarding the "three small pictures", it's totally my fault. I use the preview in VSCode to write the README and get instant feedback and so far it has been faithful to Github's markdown. However, as you duly noted, it wasn't working. So I'm going to double-check if the README is proper on GitHub as well, instead of relying on VSCode's preview. Also, the pictures to me looked correct side-by-side but I was working on a much bigger screen, should have thought that on laptops it wasn't discernable. Lesson learned! 😅 Again, thanks for the feedback and for adding the much-needed extra information that was lacking. Will surely pay more attention next time (especially with new "epic" sections like "API development"). |
@LuchoTurtle similarly, I'm working on a 4K screen. Your time should never be wasted.Then this is breaking a promise. Furthermore, I don't care how good it looks on your screen or It's not side-by-side it's scrolling and tiny. And when I click on one of the images: There's so much whitespace in the image I'm drownging in it. That's an 80% reduction. |
If things magically work for you without any extra effort that's great. 🎉 |
|
As part of building our
REST API
#256 we want to adopt a Software Engineering-approach/mindsetand add automated testing to GitHub CI.
As noted by @LuchoTurtle's research/notes into API Testing: github.com/dwyl/learn-api-design#api-testing
There are several options to chose from in this space.
Requirements
GitHub Actions/CI
. @apardo04's locust-load-test looks like a good candidate (as noted by @LuchoTurtle 👌)mix format
,mix test
,coveralls
) but should fail the build if theAPI
is not working as expected.Phoenix App
onGitHub CI
and then running the tests against the server or should run against the deployed Review App.API
but don't want to slow down our velocity. We will need to setupAPI
Test Results. Initially it's fine for these to just be in the build logs. But ideally, a comment should be posted to the PR with a summary of theAPI
test. And then we should also start recording them in a secondary format e.g.JSON
onS3
so that we can aggregate the data and run stats to know if/when things slow down. 💭Todo
API.md
for our basic API [PR] Stage 1 - Noauth
, anonymous API forTimers
andItems
#263locustfile.py
with lots of comments to help a complete beginner understand itGitHub Action
against the unauthenticatedAPI
.API
Requests as part of "Stage 3" (but leave these as stubs we will return to a the end of the week). 👌The text was updated successfully, but these errors were encountered: