Skip to content

[SDCICD-1729] Add S3 upload capability for test artifacts#3089

Closed
YiqinZhang wants to merge 1 commit intoopenshift:mainfrom
YiqinZhang:SDCICD-1729-s3-upload
Closed

[SDCICD-1729] Add S3 upload capability for test artifacts#3089
YiqinZhang wants to merge 1 commit intoopenshift:mainfrom
YiqinZhang:SDCICD-1729-s3-upload

Conversation

@YiqinZhang
Copy link
Copy Markdown
Contributor

Add native S3 upload functionality to osde2e for uploading test artifacts (JUnit XML, logs) after test execution.

Features:

  • New s3upload package with configurable S3 upload
  • Auto-derives operator name from test image
  • Generates presigned URLs (7d expiry) for easy access
  • Organized S3 structure: < prefix > / < operator > / < date > / < job-id > /

Configuration (env var):

Variable Default Description
S3_UPLOAD_ENABLED true Enable/disable S3 upload
S3_UPLOAD_BUCKET osde2e-loki-logs S3 bucket name
S3_UPLOAD_REGION us-east-1 AWS region
S3_UPLOAD_PREFIX test-results Path prefix in bucket
S3_UPLOAD_OPERATOR_NAME (auto-derived) Override operator name
S3_UPLOAD_PRESIGNED_URL_EXPIRY 168 (7 days) URL expiry in hours

SDCICD-1729

This PR adds native S3 upload functionality to osde2e for uploading test
artifacts (JUnit XML, logs) after test execution.

Features:
- New s3upload package with configurable S3 upload
- Auto-derives operator name from test image
- Generates presigned URLs (24h expiry) for easy access
- Organized S3 structure: <prefix>/<operator>/<date>/<job-id>/

Configuration:
- S3_UPLOAD_ENABLED: Enable/disable S3 upload (default: true)
- S3_UPLOAD_BUCKET: S3 bucket name (default: osde2e-loki-logs)
- S3_UPLOAD_REGION: AWS region (default: us-east-1)
- S3_UPLOAD_PREFIX: Path prefix (default: test-results)
- S3_UPLOAD_OPERATOR_NAME: Override operator name (optional)
- S3_UPLOAD_PRESIGNED_URL_EXPIRY: URL expiry hours (default: 24)
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jan 23, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: YiqinZhang

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

The pull request process is described here

Details 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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 23, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jan 23, 2026

@YiqinZhang: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.


// OperatorName is the name of the operator being tested (auto-derived from TEST_IMAGE if not set)
// Env: OPERATOR_NAME
OperatorName string
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.

Test suite may not always be an operator. Can you call it "bucker_prefix" ? Does this need to be an env var?

viper.SetDefault(Tests.EnableS3Upload, true)
_ = viper.BindEnv(Tests.EnableS3Upload, "ENABLE_S3_UPLOAD")

_ = viper.BindEnv(Tests.OperatorName, "OPERATOR_NAME")
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.

Same question - if this is only used as bucket name prefix, does this need to be an env var?

// 2. Derive from TEST_IMAGE or TestSuites
// 3. Fallback to "unknown-operator"
func deriveOperatorName() string {
// Priority 1: Explicit OPERATOR_NAME env var
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.

same comment as above

@@ -0,0 +1,328 @@
// Package s3upload provides functionality for uploading test artifacts to S3.
package s3upload
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.

Why not sue existing s3 package under common/aws ?

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants