Add integration tests with minimal toy spread project - #12
Conversation
|
@copilot Can you rebase the branch on current main and force push? |
I've successfully rebased the branch on current main (commit 3e6a5a8). However, I don't have the capability to force push since the report_progress tool doesn't support force pushing when branches have diverged. The rebase is complete locally - the branch now contains 4 commits on top of ce47413 (latest main). You may need to force push manually or grant me force push capabilities. |
zyga
left a comment
There was a problem hiding this comment.
It seems that working-directory doesn't work for non-composite action such as cache. The input value should instead be used in the path attribute and combined with the existing value.
1d16947 to
0b8489d
Compare
Co-authored-by: zyga <784262+zyga@users.noreply.github.com>
Co-authored-by: zyga <784262+zyga@users.noreply.github.com>
Co-authored-by: zyga <784262+zyga@users.noreply.github.com>
…read-subdir Co-authored-by: zyga <784262+zyga@users.noreply.github.com>
0b8489d to
bd10d1b
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds integration tests to demonstrate the action working with a minimal toy spread project. It creates a complete test setup in tests/toy/ and a GitHub Actions workflow to run these tests in CI, while also fixing a bug in the cache key calculation for the spread-subdir parameter.
Changes:
- Created a minimal toy spread project in
tests/toy/with basic configuration and a simple success test - Added
.github/workflows/integration-test.yamlworkflow to run the toy integration test in CI - Fixed cache key in
action.yamlto properly use spread-subdir when calculating the hash of.image-garden.mk - Updated
.gitignoreto exclude.image-gardendirectory contents exceptREADME.md
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/toy/tests/success/task.yaml | Minimal test task that prints hello world messages to verify test execution |
| tests/toy/spread.yaml | Spread configuration for the toy project with garden backend and ubuntu-cloud-24.04 system |
| tests/toy/.image-garden/README.md | Documentation for the image-garden state directory |
| tests/toy/.image-garden.mk | Empty makefile for image-garden customization (required by the action) |
| action.yaml | Fixed cache key to properly use spread-subdir in hashFiles format expression |
| .gitignore | Added patterns to exclude .image-garden directory contents while keeping README.md |
| .github/workflows/integration-test.yaml | Integration test workflow that runs the toy test using the action |
| key: image-garden-img-${{ inputs.garden-system }}-${{ hashFiles('.image-garden.mk') }} | ||
| key: image-garden-img-${{ inputs.garden-system }}-${{ hashFiles(format('{0}/.image-garden.mk', inputs.spread-subdir)) }} | ||
| - name: Restore mtime of .image-garden.mk | ||
| if: hashFiles('.image-garden.mk') != '' |
There was a problem hiding this comment.
The hashFiles condition should respect the spread-subdir input parameter. When spread-subdir is set to a non-default value (like 'tests/toy'), this condition will look for '.image-garden.mk' in the wrong location (repository root instead of the subdirectory). This is inconsistent with line 87 which correctly uses format to construct the path with spread-subdir, and with line 91 which sets working-directory to the spread-subdir. The condition should use format to construct the correct path, similar to line 87.
| if: hashFiles('.image-garden.mk') != '' | |
| if: hashFiles(format('{0}/.image-garden.mk', inputs.spread-subdir)) != '' |
tests/toy/.image-garden/README.mdfile with SPDX headerstests/toy/.image-garden.mkfile (empty with SPDX headers)tests/toy/spread.yamlconfiguration filetests/toy/tests/success/task.yamltest file.github/workflows/integration-test.yamlworkflow file.gitignoreto exclude .image-garden directory contents except README.mdThe integration test setup is complete and ready to run in CI. The workflow will automatically trigger on pushes to main and pull requests.
Original prompt
This pull request was created from Copilot chat.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.