-
Notifications
You must be signed in to change notification settings - Fork 40
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
Disable SONAR scan in PRs created from forks #591
Conversation
* A lot of unittests aren't running on CI because the GHA currently * Runs all tests but only on windows and a bunch of tests have the build tag !windows * On docker ubuntu only the tests with the dag docker ubuntu run * The fix is to update the GHA that runs `make test` to run on all OSS * This rule doesn't use any build tags so it will run all tests. * Fix stateful#587
The first bullet points are not true. There is this step:
It runs all tests thanks to Not all tests can run on Windows because they are Linux specific. At the current state, runme does not provide full Windows support. Windows with WSL is recommended. With regard to the Sonar support and PRs from forks, let's wait for @sourishkrout's comment. |
@adambabik Thank you. You're correct and setting TAGS=tags_with_docker should run all tests. In which case, do you know what's going on with respect to service_test.go is running CI? That service_test failed in the test_all rule but not on main. It looks like test all sets |
Makes sense to disable Sonar for forks since we don't want to get into secrets sharing. |
It is run on Linux but it's omitted on Windows.
This test is simply flaky. It is run in main and on PRs but it sometimes fails due to race condition. runnerv2 is more stable in this respect.
Where do you see that? All tests are run with |
.github/workflows/ci.yml
Outdated
@@ -57,14 +57,23 @@ jobs: | |||
run: | | |||
go build -o runme main.go | |||
./runme --version | |||
- name: Test All |
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.
This is duplication of what's below (name: Test
) but without coverage. It runs exactly the same set of tests.
We can argue if it should be TAGS="test_with_docker" make test-coverage
(notice instead of -
which is a different Makefile target) in the step below to bring it closer to make test
.
.github/workflows/ci.yml
Outdated
- name: Test | ||
# N.B. Set-Timezone is a windows command |
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.
I don't understand this comment. It is set before calling make test
: Set-Timezone -Id "UTC" -PassThru
.
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.
I believe it's just a note to make clear that Set-Timezone
is a Windows PowerShell command; for folks who are not familiar with Windows details. Please confirm @jlewi.
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 right. Happy to remove it if you prefer less comments.
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.
My recommendation to move forward with this PR is as follows:
- Change
TAGS="test_with_docker" make test/coverage
toTAGS="test_with_docker" make test-coverage
to make it closer tomake test
on Windows. - Keep the change related to skipping SonarCloud scan.
- Remove other changes.
Please see my other comment. Btw, @adambabik, Jeremy discussed these changes with me. We're open to suggestions, however, let's move forward with what my eyes is a pragmatic solution. |
Thanks @adambabik and @sourishkrout and sorry for the slow response.
This lead me to conclude that the problem was that some tests were not running under CI. This conclusion was based on a misunderstanding about how tags worked. I assumed that setting tag "test_with_docker" only ran those tests as opposed to all tests + tests with that tag. As @adambabik points out that's incorrect. So
So at this point; I don't know why CI is more reliable than local. As a result, I don't know how to fix GHA to make it not mask flakiness. However, this means all my CI changes (except for the sonar one) are solving a non-existent problem so I reverted them. I'm uncertain what to do about skipping SimulateCtrlC. So I'm good with whatever you want. Skipping the test made more sense if we could reliably reproduce the failure in CI and didn't want to block PRs while we fixed it. But since the failures aren't reliably reproducing in CI the rationale doesn't really hold. I've left the Sonar change in because I think that makes sense given reasons mentioned previously. Closing this PR is also a completely reasonable outcome. |
@jlewi thanks for the detailed explanation! There could be several reasons why this test fails for you locally, such as bash version, OS (including different Linux distros), terminal settings, and so on. One of the options we could introduce is to run tests locally in a Docker container. Then we could ensure more reliable behaviour for all contributors, without them having to guess what to install in which version or delaying feedback and waiting for the CI result. However, the fact is that the nature of runme and its ability to execute commands on the host OS will keep it open for edge cases. |
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.
One suggestion, otherwise LGTM. Thanks!
Co-authored-by: Adam Babik <a.babik@designfortress.com>
Thanks @adambabik ; I had no idea that function was part of the stdlib. I've applied the suggestion. |
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.
👍 LGTM
@sourishkrout That was my mistake. I just accepted the suggestion through the GitHub UI and didn't check back to make sure the CI was passing. I'd have to double check that precommits are running on stateful/runme; they run on stateful/runme-vscode. |
~~* A lot of unittests aren't running on CI because the GHA currently ~~
~~ * Runs all tests but only on windows and a bunch of tests have the build tag !windows~~
~~ * On docker ubuntu only the tests with the dag docker ubuntu run~~
* The fix is to add a GHA step that runsmake test
to run on all OSS~~ * This rule doesn't use any build tags so it will run all tests.~~
Related to #587