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

Implement Parallel Unit testing #9467

Open
dblythy opened this issue Dec 3, 2024 · 4 comments
Open

Implement Parallel Unit testing #9467

dblythy opened this issue Dec 3, 2024 · 4 comments
Labels
type:ci CI related issue

Comments

@dblythy
Copy link
Member

dblythy commented Dec 3, 2024

New Feature / Enhancement Checklist

Current Limitation

Our current testing approach is more or less e2e testing. A full server and database is built in memory.

This makes test comprehensive, but slow. For a simple test like asserting that cloud functions register, there's no reason why this needs to run across all the different environments.

Feature / Enhancement Description

Implement a seperate folder of unit tests. This could still utilise Jasmine, but the focus being on mocking all external dependencies to the test. This means that the unit tests can be ran in parallel, reducing our build times. Will also make it easier to debug - theoretically, one line that breaks tests should only break one unit test.

Example Use Case

Alternatives / Workarounds

3rd Party References

Would also suggest testing standards uplifts:

  • unit testing folder structure should reflect the source code
  • each unit tests should be focused on testing one thing and one thing only
  • verbose, over complicated tests should be replaced by simpler, easier to understand tests.
Copy link

Thanks for opening this issue!

  • 🎉 We are excited about your ideas for improvement!

@mtrezza mtrezza added the type:ci CI related issue label Dec 3, 2024
@mtrezza
Copy link
Member

mtrezza commented Dec 8, 2024

Regarding parallel execution, it seems that jasmine 5 supports this, so there should be no need to switch to a different framework.

Related:

@dblythy
Copy link
Member Author

dblythy commented Dec 10, 2024

I think it would be worth having a key distinction though as the current test suite would be hard to parallelise due to the e2e nature of it.

IMO, a new folder of unit tests where we test individual methods of code (with jasmine) would be the deliverable here

@mtrezza
Copy link
Member

mtrezza commented Dec 10, 2024

I think that really depends on how parallel execution is implemented in jasmine. Parse Server and MongoDB could be parallelized as well, I think it wouldn't even be necessary to spawn up child processes, they could just run on different ports and the tests could cycle between them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:ci CI related issue
Projects
None yet
Development

No branches or pull requests

2 participants