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

[feature request] grouping of serial tests #2322

Closed
rishabhKalakoti opened this issue Dec 29, 2019 · 3 comments
Closed

[feature request] grouping of serial tests #2322

rishabhKalakoti opened this issue Dec 29, 2019 · 3 comments

Comments

@rishabhKalakoti
Copy link

Problem Description

My use case is the following:
I made two test files.

test file 1
test file 2

I wanted the test cases of both of these files to run serially and the rest of the test cases concurrently, but presently, there is no provision of doing that in case of multiple files, therefore I had to run ava using --serial flag, but using this the testing speed slows down as all the tests are run serially.

Feature Request

It would be good if we had the option of grouping the tests, so that we can select different groups of test cases that share the same resource to run serially but tests of different groups can be run concurrently.

Open to discussion.

@novemberborn
Copy link
Member

Having a quick look at the tests, if you could write the files in temporary locations you wouldn't have to worry about test files running concurrently. That's really how this is meant to be used.

We have some issues around managing restricted resources during a test run, which if it had actually existed you could have used here, but it doesn't yet 😄

(I'm closing this issue for housekeeping purposes, but let's keep the conversation going.)

@rishabhKalakoti
Copy link
Author

Hey. I am not sure if I get what you wanted to say.

if you could write the files in temporary locations you wouldn't have to worry about test files running concurrently

From the above line, I understand that concurrency is not possible if I am writing files at a location.
But for different files if run normally using test.serial run concurrently as they belong to different files.

I wanted concurrency as some of my files are independent of these two files which need to be run serially.

I didn't really get that restricted resources talk, but I get that what I wanted could be done with the help of those :)

Could you please reference the issue regarding the same, if time permits, so that I can refer it and see the progress. Thank you.

@novemberborn
Copy link
Member

From the above line, I understand that concurrency is not possible if I am writing files at a location.
But for different files if run normally using test.serial run concurrently as they belong to different files.

As you found there's two levels of concurrency:

  • Test files
  • Individual tests inside each file

The best approach is to make it so each test file can run independently of the other. In your case that means they should use separate paths for the files they write to disk.

I have some service integration tests that rely on a database, and each test file (which starts its own copy of the service) is actually using a different database instance, thus avoiding any concurrency issues when multiple test files run at once.

This kind of separation is not always possible, especially with certain databases or third party resources.

I didn't really get that restricted resources talk, but I get that what I wanted could be done with the help of those :)

This one I think: #1366

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants