Additional test data will be added in subsequent PRs.
Metadata Update from @ppisar: - Request assigned
Could you remove this line?
And remove this line too.
Do not run mmd.validate() twice. I recommend "return(is_valid, mmd)" instead.
The "idx" variable is not an index. It's a modulemd-obsoletes object. Rename the variable to e.g. "mmd".
This "idx" is also not an index. It's a modulemd-obsoletes object. Can you rename it. Moreover, do_validate() returns only the first modulemd-obsoletes object from the "file". What if the file contains multiple modulemd-obsoletes documents. E.g. You want to obsolete both nodejs:11 and nodejs:12 in Fedora 36. Or will be there a rule that each obsoleted stream must be in a separate file?
This exclusion cycle exists in the script 4 times. In addition, it processes obsoletes_test_files twice. Could filter all the 3 lists (defaults_files, obsoletes_test_files, obsoletes_files) at the beginning just when then are populated? Instead of excluding them when they are used?
I'm not sure why you call the index with overriden defaults "buildroot" (and the other "runtime").
Filip, could you address the findings of this review?
I tried running the test and it fails:
$ python3 tests/validate.py [...] Obsoletes (tests): ================ nodejs:<Modulemd.Obsoletes object at 0x7fe1eda2b980 (ModulemdObsoletes at 0x563b3e9a5260)> ERROR:root:obsoletes/.gitkeep does not end with .yaml. It will not be included by Pungi. If this file does not contain defaults, it should be added to the tests/exclusions.txt file. Traceback (most recent call last): File "/home/petr/fedora-modules/fedora-module-defaults/tests/validate.py", line 266, in <module> sys.exit(main()) File "/home/petr/fedora-modules/fedora-module-defaults/tests/validate.py", line 248, in main idx_runtime.add_obsoletes(idx) TypeError: Argument 1 does not allow None as a value
I merged the commit and fixed the fatal errors. The minor issues reported in this review are not addressed.
I corrected the minor issues.
The only remaining question for you is:
do_validate() returns only the first modulemd-obsoletes object from the "file". What if the file contains multiple modulemd-obsoletes documents. E.g. You want to obsolete both nodejs:11 and nodejs:12 in Fedora 36. Or will be there a rule that each obsoleted stream must be in a separate file?
Pull-Request has been closed by ppisar
Additional test data will be added in subsequent PRs.