Skip to content

chore(test): improve tests for job collector #1064

chore(test): improve tests for job collector

chore(test): improve tests for job collector #1064

Triggered via pull request January 20, 2025 11:14
Status Failure
Total duration 2m 7s
Artifacts

build.yml

on: pull_request
Fit to window
Zoom out
Zoom in

Annotations

6 errors and 5 warnings
Verify code: pkg/jobs/collector_test.go#L303
cannot use mockCluster (variable of type *k8s.MockCluster) as k8s.Cluster value in argument to NewCollector: *k8s.MockCluster does not implement k8s.Cluster (wrong type for method GetK8sClientSet)
Verify code: pkg/trivyk8s/trivyk8s_test.go#L85
cannot use k8s.NewMockCluster(k8s.NewMockClusterDynamicClient(nsResource)) (value of type *k8s.MockCluster) as k8s.Cluster value in struct literal: *k8s.MockCluster does not implement k8s.Cluster (wrong type for method GetK8sClientSet)
Verify code
issues found
Run unit tests: pkg/jobs/collector_test.go#L303
cannot use mockCluster (variable of type *k8s.MockCluster) as k8s.Cluster value in argument to NewCollector: *k8s.MockCluster does not implement k8s.Cluster (wrong type for method GetK8sClientSet)
Run unit tests: pkg/trivyk8s/trivyk8s_test.go#L85
cannot use k8s.NewMockCluster(k8s.NewMockClusterDynamicClient(nsResource)) (value of type *k8s.MockCluster) as k8s.Cluster value in struct literal: *k8s.MockCluster does not implement k8s.Cluster (wrong type for method GetK8sClientSet)
Run unit tests
Process completed with exit code 2.
Verify code
Unexpected input(s) 'skip-pkg-cache', 'skip-build-cache', valid inputs are ['version', 'install-mode', 'working-directory', 'github-token', 'only-new-issues', 'skip-cache', 'skip-save-cache', 'problem-matchers', 'args', 'cache-invalidation-interval']
Verify code
Restore cache failed: Dependencies file is not found in /home/runner/work/trivy-kubernetes/trivy-kubernetes. Supported file pattern: go.sum
Verify code
Unexpected input(s) 'skip-pkg-cache', 'skip-build-cache', valid inputs are ['version', 'install-mode', 'working-directory', 'github-token', 'only-new-issues', 'skip-cache', 'skip-save-cache', 'problem-matchers', 'args', 'cache-invalidation-interval']
Run end to end testing
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Run unit tests
Restore cache failed: Dependencies file is not found in /home/runner/work/trivy-kubernetes/trivy-kubernetes. Supported file pattern: go.sum