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

Run in a single test, create custom TMT results.yaml with useful logs/artifacts #80

Merged
merged 4 commits into from
Dec 13, 2022
Merged

Run in a single test, create custom TMT results.yaml with useful logs/artifacts #80

merged 4 commits into from
Dec 13, 2022

Conversation

martinpitt
Copy link
Contributor

@martinpitt martinpitt commented Nov 8, 2022

We are going to call rpminspect_runner.sh just once for a package update. All the extra result parsing and splitting is obsolete, it will be replaced with making rpminspect's new builtin viewer [1] easily accessible from TF results.

[1] https://github.com/rpminspect/rpminspect/tree/main/contrib


I configured https://quay.io/repository/rhn_engineering_mpitt/rpminspect?tab=tags to auto-build on pushes to my fork.

I tested this locally as much as possible with the corresponding pipeline change, replicating a recent real-life run:

git clone -b custom-results-yaml https://github.com/martinpitt/rpminspect-pipeline
cd rpminspect-pipeline
cat <<EOF > env.yaml
PREVIOUS_TAG: f37-updates
TASK_ID: 94237776
RPMINSPECT_PROFILE_NAME: rawhide
REPOSITORY_URL: https://src.fedoraproject.org/rpms/cockpit-podman
CONFIG_BRANCH: rawhide
DEFAULT_RELEASE_STRING: fc37
GIT_COMMIT: f6b1abe13516b37569d2dcd9b718746e97e2e486
EOF

