-
Notifications
You must be signed in to change notification settings - Fork 4
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
Invalid events being skipped when using with Minitest due to a missing test suite ID #130
Comments
Hi! This warning appeared when we turned on test suite visibility by default, the warning is there to tell you that some of your tests are not part of a test suite for some reason (and now they are being dropped). Creating a GitHub issue is exactly the right thing to do in this situation, so let's find out why this happens. I have a hunch in this case, because I've seen similar behaviour in Minitest once. One project I instrumented with datadog-ci had helper methods that are included in tests that started from Could you check your tests for helpers that start with If this is not the case, then we'll continue digging further! |
Thanks for the quick response here @anmarchenko! I just checked our test suite for did find a handful of |
Hi! Let's continue investigating. I tested this library with Minitest::Spec and so far did not uncover any issues. Let's do the following: try to run your tests in CI with env variable DD_TRACE_DEBUG=1 and send us the logs. We will be looking then for a name of the span with type "test" and without Another question: when these messages appeared, do you still see all your tests in Datadog test runs view? Or there are some tests that are being dropped? |
Now I'm really confused...
I looked in DD CI, and you are right, we are seeing a smaller # of tests than Minitest itself is reporting. Minitest reports:
However, DD CI is showing 2,281 passed and 14 skipped. The # of warnings we got in our previous run was 139, so not exactly the # of missing tests, but perhaps that warning count is not the number of individual tests but the number of test groups / suites? |
I would need the whole log to try to reproduce what happens there, could you send it to me per email? andrey.marchenko at datadoghq.com Is it consistent that there are no warnings every time you run it with DD_TRACE_DEBUG? |
About the inconsistency of passed tests: there might be name clashes if you generate your tests dynamically: You can check that number of tests here: Is the same with number here: Both are on "Test commit" page https://app.datadoghq.eu/ci/test-commit/ If you have 2281 passed tests in the first widget, but 2534 test runs that would mean that many tests have exactly same name/test suite combinations |
I have another hunch: I think shoulda-context is the reason, we might have a bug with shoulda-context in minitest. Let me try to create a repro case tomorrow morning to see if this is the case. |
@agrobbin the bug was in shoulda-context library (using eval without source location) and it was fixed in this PR: I can confirm that this fixes datadog-ci issue by using shoulda-context from main branch: 23199c3 could you run your test suite with shoulda-context version below and tell me if warnings go away and you see all your tests in Datadog? gem "shoulda-context", github: "thoughtbot/shoulda-context", branch: "main" |
Interesting, switching to |
These 26 that are left are coming from some other library that fiddles with source locations. Please send me the full debug logs from the current run and I will continue investigation. If you would not rather use email, you could open support ticket and then send these logs to Datadog support (they will find me, eventually). |
I'll email you in the next few minutes! Sorry for the delay on that, I had to put this down yesterday while looking into some other things. |
Current behaviour
Starting in v0.7.0 (I believe due to #78), we've been seeing warnings like the following in our tests:
Expected behaviour
None of our configuration is complex, with this being our
Datadog.configure
block:Additionally, our CI env vars are:
We're running in GitHub Actions.
Steps to reproduce
This started showing up as a warning in v0.7.0 of datadog-ci-rb (when we upgraded ddtrace to v1.20.0).
Environment
Datadog.configure ...
):The text was updated successfully, but these errors were encountered: