Skip to content

Commit

Permalink
core/services/ocr2/plugins/ccip: parallelize tests (#15757)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 authored Dec 19, 2024
1 parent a9455f1 commit 12f11f9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/services/ocr2/plugins/ccip/clo_ccip_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
)

func Test_CLOSpecApprovalFlow_pipeline(t *testing.T) {
t.Parallel()
ccipTH := integrationtesthelpers.SetupCCIPIntegrationTH(
t,
testhelpers.SourceChainID,
Expand All @@ -40,6 +41,7 @@ func Test_CLOSpecApprovalFlow_pipeline(t *testing.T) {
}

func Test_CLOSpecApprovalFlow_dynamicPriceGetter(t *testing.T) {
t.Parallel()
ccipTH := integrationtesthelpers.SetupCCIPIntegrationTH(
t,
testhelpers.SourceChainID,
Expand Down
2 changes: 2 additions & 0 deletions core/services/ocr2/plugins/ccip/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
)

func TestIntegration_CCIP(t *testing.T) {
t.Parallel()
// Run tke batches of tests for both pipeline and dynamic price getter setups.
// We will remove the pipeline batch once the feature is deleted from the code.
tests := []struct {
Expand Down Expand Up @@ -650,6 +651,7 @@ func TestIntegration_CCIP(t *testing.T) {

// TestReorg ensures that CCIP works even when a below finality depth reorg happens
func TestReorg(t *testing.T) {
t.Parallel()
// We need higher finality depth on the destination to perform reorg deep enough to revert commit and execution reports
destinationFinalityDepth := uint32(50)
ccipTH := integrationtesthelpers.SetupCCIPIntegrationTH(
Expand Down
3 changes: 3 additions & 0 deletions core/services/ocr2/plugins/ccip/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const (
)

func Test_SequenceNumbers(t *testing.T) {
t.Parallel()
collector := NewPluginMetricsCollector("test", sourceChainId, destChainId)

collector.SequenceNumber(Report, 10)
Expand All @@ -23,6 +24,7 @@ func Test_SequenceNumbers(t *testing.T) {
}

func Test_NumberOfMessages(t *testing.T) {
t.Parallel()
collector := NewPluginMetricsCollector("test", sourceChainId, destChainId)
collector2 := NewPluginMetricsCollector("test2", destChainId, sourceChainId)

Expand All @@ -37,6 +39,7 @@ func Test_NumberOfMessages(t *testing.T) {
}

func Test_UnexpiredCommitRoots(t *testing.T) {
t.Parallel()
collector := NewPluginMetricsCollector("test", sourceChainId, destChainId)

collector.UnexpiredCommitRoots(10)
Expand Down
9 changes: 9 additions & 0 deletions core/services/ocr2/plugins/ccip/observations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
)

func TestObservationFilter(t *testing.T) {
t.Parallel()
lggr := logger.TestLogger(t)
obs1 := CommitObservation{Interval: cciptypes.CommitStoreInterval{Min: 1, Max: 10}}
b1, err := obs1.Marshal()
Expand All @@ -39,6 +40,7 @@ type CommitObservationLegacy struct {
}

func TestObservationCompat_MultiChainGas(t *testing.T) {
t.Parallel()
obsLegacy := CommitObservationLegacy{
Interval: cciptypes.CommitStoreInterval{
Min: 1,
Expand Down Expand Up @@ -66,6 +68,7 @@ func TestObservationCompat_MultiChainGas(t *testing.T) {
}

func TestCommitObservationJsonDeserialization(t *testing.T) {
t.Parallel()
expectedObservation := CommitObservation{
Interval: cciptypes.CommitStoreInterval{
Min: 1,
Expand Down Expand Up @@ -93,6 +96,7 @@ func TestCommitObservationJsonDeserialization(t *testing.T) {
}

func TestCommitObservationMarshal(t *testing.T) {
t.Parallel()
obs := CommitObservation{
Interval: cciptypes.CommitStoreInterval{
Min: 1,
Expand Down Expand Up @@ -120,6 +124,7 @@ func TestCommitObservationMarshal(t *testing.T) {
}

func TestExecutionObservationJsonDeserialization(t *testing.T) {
t.Parallel()
expectedObservation := ExecutionObservation{Messages: map[uint64]MsgData{
2: {TokenData: tokenData("c")},
1: {TokenData: tokenData("c")},
Expand All @@ -142,6 +147,7 @@ func TestExecutionObservationJsonDeserialization(t *testing.T) {
}

func TestObservationSize(t *testing.T) {
t.Parallel()
testParams := gopter.DefaultTestParameters()
testParams.MinSuccessfulTests = 100
p := gopter.NewProperties(testParams)
Expand All @@ -166,6 +172,7 @@ func TestObservationSize(t *testing.T) {
}

func TestNewExecutionObservation(t *testing.T) {
t.Parallel()
tests := []struct {
name string
observations []ObservedMessage
Expand Down Expand Up @@ -222,6 +229,7 @@ func tokenData(value string) [][]byte {
}

func TestCommitObservationJsonSerializationDeserialization(t *testing.T) {
t.Parallel()
jsonEncoded := `{
"interval": {
"Min":1,
Expand Down Expand Up @@ -276,6 +284,7 @@ func TestCommitObservationJsonSerializationDeserialization(t *testing.T) {
}

func TestAddressEncodingBackwardsCompatibility(t *testing.T) {
t.Parallel()
// The intention of this test is to remind including proper formatting of addresses after config is updated.
//
// The following tests will fail when a new cciptypes.Address field is added or removed.
Expand Down

0 comments on commit 12f11f9

Please sign in to comment.