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

[ci] Save undeclared test outputs #22251

Open
jwnimmer-tri opened this issue Dec 2, 2024 · 1 comment
Open

[ci] Save undeclared test outputs #22251

jwnimmer-tri opened this issue Dec 2, 2024 · 1 comment
Assignees
Labels
component: continuous integration Jenkins, CDash, mirroring of externals, website infrastructure priority: medium type: feature request

Comments

@jwnimmer-tri
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

Sometimes, tests fail in CI but the failure is not reproducible locally. In this situation, the only diagnostic tool we have to solve the problem is the test output logged in CI. In many cases all we need is the console output (text), but in some cases we also need to inspect binary data (e.g., images, compressed logs, etc.)

At the moment, there is no way to retrieve non-text test output when Jenkins runs our tests and uploads the test results into CDash, but sometimes we need that information in order to solve the problem.

Describe the solution you'd like

In Bazel, extra test output files (beyond the normal assertion printouts) are called "undeclared outputs" as documented at https://bazel.build/reference/test-encyclopedia.

For example, after running the internal_render_engine_vtk_test there is a file named drake/bazel-testlogs/geometry/render_vtk/internal_render_engine_vtk_test/test.outputs/outputs.zip and inside that zipfile there are images like CloneIndependence/line_1318_Clone_independence_label.png which have been saved by the test program.

The request here is to allow a Drake Developer to download that file (outputs.zip) when a test fails in CI.

Note that we don't need to keep these files for passing tests, only failing ones.

If it's easy, then it would also be nice for the upload to be associated in CDash so that CDash users can directly refer to it. If that's difficult, then uploading it only to Jenkins is perfectly fine.

Describe alternatives you've considered

Have the test programs print the binary files as base64-encoded text, which the developer would copy-paste and then decode.

Additional context

For reference, here is TRI's groovy code from our Jenkinsfile that uploads the zipfiles when CI fails. With this snippet, the user can download the zipfile from the Jenkins PR result page.

pipeline {
  stages {
    stage('Parallel') {
      parallel {
        stage('...') {
          agent { ... }
          stages {
            ...
            stage('Test') {
              ...
            }
          }
          post {
            failure {
              junit 'bazel-testlogs/**/*.xml'
              archiveArtifacts artifacts: 'bazel-testlogs/**/test.outputs/outputs.zip', allowEmptyArchive: true
            }
          }
        }
      }
    }
  }
}
@jwnimmer-tri
Copy link
Collaborator Author

Two important caveats:

  • With bazel 8 (about to land now), tne test.outputs is no longer zipped by default. We can turn on a flag to zip it again, but probably best if we can deal with the unzipped outputs directly.

  • This feature must NOT be enabled for coverage (kcov) builds. Coverage builds have a ton of extra output files, which we do not want to keep around (very large). We already upload the coverage summary, which is enough. So we'll need some kine of on/off flag for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: continuous integration Jenkins, CDash, mirroring of externals, website infrastructure priority: medium type: feature request
Development

No branches or pull requests

3 participants