-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
feat: Add legacy simapp testing via build tags #12121
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
809156d
simple test
facundomedica 8943ce8
Merge branch 'main' of https://github.com/cosmos/cosmos-sdk into facu…
facundomedica 4a05cb2
add app_legacy.go
facundomedica a67a5ff
Merge branch 'main' of https://github.com/cosmos/cosmos-sdk into facu…
facundomedica 24cf40f
fix build tags now that I know that CI passes with the legacy stuff
facundomedica d8b8de5
Merge branch 'main' into facu/simapp-legacy-test
facundomedica 9c78547
Merge branch 'main' into facu/simapp-legacy-test
tac0turtle bc11009
add legacy tests to ci, run 2 a day
tac0turtle effbb69
fix name
tac0turtle 8a0a657
fix name
tac0turtle c9f4c0d
Merge branch 'main' into facu/simapp-legacy-test
facundomedica a0d568a
Merge branch 'main' into facu/simapp-legacy-test
facundomedica a40f0b5
Merge branch 'main' into facu/simapp-legacy-test
julienrbrt e190373
Merge branch 'main' into facu/simapp-legacy-test
facundomedica 1224713
Merge branch 'main' into facu/simapp-legacy-test
facundomedica e73a5eb
fix issues
facundomedica dcaaf20
quick test inverting builg tags
facundomedica 305a796
fix
facundomedica 4e155c8
fix
facundomedica 5dbe734
fix build tags
facundomedica bd195c8
Merge branch 'main' into facu/simapp-legacy-test
julienrbrt 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,152 @@ | ||
name: Legacy App Testing | ||
on: | ||
schedule: | ||
- cron: "0 0,12 * * *" | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
cleanup-runs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: rokroskar/workflow-run-cleanup-action@master | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'" | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go-arch: ["amd64", "arm", "arm64"] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
- name: Build | ||
run: GOARCH=${{ matrix.go-arch }} LEDGER_ENABLED=false make build | ||
|
||
- name: Build cosmovisor | ||
run: GOARCH=${{ matrix.go-arch }} LEDGER_ENABLED=false make cosmovisor | ||
|
||
- name: Install runsim | ||
run: go install github.com/cosmos/tools/cmd/[email protected] | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/go/bin | ||
key: ${{ runner.os }}-go-runsim-binary | ||
|
||
test-submodules: | ||
runs-on: ubuntu-latest | ||
container: tendermintdev/docker-tm-db-testing | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
- name: Run submodule tests and create test coverage profile. | ||
# GIT_DIFF is passed to the scripts | ||
run: bash scripts/module-tests.sh | ||
if: env.GIT_DIFF | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: "${{ github.sha }}-go-submodules-coverage" | ||
path: ./coverage-go-submod-profile.out | ||
|
||
split-test-files: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
- name: Create a file with all core Cosmos SDK pkgs | ||
run: go list ./... > pkgs.txt | ||
- name: Split pkgs into 4 files | ||
run: split -d -n l/4 pkgs.txt pkgs.txt.part. | ||
# cache multiple | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: "${{ github.sha }}-00" | ||
path: ./pkgs.txt.part.00 | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: "${{ github.sha }}-01" | ||
path: ./pkgs.txt.part.01 | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: "${{ github.sha }}-02" | ||
path: ./pkgs.txt.part.02 | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: "${{ github.sha }}-03" | ||
path: ./pkgs.txt.part.03 | ||
|
||
tests: | ||
runs-on: ubuntu-latest | ||
needs: split-test-files | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
part: ["00", "01", "02", "03"] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: "${{ github.sha }}-${{ matrix.part }}" | ||
if: env.GIT_DIFF | ||
- name: test & coverage report creation | ||
run: | | ||
cat pkgs.txt.part.${{ matrix.part }} | xargs go test -mod=readonly -timeout 30m -coverprofile=${{ matrix.part }}profile.out -covermode=atomic -tags='legacy_simapp norace ledger test_ledger_mock' | ||
if: env.GIT_DIFF | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: "${{ github.sha }}-${{ matrix.part }}-coverage" | ||
path: ./${{ matrix.part }}profile.out | ||
|
||
sims-notify-success: | ||
needs: | ||
[tests] | ||
runs-on: ubuntu-latest | ||
if: ${{ success() }} | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get previous workflow status | ||
uses: ./.github/actions/last-workflow-status | ||
id: last_status | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Notify Slack on success | ||
if: ${{ steps.last_status.outputs.last_status == 'failure' }} | ||
uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7 | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | ||
SLACK_CHANNEL: cosmos-sdk-legacy-app | ||
SLACK_USERNAME: Legacy App Tests | ||
SLACK_ICON_EMOJI: ":white_check_mark:" | ||
SLACK_COLOR: good | ||
SLACK_MESSAGE: Legacy app tests are passing | ||
SLACK_FOOTER: "" | ||
|
||
sims-notify-failure: | ||
needs: | ||
[tests] | ||
runs-on: ubuntu-latest | ||
if: ${{ failure() }} | ||
steps: | ||
- name: Notify Slack on failure | ||
uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7 | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | ||
SLACK_CHANNEL: cosmos-sdk-legacy-app | ||
SLACK_USERNAME: Legacy App Tests | ||
SLACK_ICON_EMOJI: ":skull:" | ||
SLACK_COLOR: danger | ||
SLACK_MESSAGE: Legacy app tests are failing | ||
SLACK_FOOTER: "" |
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.
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.
set it to run twice a day, is that okay?
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.
LGTM