Skip to content

fix: better error for failed run section#752

Merged
hallyn merged 2 commits intoproject-stacker:mainfrom
mikemccracken:2026.01.28/main/what-file-failed
Mar 20, 2026
Merged

fix: better error for failed run section#752
hallyn merged 2 commits intoproject-stacker:mainfrom
mikemccracken:2026.01.28/main/what-file-failed

Conversation

@mikemccracken
Copy link
Contributor

run section output can be long and it can be a pain to find which image failed to build in multiple-image situations.

This just adds the obvious information to the error you see at the end.

now it looks like this:

Error: run commands failed for image "layer1" in "/home/embrane/ssd/stacker/stackertest-test_basic_workings.XFZkds/stacker.yaml": execute failed: exit status 1

✅ By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@raharper raharper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a nice improvement. Thanks for looking at this.
+1 on this after "workflow" is happy and squashed commits.

@hallyn
Copy link
Contributor

hallyn commented Mar 2, 2026

Weird, I don't seem to have an option to re-run the tests.

run section output can be long and it can be a pain to find which image
failed to build in multiple-image situations.

This just adds the obvious information to the error you see at the end.

Signed-off-by: Michael McCracken <mikmccra@cisco.com>
ref https://docs.docker.com/reference/dockerfile/#workdir

"If the WORKDIR doesn't exist, it will be created even if it's not used
in any subsequent Dockerfile instruction."

Signed-off-by: Michael McCracken <mikmccra@cisco.com>
@mikemccracken mikemccracken force-pushed the 2026.01.28/main/what-file-failed branch from ac6b265 to 0fa7d1d Compare March 10, 2026 19:16
@mikemccracken
Copy link
Contributor Author

rebased to get the convert.bats fix from #753

@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.95%. Comparing base (9104248) to head (0fa7d1d).
⚠️ Report is 16 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #752       +/-   ##
===========================================
- Coverage   63.58%   52.95%   -10.64%     
===========================================
  Files          57       59        +2     
  Lines        5083     6538     +1455     
===========================================
+ Hits         3232     3462      +230     
- Misses       1184     2431     +1247     
+ Partials      667      645       -22     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hallyn
Copy link
Contributor

hallyn commented Mar 16, 2026

Sorry, can you explain why the second commit is part of this pr?

@mikemccracken
Copy link
Contributor Author

Sorry, can you explain why the second commit is part of this pr?

I can, yes - in a previous attempt I made to fix the failing convert test (which had been blocking this PR, until Tanmay fixed it correctly in a later PR) - I bumped the elasticsearch version too high and hit a version of their dockerfile that wrote to WORKDIR without creating it. See, in v8.17.10, they do a RUN mkdir /usr/share/elasticsearch first: https://github.com/elastic/dockerfiles/blob/3861498adce22926e852b1bbec340f159147a47f/elasticsearch/Dockerfile#L45

but in later versions they do just the WORKDIR: https://github.com/elastic/dockerfiles/blob/v9.2.4/elasticsearch/Dockerfile#L30
which is correct because Docker promises to mkdir your WORKDIR for you.

So although Tanmay's fix means we don't need this for passing CI, I left it in because it improves docker build compat.

@hallyn hallyn merged commit 753e653 into project-stacker:main Mar 20, 2026
12 of 23 checks passed
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.

3 participants