Improving unit tests (404s, flaky tests, rejected promises, etc...) #635
Replies: 4 comments 4 replies
-
Beta Was this translation helpful? Give feedback.
-
Interesting, didn't see the discussion - I raised a small PR for milo fixing most of the "./media_" issues #667 IMO the issue is that those errors go under, as opposed to actual errors tests which are more obvious, so if a dev isn't necessarily keeping an eye out for it, those quickly pile up. One approach would be first trying to reduce the current errors by just going through all of them https://github.com/adobecom/milo/actions/runs/4819932054/jobs/8583762128?pr=667 at run the tests and trying to get the test authors to revisit their tests and make small improvements Then a bit more education on what to look out for when writing tests apart of "1 Test passes ✅" would already alleviate this issue a lot IMO |
Beta Was this translation helpful? Give feedback.
-
The issue goes a bit further than just 404s, there are a lot of actual network requests being done. I've rephrased the OP-title a bit. I've found something very intriguing here which would fail tests if they did real requests
This might be a good long-term fix, we could also try to filter any 404s programmatically. |
Beta Was this translation helpful? Give feedback.
-
I've started https://github.com/orgs/adobecom/discussions/814 to document good/bad patterns! Hope that will become a good resource where we can keep patterns and point developers to |
Beta Was this translation helpful? Give feedback.
-
While working on #631 @Ruchika4 mentioned that it might be a good idea to tackle the 404s in our unit tests. It would make the test output cleaner and easier to read. Is this something we want to tackle going forward and retroactively?
Beta Was this translation helpful? Give feedback.
All reactions