Skip to content

Commit 4a67d09

Browse files
authored
fix: Flaky tests when run in GitHub Actions Workflow (#733)
## Description Hey everyone! I initially attempted to resolve this issue by following the approach mentioned in [this issue](dart-lang/pub#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: #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
1 parent db9ab3c commit 4a67d09

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.github/workflows/validate.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ jobs:
9494
- name: Install Tools
9595
run: ./.github/workflows/scripts/install-tools.sh
9696
- name: Run Tests
97-
# TODO: Remove | true once #724 iw solved.
98-
run: melos test --no-select || true
97+
run: melos test --no-select
9998

10099
test_windows:
101100
runs-on: windows-latest

packages/melos/test/matchers.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Matcher ignoringDependencyMessages(String expected) {
2020
.where(
2121
(line) =>
2222
!line.startsWith('Resolving dependencies...') &&
23+
!line.startsWith('Downloading packages...') &&
2324
!line.startsWith('Got dependencies!'),
2425
)
2526
.join('\n');

0 commit comments

Comments
 (0)