close
Skip to content

ci: store charmcraft logs if smoke tests fail#2192

Merged
tonyandrewmeyer merged 1 commit intocanonical:mainfrom
tonyandrewmeyer:store-charmcraft-log-on-smoke-failure
Nov 26, 2025
Merged

ci: store charmcraft logs if smoke tests fail#2192
tonyandrewmeyer merged 1 commit intocanonical:mainfrom
tonyandrewmeyer:store-charmcraft-log-on-smoke-failure

Conversation

@tonyandrewmeyer
Copy link
Copy Markdown
Collaborator

Sometimes the smoke test fails not in the interaction between the charm and Juju, but before that when the charm is being packed. The charmcraft output is almost always useless in this case, with the actual failure buried in the charmcraft log file.

This PR updates the smoke workflow to upload the charmcraft log files if the smoke tests fails, so that it's easier to investigate in such situations.

Copy link
Copy Markdown
Contributor

@james-garner-canonical james-garner-canonical left a comment

Choose a reason for hiding this comment

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

I haven't verified that this works as intended, but it's a very nice improvement, and I figure we'll quickly notice if anything is wrong and can follow up with fixes if needed.

@tonyandrewmeyer
Copy link
Copy Markdown
Collaborator Author

I haven't verified that this works as intended, but it's a very nice improvement, and I figure we'll quickly notice if anything is wrong and can follow up with fixes if needed.

For what it's worth, it's a direct copy from the same step I added to the Dell charms, and it worked there.

Comment on lines +43 to +46
uses: actions/upload-artifact@v4
with:
name: charmcraft-logs
path: /home/runner/.local/state/charmcraft/log/*.log
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think I saw this step occasionally failing with "permission denied" somewhere else.

At the same time, the test has already failed, so this won't hurt.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Hmm, I wonder what would cause that, and if the permission was reading the log file or uploading the artefact. Probably easiest to investigate if we see it happen. As you say, it won't make things worse.

@tonyandrewmeyer tonyandrewmeyer merged commit 0a9b743 into canonical:main Nov 26, 2025
56 checks passed
@tonyandrewmeyer tonyandrewmeyer deleted the store-charmcraft-log-on-smoke-failure branch November 26, 2025 01:18
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