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

Support live server tests with Selenium #2077

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

hansegucker
Copy link
Collaborator

Close #1854

Copy link
Member

@niklasmohrin niklasmohrin left a comment

Choose a reason for hiding this comment

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

Very cool, I feel that there are some parts that could be cleaned up or need some more explanation otherwise:

@niklasmohrin
Copy link
Member

Manager group was not present, but only if all tests are run. We found that django will first run django.test.TestCase instances, then django.test.TransactionTestCase and then unittest.TestCase. After the first, the database is cleared. If only running the live server test, the database is still there when running the test.

Link dump if we try to debug this again:

We concluded that we want to migrate an empty database, dump it, and use that dump as a fixture in the live server test - at least for now, to continue working on this.

@hansegucker
Copy link
Collaborator Author

hansegucker commented Apr 15, 2024

@Kakadus @niklasmohrin @richardebeling Finally, the last test has been migrated and I'm ready for a final review. 🥳

@hansegucker hansegucker force-pushed the live-server-tests branch 2 times, most recently from 6f8cb5d to 88d3f6e Compare April 22, 2024 18:44
Copy link
Member

@richardebeling richardebeling left a comment

Choose a reason for hiding this comment

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

Not yet fully reviewed, will have to look through most of the ported tests still, but generally this is looking very nice. Thanks!

@niklasmohrin
Copy link
Member

Getting chromium or firefox should be a lot easier now that we have nix, we can work something out together some time if you want :)

@Kakadus Kakadus force-pushed the live-server-tests branch 5 times, most recently from d182ee9 to a88cdfa Compare December 2, 2024 21:29
@Kakadus Kakadus mentioned this pull request Dec 9, 2024
@Kakadus
Copy link
Collaborator

Kakadus commented Dec 9, 2024

Heey, there is a green check now! 🎉

@hansegucker do you want to take over and resolve the open threads? If not, I can also finish this : )

Things I fixed:

  • we no longer supported django.contrib.auth.backends.ModelBackend, I switched to our evap.evaluation.auth.RequestAuthUserBackend (since Make natural key of userprofile unique #2249)
  • increased window size so that all elements should be visible now
  • compile scss&ts before testing the frontend
  • separate firefox into a separate nix shell / CI job

@Kakadus Kakadus self-assigned this Jan 13, 2025
Copy link
Member

@richardebeling richardebeling 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! I especially like the changes to package.json and package-lock.json.

Haven't re-checked yet whether all ported tests assert the same things as the old tests, will need to re-do that in a final review.

Copy link
Member

@niklasmohrin niklasmohrin left a comment

Choose a reason for hiding this comment

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

Very cool! After ensuring that I follow the steps from CI, they also passed locally :)

Copy link
Member

@richardebeling richardebeling left a comment

Choose a reason for hiding this comment

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

@Kakadus you re-requested review but some of the older review discussion points are still open. I'm generally fine with the code once these are resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Use LiveServerTestCase for frontend tests
4 participants