-
Notifications
You must be signed in to change notification settings - Fork 117
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
Make relevancy/coverage linters to not re-read fmf files #2065
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
happz
changed the title
lintMake relevancy/coverage linters to not re-read fmf files
Make relevancy/coverage linters to not re-read fmf files
May 9, 2023
happz
force-pushed
the
lint-prepare-linters
branch
from
May 16, 2023 09:07
fd674c6
to
541fd43
Compare
happz
force-pushed
the
lint-prepare-linters
branch
from
May 25, 2023 12:05
541fd43
to
30e8bcc
Compare
happz
force-pushed
the
metadata-linters-dont-reread-source-fmf
branch
from
May 25, 2023 12:41
af2d7b6
to
0b84ad8
Compare
happz
force-pushed
the
lint-prepare-linters
branch
from
May 26, 2023 13:03
30e8bcc
to
19b67e3
Compare
happz
force-pushed
the
lint-prepare-linters
branch
from
June 5, 2023 14:10
19b67e3
to
8689fa3
Compare
happz
force-pushed
the
lint-prepare-linters
branch
from
June 6, 2023 10:11
8689fa3
to
1aebcde
Compare
psss
force-pushed
the
lint-prepare-linters
branch
from
June 7, 2023 09:07
1aebcde
to
beec739
Compare
happz
force-pushed
the
metadata-linters-dont-reread-source-fmf
branch
2 times, most recently
from
June 16, 2023 11:12
50bb346
to
0155d3f
Compare
happz
force-pushed
the
metadata-linters-dont-reread-source-fmf
branch
from
June 22, 2023 10:54
0155d3f
to
bf957db
Compare
psss
requested changes
Jun 29, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple problems spotted.
happz
force-pushed
the
metadata-linters-dont-reread-source-fmf
branch
from
June 29, 2023 18:20
bf957db
to
1ebdbdc
Compare
psss
approved these changes
Jun 29, 2023
Two test linters checking for legacy constructs were re-reading the original fmf sources, to focus on leaf node only. Patch changes the linters: * both now focus on loaded fmf data, i.e. `self.node` is inspected. * this may report keys defined by parents in the node fmf tree, but that is expected - the key is defined, somewhere, and it's inherited by the test metadata, user should be aware. The current implementation might miss this case, although it should be said, relevancycoverage inheritance is probably pretty rare. * optional `relevancy` key fix is applied only when relevancy is defined in the leaf node, i.e. in the test's direct metadata. It relevancy's inherited, the fix would be impractical as it would fix the wrong node. To get the right tools for this, two functions from `tmt.identifier` were moved into `tmt.utils` and generalized a bit. With this change, two extra reads of fmf files for each test visited by `tmt lint` are gone, dropping `tmt test lint` of tmt repo from 3.7 down to 2.6 seconds (on my laptop, YMMV).
psss
force-pushed
the
metadata-linters-dont-reread-source-fmf
branch
from
June 29, 2023 19:22
9337712
to
0d2b05d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Two test linters checking for legacy constructs were re-reading the original fmf sources, to focus on leaf node only. Patch changes the linters:
self.node
is inspected.relevancy
key fix is applied only when relevancy is defined in the leaf node, i.e. in the test's direct metadata. It relevancy's inherited, the fix would be impractical as it would fix the wrong node.To get the right tools for this, two functions from
tmt.identifier
were moved intotmt.utils
and generalized a bit.With this change, two extra reads of fmf files for each test visited by
tmt lint
are gone, droppingtmt test lint
of tmt repo from 3.7 down to 2.6 seconds (on my laptop, YMMV).