-
Notifications
You must be signed in to change notification settings - Fork 19
test: add container-based acceptance test infrastructure #669
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
Open
trevor-vaughan
wants to merge
2
commits into
main
Choose a base branch
from
test/acceptance-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: acceptance-test | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| types: | ||
| - opened | ||
| - synchronize | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| acceptance-test: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 | ||
| with: | ||
| go-version-file: "./go.mod" | ||
|
|
||
| - name: Run acceptance tests | ||
| run: make test-acceptance COMPOSE="docker compose" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "ignore": [ | ||
| "vendor/**", | ||
| "**/vendor/**" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
github-advanced-security[bot] marked this conversation as resolved.
Fixed
trevor-vaughan marked this conversation as resolved.
Dismissed
|
||
| # trivy:ignore:DS001 -- test container, intentionally floats on latest UBI | ||
| # trivy:ignore:DS026 -- ephemeral seed container, exits after seeding registry | ||
| # scorecard:pinned-dependencies -- intentionally unpinned; UBI images track latest for errata coverage | ||
| FROM registry.access.redhat.com/ubi10/ubi-minimal:latest | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
github-advanced-security[bot] marked this conversation as resolved.
Fixed
trevor-vaughan marked this conversation as resolved.
Dismissed
trevor-vaughan marked this conversation as resolved.
Dismissed
|
||
|
|
||
| ARG ORAS_VERSION=1.2.2 | ||
| # sha256 from https://github.com/oras-project/oras/releases/tag/v1.2.2 checksums.txt | ||
| ARG ORAS_SHA256=bff970346470e5ef888e9f2c0bf7f8ee47283f5a45207d6e7a037da1fb0eae0d | ||
|
|
||
| RUN microdnf install -y tar gzip && microdnf clean all | ||
|
|
||
| ADD https://github.com/oras-project/oras/releases/download/v${ORAS_VERSION}/oras_${ORAS_VERSION}_linux_amd64.tar.gz /tmp/oras.tar.gz | ||
| RUN echo "${ORAS_SHA256} /tmp/oras.tar.gz" | sha256sum -c - && \ | ||
| tar -xzf /tmp/oras.tar.gz -C /usr/local/bin oras && \ | ||
| rm /tmp/oras.tar.gz && \ | ||
| chmod +x /usr/local/bin/oras | ||
|
|
||
| COPY seed.sh /seed.sh | ||
| RUN chmod +x /seed.sh | ||
|
|
||
| USER nobody | ||
| ENTRYPOINT ["/seed.sh"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
trevor-vaughan marked this conversation as resolved.
Dismissed
|
||
|
|
||
| # Runtime-only container for acceptance tests. | ||
| # All binaries are built locally and injected from bin/. | ||
| # trivy:ignore:DS001 -- test container, intentionally floats on latest UBI | ||
| # trivy:ignore:DS026 -- ephemeral test container, compose healthcheck covers readiness | ||
| # scorecard:pinned-dependencies -- intentionally unpinned; UBI images track latest for errata coverage | ||
| FROM registry.access.redhat.com/ubi10/ubi-minimal:latest | ||
|
trevor-vaughan marked this conversation as resolved.
Dismissed
trevor-vaughan marked this conversation as resolved.
Dismissed
|
||
|
|
||
| RUN microdnf install -y shadow-utils && microdnf clean all && \ | ||
| useradd -m testuser | ||
|
|
||
| COPY bin/acceptance.test /usr/local/bin/acceptance.test | ||
| COPY bin/complyctl /usr/local/bin/complyctl | ||
| COPY bin/complyctl-provider-test \ | ||
| /home/testuser/.complytime/providers/complyctl-provider-test | ||
|
|
||
| RUN chown -R testuser:testuser /home/testuser/.complytime && \ | ||
| chmod 755 /home/testuser/.complytime/providers/complyctl-provider-test | ||
|
|
||
| USER testuser | ||
| WORKDIR /home/testuser | ||
|
|
||
| ENTRYPOINT ["/usr/local/bin/acceptance.test"] | ||
| CMD ["-test.v", "-test.timeout=3m"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # SUT container only needs pre-built binaries from bin/. | ||
| # Exclude everything else. | ||
| * | ||
| !bin/acceptance.test | ||
| !bin/complyctl | ||
| !bin/complyctl-provider-test |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.