-
Notifications
You must be signed in to change notification settings - Fork 156
test: Update to work with OSCI gating test #1842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Xiaofeng Wang <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request updates tests to work with OSCI gating. The changes involve adding new RHEL base images to os-image-map.json and modifying a test script to copy repository files on RHEL systems. My review focuses on improving the robustness and maintainability of the test script changes. I've identified a potential bug with a hardcoded repository filename and suggested a simplification for parsing the os-release file.
| cp /etc/yum.repos.d/rhel.repo . | ||
| $repo_copy = "COPY rhel.repo /etc/yum.repos.d/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The filename rhel.repo appears to be incorrect. On standard RHEL systems, the main repository file is typically named redhat.repo. Using rhel.repo would likely cause the cp command to fail and break the test on a standard RHEL environment.
If rhel.repo is intentionally used and is specific to the OSCI environment, it would be helpful to add a comment explaining this context.
For better robustness and portability, you might consider copying all .repo files instead of relying on a single hardcoded name. This would make the test less brittle to changes in repository configuration. For example:
if $os.ID == "rhel" {
cp (glob /etc/yum.repos.d/*.repo) .
$repo_copy = "COPY *.repo /etc/yum.repos.d/"
} cp /etc/yum.repos.d/redhat.repo .
$repo_copy = "COPY redhat.repo /etc/yum.repos.d/"
| let os = open /usr/lib/os-release | ||
| | lines | ||
| | filter {|l| $l != "" and not ($l | str starts-with "#") } | ||
| | parse "{key}={value}" | ||
| | reduce {|it, acc| | ||
| $acc | upsert $it.key ($it.value | str trim -c '"') | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nushell's from dotenv command
This one looks like a hallucination
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, there's no dotenv in my side.
Usage:
> from
Subcommands:
from csv - Parse text as .csv and create table.
from json - Convert from json to structured data.
from msgpack - Convert MessagePack data into Nu values.
from msgpackz - Convert brotli-compressed MessagePack data into Nu values.
from nuon - Convert from nuon to structured data.
from ods - Parse OpenDocument Spreadsheet(.ods) data and create table.
from ssv - Parse text as space-separated values and create a table. The default minimum number of spaces counted as a separator is 2.
from toml - Parse text as .toml and create record.
from tsv - Parse text as .tsv and create table.
from url - Parse url-encoded string as a record.
from xlsx - Parse binary Excel(.xlsx) data and create table.
from xml - Parse text as .xml and create record.
from yaml - Parse text as .yaml/.yml and create table.
from yml - Parse text as .yaml/.yml and create table.
Flags:
-h, --help: Display the help message for this command
The patch has been added in OSCI. Those updates need to be added here so the patch can be removed from OSCI in next release.