Skip to content

.github,test: Upload container logs during e2e runs as artifacts#2432

Merged
timflannagan merged 3 commits intooperator-framework:masterfrom
timflannagan:e2e-collect-container-logs
Nov 3, 2021
Merged

.github,test: Upload container logs during e2e runs as artifacts#2432
timflannagan merged 3 commits intooperator-framework:masterfrom
timflannagan:e2e-collect-container-logs

Conversation

@timflannagan
Copy link
Copy Markdown
Member

Description of the change:
Upload the container logs from the various kind clusters that were provisioned during individual e2e runs as artifacts using the upload-artifact action.

Motivation for the change:
Currently, there's little visibility into why individual e2e runs failed. A quick, short-term win is to collect the individual container logs that were running on the provisioned kind cluster to the configured artifacts directory for GHA.

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /doc
  • Commit messages sensible and descriptive

Update the operatorsv1 API package import from v1 -> operatorsv1.

Signed-off-by: timflannagan <timflannagan@gmail.com>
Update the $JUNIT_DIRECTORY environment varaible that's used throughout
the e2e testing suite to the more generalized $ARTIFACTS_DIRECTORY which
can be used as the base directory for various testing artifacts.

Junit reports are now created implicitly whenever the
$ARTIFACTS_DIRECTORY has been specified/non-empty.

Signed-off-by: timflannagan <timflannagan@gmail.com>
…visioning

Update the kind provisioner and collect container logs (and various
other testing artifacts) before deprovisioning the kind cluster that
tests were running.

Signed-off-by: timflannagan <timflannagan@gmail.com>
@openshift-ci openshift-ci Bot requested review from ecordell and exdx November 2, 2021 18:46
with:
go-version: '~1.16'
- run: make e2e-local E2E_NODES=2 JUNIT_DIRECTORY=./artifacts/
- run: make e2e-local E2E_NODES=2 ARTIFACTS_DIR=./artifacts/
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note: we'd need to also update the downstream o/release configuration for this environment variable as well: https://github.com/openshift/release/blob/master/ci-operator/config/openshift/operator-framework-olm/openshift-operator-framework-olm-release-4.10.yaml#L81.

Comment thread test/e2e/e2e_test.go
if junitDir := os.Getenv("JUNIT_DIRECTORY"); junitDir != "" {
junitReporter := reporters.NewJUnitReporter(path.Join(junitDir, fmt.Sprintf("junit_e2e_%02d.xml", config.GinkgoConfig.ParallelNode)))
// always configure a junit report when ARTIFACTS_DIR has been set
if artifactsDir := os.Getenv("ARTIFACTS_DIR"); artifactsDir != "" {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

JUnit reports are now created implicitly whenever the $ARTIFACTS_DIRECTORY has been specified/non-empty.

@timflannagan
Copy link
Copy Markdown
Member Author

Link to an action run that has the populated artifacts structure: https://github.com/operator-framework/operator-lifecycle-manager/actions/runs/1413705354

# download actions zip run
$ mkdir artifacts
$ unzip <...> -d artifacts
$ tree -d -L 2 artifacts
tree -d -L 2 artifacts/
artifacts/
├── junit
└── logs
    ├── kind-75drbpk9xgmfzpm5-control-plane
    └── kind-9q22pms6dbzdjglt-control-plane

@timflannagan timflannagan force-pushed the e2e-collect-container-logs branch from d6f3399 to 1d45f50 Compare November 2, 2021 20:57
@timflannagan timflannagan changed the title .github/test: Upload container logs during e2e runs as artifacts .github,test: Upload container logs during e2e runs as artifacts Nov 2, 2021
Copy link
Copy Markdown
Contributor

@tylerslaton tylerslaton left a comment

Choose a reason for hiding this comment

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

This looks really clean. I took a look at the artifact you linked and its great. We can talk about this off-pr but have we thought of how we may then use these artifacts in an automated way to detect regressions?

Comment thread test/e2e/e2e_test.go
@awgreene
Copy link
Copy Markdown
Member

awgreene commented Nov 3, 2021

/lgtm
/retest

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Nov 3, 2021
@awgreene
Copy link
Copy Markdown
Member

awgreene commented Nov 3, 2021

@timflannagan thanks for the example run.

@kevinrizza
Copy link
Copy Markdown
Member

/approve

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Nov 3, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kevinrizza, timflannagan

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 Nov 3, 2021
@openshift-bot
Copy link
Copy Markdown
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

2 similar comments
@openshift-bot
Copy link
Copy Markdown
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Copy Markdown
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@timflannagan
Copy link
Copy Markdown
Member Author

Force (squash) merging this as CI is currently blocked and this can improve visibility while we sort through the existing list of failures.

@timflannagan timflannagan merged commit 58c8485 into operator-framework:master Nov 3, 2021
@timflannagan timflannagan deleted the e2e-collect-container-logs branch November 3, 2021 13:37
@njhale njhale linked an issue Nov 9, 2021 that may be closed by this pull request
2 tasks
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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Export controller logs as artifacts after e2e test execution

5 participants