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

test: refactor testdata to be generated #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

micahhausler
Copy link

@micahhausler micahhausler commented Sep 1, 2023

  • Removed hand-maintained test data
  • Added support for test fixture generation
  • Added additional test cases for amazonlinux, oraclelinux, fedora38

Issue #, if available:

N/A

Description of changes:

This doesn't change the API, or any functionality, but makes it easier to add new fields and tests.

Previously, large Go structs were committed with test data. This change uses rpm -qa --queryformat to dump RPM database information and stores it as a CSV. This will enable more easily supporting new fields by running go test ./... -update-testcases=true rather than having to hand-edit the test fixtures.

Given CentOS is no longer maintained, I added a amazonlinux and oraclelinux, and included existing CentOS databases. I'd be happy to update this PR dropping CentOS

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@micahhausler
Copy link
Author

@knqyf263 is this a PR you're open to merging?

* Removed hand-maintained test data
* Added support for test fixture generation
* Added additional test cases for amazonlinux, oraclelinux, fedora38
@knqyf263
Copy link
Owner

Yes, but I currently have less capacity to review the large PR due to family circumstances.

@micahhausler
Copy link
Author

Would you like this broken into smaller PRs?

@knqyf263
Copy link
Owner

It would be helpful

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