Skip to content

Commit

Permalink
chore: swap name of 'e2e' and 'integration' tests (cosmos#681)
Browse files Browse the repository at this point in the history
* save first changes

* fix gh workflow

* update gh actions

* fix bug

* squash commits

* Simply use Test rather than Ingt for naming integration test keepers

* update git workflows
  • Loading branch information
sainoe authored Apr 4, 2023
1 parent 75c0652 commit cc3f8d2
Show file tree
Hide file tree
Showing 70 changed files with 326 additions and 317 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/automated-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
with:
go-version: "1.18.0" # The Go version to download (if necessary) and use.

- name: Unit, e2e and difference tests
- name: Unit, integration and difference tests
run: go test ./...

- name: Integration tests
run: make test-integration-short
- name: E2E tests
run: make test-e2e-short
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# manually run full integration test suite
# manually run full E2E test suite
# all tests are run sequentially
name: manual-integration-main
name: manual-e2e-main
on:
workflow_dispatch:

Expand All @@ -22,5 +22,5 @@ jobs:
with:
go-version: "1.18" # The Go version to download (if necessary) and use.

- name: Integration tests
run: make test-integration
- name: E2E tests
run: make test-e2e
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# !! Relevant changes to this file should be propagated manual-integration.yml

name: nightly-integration-main
name: nightly-e2e-main
on:
schedule:
# run every day at 03:00 UTC
Expand All @@ -28,8 +28,8 @@ jobs:

- uses: actions/checkout@v3

- name: Integration tests
run: make test-integration
- name: E2E tests
run: make test-e2e


nightly-test-fail:
Expand All @@ -53,7 +53,7 @@ jobs:
"type": "header",
"text": {
"type": "plain_text",
"text": "❗Integration tests failed❗",
"text": "E2E tests failed❗",
"emoji": true
}
},
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ COPY --from=is-builder /go/bin/interchain-security-cdd /usr/local/bin/interchain


# Copy in the shell scripts that run the testnet
ADD ./tests/integration/testnet-scripts /testnet-scripts
ADD ./tests/e2e/testnet-scripts /testnet-scripts

# Copy in the hermes config
ADD ./tests/integration/testnet-scripts/hermes-config.toml /root/.hermes/config.toml
ADD ./tests/e2e/testnet-scripts/hermes-config.toml /root/.hermes/config.toml
4 changes: 2 additions & 2 deletions Dockerfile.gaia
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ COPY --from=is-builder /go/bin/interchain-security-cdd /usr/local/bin/interchain


# Copy in the shell scripts that run the testnet
ADD ./tests/integration/testnet-scripts /testnet-scripts
ADD ./tests/e2e/testnet-scripts /testnet-scripts

# Copy in the hermes config
ADD ./tests/integration/testnet-scripts/hermes-config.toml /root/.hermes/config.toml
ADD ./tests/e2e/testnet-scripts/hermes-config.toml /root/.hermes/config.toml
74 changes: 39 additions & 35 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,60 +8,64 @@ install: go.sum
go install $(BUILD_FLAGS) ./cmd/interchain-security-cd
go install $(BUILD_FLAGS) ./cmd/interchain-security-cdd

# run all tests: unit, e2e, diff, and integration
# run all tests: unit, integration, diff, and E2E
test:
go test ./... && go run ./tests/integration/...
go test ./... && go run ./tests/e2e/...

# run e2e and unit tests
# run unit and integration tests
test-short:
go test ./tests/e2e/... ./x/... ./app/...
go test ./x/... ./app/... ./tests/integration/...

# run E2E tests
test-e2e:
go test ./tests/e2e/...

# run difference tests
test-diff:
go test ./tests/difference/...

# run only happy path integration tests
test-integration-short:
go run ./tests/integration/... --happy-path-only
# run only happy path E2E tests
test-e2e-short:
go run ./tests/e2e/... --happy-path-only

# run full integration tests in sequence (including multiconsumer)
test-integration:
go run ./tests/integration/... --include-multi-consumer
# run full E2E tests in sequence (including multiconsumer)
test-e2e:
go run ./tests/e2e/... --include-multi-consumer

# run full integration tests in parallel (including multiconsumer)
test-integration-parallel:
go run ./tests/integration/... --include-multi-consumer --parallel
# run full E2E tests in parallel (including multiconsumer)
test-e2e-parallel:
go run ./tests/e2e/... --include-multi-consumer --parallel

# run full integration tests in sequence (including multiconsumer) using latest tagged gaia
test-gaia-integration:
go run ./tests/integration/... --include-multi-consumer --use-gaia
# run full E2E tests in sequence (including multiconsumer) using latest tagged gaia
test-gaia-e2e:
go run ./tests/e2e/... --include-multi-consumer --use-gaia

# run only happy path integration tests using latest tagged gaia
test-gaia-integration-short:
go run ./tests/integration/... --happy-path-only --use-gaia
# run only happy path E2E tests using latest tagged gaia
test-gaia-e2e-short:
go run ./tests/e2e/... --happy-path-only --use-gaia

# run full integration tests in parallel (including multiconsumer) using latest tagged gaia
test-gaia-integration-parallel:
go run ./tests/integration/... --include-multi-consumer --parallel --use-gaia
# run full E2E tests in parallel (including multiconsumer) using latest tagged gaia
test-gaia-e2e-parallel:
go run ./tests/e2e/... --include-multi-consumer --parallel --use-gaia

# run full integration tests in sequence (including multiconsumer) using specific tagged version of gaia
# usage: GAIA_TAG=v9.0.0 make test-gaia-integration-tagged
test-gaia-integration-tagged:
go run ./tests/integration/... --include-multi-consumer --use-gaia --gaia-tag $(GAIA_TAG)
# run full E2E tests in sequence (including multiconsumer) using specific tagged version of gaia
# usage: GAIA_TAG=v9.0.0 make test-gaia-e2e-tagged
test-gaia-e2e-tagged:
go run ./tests/e2e/... --include-multi-consumer --use-gaia --gaia-tag $(GAIA_TAG)

# run only happy path integration tests using latest tagged gaia
# usage: GAIA_TAG=v9.0.0 make test-gaia-integration-short-tagged
test-gaia-integration-short-tagged:
go run ./tests/integration/... --happy-path-only --use-gaia --gaia-tag $(GAIA_TAG)
# run only happy path E2E tests using latest tagged gaia
# usage: GAIA_TAG=v9.0.0 make test-gaia-e2e-short-tagged
test-gaia-e2e-short-tagged:
go run ./tests/e2e/... --happy-path-only --use-gaia --gaia-tag $(GAIA_TAG)

# run full integration tests in parallel (including multiconsumer) using specific tagged version of gaia
# usage: GAIA_TAG=v9.0.0 make test-gaia-integration-parallel-tagged
test-gaia-integration-parallel-tagged:
go run ./tests/integration/... --include-multi-consumer --parallel --use-gaia --gaia-tag $(GAIA_TAG)
# run full E2E tests in parallel (including multiconsumer) using specific tagged version of gaia
# usage: GAIA_TAG=v9.0.0 make test-gaia-e2e-parallel-tagged
test-gaia-e2e-parallel-tagged:
go run ./tests/e2e/... --include-multi-consumer --parallel --use-gaia --gaia-tag $(GAIA_TAG)

# run all tests with caching disabled
test-no-cache:
go test ./... -count=1 && go run ./tests/integration/...
go test ./... -count=1 && go run ./tests/e2e/...

mockgen_cmd=go run github.com/golang/mock/mockgen
mocks:
Expand Down
37 changes: 19 additions & 18 deletions app/consumer-democracy/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ import (
dbm "github.com/tendermint/tm-db"

distr "github.com/cosmos/cosmos-sdk/x/distribution"

distrclient "github.com/cosmos/cosmos-sdk/x/distribution/client"
distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
"github.com/cosmos/interchain-security/testutil/e2e"
testutil "github.com/cosmos/interchain-security/testutil/integration"
ccvdistr "github.com/cosmos/interchain-security/x/ccv/democracy/distribution"

stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
Expand Down Expand Up @@ -758,50 +759,50 @@ func (app *App) SimulationManager() *module.SimulationManager {
return app.sm
}

// DemocConsumerApp interface implementations for e2e tests
// DemocConsumerApp interface implementations for integration tests

// GetConsumerKeeper implements the ConsumerApp interface.
func (app *App) GetConsumerKeeper() consumerkeeper.Keeper {
return app.ConsumerKeeper
}

// GetE2eBankKeeper implements the ConsumerApp interface.
func (app *App) GetE2eBankKeeper() e2e.E2eBankKeeper {
// GetTestBankKeeper implements the ConsumerApp interface.
func (app *App) GetTestBankKeeper() testutil.TestBankKeeper {
return app.BankKeeper
}

// GetE2eAccountKeeper implements the ConsumerApp interface.
func (app *App) GetE2eAccountKeeper() e2e.E2eAccountKeeper {
// GetTestAccountKeeper implements the ConsumerApp interface.
func (app *App) GetTestAccountKeeper() testutil.TestAccountKeeper {
return app.AccountKeeper
}

// GetE2eSlashingKeeper implements the ConsumerApp interface.
func (app *App) GetE2eSlashingKeeper() e2e.E2eSlashingKeeper {
// GetTestSlashingKeeper implements the ConsumerApp interface.
func (app *App) GetTestSlashingKeeper() testutil.TestSlashingKeeper {
return app.SlashingKeeper
}

// GetE2eEvidenceKeeper implements the ConsumerApp interface.
func (app *App) GetE2eEvidenceKeeper() e2e.E2eEvidenceKeeper {
// GetTestEvidenceKeeper implements the ConsumerApp interface.
func (app *App) GetTestEvidenceKeeper() testutil.TestEvidenceKeeper {
return app.EvidenceKeeper
}

// GetE2eStakingKeeper implements the ConsumerApp interface.
func (app *App) GetE2eStakingKeeper() e2e.E2eStakingKeeper {
// GetTestStakingKeeper implements the ConsumerApp interface.
func (app *App) GetTestStakingKeeper() testutil.TestStakingKeeper {
return app.StakingKeeper
}

// GetE2eDistributionKeeper implements the ConsumerApp interface.
func (app *App) GetE2eDistributionKeeper() e2e.E2eDistributionKeeper {
// GetTestDistributionKeeper implements the ConsumerApp interface.
func (app *App) GetTestDistributionKeeper() testutil.TestDistributionKeeper {
return app.DistrKeeper
}

// GetE2eMintKeeper implements the ConsumerApp interface.
func (app *App) GetE2eMintKeeper() e2e.E2eMintKeeper {
// GetTestMintKeeper implements the ConsumerApp interface.
func (app *App) GetTestMintKeeper() testutil.TestMintKeeper {
return app.MintKeeper
}

// GetE2eGovKeeper implements the ConsumerApp interface.
func (app *App) GetE2eGovKeeper() e2e.E2eGovKeeper {
// GetTestGovKeeper implements the ConsumerApp interface.
func (app *App) GetTestGovKeeper() testutil.TestGovKeeper {
return app.GovKeeper
}

Expand Down
20 changes: 10 additions & 10 deletions app/consumer/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ import (
tmos "github.com/tendermint/tendermint/libs/os"
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/interchain-security/testutil/e2e"
ibcconsumer "github.com/cosmos/interchain-security/x/ccv/consumer"
ibcconsumerkeeper "github.com/cosmos/interchain-security/x/ccv/consumer/keeper"
ibcconsumertypes "github.com/cosmos/interchain-security/x/ccv/consumer/types"

// unnamed import of statik for swagger UI support
_ "github.com/cosmos/cosmos-sdk/client/docs/statik"
testutil "github.com/cosmos/interchain-security/testutil/integration"
)

const (
Expand Down Expand Up @@ -646,30 +646,30 @@ func (app *App) SimulationManager() *module.SimulationManager {
return app.sm
}

// ConsumerApp interface implementations for e2e tests
// ConsumerApp interface implementations for integration tests

// GetConsumerKeeper implements the ConsumerApp interface.
func (app *App) GetConsumerKeeper() ibcconsumerkeeper.Keeper {
return app.ConsumerKeeper
}

// GetE2eBankKeeper implements the ConsumerApp interface.
func (app *App) GetE2eBankKeeper() e2e.E2eBankKeeper {
// GetTestBankKeeper implements the ConsumerApp interface.
func (app *App) GetTestBankKeeper() testutil.TestBankKeeper {
return app.BankKeeper
}

// GetE2eAccountKeeper implements the ConsumerApp interface.
func (app *App) GetE2eAccountKeeper() e2e.E2eAccountKeeper {
// GetTestAccountKeeper implements the ConsumerApp interface.
func (app *App) GetTestAccountKeeper() testutil.TestAccountKeeper {
return app.AccountKeeper
}

// GetE2eSlashingKeeper implements the ConsumerApp interface.
func (app *App) GetE2eSlashingKeeper() e2e.E2eSlashingKeeper {
// GetTestSlashingKeeper implements the ConsumerApp interface.
func (app *App) GetTestSlashingKeeper() testutil.TestSlashingKeeper {
return app.SlashingKeeper
}

// GetE2eEvidenceKeeper implements the ConsumerApp interface.
func (app *App) GetE2eEvidenceKeeper() e2e.E2eEvidenceKeeper {
// GetTestEvidenceKeeper implements the ConsumerApp interface.
func (app *App) GetTestEvidenceKeeper() testutil.TestEvidenceKeeper {
return app.EvidenceKeeper
}

Expand Down
20 changes: 10 additions & 10 deletions app/provider/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ import (
ibcproviderkeeper "github.com/cosmos/interchain-security/x/ccv/provider/keeper"
providertypes "github.com/cosmos/interchain-security/x/ccv/provider/types"

e2e "github.com/cosmos/interchain-security/testutil/e2e"
testutil "github.com/cosmos/interchain-security/testutil/integration"

"github.com/tendermint/spm/cosmoscmd"

Expand Down Expand Up @@ -751,30 +751,30 @@ func (app *App) SimulationManager() *module.SimulationManager {
return app.sm
}

// ProviderApp interface implementations for e2e tests
// ProviderApp interface implementations for integration tests

// GetProviderKeeper implements the ProviderApp interface.
func (app *App) GetProviderKeeper() ibcproviderkeeper.Keeper {
return app.ProviderKeeper
}

// GetE2eStakingKeeper implements the ProviderApp interface.
func (app *App) GetE2eStakingKeeper() e2e.E2eStakingKeeper {
// GetTestStakingKeeper implements the ProviderApp interface.
func (app *App) GetTestStakingKeeper() testutil.TestStakingKeeper {
return app.StakingKeeper
}

// GetE2eBankKeeper implements the ProviderApp interface.
func (app *App) GetE2eBankKeeper() e2e.E2eBankKeeper {
// GetTestBankKeeper implements the ProviderApp interface.
func (app *App) GetTestBankKeeper() testutil.TestBankKeeper {
return app.BankKeeper
}

// GetE2eSlashingKeeper implements the ProviderApp interface.
func (app *App) GetE2eSlashingKeeper() e2e.E2eSlashingKeeper {
// GetTestSlashingKeeper implements the ProviderApp interface.
func (app *App) GetTestSlashingKeeper() testutil.TestSlashingKeeper {
return app.SlashingKeeper
}

// GetE2eDistributionKeeper implements the ProviderApp interface.
func (app *App) GetE2eDistributionKeeper() e2e.E2eDistributionKeeper {
// GetTestDistributionKeeper implements the ProviderApp interface.
func (app *App) GetTestDistributionKeeper() testutil.TestDistributionKeeper {
return app.DistrKeeper
}

Expand Down
Loading

0 comments on commit cc3f8d2

Please sign in to comment.