Skip to content

Commit

Permalink
update how tests work
Browse files Browse the repository at this point in the history
  • Loading branch information
faddat committed Jan 11, 2025
1 parent a09db13 commit 7651286
Show file tree
Hide file tree
Showing 2 changed files with 375 additions and 120 deletions.
145 changes: 131 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,132 @@
on: [push, pull_request]
name: Test
name: WasmVM Tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
strategy:
matrix:
go-version: [1.23.x]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- run: go test ./...
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Cache Go modules
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
main-package-tests:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Run main package tests
run: |
go test -v ./... -run "^Test(IBC|AnalyzeCode|StoreCode|SimulateStoreCode|StoreCodeAndGet|RemoveCode|HappyPath|Env|GetMetrics|LongPayloadDeserialization|CreateChecksum)$"
api-contract-tests:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Run API contract tests
run: |
go test -v ./internal/api -run "^Test(Instantiate|Execute|ExecutePanic|ExecuteUnreachable|ExecuteCpuLoop|ExecuteStorageLoop|ExecuteUserErrorsInApiCalls|Migrate|MultipleInstances|Sudo)$"
api-iterator-tests:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Run API iterator tests
run: |
go test -v ./internal/api -run "^Test(StoreIterator|QueueIterator|RetrieveIterator)"
api-cache-tests:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Run API cache tests
run: |
go test -v ./internal/api -run "^Test(InitAndReleaseCache|InitCache|InitLocking)"
api-pin-tests:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Run API pin tests
run: |
go test -v ./internal/api -run "^Test(Pin|Unpin|GetMetrics|GetPinnedMetrics)"
api-query-tests:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Run API query tests
run: |
go test -v ./internal/api -run "^Test(DispatchSubmessage|ReplyAndQuery|Query|HackatomQuerier|CustomReflectQuerier|Floats|LibwasmvmVersion)"
types-serialization-tests:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Run types serialization tests
run: |
go test -v ./types -run "^Test(.*Serialization|.*JSON)$"
types-data-tests:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Run types data tests
run: |
go test -v ./types -run "^Test(MessageInfo|BlockInfo|Delegation|Validator|QueryResult|ConfigJSON|ChecksumString)$"
benchmarks:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Run benchmarks
run: |
go test -v ./internal/api -run=^$ -bench=.
Loading

0 comments on commit 7651286

Please sign in to comment.