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

"Normalize" tests #169

Open
Naapperas opened this issue Aug 9, 2021 · 4 comments · May be fixed by #311
Open

"Normalize" tests #169

Naapperas opened this issue Aug 9, 2021 · 4 comments · May be fixed by #311
Assignees
Labels
maintenance P0 High priority

Comments

@Naapperas
Copy link
Member

Naapperas commented Aug 9, 2021

Right now there are tests that manage (create/delete) the resources they need and there are others that use what is available from prior tests. This can cause conflicts that should not happen, since the tests, or test groups (mainly tests inside a describe) should be independent from each other, and not have any influence on tests that appear after.

So the test suites should be refactored in order to have each test/test group use only the resources they need, creating them and deleting them, without leaving "residues" for other tests.

@Naapperas
Copy link
Member Author

I had problems regarding this when working on #168: in the edit offer tests, I had to change the date of creation of the offers because the dates previously used were causing conflicts with another test later on

@Naapperas Naapperas added the P1 Medium Priority label Aug 9, 2021
@BrunoRosendo
Copy link
Member

We need to prioritize this issue very soon.
We should also split the test files, maybe by route. The test files are way too big right now. Small discussion here

@Process-ing
Copy link
Contributor

Process-ing commented Dec 24, 2022

While working on issue #261, I noticed that some offer publish dates in the offer and company tests were outdated (see more details in the issue). It's most likely that other dates are also outdated, leading to unwanted behavior in the tests, so those should be checked.

@BrunoRosendo
Copy link
Member

BrunoRosendo commented Feb 7, 2023

We can consider separating tests into different files and also have some listener that purges all the database's information. This could happen in each test or group. This is done in https://github.com/NIAEFEUP/website-niaefeup-backend but it's a totally different tech

@Naapperas Naapperas linked a pull request Mar 1, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance P0 High priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants