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 Minitest's parallel execution #129

Open
andyundso opened this issue Jul 26, 2023 · 1 comment
Open

Support Minitest's parallel execution #129

andyundso opened this issue Jul 26, 2023 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@andyundso
Copy link
Contributor

This morning, We encountered a strange issue when integrating this gem with our Minitest test suite. Sometimes, the OpenAPI schema was generated, sometimes not. In the end, we discovered that no schema was generated when running all tests simultaneously, but it worked fine when only running a specific controller test.

Rails offers a helper named "parallelize" to run multiple tests simultaneously. However, this only comes into effect when running a more considerable amount of tests. Single tests are still executed in one process.

My assumption right now, which explains the phenomenon explained earlier, is when Rails starts parallelizing the tests, each process has its copy of RSpec::OpenAPI.path_records. The primary process does not execute any tests, and therefore, its version of the path records remains empty, and no OpenAPI schema is generated.

Parallel test execution is a native feature of Minitest. It would be nice if RSpec OpenAPI could support it.

@exoego exoego added the help wanted Extra attention is needed label Jul 27, 2023
@exoego
Copy link
Owner

exoego commented Jul 27, 2023

I will not work on this since I do not use minitest.
PR welcome.

@exoego exoego added the enhancement New feature or request label Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants