Skip to content

Improve package name resolver test#2521

Open
EmmaYuan1015 wants to merge 7 commits intomasterfrom
improve-package-name-resolver-test
Open

Improve package name resolver test#2521
EmmaYuan1015 wants to merge 7 commits intomasterfrom
improve-package-name-resolver-test

Conversation

@EmmaYuan1015
Copy link
Contributor

Merge scattered test cases. Remove duplicate "prioritize" and "fallback" logic tests.
Remove redundant null checks.
Test coverage remains the same, but the code is more maintainable.

v-zhenyuan and others added 4 commits January 21, 2026 13:55
- Add test for multiline applicationId declarations in build.gradle
- Add test for spaces around equals sign in applicationId assignment
- Add test to verify build.gradle applicationId takes priority over AndroidManifest.xml
- Add test for missing applicationId in build.gradle with manifest fallback
- Add test for empty build.gradle file handling
- Add test for application name lowercase conversion
- Add test for special characters in application names

These tests provide comprehensive coverage for the package name resolution logic,
ensuring robustness across various build.gradle and AndroidManifest.xml formats.
Refactored test suite to reduce code duplication:
- Merged 3 separate format tests into parametrized test with test data
- Combined 'fall back to manifest' and 'empty file' tests into one scenario
- Combined default package name tests into parametrized test with multiple app names
- Improved test clarity and maintainability by grouping related scenarios

This reduces from 7 individual tests to 5 more focused tests while maintaining full coverage.
…unctions and consolidating duplicate tests

- Extract three helper functions: setupBuildGradleStub, setupManifestStub, and resolvePackageName
- Consolidate four separate build.gradle format tests into one parameterized test
- Remove redundant stub setup code throughout the test suite
- Simplify teardown logic by removing unnecessary null checks
- Maintain 100% test coverage while reducing code from 274 to 198 lines (-27.7%)
- Improve test maintainability and readability
@EmmaYuan1015
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@EmmaYuan1015 EmmaYuan1015 linked an issue Feb 10, 2026 that may be closed by this pull request
@EmmaYuan1015
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@EmmaYuan1015 EmmaYuan1015 marked this pull request as ready for review February 10, 2026 06:22
The test was failing on macOS CI because it only waited 2 seconds for the .vscode folder to appear in file explorer. This increases the timeout to 10 seconds using the new TimeoutConstants.FILE_EXPLORER_TIMEOUT constant.
@EmmaYuan1015
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@EmmaYuan1015
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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.

[Feature] Improve package name resolver test

1 participant