Skip to content
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

scripts/test_images.sh: refactor to import job into the prow infrastructure #19305

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

ivanvc
Copy link
Member

@ivanvc ivanvc commented Jan 29, 2025

While importing the release tests into the Prow infrastructure, after some exploration, I found that the current script didn't work correctly because it allows an input environment variable "IMAGE," which in the Prow infra points to the image from the container. This made the scripts/test_images.sh script fail. So, I took an opportunity to rewrite the script in a more modular way while fixing this issue.

  • Wrap script in functions, add a main function, and call them from it.
  • Make environment variables local inside the function scope to avoid unexpected behaviors by the running environment-supplied variables.
  • Fix the typo in the "REPOSITORY" environment variable.
  • Rename the input "IMAGE" to "TEST_IMAGE" to avoid clashing with the environment variable from the Prow infrastructure.

Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.

@k8s-ci-robot
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ivanvc
Copy link
Member Author

ivanvc commented Jan 29, 2025

/test pull-etcd-release-tests

@ivanvc
Copy link
Member Author

ivanvc commented Jan 29, 2025

/test pull-etcd-release-tests

Copy link

codecov bot commented Jan 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.83%. Comparing base (dd60559) to head (0ac24a8).
Report is 19 commits behind head on main.

Additional details and impacted files

see 14 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #19305      +/-   ##
==========================================
- Coverage   68.84%   68.83%   -0.02%     
==========================================
  Files         420      420              
  Lines       35693    35693              
==========================================
- Hits        24573    24568       -5     
- Misses       9698     9702       +4     
- Partials     1422     1423       +1     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dd60559...0ac24a8. Read the comment docs.

@ivanvc
Copy link
Member Author

ivanvc commented Jan 29, 2025

/test pull-etcd-release-tests

2 similar comments
@ivanvc
Copy link
Member Author

ivanvc commented Jan 29, 2025

/test pull-etcd-release-tests

@ivanvc
Copy link
Member Author

ivanvc commented Jan 29, 2025

/test pull-etcd-release-tests

@ivanvc
Copy link
Member Author

ivanvc commented Jan 30, 2025

/test pull-etcd-release-tests

2 similar comments
@ivanvc
Copy link
Member Author

ivanvc commented Jan 30, 2025

/test pull-etcd-release-tests

@ivanvc
Copy link
Member Author

ivanvc commented Jan 30, 2025

/test pull-etcd-release-tests

@ivanvc
Copy link
Member Author

ivanvc commented Jan 30, 2025

/test pull-etcd-release-tests

@ivanvc ivanvc force-pushed the test-prow-job branch 2 times, most recently from 5093328 to e0007d7 Compare January 30, 2025 07:35
@ivanvc
Copy link
Member Author

ivanvc commented Jan 30, 2025

/test pull-etcd-release-tests

@ivanvc
Copy link
Member Author

ivanvc commented Jan 30, 2025

/test pull-etcd-release-tests

@ivanvc
Copy link
Member Author

ivanvc commented Jan 30, 2025

/test pull-etcd-verify

* Wrap script in functions, add a main function, and call them from it.
* Make environment variables local inside the function scope to avoid
  unexpected behaviors by the running environment-supplied variables.
* Fix the typo in the "REPOSITORY" environment variable.
* Rename the input "IMAGE" to "TEST_IMAGE" to avoid clashing with the
  environment variable from the Prow infrastructure.

Signed-off-by: Ivan Valdes <[email protected]>
@ivanvc
Copy link
Member Author

ivanvc commented Jan 30, 2025

/test pull-etcd-release-tests pull-etcd-verify

@ivanvc ivanvc changed the title [do not review] test prow jobs scripts/test_images.sh: refactor to import job into the prow infrastructure Jan 30, 2025
@ivanvc ivanvc marked this pull request as ready for review January 30, 2025 21:52
@ivanvc
Copy link
Member Author

ivanvc commented Jan 30, 2025

/test pull-etcd-integration-1-cpu-amd64

@ivanvc
Copy link
Member Author

ivanvc commented Jan 31, 2025

Let me know if you want me to start a fresh PR. I reused the one I used to test that the prow job worked.

Copy link
Member

@ahrtr ahrtr left a comment

Choose a reason for hiding this comment

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

LGTM with a minor comment.

scripts/test_images.sh Show resolved Hide resolved
@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahrtr, ivanvc

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ahrtr ahrtr merged commit 05f700f into etcd-io:main Jan 31, 2025
36 checks passed
@ivanvc ivanvc deleted the test-prow-job branch February 1, 2025 04:31
ivanvc added a commit to ivanvc/test-infra that referenced this pull request Feb 1, 2025
After merging etcd-io/etcd#19305, this job is passing. Allow it to run
for some time before removing the optional flag.
ivanvc added a commit to ivanvc/test-infra that referenced this pull request Feb 1, 2025
After merging etcd-io/etcd#19305, this job is passing. Allow it to run
for some time before removing the optional flag.
hbostan pushed a commit to hbostan/test-infra that referenced this pull request Feb 5, 2025
After merging etcd-io/etcd#19305, this job is passing. Allow it to run
for some time before removing the optional flag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants