-
Notifications
You must be signed in to change notification settings - Fork 8
misc: run acceptance tests from github actions. #497
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
base: main
Are you sure you want to change the base?
Conversation
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.
0d2439d
to
cc443f5
Compare
SHELL ["/bin/bash", "-c"] | ||
|
||
RUN \ | ||
git clone https://github.com/oxidecomputer/omicron.git --depth 1 --branch jmcarp/prereqs-omit-sudo && \ |
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.
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.
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.
Oh, containers.
cc443f5
to
1b452f9
Compare
@@ -0,0 +1,53 @@ | |||
# /// script |
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 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"] |
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.
CLEAN
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 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 |
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.
Just noting that we should probably consider creating a setup-oxide
GitHub Action at some point.
uv run auth.py | ||
echo "OXIDE_TOKEN=$(uv run auth.py)" >> $GITHUB_OUTPUT |
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.
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 && \ |
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.
Oh, containers.
Builds on #494.