Skip to content

Conversation

Copy link

Copilot AI commented Dec 29, 2025

Test Failure Investigation and Fixes

  • Identify failing workflow run (20564405481)
  • Review test files added (settings_test.dart, config_test.dart, assets_gen_integrations_test.dart)
  • Examine test resource files
  • Identify root cause of test failure (pubspec.lock path resolution bug)
  • Fix the failing tests (fix path resolution bugs in config.dart)
  • Validate fixes
  • Run code review (passed)
  • Complete security scan (passed)

Changes Made

Path Resolution Bugs Fixed:

  • Fixed pubspec.lock path resolution in config.dart - changed from basename(pubspecFile.parent.path) to pubspecFile.parent.path
  • Fixed analysis_options.yaml path resolution similarly
  • These bugs prevented files from being found when pubspec.yaml was in a subdirectory

Test Resources Reorganized:

  • Moved test resources into subdirectories with standard pubspec.yaml/pubspec.lock naming:
    • test_resources/integration_versions/ for Rive 0.13.x
    • test_resources/integration_versions_rive_014/ for Rive 0.14.x
  • Force-added .lock files (excluded by gitignore but needed for tests)
  • Updated test paths to use new subdirectories

Test Coverage:

  • 19 test cases covering version resolution mechanism
  • Tests for pubspec dependency parsing (8 cases)
  • Tests for config integration resolution (9 cases)
  • Tests for assets generator integration (2 cases)

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits December 29, 2025 03:52
Add tests for:
- _dependenciesFromJson parsing in pubspec.dart (string versions, map versions, path/git dependencies, invalid versions, null dependencies, mixed formats)
- Integration version constraint collection in config.dart (from pubspec.yaml and pubspec.lock)
- Version resolution priority and edge cases

Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
Test version resolution with various constraint formats and validate the integration with AssetsGenConfig

Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
- Replace meaningless null key check with proper validation of expected integration types
- Clarify comment about version resolution priority

Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
- Use consistent dependency format in test resources
- Import and use integrationPackages registry instead of hardcoding types

Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for Rive 0.14 integration Add test coverage for version resolution mechanism Dec 29, 2025
Copilot AI requested a review from AlexV525 December 29, 2025 03:58
@AlexV525
Copy link
Member

Copilot AI and others added 4 commits December 29, 2025 04:15
Moved test resources into subdirectories with standard pubspec.yaml/pubspec.lock names.
This fixes the issue where loadPubspecConfig expects pubspec.lock in the same directory
as pubspec.yaml, not with custom names.

Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
Force-add the lock files that were excluded by gitignore.
These test resources need lock files to test version resolution.

Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
Changed from basename(pubspecFile.parent.path) to pubspecFile.parent.path
to correctly resolve pubspec.lock location. The basename() call was stripping
directory structure, causing lock files in subdirectories to not be found.

Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
Apply same fix to analysis_options.yaml path - use full parent path
instead of basename to correctly locate the file.

Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
Copy link
Author

Copilot AI commented Dec 29, 2025

@copilot Fix tests https://github.com/FlutterGen/flutter_gen/actions/runs/20564405481/job/59060385061?pr=729

Fixed in commits f02b252 and 7f88429.

The issue was in the path resolution logic for pubspec.lock and analysis_options.yaml - the code was using basename() which stripped directory structure, preventing files in subdirectories from being found. Changed to use the full parent path.

Also reorganized test resources into subdirectories with standard pubspec.yaml/pubspec.lock naming convention.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/FlutterGen/flutter_gen/actions/jobs/59060385061/logs
    • Triggering command: /usr/bin/curl curl -s -L -H Accept: application/vnd.github&#43;json -H X-GitHub-Api-Version: 2022-11-28 REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants