From 4a67d098686b4724cae23d24bdab46be820aa0b3 Mon Sep 17 00:00:00 2001 From: Jessica Tarra Date: Wed, 26 Jun 2024 03:20:36 -0300 Subject: [PATCH] fix: Flaky tests when run in GitHub Actions Workflow (#733) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Hey everyone! I initially attempted to resolve this issue by following the approach mentioned in [this issue](https://github.com/dart-lang/pub/issues/3998) by setting the environment variable `PUB_SUMMARY_ONLY=1` in the workflow. However, this did not work as expected. Then, I decided to solve it by updating the `ignoringDependencyMessages` method in the matcher file, and this approach seems to be working fine. **Changes:** - Remove unnecessary TODO comment in the workflow file - Update test command in workflow to remove unnecessary `|| true` - Update dependency messages matcher in `matchers.dart` test file Issue: https://github.com/invertase/melos/issues/724 ## Type of Change - [ ] โœจ `feat` -- New feature (non-breaking change which adds functionality) - [x] ๐Ÿ› ๏ธ `fix` -- Bug fix (non-breaking change which fixes an issue) - [ ] โŒ `!` -- Breaking change (fix or feature that would cause existing functionality to change) - [ ] ๐Ÿงน `refactor` -- Code refactor - [x] โœ… `ci` -- Build configuration change - [ ] ๐Ÿ“ `docs` -- Documentation - [ ] ๐Ÿ—‘๏ธ `chore` -- Chore --- .github/workflows/validate.yaml | 3 +-- packages/melos/test/matchers.dart | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index 43a59e5c4..6ff61f6ba 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -94,8 +94,7 @@ jobs: - name: Install Tools run: ./.github/workflows/scripts/install-tools.sh - name: Run Tests - # TODO: Remove | true once #724 iw solved. - run: melos test --no-select || true + run: melos test --no-select test_windows: runs-on: windows-latest diff --git a/packages/melos/test/matchers.dart b/packages/melos/test/matchers.dart index e279e852f..7dd8745b1 100644 --- a/packages/melos/test/matchers.dart +++ b/packages/melos/test/matchers.dart @@ -20,6 +20,7 @@ Matcher ignoringDependencyMessages(String expected) { .where( (line) => !line.startsWith('Resolving dependencies...') && + !line.startsWith('Downloading packages...') && !line.startsWith('Got dependencies!'), ) .join('\n');