Skip to content

test: replace curl with wget in exporter metrics conformance test#1045

Open
ashokpariya0 wants to merge 1 commit intok8snetworkplumbingwg:masterfrom
ashokpariya0:use-wget
Open

test: replace curl with wget in exporter metrics conformance test#1045
ashokpariya0 wants to merge 1 commit intok8snetworkplumbingwg:masterfrom
ashokpariya0:use-wget

Conversation

@ashokpariya0
Copy link
Contributor

We need this change to fix below test issue on s390x,

The test at

It("collects metrics regarding receiving traffic via VF", func() {

is currently failing because curl is not available inside the sriov-network-metrics-exporter pod.

To resolve this, replacing curl with wget, which is available in the container image.

/root/ap/sriov-network-operator/test/conformance/tests/test_exporter_metrics.go:84
  STEP: Enabling `metricsExporter` feature flag @ 02/24/26 07:54:13.655
  STEP: Adding monitoring label to openshift-sriov-network-operator @ 02/24/26 07:54:13.656
Waiting for the sriov state to stable
Sriov state is stable
  STEP: Using device ens2048f0np0 on node master-0.ocp-ashok.lnxero1.boe @ 02/24/26 07:54:46.728
Waiting for the sriov state to stable
Sriov state is stable
  [FAILED] in [It] - /root/ap/sriov-network-operator/test/conformance/tests/test_exporter_metrics.go:200 @ 02/24/26 07:55:41.689
• [FAILED] [88.053 seconds]
[sriov] Metrics Exporter [It] collects metrics regarding receiving traffic via VF
/root/ap/sriov-network-operator/test/conformance/tests/test_exporter_metrics.go:84

  [FAILED] pod: [openshift-sriov-network-operator/sriov-network-metrics-exporter-l2fw8] command: [[curl http://127.0.0.1:9110/metrics]]
  stdout: 
  **stderr: executable file `curl` not found in $PATH: No such file or directory**

  Unexpected error:
      <exec.CodeExitError>: 
      command terminated with exit code 1
      {
          Err: <*errors.errorString | 0xc0005aa800>{
              s: "command terminated with exit code 1",
          },
          Code: 1,
      }
  occurred
  In [It] at: /root/ap/sriov-network-operator/test/conformance/tests/test_exporter_metrics.go:200 @ 02/24/26 07:55:41.689

Signed-off-by: Ashok Pariya <ashok.pariya@ibm.com>
@github-actions
Copy link

Thanks for your PR,
To run vendors CIs, Maintainers can use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs, Maintainers can use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@github-actions github-actions bot added the tests label Feb 25, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello @ashokpariya0, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves a failing conformance test for the sriov-network-metrics-exporter by addressing an issue where the curl utility was not available within the test pod. The change updates the test to use wget instead, which is confirmed to be present in the container image, allowing the metrics collection test to execute successfully and validate the exporter's functionality.

Highlights

  • Test Fix: Replaced the curl command with wget in the exporter metrics conformance test to resolve a command not found error within the sriov-network-metrics-exporter pod.
Changelog
  • test/conformance/tests/test_exporter_metrics.go
    • Updated the command used to fetch metrics from curl to wget to ensure test execution within the sriov-network-metrics-exporter pod.
Activity
  • No human activity has occurred on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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 correctly replaces curl with wget in the exporter metrics conformance test to fix an issue where curl is not available in the sriov-network-metrics-exporter pod. The change is effective and directly addresses the problem. I've added one suggestion to improve maintainability by defining the hardcoded URL as a constant.

metricsExporterPod := metricsExporterPods.Items[0]

command := []string{"curl", "http://127.0.0.1:9110/metrics"}
command := []string{"wget", "-qO-", "http://127.0.0.1:9110/metrics"}

Choose a reason for hiding this comment

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

medium

The metrics URL is hardcoded. To improve readability and maintainability, it's better to define it as a constant. This avoids using a 'magic string' and makes it easier to find and update if needed.

Suggested change
command := []string{"wget", "-qO-", "http://127.0.0.1:9110/metrics"}
const metricsURL = "http://127.0.0.1:9110/metrics"
command := []string{"wget", "-qO-", metricsURL}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant