Muted tests inside Docker show as failed — using artifact-mounted mytest.dll via docker-compose
Hello TeamCity community,
I previously posted about muted xUnit tests still showing as failed when run inside a Docker container with the docker runner (using docker exec myContainer dotnet test /mytest.dll). I no longer have access to that account and am reopening the issue from a new account. Below I summarize the original context and add additional details about my current pipeline.
Problem
- Tests that are muted in TeamCity still show up as failed when I run them inside a Docker container using: docker exec myContainer dotnet test /mytest.dll
- I expect TeamCity to mark muted tests as muted/ignored, not failed.
My build setup in short (additional details)
- The pipeline has three build steps:
- Unpack artifacts from another build and copy the extracted mytest.dll into the path expected by my Docker setup. (S the mytest.dll comes prebuilt form the other build)
- Run docker-compose to build/prepare containers. As part of this, mytest.dll is mounted into the test container (via a bind mount or volume configured in docker-compose).
- Start test execution with: docker-Runner and exec-Command and “myContainer dotnet test /mytest.dll” as additional arguments
- Important: mytest.dll is not built on the same build agent; it comes exclusively as an artifact from a different build and is mounted into the container after docker-compose is started.
From the previous thread I was kinda confused about the following statements:
Add a dotnet build step (either inside or outside the Docker container) to ensure the DLL is freshly generated.
As described, the DLL comes as artifact from another build
Build the DLL outside the container, then mount the output directory into the container at runtime.
Which I do already, as described above.
Avoid copying my.dll from previous builds or artifacts unless it has been rebuilt, as this can prevent proper test tracking in TeamCity.
Every time I run the test pipeline, I always fetch a freshly built mytest.dll from the build chain. The mytest.dll copied from the artifact is never reused between runs, so it should not break TeamCity’s test tracking.
Here is also the link of the previous thread
If there’s any other information I can provide that might help diagnose this (aside from the full build log, which I need to check before posting), please let me know.
Please sign in to leave a comment.
Could you please help check whether the full test name (including suites, etc.) is exactly the same for the muted test and the test that should be muted?
Muting may not work if the test name does not exactly match between two builds. Or if the muting scope does not match (not same project).
Could you please also share the relevant build logs (the build log from the other agent and the test log from the Docker container)?
Files can be uploaded via https://uploads.jetbrains.com/. Please let us know the exact id after the upload.
Best Regards,
Tom
While I wait for approval to upload the log file, I would be interested to know how TeamCity detects new failed tests.
Currently, all failed test cases are recognized as new failures with every run.
Perhaps I can already adjust something once I understand the mechanism.
Best Regards
finally I could upload the log. Here is the Upload id: 2025_11_12_bz9AVis65ocuDf9MRezfe9 (file: Testautomatisierung_WebApp_-_Schnellerfassung_Verwaltung_0.0.0.107.log)
Thanks for providing the log file.
As mentioned earlier, could you please also share the related build logs — specifically, the one from the other agent and the test log from the Docker container?
This will allow us to compare both logs and identify any differences.
My bad. Here are the build logs from one complete run from the 3 different machines. I actually dont know what you mean with the docker test log. The outputs on the console from the docker container are also appearing in the build log from team city.
Upload id: 2025_11_18_247xCoazR6e3T3Rhjwug9r (files: Testautomatisierung_WebApp_-_Schnellerfassung_Verwaltung_0.0.0.113.log and 2 more)
Based on the your supplied log files, I noticed that the failed test case
MediFox.Therapie.Tests.WebApp.Ui.Tests.Einstellungen.EinstellungenTests.Terminplanzeiten_FilialuebergreifendeZeitenFestlegen_ErfolgreichFestgelegt_MFT93057
appears in two logs:
Testautomatisierung_WebApp_-_Terminplan_Abrechnung_Zahlungen_Einstellungen_0.0.0.118.log and
Testautomatisierung_WebApp_-_Schnellerfassung_Verwaltung_0.0.0.113.log.
It seems that the full test name is identical in both cases, so it should be muted under this condition.
I’ve reached out to our development team for assistance. Please expect some delay while they investigate this. Thank you for your understanding.