test: add integration tests for make plugin
Metadata
Current evaluation
Merged integration tests for the make plugin covering basic functionality and parameter forwarding. Addressed review feedback by refactoring tests, fixing DESTDIR failures, and updating commit messages. Resolved conflicts and passed CI.
Suggested action: —
No scores available.
Issue body
- [x] Have you followed the guidelines for contributing?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] Have you successfully run `make lint && make test`?
- [ ] Have you added an entry to the changelog (`docs/reference/changelog.rst`)?
---
## Description
Added comprehensive integration tests for the make plugin that were previously missing. The tests validate basic functionality and parameter forwarding using a parametrized test approach with local test fixtures.
## Changes Made
- Created `test_make.py` with integration tests for the make plugin
- Added test fixtures including a simple C program with Makefile for testing parameter forwarding
- Used pytest parametrization to reduce code duplication while testing multiple scenarios
- Refactored tests based on code review feedback to use string literals instead of lambda functions
- Removed conditional validation logic to improve test maintainability
- Removed accidentally committed CodeQL-generated file (`_codeql_detected_source_root`)
- Merged main branch and resolved conflicts in `.gitignore`
The tests include:
1. **Basic functionality test** - Verifies build and install using a simple C program with Makefile
2. **Parameter forwarding test** - Validates `make-parameters` are passed correctly via compile-time preprocessor definitions
Test structure follows existing plugin patterns (cmake, scons, autotools) with local test fixtures and pytest integration.
## Note on Real-World Project Tests
Initial attempts to include a real-world project test (tree utility) were removed based on code review feedback. The override-build approach used didn't actually test the make plugin behavior, as it duplicated make functionality with bash commands. Additionally, most real-world make-based projects either use autotools (covered by test_autotools.py) or have Makefiles that don't properly respect DESTDIR for all installation targets, making them unsuitable for isolated make plugin testing.
## Testing
- ✅ All 4 test variations (2 test cases × 2 partition configurations) pass successfully
- ✅ Linting passes with ruff
- ✅ Tests follow the same patterns as other plugin integration tests
- ✅ Merge conflicts resolved with main branch
<!-- START COPILOT CODING AGENT SUFFIX -->
<details>
<summary>Original prompt</summary>
>
> ----
>
> *This section details on the original issue you should resolve*
>
> <issue_title>Add integration tests for make plugin</issue_title>
> <issue_description>### What needs to get done
>
> The make plugin needs some integration tests to validate its behavior. Turns out, we never had any...
>
> ### Why it needs to get done
>
> Spawned from this TODO comment:
> https://github.com/canonical/craft-parts/blob/a20b49d1b27ecd00ab74eb786d0f2403184adc97/tests/integration/plugins/test_make.py#L1</issue_description>
>
> <agent_instructions>Use at least one real-world repository that uses make to test the plugin. Use the cmake plugin integration tests as a starting point.
> </agent_instructions>
>
> ## Comments on the Issue (you are @copilot in this section)
>
> <comments>
> </comments>
>
</details>
- Fixes canonical/craft-parts#1334
<!-- START COPILOT CODING AGENT TIPS -->
---
✨ Let Copilot coding agent [set things up for you](https://github.com/canonical/craft-parts/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged integration tests for the make plugin covering basic functionality and parameter forwarding. Addressed review feedback by refactoring tests, fixing DESTDIR failures, and updating commit messages. Resolved conflicts and passed CI. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Added integration tests for the make plugin validating build, install, and parameter forwarding via pytest parametrization. Removed unsuitable real-world tests, fixed DESTDIR failures, rewrote commits, and resolved conflicts. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1334 Add integration tests for make plugin | craft-parts | closed | Abandoned. The request to add integration tests for the make plugin was closed without implementation after a Jira ticket was created, with no follow-up pull requests or code changes recorded. | |
| #33 plugins: add make plugin | craft-parts | merged | Merged the addition of a make plugin for building make-based parts. Approved by two reviewers, the change adds 237 lines across five files to extend the plugin system. | |
| #992 plugins: update make plugin to use get_build_properties() | snapcraft | merged | Merged into master. Updated the make plugin to use get_build_properties() and added corresponding tests. Approved by a reviewer, passed CI checks, and resolved Launchpad bug 1650548. | |
| #199 tests: refactor plugin dependency tests | craft-parts | merged | Merged after approval and passing CI. Refactored plugin dependency tests by replacing redundant fixtures with a fixture factory in conftest.py, optimizing 4 files. Addressed reviewer feedback regarding test configuration. | |
| #77 tests: add integration tests for application plugins (CRAFT-69) | craft-parts | merged | Merged integration tests for application plugins. Approved by two reviewers, passed CI checks, and added 203 lines across two files to verify plugin registration and functionality. | |
| #264 Make plugin: Support non-standard makefile name. | snapcraft | merged | Merged a change adding a makefile property to the Make plugin, enabling custom makefile names. The author added integration tests without mocks per reviewer feedback. Resolves Launchpad bug #1500759. |