Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: swap name of 'e2e' and 'integration' tests #681

Merged
merged 11 commits into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
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
6 changes: 3 additions & 3 deletions .github/workflows/automated-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,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
4 changes: 2 additions & 2 deletions .github/workflows/manual-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions .github/workflows/nightly-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 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
70 changes: 37 additions & 33 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, e2e, diff, and E2E
test:
go test ./... && go run ./tests/integration/...
go test ./... && go run ./tests/e2e/...

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

# run integration tests
test-integration:
go test ./tests/integration/...

# 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"
intgutil "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 {
// GetIntgBankKeeper implements the ConsumerApp interface.
func (app *App) GetIntgBankKeeper() intgutil.IntgBankKeeper {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is trivial but I'd probably just call this TestBankKeeper (same prefix for other test keepers). E2E tests are treating Gaia like a black box anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point

return app.BankKeeper
}

// GetE2eAccountKeeper implements the ConsumerApp interface.
func (app *App) GetE2eAccountKeeper() e2e.E2eAccountKeeper {
// GetIntgAccountKeeper implements the ConsumerApp interface.
func (app *App) GetIntgAccountKeeper() intgutil.IntgAccountKeeper {
return app.AccountKeeper
}

// GetE2eSlashingKeeper implements the ConsumerApp interface.
func (app *App) GetE2eSlashingKeeper() e2e.E2eSlashingKeeper {
// GetIntgSlashingKeeper implements the ConsumerApp interface.
func (app *App) GetIntgSlashingKeeper() intgutil.IntgSlashingKeeper {
return app.SlashingKeeper
}

// GetE2eEvidenceKeeper implements the ConsumerApp interface.
func (app *App) GetE2eEvidenceKeeper() e2e.E2eEvidenceKeeper {
// GetIntgEvidenceKeeper implements the ConsumerApp interface.
func (app *App) GetIntgEvidenceKeeper() intgutil.IntgEvidenceKeeper {
return app.EvidenceKeeper
}

// GetE2eStakingKeeper implements the ConsumerApp interface.
func (app *App) GetE2eStakingKeeper() e2e.E2eStakingKeeper {
// GetIntgStakingKeeper implements the ConsumerApp interface.
func (app *App) GetIntgStakingKeeper() intgutil.IntgStakingKeeper {
return app.StakingKeeper
}

// GetE2eDistributionKeeper implements the ConsumerApp interface.
func (app *App) GetE2eDistributionKeeper() e2e.E2eDistributionKeeper {
// GetIntgDistributionKeeper implements the ConsumerApp interface.
func (app *App) GetIntgDistributionKeeper() intgutil.IntgDistributionKeeper {
return app.DistrKeeper
}

// GetE2eMintKeeper implements the ConsumerApp interface.
func (app *App) GetE2eMintKeeper() e2e.E2eMintKeeper {
// GetIntgMintKeeper implements the ConsumerApp interface.
func (app *App) GetIntgMintKeeper() intgutil.IntgMintKeeper {
return app.MintKeeper
}

// GetE2eGovKeeper implements the ConsumerApp interface.
func (app *App) GetE2eGovKeeper() e2e.E2eGovKeeper {
// GetIntgGovKeeper implements the ConsumerApp interface.
func (app *App) GetIntgGovKeeper() intgutil.IntgGovKeeper {
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"
intgutil "github.com/cosmos/interchain-security/testutil/integration"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
intgutil "github.com/cosmos/interchain-security/testutil/integration"
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 {
// GetIntgBankKeeper implements the ConsumerApp interface.
func (app *App) GetIntgBankKeeper() intgutil.IntgBankKeeper {
return app.BankKeeper
}

// GetE2eAccountKeeper implements the ConsumerApp interface.
func (app *App) GetE2eAccountKeeper() e2e.E2eAccountKeeper {
// GetIntgAccountKeeper implements the ConsumerApp interface.
func (app *App) GetIntgAccountKeeper() intgutil.IntgAccountKeeper {
return app.AccountKeeper
}

// GetE2eSlashingKeeper implements the ConsumerApp interface.
func (app *App) GetE2eSlashingKeeper() e2e.E2eSlashingKeeper {
// GetIntgSlashingKeeper implements the ConsumerApp interface.
func (app *App) GetIntgSlashingKeeper() intgutil.IntgSlashingKeeper {
return app.SlashingKeeper
}

// GetE2eEvidenceKeeper implements the ConsumerApp interface.
func (app *App) GetE2eEvidenceKeeper() e2e.E2eEvidenceKeeper {
// GetIntgEvidenceKeeper implements the ConsumerApp interface.
func (app *App) GetIntgEvidenceKeeper() intgutil.IntgEvidenceKeeper {
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"
intgutil "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 {
// GetIntgStakingKeeper implements the ProviderApp interface.
func (app *App) GetIntgStakingKeeper() intgutil.IntgStakingKeeper {
return app.StakingKeeper
}

// GetE2eBankKeeper implements the ProviderApp interface.
func (app *App) GetE2eBankKeeper() e2e.E2eBankKeeper {
// GetIntgBankKeeper implements the ProviderApp interface.
func (app *App) GetIntgBankKeeper() intgutil.IntgBankKeeper {
return app.BankKeeper
}

// GetE2eSlashingKeeper implements the ProviderApp interface.
func (app *App) GetE2eSlashingKeeper() e2e.E2eSlashingKeeper {
// GetIntgSlashingKeeper implements the ProviderApp interface.
func (app *App) GetIntgSlashingKeeper() intgutil.IntgSlashingKeeper {
return app.SlashingKeeper
}

// GetE2eDistributionKeeper implements the ProviderApp interface.
func (app *App) GetE2eDistributionKeeper() e2e.E2eDistributionKeeper {
// GetIntgDistributionKeeper implements the ProviderApp interface.
func (app *App) GetIntgDistributionKeeper() intgutil.IntgDistributionKeeper {
return app.DistrKeeper
}

Expand Down
Loading