Skip to content

Commit

Permalink
fix: Flaky tests when run in GitHub Actions Workflow (#733)
Browse files Browse the repository at this point in the history
## 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
  • Loading branch information
jessicatarra authored Jun 26, 2024
1 parent db9ab3c commit 4a67d09
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions packages/melos/test/matchers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Matcher ignoringDependencyMessages(String expected) {
.where(
(line) =>
!line.startsWith('Resolving dependencies...') &&
!line.startsWith('Downloading packages...') &&
!line.startsWith('Got dependencies!'),
)
.join('\n');
Expand Down

0 comments on commit 4a67d09

Please sign in to comment.