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

Add API integration tests #551

Merged
merged 12 commits into from
Jan 11, 2022
Merged

Add API integration tests #551

merged 12 commits into from
Jan 11, 2022

Conversation

yolossn
Copy link
Contributor

@yolossn yolossn commented Jan 4, 2022

TODO:

  • Test Omaha Endpoint.
  • Find a way to test the timeline endpoints properly (Refer TODO statements in stats_test.go).
  • Update CI/corresponding make functions to use the docker-compose.test.yaml file.

@yolossn yolossn marked this pull request as draft January 4, 2022 13:39
@yolossn yolossn force-pushed the api_test branch 2 times, most recently from e6cc27a to 325ec6f Compare January 5, 2022 15:55
This patch adds the docker compose file that
will used for the e2e tests

Signed-off-by: Santhosh Nagaraj S <[email protected]>
Signed-off-by: Santhosh Nagaraj S <[email protected]>
This patch adds the e2e tests for the endpoints
related to applications

Signed-off-by: Santhosh Nagaraj S <[email protected]>
This patch adds the e2e tests for the endpoints
related to groups

Signed-off-by: Santhosh Nagaraj S <[email protected]>
This patch adds the e2e tests for the endpoints
related to channels

Signed-off-by: Santhosh Nagaraj S <[email protected]>
This patch adds the e2e tests for config endpoint

Signed-off-by: Santhosh Nagaraj S <[email protected]>
This patch adds the e2e tests for the endpoints
related to instance

Signed-off-by: Santhosh Nagaraj S <[email protected]>
This patch adds the e2e tests for the endpoints
related to activity

Signed-off-by: Santhosh Nagaraj S <[email protected]>
This patch adds the e2e tests for the endpoints
related to packages

Signed-off-by: Santhosh Nagaraj S <[email protected]>
@yolossn yolossn force-pushed the api_test branch 4 times, most recently from 382d3bb to 47ea740 Compare January 10, 2022 09:05
This patch adds the e2e tests for the endpoints
related to instance stats

Signed-off-by: Santhosh Nagaraj S <[email protected]>
This patch adds the e2e tests for omaha endpoint

Signed-off-by: Santhosh Nagaraj S <[email protected]>
@yolossn yolossn changed the title wip: add integration test Add API integration tests Jan 10, 2022
@yolossn yolossn marked this pull request as ready for review January 10, 2022 11:49
backend/Makefile Outdated Show resolved Hide resolved

assert.Equal(t, len(timelineDB), len(timelineResponse))

// Since the response from DB and API doesn't match as they are relative to the time at which
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@illume illume left a comment

Choose a reason for hiding this comment

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

🎉 Looking good. Thanks for doing this.

I left a little comment about the make target name. Apart from that looks good to me.

I'm not sure if we should be testing the auth related stuff here? But I understand testing auth is out of scope for this PR. Additionally, testing error handling is out of scope of this PR.

In case anyone else is reading, the reason this was done as a http level integration test rather than the usual way with testing handlers... is because the proof-of-concept branch rewrites the backend, so that isn't possible to test the handlers easily. This way the tests can be used on the main branch and then also in the proof of concept branch.

This patch updates the make file to use the docker compose
file for tests instead of the shell scripts and docker
commands.

Signed-off-by: Santhosh Nagaraj S <[email protected]>
@joaquimrocha
Copy link
Collaborator

Thanks @yolossn for such a massive effort!

@joaquimrocha joaquimrocha merged commit 34fb639 into main Jan 11, 2022
@joaquimrocha joaquimrocha deleted the api_test branch January 11, 2022 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants