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

ZIO Test: Support SBT testQuick Command #1927

Open
adamgfraser opened this issue Oct 7, 2019 · 4 comments
Open

ZIO Test: Support SBT testQuick Command #1927

adamgfraser opened this issue Oct 7, 2019 · 4 comments
Labels
enhancement New feature or request tests

Comments

@adamgfraser
Copy link
Contributor

With the work we have been doing to add support for SBT command line arguments to ZIO Test, I think the main one we are still missing is testQuick. Currently this works at the file level but not the individual test level. For example, if there is a failing test in ZQueueSpec and I run testQuick in coreTestsJVM, after the first run it will only run ZQueueSpec (because that is the only file with failing tests). But it will run all the tests in ZQueueSpec instead of just the individual test that failed, as other testing frameworks do.

Copying @reibitto.

@mtsokol
Copy link
Contributor

mtsokol commented Oct 8, 2019

@adamgfraser Hi, I've tried to look at it right now because I would be great to have it.
After quick googling for it and inspecting sbt internals according to https://stackoverflow.com/a/46829675/6717327 it's clear that we are missing creating succeded_tests deeply in target.

Although I've looked inside one of my projects that uses scalaTest framework and it turns out that succeded_tests created by scalaTest is operating on the level of test suites, not single tests inside suite.
Here is a snippet from this file:

#Successful Tests
#Fri Jun 14 13:49:53 CEST 2019
projectmembership.ProjectMembershipSpec=1560512993879
user.UserSpec=1560512993869
session.SessionSpec=1560512993935
project.ProjectSpec=1560512993877

So it works for running all tests suites and then testQuick only runs suites that have failed tests.

So is it about making this possible? (running all suites and testQuick only failed suites)
Because I don't see testQuick for scalaTest operative on the level of single test inside a suite.
Or am I missing something?

@adamgfraser
Copy link
Contributor Author

You are totally right. I thought I remembered that feature existing but clearly I was hallucinating.

I do think it would be fairly straightforward for us to implement this ourselves. The SummaryBuilder already collects all the failed tests so we would just need to write this to a file after running the tests and then create a new command line option similar to what we did for -t to read the file and filter for only tests listed in the file.

@mtsokol
Copy link
Contributor

mtsokol commented Oct 10, 2019

Sounds awesome for me. Do you don't mind if I will try to do it this or next weekend? I haven't done any sbt integration feature yet, so I will look into this -t for an idea.

@adamgfraser
Copy link
Contributor Author

That sounds fantastic! Let me know if you need any help as you are working through it.

@adamgfraser adamgfraser added the enhancement New feature or request label Nov 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tests
Projects
None yet
Development

No branches or pull requests

3 participants