Skip to content

add license-validate test#30

Merged
lbarcziova merged 1 commit into
packit:mainfrom
xsuchy:license-validate
Mar 20, 2026
Merged

add license-validate test#30
lbarcziova merged 1 commit into
packit:mainfrom
xsuchy:license-validate

Conversation

@xsuchy
Copy link
Copy Markdown
Contributor

@xsuchy xsuchy commented Feb 25, 2026

TODO:

[ ] The precommit hook prints:
The 'test' attribute in '/tests/license-validate/prepare-distgit' must be defined. and I have no idea what it means and how to fix it. I will appreciate guidance.

I am not familiar with fmf. I copied the code from rplint and fedora-review tests and edit them accordingly.

RELEASE NOTES BEGIN

Added test to run license-validate after each commit.

RELEASE NOTES END

Comment thread tests/license-validate/main.fmf Outdated
Comment thread tests/license-validate/main.fmf Outdated
Comment thread tests/license-validate/packit.toml Outdated
@xsuchy
Copy link
Copy Markdown
Contributor Author

xsuchy commented Feb 25, 2026

Updated.

@LecrisUT
Copy link
Copy Markdown
Collaborator

Great. Final part, can you submit a testing-farm job to show how it works? Like in #28 (comment)

@xsuchy
Copy link
Copy Markdown
Contributor Author

xsuchy commented Feb 26, 2026

$ testing-farm request  \
    --git-url https://github.com/xsuchy/tmt-plans.git \
    --git-ref license-validate \
    --plan /plans/license-validate \
    -e KOJI_TASK_ID=142311560 \
    --context initiator=fedora-ci \
    --context trigger=commit \
    --compose Fedora-latest 
📦 repository https://github.com/xsuchy/tmt-plans.git ref license-validate test-type fmf
💻 Fedora-latest on x86_64 
🔎 api https://api.dev.testing-farm.io/v0.1/requests/2804f788-b6ea-406a-946b-7e3711e6d622
💡 waiting for request to finish, use ctrl+c to skip
👶 request is waiting to be queued
🚀 request is running
🚢 artifacts https://artifacts.dev.testing-farm.io/2804f788-b6ea-406a-946b-7e3711e6d622
✅ tests passed
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ id                                   ┃ state    ┃ artifacts                                    ┃ overall ┃ arches_requested ┃ errored_plans ┃ failed_plans ┃ skipped_plans ┃ passed_plans ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ 2804f788-b6ea-406a-946b-7e3711e6d622 │ complete │ https://artifacts.dev.testing-farm.io/2804f… │ passed  │ x86_64           │ 0             │ 0            │ 0             │ 1            │
└──────────────────────────────────────┴──────────┴──────────────────────────────────────────────┴─────────┴──────────────────┴───────────────┴──────────────┴───────────────┴──────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┓
┃ plan                    ┃ x86_64 ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━┩
│ /plans/license-validate │ pass   │
└─────────────────────────┴────────┘

which is weird because the test actually fail with

09:32:27         Test invocation process spawned with pid 823.
09:32:27                 stdout: Traceback (most recent call last):
09:32:27                 stdout:   File "/usr/bin/license-validate", line 8, in <module>
09:32:27                 stdout:     from specfile import Specfile
09:32:27                 stdout: ModuleNotFoundError: No module named 'specfile'
09:32:27                 stdout: Running license-validate with: ['/var/ARTIFACTS/work-license-validate3cm6r_r_/plans/license-validate/data/dist-git/python-sport-activities-features.spec']
09:32:27                 stdout: Shared connection to 3.131.152.160 closed.
09:32:27         Command returned '0' (success).

https://artifacts.dev.testing-farm.io/2804f788-b6ea-406a-946b-7e3711e6d622/work-license-validate3cm6r_r_/log.txt

Copy link
Copy Markdown
Collaborator

@LecrisUT LecrisUT left a comment

Choose a reason for hiding this comment

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

Looks like the test actually failed

Traceback (most recent call last):
  File "/usr/bin/license-validate", line 8, in <module>
    from specfile import Specfile
ModuleNotFoundError: No module named 'specfile'
Running license-validate with: ['/var/ARTIFACTS/work-license-validate3cm6r_r_/plans/license-validate/data/dist-git/python-sport-activities-features.spec']

Comment thread tests/license-validate/run-license-validate.py Outdated
Comment thread tests/license-validate/main.fmf
Comment thread tests/license-validate/run-license-validate.py Outdated
@xsuchy xsuchy force-pushed the license-validate branch 3 times, most recently from ab10041 to aa4b9e1 Compare February 26, 2026 13:59
@xsuchy
Copy link
Copy Markdown
Contributor Author

xsuchy commented Feb 26, 2026

$ testing-farm request  \
    --git-url https://github.com/xsuchy/tmt-plans.git \
    --git-ref license-validate \
    --plan /plans/license-validate \
    -e KOJI_TASK_ID=142311560 \
    --context initiator=fedora-ci \
    --context trigger=commit \
    --compose Fedora-latest 

📦 repository https://github.com/xsuchy/tmt-plans.git ref license-validate test-type fmf
💻 Fedora-latest on x86_64 
🔎 api https://api.dev.testing-farm.io/v0.1/requests/da2e56fe-5177-447b-97b9-1277ef4e7873
💡 waiting for request to finish, use ctrl+c to skip
👶 request is waiting to be queued
🚀 request is running
🚢 artifacts https://artifacts.dev.testing-farm.io/da2e56fe-5177-447b-97b9-1277ef4e7873
✅ tests passed
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ id                                   ┃ state    ┃ artifacts                                    ┃ overall ┃ arches_requested ┃ errored_plans ┃ failed_plans ┃ skipped_plans ┃ passed_plans ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ da2e56fe-5177-447b-97b9-1277ef4e7873 │ complete │ https://artifacts.dev.testing-farm.io/da2e5… │ passed  │ x86_64           │ 0             │ 0            │ 0             │ 1            │
└──────────────────────────────────────┴──────────┴──────────────────────────────────────────────┴─────────┴──────────────────┴───────────────┴──────────────┴───────────────┴──────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┓
┃ plan                    ┃ x86_64 ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━┩
│ /plans/license-validate │ pass   │
└─────────────────────────┴────────┘

Comment on lines +2 to +4
# /// script
# dependencies = [ ]
# ///
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What's this for?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have no idea. I just copied that from rpmlint directory.

Copy link
Copy Markdown
Collaborator

@LecrisUT LecrisUT Mar 2, 2026

Choose a reason for hiding this comment

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

It is PEP723. It is meant to be able to run locally with just (pipx|hatch|uv) run ... and it handles any missing dependencies etc.

Copy link
Copy Markdown
Collaborator

@LecrisUT LecrisUT left a comment

Choose a reason for hiding this comment

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

LGTM

Comment thread tests/license-validate/main.fmf Outdated
@xsuchy xsuchy force-pushed the license-validate branch from aa4b9e1 to 3f746d7 Compare March 2, 2026 09:06
@lbarcziova lbarcziova merged commit c42d01f into packit:main Mar 20, 2026
1 check passed
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.

4 participants