-
Notifications
You must be signed in to change notification settings - Fork 4
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 integration tests #53
Add integration tests #53
Conversation
292d83a
to
945f908
Compare
13d0389
to
5e73bef
Compare
5421e88
to
7694f94
Compare
As mentioned in slack, the tests are currently not passing because the |
7716920
to
d301ab8
Compare
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.
One tiny comment. I'll continue my review tomorrow.
d301ab8
to
10b7440
Compare
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.
Just one comment. Otherwise this looks good to me!
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.
This is impressive! This is going to make us feel a lot safer of the whole product.
My most important thought:
-
I don't think we should run these tests in the CI just yet. Maybe in the future a subset of these tests can run automatically. The reason is that we can run the test in parallel. So two PRs will write each others tests. Running those manually is not a huge deal because you can understand what's going on and run then again. So basically we are adding a step we don't really have so far, QA. Some human being needs to smoke tests that everything works as expected after each deployment (or right before the release)
-
I think it would be a good idea to "mark" the order and trades we create on each test run or even test case. An idea is to use the tag, but we might use something else.
I think we can merge this PR with these tests and start adding test cases!
Many, many thanks!
10b7440
to
e796604
Compare
As discussed in the office I created a new workflow for these integration tests instead of having them ran by the CI. They will now be ran every time there is a new release, and can be ran manually from Github (by going into Actions --> Electricity-Trading-API-Integration-Tests --> Run workflow). |
With regards to the tags I tried adding
|
e796604
to
8fa612c
Compare
Fixed the tag now that the changes were made in the service. |
Forgot to mention but this should be fixed now. |
Signed-off-by: camille-bouvy-frequenz <[email protected]>
Signed-off-by: camille-bouvy-frequenz <[email protected]>
Signed-off-by: camille-bouvy-frequenz <[email protected]>
Signed-off-by: camille-bouvy-frequenz <[email protected]>
8fa612c
to
c1e13af
Compare
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.
LGTM!
|
||
try: | ||
# Stream trades with a 15-second timeout to avoid indefinite hanging | ||
streamed_order = await asyncio.wait_for(anext(stream), timeout=15) |
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 didn't know about anext
, my Python is getting Rusty.
This PR adds integration test for the API client, service, as well as handel. These tests are performed by creating, updating & deleting orders on the simulation database.
As discussed in the latest team meeting, these tests were originally written with the goal of automatising everything. As a consequence, some of them might not be the most coherent: for instance
test_list_public_trades()
just verifies that the returned list isn’t null. It doesn’t check for the correctness of the output at all. These tests might thus have to be split into system tests (that would be performed manually), and integration test. Additionally, I think that having these tests run by the CI is not the most appropriate (especially given that they depend on other components than just the client).So please suggest alternatives & improvements, & let's make a next level robust, efficient and awesome test suite!😎