Skip to content
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

Run CI (tests) on MacOS #3528

Merged
merged 9 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
go-version: [1.20.x]
platform: [ubuntu-latest, windows-2019]
platform: [ubuntu-latest, windows-2019, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
Expand All @@ -37,8 +37,8 @@ jobs:
go version
export GOMAXPROCS=2
args=("-p" "2" "-race")
# Run with less concurrency on Windows to minimize flakiness.
if [[ "${{ matrix.platform }}" == windows* ]]; then
# Run with less concurrency on Windows/MacOS to minimize flakiness.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried luck without this, and there has been no way to get all tests passing. I guess next step will be to take a look at that flakiness and try to correct it, but for now I guess it's fine, as it has been for Windows so far.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that tests are flaky on all platforms, primarily GRPC-TLS related https://github.com/grafana/xk6-grpc/issues/39. Which ones do you constantly see?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, there's nothing new, as I think all (or most) of them are documented at #2144.

It's just that it seems that Windows and MacOS runners are way more likely to fail (it's probably a matter of their performance), so I decided to add MacOS into that exception we already had for Windows, to avoid adding more flakiness.

if [[ "${{ matrix.platform }}" == windows* || "${{ matrix.platform }}" == macos* ]]; then
unset args[2]
args[1]="1"
export GOMAXPROCS=1
Expand All @@ -49,7 +49,7 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, windows-2019]
platform: [ubuntu-latest, windows-2019, macos-latest]
runs-on: ${{ matrix.platform }}
continue-on-error: true
steps:
Expand All @@ -75,8 +75,8 @@ jobs:
go version
export GOMAXPROCS=2
args=("-p" "2" "-race")
# Run with less concurrency on Windows to minimize flakiness.
if [[ "${{ matrix.platform }}" == windows* ]]; then
# Run with less concurrency on Windows/MacOS to minimize flakiness.
if [[ "${{ matrix.platform }}" == windows* || "${{ matrix.platform }}" == macos* ]]; then
unset args[2]
args[1]="1"
export GOMAXPROCS=1
Expand All @@ -88,7 +88,7 @@ jobs:
fail-fast: false
matrix:
go-version: [1.21.x]
platform: [ubuntu-latest, windows-2019]
platform: [ubuntu-latest, windows-2019, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
Expand All @@ -103,8 +103,8 @@ jobs:
go version
export GOMAXPROCS=2
args=("-p" "2" "-race")
# Run with less concurrency on Windows to minimize flakiness.
if [[ "${{ matrix.platform }}" == windows* ]]; then
# Run with less concurrency on Windows/MacOS to minimize flakiness.
if [[ "${{ matrix.platform }}" == windows* || "${{ matrix.platform }}" == macos* ]]; then
unset args[2]
args[1]="1"
export GOMAXPROCS=1
Expand All @@ -126,8 +126,12 @@ jobs:
CODECOV_BASH_SHA512SUM: d075b412a362a9a2b7aedfec3b8b9a9a927b3b99e98c7c15a2b76ef09862aeb005e91d76a5fd71b511141496d0fd23d1b42095f722ebcd509d768fba030f159e
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
if [[ "${{ matrix.platform }}" == macos* ]]; then
shopt -s expand_aliases
alias sha512sum='shasum -a 512'
fi
curl -fsSLO "https://raw.githubusercontent.com/codecov/codecov-bash/${CODECOV_BASH_VERSION}/codecov"
echo "$CODECOV_BASH_SHA512SUM codecov" | sha512sum -c -
echo "$CODECOV_BASH_SHA512SUM codecov" | sha512sum -c -
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason (I didn't fully get), without the extra space it doesn't work on MacOS, but with it, it works correctly in all platforms 🤷🏻

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember that we had issues with codecov (which later were resolved) and created the task, but one of the highlights was that codecov has the GH action. So maybe it's worth migrating to it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, nice! Thanks for letting me know, I could consider working on that right after, but I'd prefer to keep it for a separate PR, if that sounds good to you as well 🙏🏻

platform="${{ matrix.platform }}"
bash ./codecov -F "${platform%%-*}"
- name: Generate coverage HTML report
Expand Down
2 changes: 1 addition & 1 deletion js/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ func TestVURunInterruptDoesntPanic(t *testing.T) {
assert.Contains(t, vuErr.Error(), "context canceled")
}()
<-ch
time.Sleep(time.Millisecond * 1) // NOTE: increase this in case of problems ;)
time.Sleep(time.Microsecond * 1) // NOTE: increase this in case of problems ;)
newCancel()
wg.Wait()
}
Expand Down