-
Notifications
You must be signed in to change notification settings - Fork 10
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
Bring back tests to CI/CD pipeline #571
Comments
With regards to the DatabaseCleaner, the following links might be useful: |
Cypress vs. CapybaraThere is a suggestion whether we should switch to capybara for front-end integration tests instead of using cypress. I gathered some (admittedly anectodical) posts, some of which try to provide a fair comparison, others endorsing cypress in a direct comparison. (I haven't been able to find a post that directly compares cypress & capybara and favors capybara over cypress, only the other way around.) These arguments might be biased towards favoring Cypress.
The asynchronous approach of Capybara is described in its documentation here. However, Cypress apparently also follows this timeout-and-try strategy as seen here. But with Cypress, for DOM events, it will automatically wait:
as seen here We should also take into account, that we already have quite a few tests written in Cypress for MaMpf, so switching to Capybara would imply the additional effort of having to rewrite those tests in another language. Based on my very limited research on both tools, I prefer Cypress so far, as:
We have to also consider that Cypress might be more difficult to setup, especially with regards to our docker setup. But I'm sure, we can manage to get a workable solution with no flaky tests and easy to use setup locally (which might require some initial effort, but that's probably also the case with capybara). After having talked in persona (@fosterfarrell9 and @Splines), we found that staying with Cypress would be the best option for us, especially since we already have test cases written with Cypress. However, we want to focus more on the integration test aspect, i.e. not try to manipulate the API or the backend via app factory methods. Instead, testing with Cypress will allow us to test MaMpf just like a manual tester would, without any knowledge of the backend and without even knowing that it is written in Ruby on Rails. Therefore we will probably not mock any data and instead preseed/initialize the database with our already-existing mock data before the Cypress test runs. This is contrary to the philosophy of unit tests where every test should only have a very narrow scope and where we mock our data with FactoryBot. Nevertheless, we still have to find a good solution such that Cypress tests don't affect each other when manipulating the database. This could be achieved by using transactions and automatically rolling them back after each test run; we'll see what a good strategy for that is. I will try to get the setup to work locally and in the CI/CD pipeline again in the near future. Before that, unit test support is brought back via #581. |
Getting Cypress up and running
|
So finally, in #652, we also brought back Cypress. I think that this issue is therefore done. |
#562 removed the testing from the CI/CD pipeline. We should bring it back in an easy to use fashion. This includes
The text was updated successfully, but these errors were encountered: