Skip to content
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

Merged
merged 6 commits into from
Mar 6, 2023
Merged

Adding behavioural tests for API #816

merged 6 commits into from
Mar 6, 2023

Conversation

manasaV3
Copy link
Collaborator

@manasaV3 manasaV3 commented Jan 5, 2023

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.

@manasaV3 manasaV3 marked this pull request as draft January 5, 2023 19:04
@manasaV3 manasaV3 self-assigned this Jan 6, 2023
@manasaV3 manasaV3 added the improvement Release Label: Used for categorizing improvements in automated CI release notes label Jan 6, 2023
@manasaV3 manasaV3 marked this pull request as ready for review January 6, 2023 00:27
@manasaV3 manasaV3 changed the title Adding Behavioural tests for backend Adding behavioural tests for API Jan 6, 2023
@@ -0,0 +1,74 @@
import json
from behave import given, then
Copy link
Collaborator

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

Copy link
Collaborator Author

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.

Copy link
Member

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added it.. :)

@manasaV3 manasaV3 requested a review from kne42 January 13, 2023 18:35
@manasaV3 manasaV3 marked this pull request as draft January 23, 2023 21:14
@manasaV3 manasaV3 added new-feature Release Label: Used for categorizing features in automated release notes and removed improvement Release Label: Used for categorizing improvements in automated CI release notes labels Jan 25, 2023
Copy link
Collaborator

@codemonkey800 codemonkey800 left a 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

- name: Set workflow artifact file
run: |
mkdir -p ./workflow_artifact
echo STACK_NAME > ./workflow_artifact/stack_name
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.. :)

@@ -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
Copy link
Collaborator

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?

codemonkey800
codemonkey800 previously approved these changes Jan 31, 2023
klai95
klai95 previously approved these changes Mar 1, 2023
Copy link
Contributor

@klai95 klai95 left a 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!

@manasaV3 manasaV3 dismissed stale reviews from klai95 and codemonkey800 via d5eee12 March 2, 2023 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature Release Label: Used for categorizing features in automated release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants