test: fix UT in TokenizeShares
#38
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
name: Tests / Code Coverage | |
on: | |
pull_request: | |
push: | |
branches: | |
- release/v0.47.x | |
permissions: | |
contents: read | |
concurrency: | |
group: ci-${{ github.ref }}-tests | |
cancel-in-progress: true | |
jobs: | |
split-test-files: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: "1.19" | |
check-latest: true | |
- 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. | |
- 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.19" | |
check-latest: true | |
cache: true | |
cache-dependency-path: go.sum | |
- uses: technote-space/[email protected] | |
id: git_diff | |
with: | |
PATTERNS: | | |
**/*.go | |
go.mod | |
go.sum | |
**/go.mod | |
**/go.sum | |
- uses: actions/download-artifact@v3 | |
with: | |
name: "${{ github.sha }}-${{ matrix.part }}" | |
- name: test & coverage report creation | |
if: env.GIT_DIFF | |
run: | | |
cat pkgs.txt.part.${{ matrix.part }} | xargs go test -mod=readonly -race -timeout 30m -coverprofile=${{ matrix.part }}profile.out -covermode=atomic -tags='ledger test_ledger_mock' | |
- uses: actions/upload-artifact@v3 | |
if: env.GIT_DIFF | |
with: | |
name: "${{ github.sha }}-${{ matrix.part }}-coverage" | |
path: ./${{ matrix.part }}profile.out | |
test-integration: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: "1.19" | |
check-latest: true | |
cache: true | |
cache-dependency-path: go.sum | |
- uses: technote-space/[email protected] | |
id: git_diff | |
with: | |
PATTERNS: | | |
**/*.go | |
go.mod | |
go.sum | |
**/go.mod | |
**/go.sum | |
**/Makefile | |
Makefile | |
- name: integration tests | |
if: env.GIT_DIFF | |
run: | | |
make test-integration-cov | |
- uses: actions/upload-artifact@v3 | |
if: env.GIT_DIFF | |
with: | |
name: "${{ github.sha }}-integration-coverage" | |
path: ./tests/integration-profile.out | |
test-e2e: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: "1.19" | |
check-latest: true | |
cache: true | |
cache-dependency-path: go.sum | |
- uses: technote-space/[email protected] | |
id: git_diff | |
with: | |
PATTERNS: | | |
**/*.go | |
go.mod | |
go.sum | |
**/go.mod | |
**/go.sum | |
**/Makefile | |
Makefile | |
- name: e2e tests | |
if: env.GIT_DIFF | |
run: | | |
make test-e2e-cov | |
- uses: actions/upload-artifact@v3 | |
if: env.GIT_DIFF | |
with: | |
name: "${{ github.sha }}-e2e-coverage" | |
path: ./tests/e2e-profile.out | |
repo-analysis: | |
runs-on: ubuntu-latest | |
needs: [tests, test-integration, test-e2e] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: technote-space/[email protected] | |
id: git_diff | |
with: | |
PATTERNS: | | |
**/*.go | |
go.mod | |
go.sum | |
**/go.mod | |
**/go.sum | |
- uses: actions/download-artifact@v3 | |
if: env.GIT_DIFF | |
with: | |
name: "${{ github.sha }}-00-coverage" | |
- uses: actions/download-artifact@v3 | |
if: env.GIT_DIFF | |
with: | |
name: "${{ github.sha }}-01-coverage" | |
- uses: actions/download-artifact@v3 | |
if: env.GIT_DIFF | |
with: | |
name: "${{ github.sha }}-02-coverage" | |
- uses: actions/download-artifact@v3 | |
if: env.GIT_DIFF | |
with: | |
name: "${{ github.sha }}-03-coverage" | |
- uses: actions/download-artifact@v3 | |
if: env.GIT_DIFF | |
with: | |
name: "${{ github.sha }}-integration-coverage" | |
- uses: actions/download-artifact@v3 | |
if: env.GIT_DIFF | |
with: | |
name: "${{ github.sha }}-e2e-coverage" | |
continue-on-error: true | |
- name: sonarcloud | |
if: env.GIT_DIFF | |
uses: SonarSource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
liveness-test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: "1.19" | |
check-latest: true | |
cache: true | |
cache-dependency-path: go.sum | |
- uses: technote-space/[email protected] | |
id: git_diff | |
with: | |
PATTERNS: | | |
**/*.go | |
go.mod | |
go.sum | |
**/go.mod | |
**/go.sum | |
**/Makefile | |
Makefile | |
- name: start localnet | |
if: env.GIT_DIFF | |
run: | | |
make clean localnet-start | |
- name: test liveness | |
if: env.GIT_DIFF | |
run: | | |
./contrib/localnet_liveness.sh 100 5 50 localhost | |
test-sim-nondeterminism: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: "1.19" | |
check-latest: true | |
cache: true | |
cache-dependency-path: go.sum | |
- uses: technote-space/[email protected] | |
id: git_diff | |
with: | |
PATTERNS: | | |
**/*.go | |
go.mod | |
go.sum | |
**/go.mod | |
**/go.sum | |
**/Makefile | |
Makefile | |
- name: test-sim-nondeterminism | |
if: env.GIT_DIFF | |
run: | | |
make test-sim-nondeterminism | |
test-simapp: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: "1.19" | |
check-latest: true | |
cache: true | |
cache-dependency-path: simapp/go.sum | |
- uses: technote-space/[email protected] | |
id: git_diff | |
with: | |
PATTERNS: | | |
simapp/**/*.go | |
simapp/go.mod | |
simapp/go.sum | |
- name: tests simapp | |
if: env.GIT_DIFF | |
run: | | |
cd simapp | |
go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... | |
- name: tests simapp v1 | |
if: env.GIT_DIFF | |
run: | | |
cd simapp | |
go test -mod=readonly -timeout 30m -tags='app_v1 norace ledger test_ledger_mock rocksdb_build' ./... | |
- name: sonarcloud | |
if: env.GIT_DIFF | |
uses: SonarSource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
projectBaseDir: simapp/ |