-
Notifications
You must be signed in to change notification settings - Fork 9
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
ci: add e2e test for OpenSSL #152
Conversation
93ab112
to
2fd4a05
Compare
Marking this as a draft while I try to find out what the issue is. Locally, the test works. Kubectl exec also seems quite brittle in a failing case like this, as it doesn't report the output reliably. Working on a fix |
Co-authored-by: Markus Rudy <[email protected]>
9bb94bb
to
b198cc5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I simplified the PR a bit - the idea is to keep things until nunki set
in the justfile, because it's the same logic for all, and then do tests on top - like the openssl tests here.
- name: Log in to ghcr.io Container registry | ||
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Login to Azure | ||
uses: azure/login@cb79c773a3cfa27f31f25eb3f677781210c9ce3d # v1.6.1 | ||
with: | ||
creds: ${{ secrets.NUNKI_CI_INFRA_AZURE }} | ||
- uses: nicknovitski/nix-develop@a2060d116a50b36dfab02280af558e73ab52427d # v1.1.0 | ||
- name: Generate namespace suffix | ||
id: ns | ||
run: | | ||
uuid=$(cat /proc/sys/kernel/random/uuid) | ||
uid=${uuid##*-} | ||
echo "namespace_suffix=$uid" >> "$GITHUB_OUTPUT" | ||
- name: Create justfile.env | ||
run: | | ||
cat <<EOF > justfile.env | ||
container_registry=${{ env.container_registry }} | ||
azure_resource_group=${{ env.azure_resource_group }} | ||
namespace_suffix=-${{ steps.ns.outputs.namespace_suffix }} | ||
EOF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The common steps should maybe go into an action someday.
// namespace the tests are executed in. | ||
const namespaceEnv = "K8S_NAMESPACE" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be part of the library.
Co-authored-by: Markus Rudy <[email protected]>
Co-authored-by: Markus Rudy <[email protected]>
b198cc5
to
63c37ef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested this locally and saw the CI job is passing, too.
Looks like a good start. Thanks to both of you!
This adds a tentative E2E test for the OpenSSL deployment. It tries to set up the Nunki cluster in the same way a user would do it, using
kubectl
to deploy. The actual test's logic is then packed into a Go test, exec'ing into the pods of the deployment and running the actualopenssl
commands. This does not give much value for this test, as the assertions and orchestration of the execs is very simple, but may take some of the boilerplate away for other, more complicated tests.Run of the test: https://github.com/edgelesssys/nunki/actions/runs/7875034691