-
Notifications
You must be signed in to change notification settings - Fork 52
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
Test log output is no longer streamed as the test runs since CSAPI tests moved to tests/csapi
(multiple packages in tests)
#215
Comments
If you want streaming output, only specify a single package in
|
Streaming log output seems like a great default benefit to have. It would be nice to just make it work without people having to know this random caveat. We could modify the Synapse test runner for Complement to only run |
Well, yes, but there are good reasons why this is not the default. If you are running tests under CI, most of the time you care more about the speed of the tests rather than having any kind of streamed output. If you are running tests locally then you care more for streamed output in which case just run a single package. They are conflicting features because in order to get large speedups (e.g 2x) you need to run tests in parallel. If this was streamed as it happened the output would be nonsensical and hard to follow, which is why it gets buffered in the first place. |
Do you mean that it isn't very practical/reasonable to add
It seems like those can coexist, I'm not trying to be CI and developer at the same time. Make CI efficient however and have it work out of the box for a local developer seems achievable. Ideal solutionI think ideally, Go could see that when I'm using Potential solutionsSplit tests manuallyBut something we can do now, boils down to what you mentioned about specifying a package. We could have all of the tests in the For CI
Systematically split tests across CI jobsOr parallelize more systematically, https://docs.gitlab.com/ee/ci/yaml/#parallel. I don't see this exact option for GitHub actions but something of the sort is possible, https://rubyyagi.com/how-to-run-tests-in-parallel-in-github-actions/#configuring-github-actions-workflow-to-run-test-in-parallel Write some shell script to do the same thing 🤷
Even after renaming all of
|
The number of directories will increase as the number of tests increases, so your solution isn't very practical as it would mean having to constantly update callsites where Complement is invoked (GH actions, manually, READMEs, etc) Using a shell script doesn't help because either:
Splitting them across different processes would be useful but seems convoluted given GH actions doesn't support it and afaik the only benefit for doing this would be to allow concurrent streaming output (it wouldn't speed up test runs any more than what we do currently). Overall, I'm not seeing any convincing argument for changing the current behaviour. By default, tests are run in parallel and output is buffered and emitted all at once at the end. If you want streaming output when debugging or creating new tests, then run a single package as outlined in #215 (comment) - this gives the best of both worlds, at the cost of needing to know how I don't think it's worth wasting more time and effort on this so I'm closing this issue. |
I've created golang/go#49195 to try to tackle this from the Go side so it just works out of the box. |
This tip from @richvdh to change the parallelism works well,
|
Before #171 and the
csapi
package was added, I was able to run Complement tests and see the log output as it runs. But nowadays, all of the test log output is buffered and only printed when all of the tests finish.This is caused by Go deciding to not stream log output when there are multiple packages present (we have
tests
andcsapi
in the./tests/...
directory):Related:
I liked the streaming behavior before to see the test progress but it's also important when I try to hook up Element to the homeserver and rooms from Complement to be able to see the log output of room ID's, etc to join and inspect, https://github.com/matrix-org/complement/blob/master/ONBOARDING.md#how-do-i-hook-up-a-matrix-client-like-element-to-the-homeservers-spun-up-by-complement-after-a-test-runs
As a workaround, I can get the log streaming behavior I want by being very selective about the files to run:
go test -v -run TestImportHistoricalMessages ./tests/main_test.go ./tests/msc2716_test.go
but this is manual process adjusting our generic Synapse test runner every time.Potential solutions
tests
package.The text was updated successfully, but these errors were encountered: