Unverified Commit 46d00535 authored by Roman's avatar Roman Committed by GitHub
Browse files

chore: use environment variable instead of build tags to control e2e (#3179)

parent 20c72cce
Showing with 11 additions and 14 deletions
+11 -14
...@@ -224,7 +224,7 @@ run-querygen: ...@@ -224,7 +224,7 @@ run-querygen:
############################################################################### ###############################################################################
PACKAGES_UNIT=$(shell go list ./... | grep -E -v 'tests/simulator|e2e') PACKAGES_UNIT=$(shell go list ./... | grep -E -v 'tests/simulator|e2e')
PACKAGES_E2E=$(shell go list -tags e2e ./... | grep '/e2e') PACKAGES_E2E=$(shell go list ./... | grep '/e2e')
PACKAGES_SIM=$(shell go list ./... | grep '/tests/simulator') PACKAGES_SIM=$(shell go list ./... | grep '/tests/simulator')
TEST_PACKAGES=./... TEST_PACKAGES=./...
...@@ -261,25 +261,25 @@ test-sim-bench: ...@@ -261,25 +261,25 @@ test-sim-bench:
# In that case, run `make e2e-remove-resources` # In that case, run `make e2e-remove-resources`
# manually. # manually.
# Utilizes Go cache. # Utilizes Go cache.
test-e2e: e2e-setup test-e2e-ci test-e2e: OSMOSIS_E2E=True e2e-setup test-e2e-ci
# test-e2e-ci runs a full e2e test suite # test-e2e-ci runs a full e2e test suite
# does not do any validation about the state of the Docker environment # does not do any validation about the state of the Docker environment
# As a result, avoid using this locally. # As a result, avoid using this locally.
test-e2e-ci: test-e2e-ci:
@VERSION=$(VERSION) OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_UPGRADE_VERSION=$(E2E_UPGRADE_VERSION) go test -tags e2e -mod=readonly -timeout=25m -v $(PACKAGES_E2E) @VERSION=$(VERSION) OSMOSIS_E2E=True OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_UPGRADE_VERSION=$(E2E_UPGRADE_VERSION) go test -mod=readonly -timeout=25m -v $(PACKAGES_E2E)
# test-e2e-debug runs a full e2e test suite but does # test-e2e-debug runs a full e2e test suite but does
# not attempt to delete Docker resources at the end. # not attempt to delete Docker resources at the end.
test-e2e-debug: e2e-setup test-e2e-debug: e2e-setup
@VERSION=$(VERSION) OSMOSIS_E2E_UPGRADE_VERSION=$(E2E_UPGRADE_VERSION) OSMOSIS_E2E_SKIP_CLEANUP=True go test -tags e2e -mod=readonly -timeout=25m -v $(PACKAGES_E2E) -count=1 @VERSION=$(VERSION) OSMOSIS_E2E=True OSMOSIS_E2E_UPGRADE_VERSION=$(E2E_UPGRADE_VERSION) OSMOSIS_E2E_SKIP_CLEANUP=True go test -mod=readonly -timeout=25m -v $(PACKAGES_E2E) -count=1
# test-e2e-short runs the e2e test with only short tests. # test-e2e-short runs the e2e test with only short tests.
# Does not delete any of the containers after running. # Does not delete any of the containers after running.
# Deletes any existing containers before running. # Deletes any existing containers before running.
# Does not use Go cache. # Does not use Go cache.
test-e2e-short: e2e-setup test-e2e-short: e2e-setup
@VERSION=$(VERSION) OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_SKIP_UPGRADE=True OSMOSIS_E2E_SKIP_IBC=True OSMOSIS_E2E_SKIP_STATE_SYNC=True OSMOSIS_E2E_SKIP_CLEANUP=True go test -tags e2e -mod=readonly -timeout=25m -v $(PACKAGES_E2E) -count=1 @VERSION=$(VERSION) OSMOSIS_E2E=True OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_SKIP_UPGRADE=True OSMOSIS_E2E_SKIP_IBC=True OSMOSIS_E2E_SKIP_STATE_SYNC=True OSMOSIS_E2E_SKIP_CLEANUP=True go test -mod=readonly -timeout=25m -v $(PACKAGES_E2E) -count=1
test-mutation: test-mutation:
@bash scripts/mutation-test.sh $(MODULES) @bash scripts/mutation-test.sh $(MODULES)
......
//go:build e2e
// +build e2e
package e2e package e2e
import ( import (
...@@ -15,6 +12,8 @@ import ( ...@@ -15,6 +12,8 @@ import (
) )
const ( const (
// Environment variable signifying whether to run e2e tests.
e2eEnabledEnv = "OSMOSIS_E2E"
// Environment variable name to skip the upgrade tests // Environment variable name to skip the upgrade tests
skipUpgradeEnv = "OSMOSIS_E2E_SKIP_UPGRADE" skipUpgradeEnv = "OSMOSIS_E2E_SKIP_UPGRADE"
// Environment variable name to skip the IBC tests // Environment variable name to skip the IBC tests
...@@ -40,6 +39,10 @@ type IntegrationTestSuite struct { ...@@ -40,6 +39,10 @@ type IntegrationTestSuite struct {
} }
func TestIntegrationTestSuite(t *testing.T) { func TestIntegrationTestSuite(t *testing.T) {
isEnabled := os.Getenv(e2eEnabledEnv)
if isEnabled != "True" {
t.Skip(fmt.Sprintf("e2e test is disabled. To run, set %s to True", e2eEnabledEnv))
}
suite.Run(t, new(IntegrationTestSuite)) suite.Run(t, new(IntegrationTestSuite))
} }
......
//go:build e2e
// +build e2e
package e2e package e2e
import ( import (
......
//go:build e2e
// +build e2e
package initialization_test package initialization_test
import ( import (
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment