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
21 changes: 12 additions & 9 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,6 +126,9 @@ jobs:
CODECOV_BASH_SHA512SUM: d075b412a362a9a2b7aedfec3b8b9a9a927b3b99e98c7c15a2b76ef09862aeb005e91d76a5fd71b511141496d0fd23d1b42095f722ebcd509d768fba030f159e
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
if [ "$(uname)" = "Darwin" ]; then
alias sha256sum='shasum -a 256'
fi
curl -fsSLO "https://raw.githubusercontent.com/codecov/codecov-bash/${CODECOV_BASH_VERSION}/codecov"
echo "$CODECOV_BASH_SHA512SUM codecov" | sha512sum -c -
platform="${{ matrix.platform }}"
Expand Down
Loading