Skip to content

Commit

Permalink
Update feature def and parser calls to support updated version
Browse files Browse the repository at this point in the history
Signed-off-by: Jose R. Gonzalez <[email protected]>
  • Loading branch information
komish committed Jun 7, 2024
1 parent 7ba5680 commit 05a7e75
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 26 deletions.
14 changes: 7 additions & 7 deletions tests/tests/functional/chart_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,23 @@ def test_chart_signed():


@given(
parsers.parse("I would like to use the <type> profile"),
parsers.parse("I would like to use the {category} profile"),
target_fixture="profile_type",
)
def profile_type(type):
return type
def profile_type(category):
return category


@given(
parsers.parse("I will provide a <location> of a <helm_chart>"),
parsers.parse("I will provide a {location} of a {helm_chart}"),
target_fixture="chart_location",
)
def chart_location(location, helm_chart):
return os.path.join(location, helm_chart)


@given(
parsers.parse("I will provide a <location> of an expected <report_info>"),
parsers.parse("I will provide a {location} of an expected {report_info}"),
target_fixture="report_info_location",
)
def report_info_location(location, report_info):
Expand All @@ -71,7 +71,7 @@ def report_info_location(location, report_info):

@given(
parsers.parse(
"I will provide a <location> of a <public_key> to verify the signature"
"I will provide a {location} of a {public_key} to verify the signature"
),
target_fixture="public_key_location",
)
Expand All @@ -80,7 +80,7 @@ def public_key_location(location, public_key):


@given(
parsers.parse("I will use the chart verifier <image_type> image"),
parsers.parse("I will use the chart verifier {image_type} image"),
target_fixture="image_type",
)
def image_type(image_type):
Expand Down
45 changes: 26 additions & 19 deletions tests/tests/functional/features/chart_good.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,47 @@ Feature: Chart verification
Partners or redhat or community can verify their charts by running the
chart verifier against an error free chart.

Examples:
| image_type |
| tarball |
| podman |

@source
Scenario Outline: A chart provider verifies their chart using the chart verifier
Given I would like to use the <type> profile
Given I would like to use the <category> profile
Given I will provide a <location> of a <helm_chart>
Given I will provide a <location> of an expected <report_info>
Given I will use the chart verifier <image_type> image
Given The chart verifier version value
When I run the chart-verifier verify command against the chart to generate a report
Then I should see the report-info from the generated report matching the expected report-info

Examples:
| type | location | helm_chart | report_info |
| partner | tests/charts/psql-service/0.1.8/ | src | partner-report-info.json |
| partner | tests/charts/psql-service/0.1.9/ | psql-service-0.1.9.tgz | partner-report-info.json |
| redhat | tests/charts/psql-service/0.1.8/ | src | redhat-report-info.json |
| redhat | tests/charts/psql-service/0.1.9/ | psql-service-0.1.9.tgz | redhat-report-info.json |
| community | tests/charts/psql-service/0.1.8/ | src | community-report-info.json |
| community | tests/charts/psql-service/0.1.9/ | psql-service-0.1.9.tgz | community-report-info.json |
| category | location | helm_chart | report_info | image_type |
# test with tarball
| partner | tests/charts/psql-service/0.1.8/ | src | partner-report-info.json | tarball |
| partner | tests/charts/psql-service/0.1.9/ | psql-service-0.1.9.tgz | partner-report-info.json | tarball |
| redhat | tests/charts/psql-service/0.1.8/ | src | redhat-report-info.json | tarball |
| redhat | tests/charts/psql-service/0.1.9/ | psql-service-0.1.9.tgz | redhat-report-info.json | tarball |
| community | tests/charts/psql-service/0.1.8/ | src | community-report-info.json | tarball |
| community | tests/charts/psql-service/0.1.9/ | psql-service-0.1.9.tgz | community-report-info.json | tarball |
# Testing with Podman
| partner | tests/charts/psql-service/0.1.8/ | src | partner-report-info.json | podman |
| partner | tests/charts/psql-service/0.1.9/ | psql-service-0.1.9.tgz | partner-report-info.json | podman |
| redhat | tests/charts/psql-service/0.1.8/ | src | redhat-report-info.json | podman |
| redhat | tests/charts/psql-service/0.1.9/ | psql-service-0.1.9.tgz | redhat-report-info.json | podman |
| community | tests/charts/psql-service/0.1.8/ | src | community-report-info.json | podman |
| community | tests/charts/psql-service/0.1.9/ | psql-service-0.1.9.tgz | community-report-info.json | podman |

@signed
Scenario Outline: A chart provider verifies their signed chart using the chart verifier
Given I would like to use the <type> profile
Given I would like to use the <category> profile
Given I will provide a <location> of a <helm_chart>
Given I will provide a <location> of an expected <report_info>
Given I will use the chart verifier <image_type> image
Given I will provide a <location> of a <public_key> to verify the signature
Given The chart verifier version value
When I run the chart-verifier verify command against the signed chart to generate a report
Then I should see the report-info from the report for the signed chart matching the expected report-info

Examples:
| type | location | helm_chart | report_info | public_key |
| partner | tests/charts/psql-service/0.1.11/ | psql-service-0.1.11.tgz | partner-report-info.json | psql-service-0.1.11.tgz.key |
| redhat | tests/charts/psql-service/0.1.11/ | psql-service-0.1.11.tgz | redhat-report-info.json | psql-service-0.1.11.tgz.key |
| category | location | helm_chart | report_info | public_key | image_type |
# test with tarball
| partner | tests/charts/psql-service/0.1.11/ | psql-service-0.1.11.tgz | partner-report-info.json | psql-service-0.1.11.tgz.key | tarball |
| redhat | tests/charts/psql-service/0.1.11/ | psql-service-0.1.11.tgz | redhat-report-info.json | psql-service-0.1.11.tgz.key | tarball |
# test with podman
| partner | tests/charts/psql-service/0.1.11/ | psql-service-0.1.11.tgz | partner-report-info.json | psql-service-0.1.11.tgz.key | podman |
| redhat | tests/charts/psql-service/0.1.11/ | psql-service-0.1.11.tgz | redhat-report-info.json | psql-service-0.1.11.tgz.key | podman |

0 comments on commit 05a7e75

Please sign in to comment.