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: add integration testing for OVAL #274

Merged
merged 1 commit into from
Feb 20, 2023

Conversation

awilson-urbane
Copy link
Contributor

@awilson-urbane awilson-urbane commented Jan 4, 2023

If this Pull Request is work in progress, Add a prefix of “[WIP]” in the title.

What did you implement:

  • Automated integration testing for feed consumers and Postgres DB
    • Runs on push and Sunday at midnight
    • run locally with make test-integration

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Wrote integration tests. Clone repo and run make test-integration, or see GH actions.

Checklist:

You don't have to satisfy all of the following.

  • Write tests
  • Write documentation
  • Check that there aren't other open pull requests for the same issue/feature
  • Format your source code by make fmt
  • Pass the test by make test
  • Provide verification config / commands
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES

Reference

@eyablokov
Copy link

It would be nice to see it merged into the upstream, since I face this issue as well.

models/models.go Outdated Show resolved Hide resolved
@JulianNeuhaus27
Copy link

Similar issue like this: vulsio/go-kev#43

@eyablokov
Copy link

@awilson-urbane , is it ready to be merged to the upstream?

@awilson-urbane
Copy link
Contributor Author

@eyablokov Yes, this is ready. I just tested again (make test-integration) and updated the Fedora part to point to currently-supported versions

@eyablokov
Copy link

@awilson-urbane , @JulianNeuhaus27 is okay with this PR. He checked it out earlier :)

@awilson-urbane
Copy link
Contributor Author

awilson-urbane commented Feb 8, 2023

What are next steps? Who has permission to merge the PR?
(sorry for the confusion - I've not contributed to this project before)

@eyablokov
Copy link

As far as I understand, @MaineK00n or @kotakanbe should do that.

@MaineK00n
Copy link
Collaborator

MaineK00n commented Feb 9, 2023

I have been aware of this PR for some time, but I wonder if it is necessary to add an integration test to a fix that only changes the GORM type.

@MaineK00n
Copy link
Collaborator

If integration tests are also included in the merge, for example, it is recommended that the merge be periodically checked not only for PostgreSQL but also for MySQL, SQLite3, Redis, and so on.

@MaineK00n MaineK00n changed the title Fix ubuntu oval test: add integration testing for OVAL Feb 9, 2023
@MaineK00n
Copy link
Collaborator

MaineK00n commented Feb 9, 2023

@awilson-urbane

I have changed the PR to one that guarantees the success of periodic fetches for each DB Type.

The following points need to be considered and modified.

  • Periodic fetch success should be guaranteed not only for PostgreSQL but also for MySQL, SQLite3, and Redis.
  • Containerization of goval-dictionary is not necessary, and it would be better to prepare only the DB part in a container or the like as appropriate (is docker-compose necessary?). I think you can do what you want by just preparing a temporary DB like fetch-redis and running it on a schedule with GitHub Actions.
  • I would avoid the name Integration if the content only guarantees fetch.

Copy link
Collaborator

@MaineK00n MaineK00n left a comment

Choose a reason for hiding this comment

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

@MaineK00n MaineK00n removed the request for review from JulianNeuhaus27 February 9, 2023 12:19
@awilson-urbane
Copy link
Contributor Author

Hi @MaineK00n, thank you for your guidance, and I apologize for the lapse in communication. I'm revisiting this now and I'll have the requested changes ready for your review ASAP.

@awilson-urbane
Copy link
Contributor Author

OK @MaineK00n I've set up fetch testing for Postgres, Sqlite, MySQL and Redis. I also removed docker-compose from the process.

Here are the results from a test run: https://github.com/awilson-urbane/goval-dictionary/actions/runs/4198013433

@eyablokov
Copy link

By the way, @awilson-urbane , is there any Docker image of your branch existing and publicly available? Docker Hub etc.

@awilson-urbane
Copy link
Contributor Author

Hi @eyablokov, No, I haven't published the image anywhere.

Copy link
Collaborator

@MaineK00n MaineK00n left a comment

Choose a reason for hiding this comment

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

Basically, I don't want to assume that this fetch is going to run on hand. Therefore, we would like to pay attention to the execution time of GitHub Actions.

As far as I can tell from your test, it took about 14 minutes.
I would like to reduce this test time as much as possible.
Do you know of any good ways to do this?
https://github.com/awilson-urbane/goval-dictionary/actions/runs/4198013433

docker-compose.yaml Outdated Show resolved Hide resolved
.github/workflows/fetch.yml Outdated Show resolved Hide resolved
GNUmakefile Outdated Show resolved Hide resolved
.github/workflows/fetch.yml Outdated Show resolved Hide resolved
.github/workflows/fetch.yml Outdated Show resolved Hide resolved
.github/workflows/fetch.yml Outdated Show resolved Hide resolved
.github/workflows/fetch.yml Outdated Show resolved Hide resolved
GNUmakefile Outdated Show resolved Hide resolved
GNUmakefile Outdated Show resolved Hide resolved
.github/workflows/fetch.yml Outdated Show resolved Hide resolved
@awilson-urbane
Copy link
Contributor Author

We could reduce the overall CI time by changing the conditions under which it runs (just weekly instead of weekly and on push), but I don't know how to make the fetches themselves run faster.

@MaineK00n MaineK00n force-pushed the fix-ubuntu-oval branch 2 times, most recently from c912add to 1bf570f Compare February 20, 2023 03:06
@MaineK00n MaineK00n merged commit 0086c16 into vulsio:master Feb 20, 2023
@eyablokov
Copy link

@MaineK00n , is this bug fix in the latest tagged image here? I would like to see 0.8.2 version.

@MaineK00n
Copy link
Collaborator

@eyablokov
I will create v0.8.2 soon, but until then, please use the latest tagged image.

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