Skip to content

Conversation

jmcarp
Copy link
Contributor

@jmcarp jmcarp commented Aug 19, 2025

Builds on #494.

Update tests and docs such that the entire acceptance test suite runs
against the simulated omicron environment. We either document and script
all resources that the tests depend on, or teach the tests to create the
dependencies themselves. We'll look into running the acceptance suite
against simulated omicron in a separate patch.
@jmcarp jmcarp force-pushed the jmcarp/omicron-test-actions branch 17 times, most recently from 0d2439d to cc443f5 Compare August 20, 2025 13:54
@jmcarp jmcarp changed the title Jmcarp/omicron test actions misc: run acceptance tests from github actions. Aug 20, 2025
@jmcarp jmcarp changed the title misc: run acceptance tests from github actions. misc: run acceptance tests from github actions. Aug 20, 2025
SHELL ["/bin/bash", "-c"]

RUN \
git clone https://github.com/oxidecomputer/omicron.git --depth 1 --branch jmcarp/prereqs-omit-sudo && \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I had to make some small changes to the install scripts in omicron to get this to build. If we like this approach, I'll send a PR to omicron and stop pointing to my branch.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, containers.

@jmcarp jmcarp marked this pull request as ready for review August 20, 2025 15:56
@jmcarp jmcarp requested a review from a team as a code owner August 20, 2025 15:56
@jmcarp jmcarp force-pushed the jmcarp/omicron-test-actions branch from cc443f5 to 1b452f9 Compare August 20, 2025 16:03
@@ -0,0 +1,53 @@
# /// script
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit of a hack. To run these tests manually, the user would first run oxide auth login, but that's an interactive flow that requires a browser. To make this non-interactive, we add a script that simulates the device auth flow and prints a token. @david-crespo pointed out that we could instead support password login via the cli, with a warning not to use it in production, but IMO this is fine for the time being.

},
)
token_resp.raise_for_status()
return token_resp.json()["access_token"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLEAN

Copy link
Collaborator

@sudomateo sudomateo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great! I know we have a few hacks in here for now but it'll be great to get acceptance tests running in automation while we sort those hacks out.

go-version-file: 'go.mod'
- uses: docker/setup-compose-action@v1
- uses: astral-sh/setup-uv@v6
- name: install oxide cli
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noting that we should probably consider creating a setup-oxide GitHub Action at some point.

Comment on lines +63 to +64
uv run auth.py
echo "OXIDE_TOKEN=$(uv run auth.py)" >> $GITHUB_OUTPUT
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of running uv run auth.py twice? Should we just capture the result as a variable and echo it instead?

SHELL ["/bin/bash", "-c"]

RUN \
git clone https://github.com/oxidecomputer/omicron.git --depth 1 --branch jmcarp/prereqs-omit-sudo && \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, containers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants