Re-add envvar required by pulp-cli tests#1024
Merged
Conversation
gerrod3
reviewed
Mar 30, 2026
| {%- if docker_fixtures %} | ||
| export PULP_FIXTURES_URL="http://pulp-fixtures:8080" | ||
| # some pulp-cli tests use the api root envvar | ||
| export PULP_API_ROOT="$(EDITOR=cat pulp config edit 2>/dev/null | grep api_root | awk -F'"' '/api_root/{print $2; exit}')" |
Contributor
There was a problem hiding this comment.
I don't understand what this command is doing. Can you explain?
Member
Author
There was a problem hiding this comment.
It's getting the api_root from pulp-cli config.
# workaround to dump the cli config. It will use cat as editor, which will just dump the file contents
EDITOR=cat pulp config edit
# filter the lines with the api_root config (hopefully only one)
grep api_root
# -F"" split fields by " (quote). '/api_root/{...}' matches lines, prints 2nd field and exit on stops on first line (if more than one line would match).
awk -F'"' '/api_root/{print $2; exit}')
Member
Author
There was a problem hiding this comment.
Hmm, I can get rid of the grep. Wrote it before looking for the awk thing.
Member
Author
There was a problem hiding this comment.
It should work on any machine with pulp-cli installed and configured (works on mine).
Member
Author
There was a problem hiding this comment.
And 2>/dev/null supresses the pulp-cli warning that the "editor" didn't do anything.
PULP_API_ROOT environment variable is required by some pulp-cli tests. This re-introduces the variable only for running those tests.
0668c65 to
e21733e
Compare
gerrod3
approved these changes
Mar 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PULP_API_ROOTenvironment variable is required by some pulp-cli tests. This re-introduces the variable only for running those tests.Failing test (without this patch): https://github.com/pulp/pulpcore/pull/7543/checks?check_run_id=69192556708
Passing test (with this patch): https://github.com/pulp/pulpcore/pull/7543/checks?check_run_id=69195895246