test: regression tests for .snapcraft.yaml as project file
Metadata
Current evaluation
Merged regression tests for #5083 confirming .snapcraft.yaml detection. The fix was previously applied in PR #5349 via a craft-application 5 refactor. Adds unit, integration, and spread tests covering all supported project file locations.
Suggested action: —
No scores available.
Issue body
## Description
Adds regression tests for [#5083](https://github.com/canonical/snapcraft/issues/5083) — `.snapcraft.yaml` in the project root was not picked up as the project file.
The fix landed in this branch via #5349 (refactor onto craft-application 5), which replaced the old `_resolve_project_path` override with `get_snap_project()`, which correctly searches all supported project file locations.
## Tests added
- **Unit test** (`tests/unit/parts/test_yaml_utils.py`): `test_get_snap_project_all_locations` — parametrized over all 4 supported project file locations, directly testing `get_snap_project()`.
- **Integration test** (`tests/unit/test_application.py`): `test_project_file_locations` — parametrized over all 4 locations, testing the full application code path.
- **Spread test** (`tests/spread/core24/dot-snapcraft-yaml/`): end-to-end test that builds and installs a snap using `.snapcraft.yaml` as the project file.
Fixes #5083
---
- [x] I've followed the [contribution guidelines](https://github.com/canonical/snapcraft/blob/main/CONTRIBUTING.md).
- [x] I've signed the [CLA](http://www.ubuntu.com/legal/contributors/).
- [x] I've successfully run `make lint && make test`.
- [ ] I've added or updated any relevant documentation.
- [ ] I've updated the relevant release notes.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged regression tests for #5083 confirming .snapcraft.yaml detection. The fix was previously applied in PR #5349 via a craft-application 5 refactor. Adds unit, integration, and spread tests covering all supported project file locations. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged regression tests for .snapcraft.yaml project file detection, resolving issue #5083. Tests validate the get_snap_project() fix from #5349, covering unit, integration, and spread suites across all four supported locations. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Adds unit, integration, and spread regression tests for issue #5083, verifying .snapcraft.yaml detection across all supported locations. The underlying fix was implemented in #5349 using get_snap_project(). |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3609 tests: move legacy snapcraft tests (CRAFT-728) | snapcraft | merged | Merged following reviewer approval and passing CI. Relocated unit tests for the renamed snapcraft_legacy package to tests/legacy, modifying 313 files (+579/-564 lines). | |
| #2353 tests: remove dependency on snapcraft for integration tests | snapcraft | merged | Merged after reviewer approval and passing CI. The change removes the snapcraft dependency from integration tests to improve test independence, modifying 27 files with 956 additions and 733 deletions. | |
| #4755 tests: fix devel base snap test | snapcraft | merged | Merged a fix for the devel base snap test. The update ensures snapcraft correctly creates and utilizes the devel base. Approved by two reviewers, passed CI checks, and applied with a minimal one-file change. | |
| #5845 test(spread): test building base and snapd snaps | snapcraft | merged | Merged spread tests for building base and snapd snaps. Despite initial CI failures linked to snapcraft issue #5843, the changes were approved and integrated to maintain build compatibility with mainline snapcraft. | |
| #5083 ".snapcraft.yaml" not picked up as a project file | snapcraft | closed | Fixed in Snapcraft 8.9 for core24. Refactoring in craft-application resolved the regression that prevented snapcraft from recognizing .snapcraft.yaml as a valid project file. Requires regression testing to prevent future failures. | |
| #669 Add detection for an existing `.snapcraft.yaml` file before running `snapcraft init` | snapcraft | merged | Merged fix preventing snapcraft init from creating a duplicate snapcraft.yaml when .snapcraft.yaml exists. A unit test was added per reviewer request before merge. | |
| #1394 tests: document the test suites in the snapcraft repo | snapcraft | merged | Test suite documentation added to snapcraft. Approved by two reviewers, the merge updated two files with 160 additions and 33 deletions to clarify test execution. Reviewer feedback was incorporated prior to merging. |