Skip to content

[ROX-10775] : Node Vulnerability GraphQL Endpoint tests#2815

Merged
charmik-redhat merged 7 commits intomasterfrom
ROX-10775/charmik/node-vulns-graphql-go-tests
Aug 29, 2022
Merged

[ROX-10775] : Node Vulnerability GraphQL Endpoint tests#2815
charmik-redhat merged 7 commits intomasterfrom
ROX-10775/charmik/node-vulns-graphql-go-tests

Conversation

@charmik-redhat
Copy link
Contributor

@charmik-redhat charmik-redhat commented Aug 24, 2022

Description

  • Added go tests for NodeVulnerability graphQL endpoints

Checklist

  • Investigated and inspected CI test results
  • Unit test and regression tests added
  • [ ] Evaluated and added CHANGELOG entry if required
  • [ ] Determined and documented upgrade steps
  • [ ] Documented user facing changes (create PR based on openshift/openshift-docs and merge into rhacs-docs)

If any of these don't apply, please comment below.

Testing Performed

TODO(replace-me)
Use this space to explain how you tested your PR, or, if you didn't test it, why
you did not do so. Valid reasons include, for example, "CI is sufficient",
"No testable changes". Feel free to attach JSON snippets, curl commands,
screenshots.

In addition to reviewing your code, reviewers must also review your testing
instructions and make sure they are sufficient.

@openshift-ci
Copy link

openshift-ci bot commented Aug 24, 2022

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@charmik-redhat
Copy link
Contributor Author

/test all

@charmik-redhat charmik-redhat force-pushed the ROX-10775/charmik/node-vulns-graphql-go-tests branch from fa214e5 to c8e0cc6 Compare August 26, 2022 00:08
@charmik-redhat charmik-redhat changed the title Node Vulnerabilities graphQL go tests [ROX-10775] : Node Vulnerability GraphQL Endpoint tests Aug 26, 2022
@charmik-redhat charmik-redhat marked this pull request as ready for review August 26, 2022 00:11
@ghost
Copy link

ghost commented Aug 26, 2022

Images are ready for the commit at f7975dd.

To use with deploy scripts, first export MAIN_IMAGE_TAG=3.71.x-422-gf7975dd49d.

@charmik-redhat charmik-redhat force-pushed the ROX-10775/charmik/node-vulns-graphql-go-tests branch from c913335 to dfa8864 Compare August 29, 2022 17:11
return vuln
}

func testNodes() []*storage.Node {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please move this function to the test_utils.go file, this could be reused in future tests on the node endpoint

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that's right. Moved the function.


vuln := s.getImageVulnerabilityResolver(ctx, "cve-2018-1#")

scopedCtx := scoped.Context(ctx, scoped.Scope{
Copy link
Contributor

Choose a reason for hiding this comment

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

Please get rid of scopedCtx since it is no longer being used

Copy link
Contributor Author

Choose a reason for hiding this comment

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

scopedCtx is needed to fetch the ImageVulnerabilityResolver that is component scoped by calling getImageVulnerabilityResolver.

s.Error(err)
}

func (s *GraphQLNodeVulnerabilityTestSuite) TestTopNodeVulnerability() {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should test that top vuln changes when scoped

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, testing it when it is node scoped in this test. I will add the test for when it is component scoped when adding node components tests.

@charmik-redhat charmik-redhat force-pushed the ROX-10775/charmik/node-vulns-graphql-go-tests branch from 8771776 to f7975dd Compare August 29, 2022 18:56
@charmik-redhat
Copy link
Contributor Author

/retest-required

@charmik-redhat charmik-redhat merged commit d23dd4c into master Aug 29, 2022
@charmik-redhat charmik-redhat deleted the ROX-10775/charmik/node-vulns-graphql-go-tests branch August 29, 2022 22:17
davdhacs added a commit that referenced this pull request Jan 29, 2026
Update SCANNER_VERSION and COLLECTOR_VERSION to reference images from
their respective UBI9 migration PRs:
- Scanner: 2.38.x-166-g16d772deeb (PR #2562) - includes arm64 build fix
- Collector: 3.23.x-132-g98b7877e58 (PR #2815)

This enables e2e tests to verify all three components work correctly
together with UBI9.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants