-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
test: Initial release of smoke/integration tests + testing framework #993
Merged
monilpat
merged 14 commits into
elizaOS:develop
from
Sifchain:test/integration-test-poc
Dec 12, 2024
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
107d9e9
Initial release of smoke/integration tests + testing framework
jzvikart e9b6c1c
update lock file
pgoos 7290ae8
add sleep for stability
pgoos b0d91d2
reverse sleep order
pgoos 5749bea
more complex CI fix
pgoos a24934e
update workflow file
pgoos 1a9ced2
update how the secret is passed
pgoos 0e347f8
update workflow file
pgoos bb0563c
cleanup
pgoos 44b1e55
Merge branch 'main' into test/integration-test-poc
pgoos 1fd12ca
add logic to skip the run
pgoos dfac323
Merge branch 'test/integration-test-poc' of github.com:Sifchain/sa-el…
pgoos 3520954
Add README
jzvikart ff82bb9
update exit code
pgoos 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 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,55 @@ | ||
name: integration-test | ||
on: | ||
push: | ||
branches: | ||
- "*" | ||
pull_request: | ||
branches: | ||
- "*" | ||
jobs: | ||
smoke-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: pnpm/action-setup@v3 | ||
with: | ||
version: 9.4.0 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "23" | ||
cache: "pnpm" | ||
|
||
- name: Run smoke tests | ||
run: pnpm run smokeTests | ||
integration-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: pnpm/action-setup@v3 | ||
with: | ||
version: 9.4.0 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "23" | ||
cache: "pnpm" | ||
|
||
- name: Install dependencies | ||
run: pnpm install -r | ||
|
||
- name: Build packages | ||
run: pnpm build | ||
|
||
- name: Run integration tests | ||
env: | ||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
run: | | ||
if [ -z "$OPENAI_API_KEY" ]; then | ||
echo "Skipping integration tests due to missing required API keys" | ||
exit 1 | ||
else | ||
pnpm run integrationTests | ||
fi |
This file contains 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
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.
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.
GitHub does not allow this secret to be accessible for github action runs from forked repos.
See:
pull_request_target
:as well as github's blog post: https://github.blog/news-insights/product-news/github-actions-improvements-for-fork-and-pull-request-workflows/
there are some security concerns with allowing secrets to be added to runtime envs of github actions triggered by pull requests: https://nathandavison.com/blog/github-actions-and-the-threat-of-malicious-pull-requests
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.
Yes, that's expected and also desired - normally you would not want people who clone your repository to get access to your secrets. This means that each repository / fork owner is responsible for setting up their own secrets.
Yes, this was also mentioned in the "risks" above. A malicious PR (or even branch) might be set up to reveal the secret, and there is no way around it. This means that probably (a) untrusted contributors should not be able to run workflows (already implemented), (b) every PR should be reviewed before running workflows (common sense anyway), and (c) there should be some limitations on API keys such as quota and regular rotation.
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 don't see an easy way to reveal the secret that will be added specifically for ai16z workflow runs. Github CI hides it with
***
when you echo it. Other than that, @jzvikart made valid concerns.