From cb22c4fd875b2cdccfbbc8d3006112f5bb2e889c Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Wed, 17 Apr 2024 16:07:56 -0500 Subject: [PATCH] skip tests when -short --- .github/workflows/ci-core.yml | 2 ++ .../evm/headtracker/head_listener_test.go | 3 ++ core/chains/evm/log/integration_test.go | 4 +-- core/gethwrappers/go_generate_test.go | 31 ++++++++++++------- .../fluxmonitorv2/contract_submitter_test.go | 1 + .../fluxmonitorv2/flux_monitor_test.go | 8 +++++ .../fluxmonitorv2/payment_checker_test.go | 2 ++ .../fluxmonitorv2/poll_manager_test.go | 14 +++++++++ .../fluxmonitorv2/submission_checker_test.go | 1 + core/services/fluxmonitorv2/validate_test.go | 1 + .../functions/subscriptions/orm_test.go | 1 + .../subscriptions/subscriptions_test.go | 3 ++ .../generic/pipeline_runner_adapter_test.go | 1 + .../v21/mercury/v02/v02_request_test.go | 7 +++++ .../v21/mercury/v03/v03_request_test.go | 6 ++++ core/services/workflows/engine_test.go | 3 ++ core/services/workflows/models_test.go | 1 + core/services/workflows/models_yaml_test.go | 2 ++ core/services/workflows/state_test.go | 2 ++ main_test.go | 3 ++ 20 files changed, 82 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index 9eaf31d0ba2..9d9ff595ed0 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -107,6 +107,8 @@ jobs: - name: Setup Go if: ${{ needs.filter.outputs.changes == 'true' }} uses: ./.github/actions/setup-go + - name: Run short tests + run: go test -short ./... - name: Setup Solana if: ${{ needs.filter.outputs.changes == 'true' }} uses: ./.github/actions/setup-solana diff --git a/core/chains/evm/headtracker/head_listener_test.go b/core/chains/evm/headtracker/head_listener_test.go index e5131aca422..4e7efb5e809 100644 --- a/core/chains/evm/headtracker/head_listener_test.go +++ b/core/chains/evm/headtracker/head_listener_test.go @@ -25,6 +25,7 @@ import ( ) func Test_HeadListener_HappyPath(t *testing.T) { + t.Parallel() // Logic: // - spawn a listener instance // - mock SubscribeNewHead/Err/Unsubscribe to track these calls @@ -91,6 +92,7 @@ func Test_HeadListener_HappyPath(t *testing.T) { } func Test_HeadListener_NotReceivingHeads(t *testing.T) { + t.Parallel() // Logic: // - same as Test_HeadListener_HappyPath, but // - send one head, make sure ReceivingHeads() is true @@ -149,6 +151,7 @@ func Test_HeadListener_NotReceivingHeads(t *testing.T) { } func Test_HeadListener_SubscriptionErr(t *testing.T) { + t.Parallel() tests := []struct { name string err error diff --git a/core/chains/evm/log/integration_test.go b/core/chains/evm/log/integration_test.go index 4bdb43d9521..fd6b375d80a 100644 --- a/core/chains/evm/log/integration_test.go +++ b/core/chains/evm/log/integration_test.go @@ -263,8 +263,6 @@ func TestBroadcaster_BackfillUnconsumedAfterCrash(t *testing.T) { log2 := blocks.LogOnBlockNum(log2Block, contract2.Address()) logs := []types.Log{log1, log2} - contract1.On("ParseLog", log1).Return(flux_aggregator_wrapper.FluxAggregatorNewRound{}, nil) - contract2.On("ParseLog", log2).Return(flux_aggregator_wrapper.FluxAggregatorAnswerUpdated{}, nil) t.Run("pool two logs from subscription, then shut down", func(t *testing.T) { helper := newBroadcasterHelper(t, 0, 1, logs, func(c *chainlink.Config, s *chainlink.Secrets) { c.EVM[0].FinalityDepth = ptr[uint32](confs) @@ -295,6 +293,8 @@ func TestBroadcaster_BackfillUnconsumedAfterCrash(t *testing.T) { c.EVM[0].FinalityDepth = ptr[uint32](confs) }) orm := log.NewORM(helper.db, cltest.FixtureChainID) + contract1.On("ParseLog", log1).Return(flux_aggregator_wrapper.FluxAggregatorNewRound{}, nil) + contract2.On("ParseLog", log2).Return(flux_aggregator_wrapper.FluxAggregatorAnswerUpdated{}, nil) listener := helper.newLogListenerWithJob("one") listener.SkipMarkingConsumed(true) diff --git a/core/gethwrappers/go_generate_test.go b/core/gethwrappers/go_generate_test.go index 52d0f520dd7..a6253cb1a66 100644 --- a/core/gethwrappers/go_generate_test.go +++ b/core/gethwrappers/go_generate_test.go @@ -4,6 +4,7 @@ package gethwrappers import ( "crypto/sha256" + "flag" "fmt" "os" "os/exec" @@ -15,6 +16,7 @@ import ( "github.com/fatih/color" cutils "github.com/smartcontractkit/chainlink-common/pkg/utils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/utils" "github.com/stretchr/testify/assert" @@ -27,6 +29,7 @@ const compileCommand = "../../contracts/scripts/native_solc_compile_all" // contract artifacts in contracts/solc with the abi and bytecode stored in the // contract wrapper func TestCheckContractHashesFromLastGoGenerate(t *testing.T) { + testutils.SkipShort(t, "requires compiled artifacts") versions, err := ReadVersionsDB() require.NoError(t, err) require.NotEmpty(t, versions.GethVersion, `version DB should have a "GETH_VERSION:" line`) @@ -63,19 +66,13 @@ func isVRFV2Contract(fullpath string) bool { return strings.Contains(fullpath, "VRFCoordinatorV2") } -// rootDir is the local chainlink root working directory -var rootDir string - -func init() { // compute rootDir - var err error - thisDir, err := os.Getwd() - if err != nil { - panic(err) - } - rootDir, err = filepath.Abs(filepath.Join(thisDir, "../..")) +// getRootDir returns the local chainlink root working directory +func getRootDir() (string, error) { // compute rootDir + wd, err := os.Getwd() if err != nil { - panic(err) + return "", fmt.Errorf("failed to get working directory: %w", err) } + return filepath.Abs(filepath.Join(wd, "../..")) } // compareCurrentCompilerArtifactAgainstRecordsAndSoliditySources checks that @@ -95,6 +92,8 @@ func compareCurrentCompilerArtifactAgainstRecordsAndSoliditySources( t *testing.T, versionInfo ContractVersion, ) { hash := VersionHash(versionInfo.AbiPath, versionInfo.BinaryPath) + rootDir, err := getRootDir() + require.NoError(t, err) recompileCommand := fmt.Sprintf("(cd %s/contracts; make wrappers-all)", rootDir) assert.Equal(t, versionInfo.Hash, hash, utils.BoxOutput(`compiled %s and/or %s has changed; please rerun @@ -102,9 +101,17 @@ func compareCurrentCompilerArtifactAgainstRecordsAndSoliditySources( and commit the changes`, versionInfo.AbiPath, versionInfo.BinaryPath, recompileCommand)) } +func TestMain(m *testing.M) { + flag.Parse() + if !testing.Short() { + ensureArtifacts() + } + os.Exit(m.Run()) +} + // Ensure that solidity compiler artifacts are present before running this test, // by compiling them if necessary. -func init() { +func ensureArtifacts() { db, err := versionsDBLineReader() if err != nil { panic(err) diff --git a/core/services/fluxmonitorv2/contract_submitter_test.go b/core/services/fluxmonitorv2/contract_submitter_test.go index 238cf96e033..7dfd92e5acd 100644 --- a/core/services/fluxmonitorv2/contract_submitter_test.go +++ b/core/services/fluxmonitorv2/contract_submitter_test.go @@ -15,6 +15,7 @@ import ( ) func TestFluxAggregatorContractSubmitter_Submit(t *testing.T) { + t.Parallel() var ( fluxAggregator = mocks.NewFluxAggregator(t) orm = fmmocks.NewORM(t) diff --git a/core/services/fluxmonitorv2/flux_monitor_test.go b/core/services/fluxmonitorv2/flux_monitor_test.go index 042ddb99afb..d8713fed997 100644 --- a/core/services/fluxmonitorv2/flux_monitor_test.go +++ b/core/services/fluxmonitorv2/flux_monitor_test.go @@ -291,6 +291,7 @@ func setupFullDBWithKey(t *testing.T) (*sqlx.DB, common.Address) { } func TestFluxMonitor_PollIfEligible(t *testing.T) { + t.Parallel() testCases := []struct { name string eligible bool @@ -499,6 +500,7 @@ func TestFluxMonitor_PollIfEligible(t *testing.T) { // If the roundState method is unable to communicate with the contract (possibly due to // incorrect address) then the pollIfEligible method should create a JobErr record func TestFluxMonitor_PollIfEligible_Creates_JobErr(t *testing.T) { + t.Parallel() db, nodeAddr := setupStoreWithKey(t) oracles := []common.Address{nodeAddr, testutils.NewAddress()} @@ -529,6 +531,7 @@ func TestFluxMonitor_PollIfEligible_Creates_JobErr(t *testing.T) { } func TestPollingDeviationChecker_BuffersLogs(t *testing.T) { + t.Parallel() db, nodeAddr := setupStoreWithKey(t) oracles := []common.Address{nodeAddr, testutils.NewAddress()} @@ -728,6 +731,7 @@ func TestPollingDeviationChecker_BuffersLogs(t *testing.T) { } func TestFluxMonitor_TriggerIdleTimeThreshold(t *testing.T) { + t.Parallel() g := gomega.NewWithT(t) testCases := []struct { @@ -904,6 +908,7 @@ func TestFluxMonitor_HibernationTickerFiresMultipleTimes(t *testing.T) { } func TestFluxMonitor_HibernationIsEnteredAndRetryTickerStopped(t *testing.T) { + t.Parallel() db, nodeAddr := setupFullDBWithKey(t) oracles := []common.Address{nodeAddr, testutils.NewAddress()} @@ -1173,6 +1178,7 @@ func TestFluxMonitor_RoundTimeoutCausesPoll_timesOutAtZero(t *testing.T) { } func TestFluxMonitor_UsesPreviousRoundStateOnStartup_RoundTimeout(t *testing.T) { + t.Parallel() g := gomega.NewWithT(t) db, nodeAddr := setupStoreWithKey(t) @@ -1234,6 +1240,7 @@ func TestFluxMonitor_UsesPreviousRoundStateOnStartup_RoundTimeout(t *testing.T) } func TestFluxMonitor_UsesPreviousRoundStateOnStartup_IdleTimer(t *testing.T) { + t.Parallel() g := gomega.NewWithT(t) db, nodeAddr := setupStoreWithKey(t) @@ -1433,6 +1440,7 @@ func TestFluxMonitor_ConsumeLogBroadcast_Error(t *testing.T) { } func TestFluxMonitor_DoesNotDoubleSubmit(t *testing.T) { + t.Parallel() t.Run("when NewRound log arrives, then poll ticker fires", func(t *testing.T) { db, nodeAddr := setupStoreWithKey(t) oracles := []common.Address{nodeAddr, testutils.NewAddress()} diff --git a/core/services/fluxmonitorv2/payment_checker_test.go b/core/services/fluxmonitorv2/payment_checker_test.go index baec5642339..88643a69fb2 100644 --- a/core/services/fluxmonitorv2/payment_checker_test.go +++ b/core/services/fluxmonitorv2/payment_checker_test.go @@ -11,6 +11,7 @@ import ( ) func TestPaymentChecker_SufficientFunds(t *testing.T) { + t.Parallel() var ( checker = fluxmonitorv2.NewPaymentChecker(nil, nil) payment = 100 @@ -44,6 +45,7 @@ func TestPaymentChecker_SufficientFunds(t *testing.T) { } func TestPaymentChecker_SufficientPayment(t *testing.T) { + t.Parallel() var ( payment int64 = 10 eq = payment diff --git a/core/services/fluxmonitorv2/poll_manager_test.go b/core/services/fluxmonitorv2/poll_manager_test.go index 9245c309c27..be6aa9a819b 100644 --- a/core/services/fluxmonitorv2/poll_manager_test.go +++ b/core/services/fluxmonitorv2/poll_manager_test.go @@ -84,6 +84,7 @@ func watchTicks(t *testing.T, pm *fluxmonitorv2.PollManager, waitDuration time.D } func TestPollManager_PollTicker(t *testing.T) { + t.Parallel() pm, err := fluxmonitorv2.NewPollManager(fluxmonitorv2.PollManagerConfig{ PollTickerInterval: pollTickerDefaultDuration, PollTickerDisabled: false, @@ -104,6 +105,7 @@ func TestPollManager_PollTicker(t *testing.T) { } func TestPollManager_IdleTimer(t *testing.T) { + t.Parallel() pm, err := fluxmonitorv2.NewPollManager(fluxmonitorv2.PollManagerConfig{ PollTickerInterval: 100 * time.Millisecond, PollTickerDisabled: true, @@ -126,6 +128,7 @@ func TestPollManager_IdleTimer(t *testing.T) { } func TestPollManager_RoundTimer(t *testing.T) { + t.Parallel() pm, err := fluxmonitorv2.NewPollManager(fluxmonitorv2.PollManagerConfig{ PollTickerInterval: pollTickerDefaultDuration, PollTickerDisabled: true, @@ -149,6 +152,7 @@ func TestPollManager_RoundTimer(t *testing.T) { } func TestPollManager_RetryTimer(t *testing.T) { + t.Parallel() pm, err := fluxmonitorv2.NewPollManager(fluxmonitorv2.PollManagerConfig{ PollTickerInterval: pollTickerDefaultDuration, PollTickerDisabled: true, @@ -185,6 +189,7 @@ func TestPollManager_RetryTimer(t *testing.T) { } func TestPollManager_InitialPoll(t *testing.T) { + t.Parallel() pm := newPollManager(t) pm.Start(false, flux_aggregator_wrapper.OracleRoundState{}) @@ -193,6 +198,7 @@ func TestPollManager_InitialPoll(t *testing.T) { } func TestPollManager_HibernationTimer(t *testing.T) { + t.Parallel() pm, err := fluxmonitorv2.NewPollManager(fluxmonitorv2.PollManagerConfig{ PollTickerInterval: pollTickerDefaultDuration, PollTickerDisabled: true, @@ -214,6 +220,7 @@ func TestPollManager_HibernationTimer(t *testing.T) { } func TestPollManager_HibernationOnStartThenAwaken(t *testing.T) { + t.Parallel() pm, err := fluxmonitorv2.NewPollManager(fluxmonitorv2.PollManagerConfig{ PollTickerInterval: pollTickerDefaultDuration, PollTickerDisabled: false, @@ -248,6 +255,7 @@ func TestPollManager_HibernationOnStartThenAwaken(t *testing.T) { } func TestPollManager_AwakeOnStartThenHibernate(t *testing.T) { + t.Parallel() pm := newPollManager(t) pm.Start(false, flux_aggregator_wrapper.OracleRoundState{ @@ -272,6 +280,7 @@ func TestPollManager_AwakeOnStartThenHibernate(t *testing.T) { } func TestPollManager_ShouldPerformInitialPoll(t *testing.T) { + t.Parallel() testCases := []struct { name string pollTickerDisabled bool @@ -339,6 +348,7 @@ func TestPollManager_ShouldPerformInitialPoll(t *testing.T) { } func TestPollManager_Stop(t *testing.T) { + t.Parallel() pm := newPollManager(t) pm.Start(false, flux_aggregator_wrapper.OracleRoundState{ @@ -362,6 +372,7 @@ func TestPollManager_Stop(t *testing.T) { } func TestPollManager_ResetIdleTimer(t *testing.T) { + t.Parallel() pm := newPollManager(t) // Start again in awake mode @@ -382,6 +393,7 @@ func TestPollManager_ResetIdleTimer(t *testing.T) { } func TestPollManager_ResetIdleTimerWhenHibernating(t *testing.T) { + t.Parallel() pm := newPollManager(t) // Start in hibernation @@ -402,6 +414,7 @@ func TestPollManager_ResetIdleTimerWhenHibernating(t *testing.T) { } func TestPollManager_Reset(t *testing.T) { + t.Parallel() pm := newPollManager(t) // Start again in awake mode @@ -429,6 +442,7 @@ func TestPollManager_Reset(t *testing.T) { } func TestPollManager_ResetWhenHibernating(t *testing.T) { + t.Parallel() pm := newPollManager(t) // Start in hibernation diff --git a/core/services/fluxmonitorv2/submission_checker_test.go b/core/services/fluxmonitorv2/submission_checker_test.go index f8c63fef4bd..ae543c772a5 100644 --- a/core/services/fluxmonitorv2/submission_checker_test.go +++ b/core/services/fluxmonitorv2/submission_checker_test.go @@ -11,6 +11,7 @@ import ( ) func TestSubmissionChecker_IsValid(t *testing.T) { + t.Parallel() testCases := []struct { name string answer decimal.Decimal diff --git a/core/services/fluxmonitorv2/validate_test.go b/core/services/fluxmonitorv2/validate_test.go index 40efd1d724d..81d9215bea8 100644 --- a/core/services/fluxmonitorv2/validate_test.go +++ b/core/services/fluxmonitorv2/validate_test.go @@ -21,6 +21,7 @@ func (testcfg) DefaultHTTPTimeout() commonconfig.Duration { } func TestValidate(t *testing.T) { + t.Parallel() var tt = []struct { name string toml string diff --git a/core/services/gateway/handlers/functions/subscriptions/orm_test.go b/core/services/gateway/handlers/functions/subscriptions/orm_test.go index f75ab0b98c1..e2d7cfe9f49 100644 --- a/core/services/gateway/handlers/functions/subscriptions/orm_test.go +++ b/core/services/gateway/handlers/functions/subscriptions/orm_test.go @@ -237,6 +237,7 @@ func TestORM_UpsertSubscription(t *testing.T) { }) } func Test_NewORM(t *testing.T) { + t.Parallel() t.Run("OK-create_ORM", func(t *testing.T) { _, err := subscriptions.NewORM(pgtest.NewSqlxDB(t), logger.TestLogger(t), testutils.NewAddress()) require.NoError(t, err) diff --git a/core/services/gateway/handlers/functions/subscriptions/subscriptions_test.go b/core/services/gateway/handlers/functions/subscriptions/subscriptions_test.go index 212029b73f7..04a5d14102f 100644 --- a/core/services/gateway/handlers/functions/subscriptions/subscriptions_test.go +++ b/core/services/gateway/handlers/functions/subscriptions/subscriptions_test.go @@ -29,6 +29,7 @@ const ( ) func TestSubscriptions_OnePass(t *testing.T) { + t.Parallel() getSubscriptionCount := hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000000003") getSubscriptionsInRange := hexutil.MustDecode("0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000240000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000109e6e1b12098cc8f3a1e9719a817ec53ab9b35c000000000000000000000000000000000000000000000000000034e23f515cb0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f5340f0968ee8b7dfd97e3327a6139273cc2c4fa000000000000000000000000000000000000000000000001158e460913d000000000000000000000000000009ed925d8206a4f88a2f643b28b3035b315753cd60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001bc14b92364c75e20000000000000000000000009ed925d8206a4f88a2f643b28b3035b315753cd60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000005439e5881a529f3ccbffc0e82d49f9db3950aefe") @@ -72,6 +73,7 @@ func TestSubscriptions_OnePass(t *testing.T) { } func TestSubscriptions_MultiPass(t *testing.T) { + t.Parallel() const ncycles int32 = 5 var currentCycle atomic.Int32 getSubscriptionCount := hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000000006") @@ -119,6 +121,7 @@ func TestSubscriptions_MultiPass(t *testing.T) { } func TestSubscriptions_Stored(t *testing.T) { + t.Parallel() getSubscriptionCount := hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000000003") getSubscriptionsInRange := hexutil.MustDecode("0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000240000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000109e6e1b12098cc8f3a1e9719a817ec53ab9b35c000000000000000000000000000000000000000000000000000034e23f515cb0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f5340f0968ee8b7dfd97e3327a6139273cc2c4fa000000000000000000000000000000000000000000000001158e460913d000000000000000000000000000009ed925d8206a4f88a2f643b28b3035b315753cd60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001bc14b92364c75e20000000000000000000000009ed925d8206a4f88a2f643b28b3035b315753cd60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000005439e5881a529f3ccbffc0e82d49f9db3950aefe") diff --git a/core/services/ocr2/plugins/generic/pipeline_runner_adapter_test.go b/core/services/ocr2/plugins/generic/pipeline_runner_adapter_test.go index d8678844d25..02136583e49 100644 --- a/core/services/ocr2/plugins/generic/pipeline_runner_adapter_test.go +++ b/core/services/ocr2/plugins/generic/pipeline_runner_adapter_test.go @@ -36,6 +36,7 @@ answer; ` func TestAdapter_Integration(t *testing.T) { + testutils.SkipShortDB(t) logger := logger.TestLogger(t) cfg := configtest.NewTestGeneralConfig(t) url := cfg.Database().URL() diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/v02/v02_request_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/v02/v02_request_test.go index c7fd7982904..8fc55abc7e7 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/v02/v02_request_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/v02/v02_request_test.go @@ -101,6 +101,7 @@ func setupClient(t *testing.T) *client { } func TestV02_SingleFeedRequest(t *testing.T) { + t.Parallel() upkeepId := big.NewInt(123456789) tests := []struct { name string @@ -382,6 +383,7 @@ func TestV02_SingleFeedRequest(t *testing.T) { } func TestV02_DoMercuryRequestV02(t *testing.T) { + t.Parallel() upkeepId, _ := new(big.Int).SetString("88786950015966611018675766524283132478093844178961698330929478019253453382042", 10) pluginRetryKey := "88786950015966611018675766524283132478093844178961698330929478019253453382042|34" tests := []struct { @@ -624,6 +626,7 @@ func TestV02_DoMercuryRequestV02(t *testing.T) { } func TestV02_DoMercuryRequestV02_MultipleFeedsSuccess(t *testing.T) { + t.Parallel() upkeepId, _ := new(big.Int).SetString("88786950015966611018675766524283132478093844178961698330929478019253453382042", 10) pluginRetryKey := "88786950015966611018675766524283132478093844178961698330929478019253453382042|34" @@ -665,6 +668,7 @@ func TestV02_DoMercuryRequestV02_MultipleFeedsSuccess(t *testing.T) { } func TestV02_DoMercuryRequestV02_Timeout(t *testing.T) { + t.Parallel() upkeepId, _ := new(big.Int).SetString("88786950015966611018675766524283132478093844178961698330929478019253453382042", 10) pluginRetryKey := "88786950015966611018675766524283132478093844178961698330929478019253453382042|34" @@ -719,6 +723,7 @@ func TestV02_DoMercuryRequestV02_Timeout(t *testing.T) { } func TestV02_DoMercuryRequestV02_OneFeedSuccessOneFeedPipelineError(t *testing.T) { + t.Parallel() upkeepId, _ := new(big.Int).SetString("88786950015966611018675766524283132478093844178961698330929478019253453382042", 10) pluginRetryKey := "88786950015966611018675766524283132478093844178961698330929478019253453382042|34" @@ -766,6 +771,7 @@ func TestV02_DoMercuryRequestV02_OneFeedSuccessOneFeedPipelineError(t *testing.T } func TestV02_DoMercuryRequestV02_OneFeedSuccessOneFeedErrCode(t *testing.T) { + t.Parallel() upkeepId, _ := new(big.Int).SetString("88786950015966611018675766524283132478093844178961698330929478019253453382042", 10) pluginRetryKey := "88786950015966611018675766524283132478093844178961698330929478019253453382042|34" @@ -813,6 +819,7 @@ func TestV02_DoMercuryRequestV02_OneFeedSuccessOneFeedErrCode(t *testing.T) { } func TestV02_DoMercuryRequestV02_OneFeedSuccessOneFeedPipelineErrorConvertedError(t *testing.T) { + t.Parallel() upkeepId, _ := new(big.Int).SetString("88786950015966611018675766524283132478093844178961698330929478019253453382042", 10) pluginRetryKey := "88786950015966611018675766524283132478093844178961698330929478019253453382042|34" diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/v03/v03_request_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/v03/v03_request_test.go index 9c0e2aaa147..be99296d153 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/v03/v03_request_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/v03/v03_request_test.go @@ -99,6 +99,7 @@ func setupClient(t *testing.T) *client { } func TestV03_DoMercuryRequestV03(t *testing.T) { + t.Parallel() upkeepId, _ := new(big.Int).SetString("88786950015966611018675766524283132478093844178961698330929478019253453382042", 10) tests := []struct { @@ -179,6 +180,7 @@ func TestV03_DoMercuryRequestV03(t *testing.T) { } func TestV03_DoMercuryRequestV03_MultipleFeedsSuccess(t *testing.T) { + t.Parallel() upkeepId, _ := new(big.Int).SetString("88786950015966611018675766524283132478093844178961698330929478019253453382042", 10) pluginRetryKey := "88786950015966611018675766524283132478093844178961698330929478019253453382042|34" @@ -230,6 +232,7 @@ func TestV03_DoMercuryRequestV03_MultipleFeedsSuccess(t *testing.T) { } func TestV03_DoMercuryRequestV03_Timeout(t *testing.T) { + t.Parallel() upkeepId, _ := new(big.Int).SetString("88786950015966611018675766524283132478093844178961698330929478019253453382042", 10) pluginRetryKey := "88786950015966611018675766524283132478093844178961698330929478019253453382042|34" @@ -286,6 +289,7 @@ func TestV03_DoMercuryRequestV03_Timeout(t *testing.T) { } func TestV03_DoMercuryRequestV03_OneFeedSuccessOneFeedPipelineError(t *testing.T) { + t.Parallel() upkeepId, _ := new(big.Int).SetString("88786950015966611018675766524283132478093844178961698330929478019253453382042", 10) pluginRetryKey := "88786950015966611018675766524283132478093844178961698330929478019253453382042|34" @@ -342,6 +346,7 @@ func TestV03_DoMercuryRequestV03_OneFeedSuccessOneFeedPipelineError(t *testing.T } func TestV03_DoMercuryRequestV03_OneFeedSuccessOneFeedErrCode(t *testing.T) { + t.Parallel() upkeepId, _ := new(big.Int).SetString("88786950015966611018675766524283132478093844178961698330929478019253453382042", 10) pluginRetryKey := "88786950015966611018675766524283132478093844178961698330929478019253453382042|34" @@ -412,6 +417,7 @@ func TestV03_DoMercuryRequestV03_OneFeedSuccessOneFeedErrCode(t *testing.T) { } func TestV03_MultiFeedRequest(t *testing.T) { + t.Parallel() upkeepId := big.NewInt(123456789) tests := []struct { name string diff --git a/core/services/workflows/engine_test.go b/core/services/workflows/engine_test.go index 7632bbb7a27..edb924f9874 100644 --- a/core/services/workflows/engine_test.go +++ b/core/services/workflows/engine_test.go @@ -116,6 +116,7 @@ func (m *mockTriggerCapability) UnregisterTrigger(ctx context.Context, req capab } func TestEngineWithHardcodedWorkflow(t *testing.T) { + t.Parallel() ctx := testutils.Context(t) reg := coreCap.NewRegistry(logger.TestLogger(t)) @@ -288,6 +289,7 @@ func mockTarget() *mockCapability { } func TestEngine_ErrorsTheWorkflowIfAStepErrors(t *testing.T) { + t.Parallel() ctx := testutils.Context(t) reg := coreCap.NewRegistry(logger.TestLogger(t)) @@ -388,6 +390,7 @@ func mockAction() (*mockCapability, values.Value) { } func TestEngine_MultiStepDependencies(t *testing.T) { + t.Parallel() ctx := testutils.Context(t) reg := coreCap.NewRegistry(logger.TestLogger(t)) diff --git a/core/services/workflows/models_test.go b/core/services/workflows/models_test.go index 61aced2ed19..232e91eaaa8 100644 --- a/core/services/workflows/models_test.go +++ b/core/services/workflows/models_test.go @@ -8,6 +8,7 @@ import ( ) func TestParse_Graph(t *testing.T) { + t.Parallel() testCases := []struct { name string yaml string diff --git a/core/services/workflows/models_yaml_test.go b/core/services/workflows/models_yaml_test.go index 411781a3782..2732f1b44c7 100644 --- a/core/services/workflows/models_yaml_test.go +++ b/core/services/workflows/models_yaml_test.go @@ -52,6 +52,7 @@ var transformJSON = cmp.FilterValues(func(x, y []byte) bool { })) func TestWorkflowSpecMarshalling(t *testing.T) { + t.Parallel() fixtureReader := yamlFixtureReaderBytes(t, "marshalling") t.Run("Type coercion", func(t *testing.T) { @@ -168,6 +169,7 @@ func TestWorkflowSpecMarshalling(t *testing.T) { } func TestJsonSchema(t *testing.T) { + t.Parallel() t.Run("GenerateJsonSchema", func(t *testing.T) { expectedSchemaPath := fixtureDir + "workflow_schema.json" generatedSchema, err := GenerateJsonSchema() diff --git a/core/services/workflows/state_test.go b/core/services/workflows/state_test.go index 9e69520c242..0917662ccb6 100644 --- a/core/services/workflows/state_test.go +++ b/core/services/workflows/state_test.go @@ -11,6 +11,7 @@ import ( ) func TestInterpolateKey(t *testing.T) { + t.Parallel() val, err := values.NewMap( map[string]any{ "reports": map[string]any{ @@ -202,6 +203,7 @@ func TestInterpolateKey(t *testing.T) { } func TestInterpolateInputsFromState(t *testing.T) { + t.Parallel() testCases := []struct { name string inputs map[string]any diff --git a/main_test.go b/main_test.go index 51707f0d9fb..81e056e3b84 100644 --- a/main_test.go +++ b/main_test.go @@ -43,6 +43,9 @@ func TestMain(m *testing.M) { } func TestScripts(t *testing.T) { + if testing.Short() { + t.Skip("skipping testscript") + } t.Parallel() visitor := txtar.NewDirVisitor("testdata/scripts", txtar.Recurse, func(path string) error {