-
Notifications
You must be signed in to change notification settings - Fork 757
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
GitHub Actions: add test suite #5332
Conversation
ba0797d
to
49560c8
Compare
TestAbstractFunction TestOSCBundle TestSanitize TestServer
49560c8
to
561f2da
Compare
Glad to see this work moving forward! That mysterious error is one that I stuggled with enourmously. I never could figure out how to replicate it consistently. I hoped supercollider/qpm#10 had fixed the problem. As for the tests themselves, a while back I had made myself a list of ones that needed to be fixed or didn't make use of the Server correctly. I'll compare what I had found with what you've posted here. Ideally, you would merge this PR with the minimal set of functionning tests. Then, we can start creating PRs which fix problematic tests one at a time. |
I have been experiencing this problem still once passed certain number of tests added.
Mosts tests already pass, as you can see. The tests that reliably fail (or error out) should be easy to fix. And yes, for this PR I don't want to focus on the failing tests, but only GHA implementation (including json files location) and qpm changes (though maybe this PR could go as is, and I'd open a separate ticket for qpm? it's all intertwined though). |
thanks for this @dyfer and thanks to @patrickdupuis for the work that led up to it (and sorry again that i let your PR stall)! i will review this next after i finish proposing changes for #5295 . |
@dyfer just looked this over, thanks for the clear write-up. preliminary note, mostly for myself: when i run the tests locally on Arch here are some steps that are different from yours:
|
regarding the correct way to run a process with xvbf, i found i think we might consider moving xvfb-related things out of qpm and into CI scripts instead, with a possible note in the documentation of qpm that if you don't want to see GUI windows popping up while the tests run, you can install xvfb-run yourself and run it that way. this is effectively the same as offering a "headless" switch, but requires less explanation, and would also make qpm a little more robust for wayland support. to me this just "feels right" -- GHA starts an xvfb-run process, which provides an environment for qpm, which runs sclang. what do you think? the failing tests and new workaround code you added to eliminate those mysterious errors are both fine with me, as a temporary solution. |
I'm aware of xvfb-run and the dedicated action.
Not sure what you meant here. I am using a specific path for the API quark - this could be the copy that's already installed with the user's SC install (i.e. in |
really, these are just notes for myself. :) i just wanted to install the API quark through qpm and remember how to do it in case i tested again later. |
I wasn't able to use https://github.com/GabrielBB/xvfb-action So instead I've run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's fine, i would personally like to avoid using actions for things as simple as this -- each action we rely on is a potential security/maintainability issue.
it all looks good to me, although 10 minutes to run tests feels awfully long. perhaps in addition to fixing broken tests we should also look into reducing the number or scale of long-running tests and test suites.
"skipReason":"UnitTest sometimes fails when run in qpm on Linux (FIXME)" | ||
} | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a final newline and indent this file at 4 spaces. if you don't mind, i'd prefer seeing "suite" lines before "test" since that feels more intuitive (general to specific)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Re: "test" vs "suite" - I was just following the convention in the previous file, but I like the idea of changing it into "general to specific"
1609d33
to
67bf088
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! will merge after CI completes
Purpose and Motivation
This PR implements running our full test suite in GitHub Actions on Linux and macOS. It is another milestone in implementing #5261. Fixes #3132, supersedes #4749.
Result:
3036 TESTS PASSED
, as reported by the GH runner.In the process on working on this, I have discovered numerous issues, some of them are fixed, while others are "patched" in this PR, yet others are still in place and documented below.
qpm
We are using qpm for running the test suite. @patrickdupuis's work on #4749 was a big help to understand how it works.
Qpm uses the following SuperCollider code to actually run the tests. This code reads a list of tests from a JSON file, expands * globs in test names updating the list in the JSON file, and writes the results of the tests to the same file. It needs the API Quark to work.
Qpm has some system-specific code that needed to be changed to work with GHA runners. I'm not sure what is the canonical way of running xvfb, but this should be discussed on a separate issue in the qpm repo. In this PR I am using qpm with fixes I applied to a new branch.
I've encountered mysterious errors (example) as I've started running larger chunks of the test suite. I think there might be some issues in writing large dictionary to the file, and thus made some changes to the SuperCollider code runnings the tests. Particularly the hardcoded wait times are not a proper solution, but allowed to avoid these errors.
I've placed the JSON file with the list of tests in
testsuite/scripts
. I'd be happy to change that location if desired. Previously the list for Travis was stored in the root directory of the repo, which I wanted to avoid. I've also created a directorytestsuite/scripts/run
where a copy of the JSON file is made and qpm is operating on that copy.failing tests
There is a number of failing tests. Some have bugs and simply don't run, some run locally but fail, and some fail only when running as part of the test suite, sometimes when run locally, sometimes only when run in GHA. For some tests I excluded/listed specific methods, for others I excluded all tests for a given class. I also fixed some tests as part of this PR.
Here are the failing tests:
Tests with bugs:
Tests failing locally:
Tests failing in qpm, with short descriptions:
running tests locally
pip install git+https://github.com/supercollider/qpm.git@topic/xvfb-temp-fix
export PATH=/path/to/supercollider/build/Install/bin:$PATH
Extensions
andsynthdefs
folders to avoid running non-built-in tests and introducing issues from 3rd-party server pluginscp /path/to/supercollider/testsuite/scripts/gha_test_run_proto.json /path/to/supercollider/testsuite/scripts/run/gha_test_run.json && qpm test.run -l /path/to//supercollider/testsuite/scripts/run/gha_test_run.json --path /path/to/supercollider/build/Install/SuperCollider/SuperCollider.app/Contents/MacOS/sclang --include ~/path/to/API/quark /path/to/supercollider/testsuite/classlibrary
GitHub Actions implementation
I implemented running tests in jobs separate from the building ones. That way it is presented more clearly when the tests pass/fail, as it is listed in the list of jobs. Unfortunately this makes it also a little slower, since the testing stage needs to wait for all build steps to finish.
EDIT: now the qpm output is in color
Types of changes
To-do list
Allmost tests are passing (see details)