git fetch; git reset --hard origin/custom-results-yaml
rm -rf /var/tmp/tmt/*; tmt run --all --verbose -e @env.yaml

this ran, and as expected failed a few inspections. This has two initial custom logs:

$ cat /var/tmp/tmt/run-001/rpminspect/execute/data/rpminspect/data/results.yaml
- name: /rpminspect
  result: pass
  log:
    - data/rpminspect/output.txt
    - data/rpminspect/data/verbose.log
    - data/rpminspect/data/result.json

Now I want to test this end-to-end via TF, to see how that ends up in results.xml and how we can connect oculus and rpminspect's viewer.html. I hope/think that CI on this PR will do that.

I configured https://quay.io/repository/rhn_engineering_mpitt/rpminspect?tab=tags to auto-build on pushes to my fork.

Follow-up/ignore:

  • Rework rpminspect_zuul_runner.sh, this would be completely broken right now.
  • Clean up $RPMINSPECT_WORKDIR. Not really used any more, but rpminspect_zuul_runner.sh scripts are full of it still

Corresponding pipeline changes are in fedora-ci/rpminspect-pipeline#64 .

@martinpitt
Copy link
Contributor Author

Hmm, there's several blockers here. First of all, tmt's promised "custom results.yaml" does not do anything useful/visible to me. I filed teemtee/tmt#1671 about that. Also, Testing Farm only considers the first entry in log:, and does not plumb through any additional log file. I keep a todo list in the description.

@martinpitt
Copy link
Contributor Author

I sent a testing farm PR to plumb through the additional artifacts to results.xml and thus to the UI: https://gitlab.com/testing-farm/gluetool-modules/-/merge_requests/282 . This needs to land and get rolled out before we can make any progress here.

@martinpitt
Copy link
Contributor Author

@msrb, @thrix : Hmm, it seems the environment files disappeared? My original reference test run as well as a recent one still exist, but the tmt-environment-rpminspect.yaml file mentioned in the reproducer does not exist any more.

It's plausible that the recent rpminspect-runner changes around workdir may have accidentally dropped this file from the artifacts, but why did it also actively disappear from an old result?

I'll try to guess how they should look like, so that I can locally run an rpminspect pipeline. This PR is finally unblocked after last Friday's TF release. 🎉

@martinpitt
Copy link
Contributor Author

Ah, one can see the environment in the tmt log, thus a working file looks like this:

PREVIOUS_TAG: f37-updates
TASK_ID: 93912669
RPMINSPECT_PROFILE_NAME: rawhide
REPOSITORY_URL: https://src.fedoraproject.org/rpms/cockpit
CONFIG_BRANCH: rawhide
DEFAULT_RELEASE_STRING: fc37
GIT_COMMIT: 9fa3d64b44d624a37ab30ff25c56117cb31e86a9

@martinpitt
Copy link
Contributor Author

martinpitt commented Nov 28, 2022

Unfortunately that old cockpit test cannot be run any more, as rpminspect crashes: rpminspect: libannocheck_init error: version number too small. So I ran a pipeline for this recent successful cockpit-podman bodhi result through jenkins, and it ended up producing this result. This works as intended, I get the extra artifacts and the link to viewer!

We are going to call rpminspect_runner.sh just once for a package
update. All the extra result parsing and splitting is obsolete, it will
be replaced with making rpminspect's new builtin viewer [1] easily
accessible from TF results.

[1] https://github.com/rpminspect/rpminspect/tree/main/contrib
tmt 1.18 now supports generating a custom results.yaml [1] . We can use
that to declare our verbose.log and results.json as logs/artifacts.
These get plumbed through the testing farm API into results.xml, from
where they can get picked up by the gating dashboard or the Testing Farm
oculus viewer.

Move these attachments to the `$TMT_DATA_DIR`, so that they actually get
preserved. So far they were in the source git checkout, aka. TMT `tree/`
directory, but this is going away [2].

[1] teemtee/tmt#1488
[2] teemtee/tmt#1707
There is just one test now, so this script/step is not necessary any
more.
@martinpitt
Copy link
Contributor Author

The rpminspect crash was fixed at last, and depending PR #83 landed. I rebased this, and triggered a new run against voms-api-java-3.3.2-11.fc38, which actually fails rpminspect. Compare the result from current official infra to the result with this PR

@martinpitt martinpitt marked this pull request as ready for review December 13, 2022 11:00
@msrb
Copy link
Member

msrb commented Dec 13, 2022

As discussed on IRC, we don't use the Zuul scripts for anything right now. So I would leave those alone -- no need to update them in this PR.

${tests:+--tests=$tests} \
${before_build} \
${after_build_param} \
> $verbose_log 2>&1 || rc=$?
Copy link
Member

Choose a reason for hiding this comment

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

Nice trick with the || rc=$? ;)

@msrb
Copy link
Member

msrb commented Dec 13, 2022

Removing so many lines of code -- amazing! :)

I'd say let's merge this and test the changes end-to-end in the pipeline.

@msrb msrb merged commit 5e29b5f into fedora-ci:master Dec 13, 2022
@martinpitt martinpitt deleted the custom-results-yaml branch December 13, 2022 12:21
AdamWill added a commit to AdamWill/installability-pipeline that referenced this pull request Dec 6, 2023
Inspired by fedora-ci/rpminspect-runner#80
this does much the same for installability. Instead of running
four separate tests, run all four checks in a single test, then
(using the stuff from
fedora-ci/mini-tps#18 ) generate the
result JSON, put it and the viewer HTML into the test data dir,
and write a custom results.yaml pointing to it. This should
result in the viewer being easily accessible from the TF results,
giving packagers a much nicer view on the results.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
AdamWill added a commit to AdamWill/installability-pipeline that referenced this pull request Dec 13, 2023
Inspired by fedora-ci/rpminspect-runner#80
this does much the same for installability. Instead of running
four separate tests, run all four checks in a single test, then
(using the stuff from
fedora-ci/mini-tps#18 ) generate the
result JSON, put it and the viewer HTML into the test data dir,
and write a custom results.yaml pointing to it. This should
result in the viewer being easily accessible from the TF results,
giving packagers a much nicer view on the results.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
jpopelka pushed a commit to AdamWill/installability-pipeline that referenced this pull request Dec 14, 2023
Inspired by fedora-ci/rpminspect-runner#80
this does much the same for installability. Instead of running
four separate tests, run all four checks in a single test, then
(using the stuff from
fedora-ci/mini-tps#18 ) generate the
result JSON, put it and the viewer HTML into the test data dir,
and write a custom results.yaml pointing to it. This should
result in the viewer being easily accessible from the TF results,
giving packagers a much nicer view on the results.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants