Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
183aa94
feat(e2e): e2e test suite poc
GuillemGarciaDev Nov 19, 2024
a53db30
Merge branch 'main' of https://github.com/xrplevm/node
GuillemGarciaDev Nov 20, 2024
259849d
Merge branch 'main' into e2e/feat/suite
GuillemGarciaDev Nov 20, 2024
f324c9d
fix(e2e): delete legacy e2e tests
GuillemGarciaDev Nov 20, 2024
48a00d3
feat(test/integration): import integration test utils
GuillemGarciaDev Nov 20, 2024
40ab899
feat(tests): working on upgrade test suite
GuillemGarciaDev Nov 22, 2024
c8c1561
feat(tests, testutil): upgrade testsuite loads chain state successfully
GuillemGarciaDev Dec 2, 2024
063f4f2
refactor(tests, testutil): network composition
GuillemGarciaDev Dec 3, 2024
6d0e811
feat(testutil): add keyring testutils
GuillemGarciaDev Dec 4, 2024
73082f5
feat(testutil): adding default network integration testutil
GuillemGarciaDev Dec 4, 2024
f530a23
Merge branch 'main' of https://github.com/xrplevm/node
GuillemGarciaDev Dec 24, 2024
64e725c
Merge branch 'main' into e2e/feat/suite
GuillemGarciaDev Dec 24, 2024
2174526
fix(testutil): exrp common package
GuillemGarciaDev Jan 7, 2025
16e6cc9
refactor(testutil): exrp upgrade config
GuillemGarciaDev Jan 7, 2025
2748e56
feat(testutil): new exrp integration network testutil
GuillemGarciaDev Jan 7, 2025
18872b7
refactor(tests): update network config + module clients
GuillemGarciaDev Jan 7, 2025
92fbbe4
feat(tests): add integration test suite
GuillemGarciaDev Jan 7, 2025
8cf568e
chore: add test-integration make rule
GuillemGarciaDev Jan 7, 2025
5a825f0
chore: add integration tests to Dockerfile
GuillemGarciaDev Jan 7, 2025
088bae4
feat: sketch remove validator test
GuillemGarciaDev Jan 7, 2025
0180109
feat(testutil): add poa client and keeper
GuillemGarciaDev Jan 7, 2025
213101a
Merge branch 'e2e/feat/suite' into integration/feat/remove-validator-…
GuillemGarciaDev Jan 7, 2025
e35d24c
feat(tests): updated fund accounts for remove validator tests
GuillemGarciaDev Jan 8, 2025
c110eb5
refactor(testutil): add `grpc`,`factory` and `keyring`utils
GuillemGarciaDev Jan 8, 2025
dbd53da
fix(tests): update `integration` and `upgrade` test suites
GuillemGarciaDev Jan 8, 2025
eb38fba
fix: linting
GuillemGarciaDev Jan 8, 2025
993d3cc
Merge branch 'e2e/feat/suite' into integration/feat/remove-validator-…
GuillemGarciaDev Jan 8, 2025
bdd6458
feat(testutil): add `slashing` keeper to integration network
GuillemGarciaDev Jan 9, 2025
ffc4e8a
feat(testutil): add `BondDenom` config
GuillemGarciaDev Jan 9, 2025
c6a7512
feat(tests): add `Jail` and `Tombstone` remove validator tests
GuillemGarciaDev Jan 9, 2025
68907f2
fix(tests): jail validator on tombstone remove validator test
GuillemGarciaDev Jan 9, 2025
8942b30
feat(testutil): added new abci calls for NextBloc logic
GuillemGarciaDev Jan 10, 2025
467ac6a
fix(testutil): missing BuildFinalizeBlockReq param
GuillemGarciaDev Jan 10, 2025
2e2f975
feat(tests): add jailed, tombstoned, unbonded and unbonding status in…
GuillemGarciaDev Jan 10, 2025
6ec2d99
fix(tests): tests linting
GuillemGarciaDev Jan 10, 2025
7ff8362
feat(tests): add add existing validator with bonded status test
GuillemGarciaDev Jan 10, 2025
3df4b72
feat(tests): add missing `MsgAddValidator` tests
GuillemGarciaDev Jan 13, 2025
e6fbb79
fix(tests): move integration `MsgAddValidator` tests to corresponding…
GuillemGarciaDev Jan 13, 2025
0a901f9
fix(tests): linting
GuillemGarciaDev Jan 13, 2025
fb4aa93
fix(tests): add valIndex to tests
GuillemGarciaDev Jan 13, 2025
d9c7d21
fix(x/poa): `RemoveValidator` with propert amount of delegator shares
GuillemGarciaDev Jan 14, 2025
f031f1d
feat(tests): remove validator integration tests
GuillemGarciaDev Jan 14, 2025
ea08183
feat(testutil): add `abci` and `gov` testutils
GuillemGarciaDev Jan 14, 2025
4843e6b
feat(testutil): add new config options
GuillemGarciaDev Jan 14, 2025
100591e
Merge branch 'e2e/feat/suite' into integration/feat/remove-validator-…
GuillemGarciaDev Jan 14, 2025
7aa068f
Merge branch 'integration/feat/remove-validator-tests' into integrati…
GuillemGarciaDev Jan 14, 2025
3a5b7c1
refactor(testutil): dedicated abci block api for each integration net…
GuillemGarciaDev Jan 14, 2025
41b9989
refactor(tests): `MsgAddValidator` integration tests
GuillemGarciaDev Jan 14, 2025
7844ad1
Merge branch 'integration/feat/remove-validator-tests' into integrati…
GuillemGarciaDev Jan 14, 2025
ec86cc0
chore: add `coverage-poa` makefile rule
GuillemGarciaDev Jan 14, 2025
f7235a4
feat(poa): unit tests
GuillemGarciaDev Jan 15, 2025
9a6b418
fix(x/poa): refactor `ExecuteAddValidator`and `ExecuteRemoveValidator…
GuillemGarciaDev Jan 15, 2025
63f5ec8
fix(x/poa): msg server unit tests
GuillemGarciaDev Jan 15, 2025
a2f620e
chore: include html files on gitignore
GuillemGarciaDev Jan 15, 2025
e444cd2
fix(x/poa): fix linting
GuillemGarciaDev Jan 15, 2025
d6ca296
fix(x/poa): `ExecuteAddValidator` missing test cases
GuillemGarciaDev Jan 15, 2025
5310397
fix(poa): test linting
GuillemGarciaDev Jan 15, 2025
a44d736
chore: unit test coverage workflow
GuillemGarciaDev Jan 17, 2025
61c5ee2
fix: coverage workflow to run on every pull-request
GuillemGarciaDev Jan 17, 2025
a77bfed
fix: move coverage worflow to pull-request.yml
GuillemGarciaDev Jan 17, 2025
f8eacf5
chore: fix coverage-unit workflow
GuillemGarciaDev Jan 17, 2025
6260b3e
fix: test coverage config
GuillemGarciaDev Jan 17, 2025
d09b8ac
fix: coverage config exclude paths
GuillemGarciaDev Jan 17, 2025
8573792
fix: coverage unit
GuillemGarciaDev Jan 17, 2025
c179183
feat: add `client` rule to linter
GuillemGarciaDev Jan 17, 2025
f52bb86
fix: total coverage threshold
GuillemGarciaDev Jan 17, 2025
9812324
Merge pull request #45 from xrplevm/integration/feat/remove-validator…
AdriaCarrera Jan 20, 2025
297e606
Merge pull request #42 from xrplevm/integration/feat/add-validator-tests
AdriaCarrera Jan 20, 2025
923b468
Merge pull request #46 from xrplevm/integration/feat/coverage
AdriaCarrera Jan 20, 2025
b6f7363
Merge branch 'upgrade/feat/v6' into e2e/feat/suite
AdriaCarrera Jan 21, 2025
481070e
Merge branch 'e2e/feat/suite' of https://github.com/xrplevm/node into…
GuillemGarciaDev Jan 21, 2025
a660a07
fix(tests, testutil): update version on `tests` and `testutil` packages
GuillemGarciaDev Jan 21, 2025
b8dee82
Merge branch 'main' into e2e/feat/suite
AdriaCarrera Mar 18, 2025
401e25b
fix(tests): adapt main changes
AdriaCarrera Mar 18, 2025
9108862
fix(tests): adapt main changes
AdriaCarrera Mar 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/unit-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Coverage
on:
push:
branches: [ main ]
pull_request:
branches: [ '**' ]
jobs:
build:
name: Unit test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3

- name: Generate unit test coverage
run: make coverage-unit

- name: Check unit test coverage
uses: vladopajic/go-test-coverage@v2
with:
# Configure action using config file (option 1)
config: ./.testcoverage.yml
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ release/


.exrpd/
*.out
*.html

bin/
55 changes: 55 additions & 0 deletions .testcoverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# (mandatory)
# Path to coverage profile file (output of `go test -coverprofile` command).
#
# For cases where there are many coverage profiles, such as when running
# unit tests and integration tests separately, you can combine all those
# profiles into one. In this case, the profile should have a comma-separated list
# of profile files, e.g., 'cover_unit.out,cover_integration.out'.
profile: coverage_unit.out

# (optional; but recommended to set)
# When specified reported file paths will not contain local prefix in the output.
local-prefix: "github.com/xrplevm/node"

# Holds coverage thresholds percentages, values should be in range [0-100].
threshold:
# (optional; default 0)
# Minimum overall project coverage percentage required.
total: 70

# Holds regexp rules which will override thresholds for matched files or packages
# using their paths.
#
# First rule from this list that matches file or package is going to apply
# new threshold to it. If project has multiple rules that match same path,
# override rules should be listed in order from specific to more general rules.
# override:
# Increase coverage threshold to 100% for `foo` package
# (default is 80, as configured above in this example).
# - path: ^pkg/lib/foo$
# threshold: 100

# Holds regexp rules which will exclude matched files or packages
# from coverage statistics.
exclude:
# Exclude files or packages matching their paths
paths:
- cmd
- docs
- app
- tools
- tests
- \.pb\.go$
- \.pb\.gw\.go$
- module.go$
- \/testutil\/
- \/client\/

# File name of go-test-coverage breakdown file, which can be used to
# analyze coverage difference.
breakdown-file-name: ''

diff:
# File name of go-test-coverage breakdown file which will be used to
# report coverage difference.
base-breakdown-file-name: ''
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ FROM base AS integration
RUN make lint
# Unit tests
RUN make test-poa
# Integration tests
RUN make test-integration
RUN make test-upgrade
# Simulation tests
RUN make test-sim-benchmark-simulation
RUN make test-sim-full-app-fast
Expand Down
30 changes: 29 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,23 @@ lint-fix:
### Testing ###
###############################################################################
EXCLUDED_POA_PACKAGES=$(shell go list ./x/poa/... | grep -v /x/poa/testutil | grep -v /x/poa/client | grep -v /x/poa/simulation | grep -v /x/poa/types)
EXCLUDED_UNIT_PACKAGES=$(shell go list ./... | grep -v tests | grep -v testutil | grep -v tools | grep -v app | grep -v docs | grep -v cmd | grep -v /x/poa/testutil | grep -v /x/poa/client | grep -v /x/poa/simulation | grep -v /x/poa/types)

mocks:
@echo "--> Installing mockgen"
go install github.com/golang/mock/mockgen@v1.6.0
@echo "--> Generating mocks"
@./scripts/mockgen.sh

test: test-poa test-sim-benchmark-simulation test-sim-full-app-fast
test: test-poa test-integration test-upgrade test-sim-benchmark-simulation test-sim-full-app-fast

test-upgrade:
@echo "--> Running upgrade testsuite"
@go test -mod=readonly -v ./tests/upgrade

test-integration:
@echo "--> Running integration testsuite"
@go test -mod=readonly -v ./tests/integration

test-poa:
@echo "--> Running POA tests"
Expand All @@ -142,6 +151,25 @@ test-sim-full-app-fast:
@cd ${CURDIR}/app && go test -mod=readonly -run TestFullAppSimulation \
-Enabled=true -NumBlocks=100 -BlockSize=200 -Commit=true -Period=5 -Params=${CURDIR}/tests/sim/params.json -v -timeout 24h

###############################################################################
### Coverage ###
###############################################################################

coverage-unit:
@echo "--> Running unit coverage"
@go test $(EXCLUDED_UNIT_PACKAGES) -coverprofile=coverage_unit.out > /dev/null
@go tool cover -func=coverage_unit.out

coverage-poa:
@echo "--> Running POA coverage"
@go test $(EXCLUDED_POA_PACKAGES) -coverprofile=coverage_poa.out > /dev/null
@go tool cover -func=coverage_poa.out

coverage-integration:
@echo "--> Running integration coverage"
@go test ./tests/integration -mod=readonly -coverprofile=coverage_integration.out > /dev/null
@go tool cover -func=coverage_integration.out

###############################################################################
### Protobuf ###
###############################################################################
Expand Down
79 changes: 79 additions & 0 deletions tests/integration/network.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
package integration

import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/authz"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
erc20types "github.com/evmos/evmos/v20/x/erc20/types"
evmtypes "github.com/evmos/evmos/v20/x/evm/types"
feemarkettypes "github.com/evmos/evmos/v20/x/feemarket/types"
commonnetwork "github.com/xrplevm/node/v6/testutil/integration/common/network"
exrpcommon "github.com/xrplevm/node/v6/testutil/integration/exrp/common"
exrpintegration "github.com/xrplevm/node/v6/testutil/integration/exrp/integration"
poatypes "github.com/xrplevm/node/v6/x/poa/types"
)

var _ commonnetwork.Network = (*Network)(nil)

type Network struct {
exrpintegration.IntegrationNetwork
}

func NewIntegrationNetwork(opts ...exrpcommon.ConfigOption) *Network {
network := exrpintegration.New(opts...)
return &Network{
IntegrationNetwork: *network,
}
}

func (n *Network) SetupSdkConfig() {
exrpcommon.SetupSdkConfig()
}

func (n *Network) GetERC20Client() erc20types.QueryClient {
return exrpcommon.GetERC20Client(n)
}

func (n *Network) GetEvmClient() evmtypes.QueryClient {
return exrpcommon.GetEvmClient(n)
}

func (n *Network) GetGovClient() govtypes.QueryClient {
return exrpcommon.GetGovClient(n)
}

func (n *Network) GetBankClient() banktypes.QueryClient {
return exrpcommon.GetBankClient(n)
}

func (n *Network) GetFeeMarketClient() feemarkettypes.QueryClient {
return exrpcommon.GetFeeMarketClient(n)
}

func (n *Network) GetAuthClient() authtypes.QueryClient {
return exrpcommon.GetAuthClient(n)
}

func (n *Network) GetAuthzClient() authz.QueryClient {
return exrpcommon.GetAuthzClient(n)
}

func (n *Network) GetStakingClient() stakingtypes.QueryClient {
return exrpcommon.GetStakingClient(n)
}

func (n *Network) GetSlashingClient() slashingtypes.QueryClient {
return exrpcommon.GetSlashingClient(n)
}

func (n *Network) GetDistrClient() distrtypes.QueryClient {
return exrpcommon.GetDistrClient(n)
}

func (n *Network) GetPoaClient() poatypes.QueryClient {
return exrpcommon.GetPoaClient(n)
}
Loading