Skip to content

Commit

Permalink
fix cli tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wagoodman committed Jan 15, 2025
1 parent 4c32a7a commit faaf510
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
issues:
uniq-by-line: false

linters-settings:
funlen:
lines: 90
statements: 65
gocognit:
min-complexity: 32

output:
uniq-by-line: false
run:
timeout: 10m
tests: false
Expand Down
4 changes: 3 additions & 1 deletion manager/src/grype_db_manager/db/latest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
import tempfile
import threading
from dataclasses import dataclass

# note: this is needed for dataclass loading from json (do not port to a type check block)
from datetime import datetime # noqa: TC003
from http.server import HTTPServer, SimpleHTTPRequestHandler
from typing import TYPE_CHECKING

Expand All @@ -17,7 +20,6 @@

if TYPE_CHECKING:
from collections.abc import Iterator
from datetime import datetime

LATEST_FILENAME = "latest.json"

Expand Down
3 changes: 3 additions & 0 deletions manager/tests/cli/.grype-db-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ distribution:

validate:
expected-providers:
# this is what we expect for the test...
- oracle
# this next value is not true, but we include it to check if we can detect missing providers
- nvd
listing:
image: "docker.io/oraclelinux:6@sha256:a06327c0f1d18d753f2a60bb17864c84a850bb6dcbcf5946dd1a8123f6e75495"
minimum-packages: 10 # 14 as of 2023-08-14, leaving some room for possible out-of-band changes to the data
Expand Down
4 changes: 2 additions & 2 deletions manager/tests/cli/test_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def test_workflow_2(cli_env, command, logger):
cli_env["GOWORK"] = "off"

stdout, _ = command.run(
f"grype-db-manager db validate {db_id} -vvv --recapture",
f"grype-db-manager db validate {db_id} --skip-namespace-check -vvv --recapture",
env=cli_env,
expect_fail=True,
)
Expand Down Expand Up @@ -128,7 +128,7 @@ def test_workflow_2(cli_env, command, logger):
command.run("make install-oracle-labels", env=cli_env)

stdout, _ = command.run(
f"grype-db-manager db validate {db_id} -vvv",
f"grype-db-manager db validate {db_id} --skip-namespace-check -vvv",
env=cli_env,
)
assert "Quality gate passed!" in stdout

0 comments on commit faaf510

Please sign in to comment.