Skip to content

test: use smoke test account to seed db for smoke tests #5943

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

Merged
merged 6 commits into from
Oct 13, 2023

Conversation

danieljhegeman
Copy link
Contributor

@danieljhegeman danieljhegeman commented Oct 10, 2023

This commit modifies the BaseFunctionalTestCase class to allow the caller to specify a smoke_tests flag. If True, the class will initialized (seed) the data using the test account for smoke tests, which is [email protected], instead of the test account for functional tests, which is [email protected]

Reason for Change

Changes

  • Use the test user account [email protected] (rather than the functional test user account [email protected]) to seed the database ahead of smoke tests
  • Reinstate the e2e tests that are dependent on the seeded Collections being created with the test user account [email protected]

Testing steps

  • Either list QA steps or reasoning you feel QA is unnecessary
  • Describe how you made sure to know that your changes worked. Should allow someone else to go verify your code without in depth knowledge.
  • "Unit tested only", "tested in rdev by a, b, c, verifying feature worked by... ", "manually ran pipeline locally with these results: ..."

Notes for Reviewer

This commit modifies the BaseFunctionalTestCase class to allow the
caller to specify a `smoke_tests` flag. If True, the class will
initialized (seed) the data using the test account for smoke tests,
which is [email protected], instead of the test account for functional
tests, which is [email protected]
@danieljhegeman danieljhegeman requested a review from tihuan October 10, 2023 00:41
@github-actions
Copy link
Contributor

Deployment Summary

This commit un-skips the smoke tests that require a user token
@codecov
Copy link

codecov bot commented Oct 10, 2023

Codecov Report

Merging #5943 (3040892) into main (ac1cdd1) will increase coverage by 85.83%.
The diff coverage is n/a.

@@            Coverage Diff            @@
##           main    #5943       +/-   ##
=========================================
+ Coverage      0   85.83%   +85.83%     
=========================================
  Files         0      196      +196     
  Lines         0    15378    +15378     
=========================================
+ Hits          0    13200    +13200     
- Misses        0     2178     +2178     
Flag Coverage Δ
unittests 85.83% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 196 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@@ -31,7 +31,7 @@ describe("Collection Revision @loggedIn", () => {
* TODO(#5666): Enable this test once #5666 is resolved
* https://app.zenhub.com/workspaces/single-cell-5e2a191dad828d52cc78b028/issues/gh/chanzuckerberg/single-cell-data-portal/5666
*/
test.skip("starts a revision", async ({ page }) => {
test("starts a revision", async ({ page }) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tihuan re-added these two tests but it's failing 😞

not obvious to me where the issue is since the smoke test initialization is now using the test user acct, and this e2e test uses (or appears to use) the same test user credentials...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know you specifically did not request for me to make this change as part of the issue but it really did appear that it should be that simple (to my eye)

I can revert, and simply make the smoke test db initialization change, and then you can figure out how to reinstate the tests if you know what I'm missing

Copy link
Contributor

Choose a reason for hiding this comment

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

Hey Dan! Thanks so much for enabling the test! That totally makes sense and serves as a way to ensure data seeding works 😆

So far it seems like the smoke test account is not seeing any writable published collections it can pick from 🤔

Screenshot 2023-10-10 at 9 46 21 AM Screenshot 2023-10-10 at 9 44 47 AM

And if it's helpful, maybe it'd help to manually log into the smoke test account in RDEV to check it yourself too!

Another thing is that e2e test result is stored under GHA summary, and you can download it under "logged in test result" like so:

Screenshot 2023-10-10 at 9 43 17 AM

and unzipping the files will give you this directory:

Screenshot 2023-10-10 at 9 43 35 AM

The trace.zip is especially useful, to use it, please check out instructions here!

https://github.com/chanzuckerberg/single-cell-data-portal/tree/main/frontend/tests

Screenshot 2023-10-10 at 9 49 09 AM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks Timmy! I'll check this out

Copy link
Contributor

Choose a reason for hiding this comment

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

Perfect! Thanks so much for your help with this, Dan 🙏 !

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah I see. The issue here is we need additional improvements to the seeding script in addition to changing the existing collections to belong to the test user account rather than the func test account.

Copy link
Contributor

@tihuan tihuan left a comment

Choose a reason for hiding this comment

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

Woohoo!! Thanks so much for troubleshooting and getting the script to work, Dan!! 🙌🙌🙌

@danieljhegeman danieljhegeman merged commit 69cb73e into main Oct 13, 2023
@danieljhegeman danieljhegeman deleted the dan/5666-smoke-test-seeding branch October 13, 2023 20:33
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.

2 participants