Skip to content

Conversation

@hdonnay
Copy link
Member

@hdonnay hdonnay commented Apr 2, 2025

While working on #869, I got to a point where I wasn't sure if I could trust the test suite, which is an untenable state of affairs.

This is splitting out that work so it can be applied first.

@hdonnay hdonnay force-pushed the hack/rpm-version branch from 8b7ac06 to c24c26d Compare April 7, 2025 18:45
@hdonnay hdonnay force-pushed the hack/rpm-version branch 2 times, most recently from bade1c7 to b766d77 Compare April 23, 2025 17:26
@hdonnay hdonnay marked this pull request as ready for review April 23, 2025 17:43
@hdonnay hdonnay requested a review from a team as a code owner April 23, 2025 17:43
@hdonnay hdonnay requested review from RTann and removed request for a team April 23, 2025 17:43
@hdonnay hdonnay requested review from BradLugo and crozzy April 23, 2025 17:51
Copy link
Contributor

@RTann RTann left a comment

Choose a reason for hiding this comment

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

I skipped everything under test/ as well as rpm/packagescanner_test.go. I can go over rpm/packagescanner_test.go another time, if desired, but anything under test/ is very unknown to me. I can look into it, if needed, otherwise I'll leave it for someone who knows more about that than I do

hdonnay added 15 commits April 29, 2025 15:01
This changes the custom packed-string format into URL query encoding. In
the original conception, this field wasn't meant to hold structured
information. It's grown to do it, though, so we should use some format
that's not hand-rolled.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
The BDB test fixture lost the "version" field in the `rpm` objects. This
re-adds them. Done via `jq`:

```
<bdb.rpm-manifest.json jq '.rpms[] |= . + (.nerva | capture(".+-(?<version>[^-]+)-.+"))' >out
mv out bdb.rpm-manifest.json
```

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Previously, the test output just printed the diff of the lists, but this
makes it very hard to figure out what's being compared. This now prints
the name, then prints the diff if necesarry.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
This implements rpm versioning in a package under our control. I wrote
this to make sure we understand and control the procedure. Due to
issues with test fixures, I wanted to make sure we weren't breaking our
tools with our tools.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Using these should give us a nice "todo" list when the time comes.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Port `rpmtest` over to use the `rpmver` package internally for its
version comparison.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Sort the Packages for easier-to-interpret output on test failure.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Use `rpmver` for a structured comparison rather than just string
comparison.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
This tool is based on extracting portions of the `test/periodic` test,
repuroposing it to create test fixtures.

This outputs `txtar` formatted files that should have enough information
to track the manifests' provenance. This has become a pain point when
investigating the correctness of test fixures.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
// 1: a is newer than b
// 0: a and b are the same version
// -1: b is newer than a
func rpmvercmp(a, b string) int {
Copy link
Contributor

Choose a reason for hiding this comment

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

It's hard to tell, but I don't think this has changed since I last reviewed. When I last reviewed, this all looked good to me after I did a comparison between the C version and this version

Copy link
Contributor

@RTann RTann left a comment

Choose a reason for hiding this comment

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

From what I can tell, everything outside test/ looks good. I haven't checked there, but I can if you need. Curious to see how this'll be used for the dnf PR

@hdonnay
Copy link
Member Author

hdonnay commented Apr 30, 2025

/fast-forward

@github-actions github-actions bot merged commit 8be64d9 into quay:main Apr 30, 2025
6 checks passed
@hdonnay hdonnay deleted the hack/rpm-version branch April 30, 2025 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants