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

ExCheck usage in an umbrella app causes end-of-run spec counts to be reported incorrectly. #33

Open
myronmarston opened this issue Nov 20, 2016 · 6 comments

Comments

@myronmarston
Copy link

We have an umbrella app and we use ExCheck in the test suite of one of the apps. When we run mix test in our project root (which recursively runs mix test in each app), the end-of-run test counts reported for each app are inflated with an extra 100 tests. For example, we get output like this:

# ...
==> s3
Excluding tags: [:manual, :smoke]


Delorean.S3Test

Delorean.S3AcceptanceTest
  * test both clients calculate `presigned_get_url` in the same way (and the URL works) (195.1ms)
  * test `Delorean.S3.Test.FakeS3` can upload objects to S3 and later list and fetch them (13.2ms)
  * test `Delorean.S3` can upload objects to S3 and later list and fetch them (330.6ms)


Finished in 0.7 seconds
103 tests, 0 failures

Randomized with seed 54640
# ...

3 tests but it is reported as 103. I originally reported this as an elixir issue but eventually realized ExCheck is causing this.

@luc-tielen
Copy link
Contributor

The IO server and formatter.ex are the cause for this most likely. For each test with triq/excheck it adds the amount of generated tests.
Maybe we could add flag/config to switch this behaviour on and off.
Is the code online so I can test this?

@myronmarston
Copy link
Author

Is the code online so I can test this?

Sorry, it's a proprietary code base I can't share.

@luc-tielen
Copy link
Contributor

Or can you recreate a minimal failing example? Would be much appreciated.

@myronmarston
Copy link
Author

Or can you recreate a minimal failing example? Would be much appreciated.

Sure:

https://github.com/myronmarston/excheck_issue_33

Clone it, run mix deps.get and run mix test. You'll see this output:

$ mix test
==> bar
......................................................................................................

Finished in 0.07 seconds
102 tests, 0 failures

Randomized with seed 893339
==> foo
.

Finished in 0.03 seconds
101 tests, 0 failures

Randomized with seed 997063

The bar app has a property test with 100 iterations (plus one normal exunit test) and it reports the total as 102 tests (although...shouldn't that be 101 tests? 1 normal test + 100 property test iterations?). The foo has only one ex unit test and does not use excheck at all, but it reports 101 tests.

@luc-tielen
Copy link
Contributor

Thanks, the example helped a lot with debugging. 😄

@luc-tielen
Copy link
Contributor

Fix got merged in, should work now.

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