Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Jul 8, 2022
1 parent f25f7d8 commit 1bbaea2
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/legacy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,15 @@ jobs:
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'
cat pkgs.txt.part.${{ matrix.part }} | xargs go test -mod=readonly -timeout 15m -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]
needs: [tests]
runs-on: ubuntu-latest
if: ${{ success() }}
steps:
Expand All @@ -135,8 +134,7 @@ jobs:
SLACK_FOOTER: ""

sims-notify-failure:
needs:
[tests]
needs: [tests]
runs-on: ubuntu-latest
if: ${{ failure() }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-race.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ jobs:
- name: test & coverage report creation
if: env.GIT_DIFF
run: |
xargs --arg-file=pkgs.txt.part.${{ matrix.part }} go test -v -mod=readonly -timeout 30m -race -tags='cgo ledger test_ledger_mock'
xargs --arg-file=pkgs.txt.part.${{ matrix.part }} go test -mod=readonly -timeout 15m -race -tags='cgo ledger test_ledger_mock'
- uses: actions/upload-artifact@v3
if: env.GIT_DIFF
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ jobs:
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='norace ledger test_ledger_mock'
cat pkgs.txt.part.${{ matrix.part }} | xargs go test -mod=readonly -timeout 15m -coverprofile=${{ matrix.part }}profile.out -covermode=atomic -tags='norace ledger test_ledger_mock'
if: env.GIT_DIFF
- uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion contrib/test_cover.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PKGS=$(go list ./... | grep -v '/simapp')
set -e
echo "mode: atomic" > coverage.txt
for pkg in ${PKGS[@]}; do
go test -v -timeout 30m -race -coverprofile=profile.out -covermode=atomic -tags='ledger test_ledger_mock' "$pkg"
go test -v -timeout 15m -race -coverprofile=profile.out -covermode=atomic -tags='ledger test_ledger_mock' "$pkg"
if [ -f profile.out ]; then
tail -n +2 profile.out >> coverage.txt;
rm profile.out
Expand Down
2 changes: 1 addition & 1 deletion scripts/module-tests.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ execute_mod_tests() {

echo ">>> running $go_mod tests"
cd $mod_dir;
go test -mod=readonly -timeout 30m -coverprofile=${root_dir}/${coverage_file}.tmp -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
go test -mod=readonly -timeout 15m -coverprofile=${root_dir}/${coverage_file}.tmp -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
local ret=$?
echo "test return: " $ret;
cd -;
Expand Down
7 changes: 7 additions & 0 deletions testutil/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"encoding/json"
"errors"
"fmt"
"log"
"net/http"
"net/url"
"os"
Expand Down Expand Up @@ -50,6 +51,8 @@ import (
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/genutil"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

_ "net/http/pprof"
)

// package-wide network lock to only allow one test network at a time
Expand Down Expand Up @@ -260,6 +263,10 @@ func NewCLILogger(cmd *cobra.Command) CLILogger {

// New creates a new Network for integration tests or in-process testnets run via the CLI
func New(l Logger, baseDir string, cfg Config) (*Network, error) {
go func() {
log.Println(http.ListenAndServe("localhost:6060", nil))
}()

// only one caller/test can create and use a network at a time
l.Log("acquiring test network lock")
lock.Lock()
Expand Down

0 comments on commit 1bbaea2

Please sign in to comment.