-
Notifications
You must be signed in to change notification settings - Fork 137
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
Create e2e debug util file #488
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
d4c8df1
Create debug_test.go
shaspitz e89d605
democ
shaspitz bcc911b
Update debug_test.go
shaspitz 8b85c90
Merge branch 'main' into debug-file
shaspitz 6d078c9
Merge branch 'main' into debug-file
shaspitz e771e00
Merge branch 'main' into debug-file
shaspitz 3feffc3
bump to main
shaspitz 5820981
another bump, missed one
shaspitz 869a0fa
Merge branch 'main' into debug-file
jtremback fb6f948
Merge branch 'main' into debug-file
shaspitz d78b599
fix after merge main
shaspitz 97eb82e
expired client tests
shaspitz f293850
Merge branch 'main' into debug-file
mpoke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,193 @@ | ||
// Contains native golang tests relevant to individual e2e tests, | ||
// enabling easier debugging of individual e2e tests in VSCode. | ||
package e2e_test | ||
|
||
import ( | ||
"reflect" | ||
"testing" | ||
|
||
appConsumer "github.com/cosmos/interchain-security/app/consumer" | ||
appConsumerDemocracy "github.com/cosmos/interchain-security/app/consumer-democracy" | ||
appProvider "github.com/cosmos/interchain-security/app/provider" | ||
"github.com/cosmos/interchain-security/tests/e2e" | ||
icstestingutils "github.com/cosmos/interchain-security/testutil/ibc_testing" | ||
) | ||
|
||
// runCCVTestByName runs a single CCV e2e test by name, using a CCVTestSuite | ||
// initialized with the dummy provider and consumer defined in this repo. | ||
func runCCVTestByName(t *testing.T, methodName string) { | ||
|
||
suite := e2e.NewCCVTestSuite[*appProvider.App, *appConsumer.App]( | ||
icstestingutils.ProviderAppIniter, icstestingutils.ConsumerAppIniter, []string{}) | ||
suite.SetT(t) | ||
suite.SetupTest() | ||
|
||
findAndCallMethod(t, suite, methodName) | ||
} | ||
|
||
// runConsumerDemocracyTestByName runs a single consumer democracy e2e test by name, | ||
// using a ConsumerDemocracyTestSuite initialized with the dummy | ||
// democracy consumer defined in this repo. | ||
func runConsumerDemocracyTestByName(t *testing.T, methodName string) { | ||
|
||
suite := e2e.NewConsumerDemocracyTestSuite[*appConsumerDemocracy.App]( | ||
icstestingutils.DemocracyConsumerAppIniter) | ||
suite.SetT(t) | ||
suite.SetupTest() | ||
|
||
findAndCallMethod(t, suite, methodName) | ||
} | ||
|
||
func findAndCallMethod(t *testing.T, suite any, methodName string) { | ||
methodFinder := reflect.TypeOf(suite) | ||
method, found := methodFinder.MethodByName(methodName) | ||
if !found { | ||
t.Errorf("Method %s is not defined for suite type", methodName) | ||
} | ||
|
||
method.Func.Call([]reflect.Value{reflect.ValueOf(suite)}) | ||
} | ||
|
||
// | ||
// Channel init tests | ||
// | ||
|
||
func TestConsumerGenesis(t *testing.T) { | ||
runCCVTestByName(t, "TestConsumerGenesis") | ||
} | ||
|
||
func TestInitTimeout(t *testing.T) { | ||
runCCVTestByName(t, "TestInitTimeout") | ||
} | ||
|
||
// | ||
// Consumer democracy tests | ||
// | ||
|
||
func TestDemocracyRewardsDistribution(t *testing.T) { | ||
runConsumerDemocracyTestByName(t, "TestDemocracyRewardsDistribution") | ||
} | ||
|
||
func TestDemocracyGovernanceWhitelisting(t *testing.T) { | ||
runConsumerDemocracyTestByName(t, "TestDemocracyGovernanceWhitelisting") | ||
} | ||
|
||
// | ||
// Distribution tests | ||
// | ||
|
||
func TestRewardsDistribution(t *testing.T) { | ||
runCCVTestByName(t, "TestRewardsDistribution") | ||
} | ||
|
||
// | ||
// Expired client tests | ||
// | ||
|
||
func TestVSCPacketSendExpiredClient(t *testing.T) { | ||
runCCVTestByName(t, "TestVSCPacketSendExpiredClient") | ||
} | ||
|
||
func TestConsumerPacketSendExpiredClient(t *testing.T) { | ||
runCCVTestByName(t, "TestConsumerPacketSendExpiredClient") | ||
} | ||
|
||
// | ||
// Normal operations tests | ||
// | ||
|
||
func TestHistoricalInfo(t *testing.T) { | ||
runCCVTestByName(t, "TestHistoricalInfo") | ||
} | ||
|
||
// | ||
// Slashing tests | ||
// | ||
|
||
func TestRelayAndApplySlashPacket(t *testing.T) { | ||
runCCVTestByName(t, "TestRelayAndApplySlashPacket") | ||
} | ||
|
||
func TestSlashPacketAcknowledgement(t *testing.T) { | ||
runCCVTestByName(t, "TestSlashPacketAcknowledgement") | ||
} | ||
|
||
func TestHandleSlashPacketDoubleSigning(t *testing.T) { | ||
runCCVTestByName(t, "TestHandleSlashPacketDoubleSigning") | ||
} | ||
|
||
func TestHandleSlashPacketErrors(t *testing.T) { | ||
runCCVTestByName(t, "TestHandleSlashPacketErrors") | ||
} | ||
|
||
func TestHandleSlashPacketDistribution(t *testing.T) { | ||
runCCVTestByName(t, "TestHandleSlashPacketDistribution") | ||
} | ||
|
||
func TestValidatorDowntime(t *testing.T) { | ||
runCCVTestByName(t, "TestValidatorDowntime") | ||
} | ||
|
||
func TestValidatorDoubleSigning(t *testing.T) { | ||
runCCVTestByName(t, "TestValidatorDoubleSigning") | ||
} | ||
|
||
func TestQueueAndSendSlashPacket(t *testing.T) { | ||
runCCVTestByName(t, "TestQueueAndSendSlashPacket") | ||
} | ||
|
||
// | ||
// Stop consumer tests | ||
// | ||
|
||
func TestStopConsumerChain(t *testing.T) { | ||
runCCVTestByName(t, "TestStopConsumerChain") | ||
} | ||
|
||
func TestStopConsumerOnChannelClosed(t *testing.T) { | ||
runCCVTestByName(t, "TestStopConsumerOnChannelClosed") | ||
} | ||
|
||
func TestProviderChannelClosed(t *testing.T) { | ||
runCCVTestByName(t, "TestProviderChannelClosed") | ||
} | ||
|
||
// | ||
// Unbonding tests | ||
// | ||
|
||
func TestUndelegationNormalOperation(t *testing.T) { | ||
runCCVTestByName(t, "TestUndelegationNormalOperation") | ||
} | ||
|
||
func TestUndelegationVscTimeout(t *testing.T) { | ||
runCCVTestByName(t, "TestUndelegationVscTimeout") | ||
} | ||
|
||
func TestUndelegationDuringInit(t *testing.T) { | ||
runCCVTestByName(t, "TestUndelegationDuringInit") | ||
} | ||
|
||
func TestUnbondingNoConsumer(t *testing.T) { | ||
runCCVTestByName(t, "TestUnbondingNoConsumer") | ||
} | ||
|
||
func TestRedelegationNoConsumer(t *testing.T) { | ||
runCCVTestByName(t, "TestRedelegationNoConsumer") | ||
} | ||
|
||
func TestRedelegationProviderFirst(t *testing.T) { | ||
runCCVTestByName(t, "TestRedelegationProviderFirst") | ||
} | ||
|
||
// | ||
// Val set update tests | ||
// | ||
|
||
func TestPacketRoundtrip(t *testing.T) { | ||
runCCVTestByName(t, "TestPacketRoundtrip") | ||
} | ||
|
||
func TestQueueAndSendVSCMaturedPackets(t *testing.T) { | ||
runCCVTestByName(t, "TestQueueAndSendVSCMaturedPackets") | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are ordered as they appear in the VSCode explorer