-
Notifications
You must be signed in to change notification settings - Fork 18
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
Adding behavioural tests for API #816
Conversation
@@ -0,0 +1,74 @@ | |||
import json | |||
from behave import given, then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you'll need to add behave to backend/reqiurements.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hadn't added it there as it was only needed for testing and is not needed at run time. I included it in the setup here instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add it to a test requirements file then, in case local users want to test it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added it.. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left a few comments, but so far it lgtm!! I love how clean the testing scenarios are
.github/workflows/deploy.yml
Outdated
- name: Set workflow artifact file | ||
run: | | ||
mkdir -p ./workflow_artifact | ||
echo STACK_NAME > ./workflow_artifact/stack_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm should this be echo $STACK_NAME
? otherwise wouldn't this always write STACK_NAME
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, Thanks for catching that.. :)
.github/workflows/push-rdev.yml
Outdated
@@ -40,7 +40,10 @@ jobs: | |||
exit 1 | |||
else | |||
echo $GITHUB_REF_NAME | tr '[:upper:]' '[:lower:]' | xargs -I {} -n 1 echo STACK_NAME={} >> $GITHUB_ENV | |||
mkdir -p ./workflow_artifact | |||
echo STACK_NAME > ./workflow_artifact/stack_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here should it be echo $STACK_NAME
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excited to see integration tests for the API! Having a more robust backend system that validates the response structure and the data is a huge plus!
Relates to #818
Summary:
Introduces bdd tests for the GET API endpoints that fetch data from s3. It also adds a GitHub workflow to execute the test after a deployment to the dev environment.
To allow the workflow to test the specific dev environment that was deployed to, the push remote dev workflow uploads an artifact of the prefix. The new workflow downloads the artifact and passes that to the behavior tests.