diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index fbcbf755145..e504ce7ce27 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -197,45 +197,43 @@ jobs: fi core: - env: - # We explicitly have this env var not be "CL_DATABASE_URL" to avoid having it be used by core related tests - # when they should not be using it, while still allowing us to DRY up the setup - DB_URL: postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable strategy: fail-fast: false matrix: type: - - cmd: go_core_tests + - name: Core Unit Tests + cmd: go_core_tests os: ${{ needs.runner-config.outputs.core-tests-runner }} should-run: ${{ needs.filter.outputs.should-run-core-tests }} - trunk-auto-quarantine: "true" - - - cmd: go_core_tests_integration - os: ${{ needs.runner-config.outputs.core-tests-integration-runner }} - should-run: ${{ needs.filter.outputs.should-run-core-tests }} - trunk-auto-quarantine: "true" - setup-solana: "true" - install-loopps: "true" - - - cmd: go_core_fuzz + regex: "^TestUnit_" + # trunk-auto-quarantine: "true" + + # - cmd: go_core_tests_integration + # os: ${{ needs.runner-config.outputs.core-tests-integration-runner }} + # should-run: ${{ needs.filter.outputs.should-run-core-tests }} + # trunk-auto-quarantine: "true" + # setup-solana: "true" + # install-loopps: "true" + + - name: Core Fuzz Tests + cmd: go_core_fuzz os: ${{ needs.runner-config.outputs.core-fuzz-tests-runner }} should-run: ${{ needs.filter.outputs.should-run-core-tests }} - - cmd: go_core_race_tests + - name: Core Race Tests + cmd: go_core_race_tests os: ${{ needs.runner-config.outputs.core-race-tests-runner }} should-run: ${{ needs.filter.outputs.should-run-core-tests }} - - cmd: go_core_ccip_deployment_tests + - name: CCIP Deployment Unit Tests + cmd: go_core_ccip_deployment_tests os: ${{ needs.runner-config.outputs.deployment-tests-runner }} should-run: ${{ needs.filter.outputs.should-run-deployment-tests }} - trunk-auto-quarantine: "true" + regex: "^TestUnit_" go-mod-directory: "deployment/" - setup-solana: "true" - setup-aptos: "true" - install-loopps: "true" - setup-sui: "true" + # trunk-auto-quarantine: "true" - name: Core Tests (${{ matrix.type.cmd }}) # Be careful modifying the job name, as it is used to fetch the job URL + name: Core Tests (${{ matrix.type.name }}) # We don't directly merge dependabot PRs, so let's not waste the resources if: ${{ github.actor != 'dependabot[bot]' }} needs: [filter, run-frequency, runner-config] @@ -267,34 +265,6 @@ jobs: go-version-file: ${{ matrix.type.go-mod-directory }}go.mod go-module-file: ${{ matrix.type.go-mod-directory }}go.sum - - name: Setup Solana - if: ${{ matrix.type.should-run == 'true' && matrix.type.setup-solana == 'true' }} - uses: ./.github/actions/setup-solana - - - name: Setup Aptos - if: ${{ matrix.type.should-run == 'true' && matrix.type.setup-aptos == 'true' }} - uses: aptos-labs/actions/install-aptos-cli@63740b290d839b87ecfafbcf75ed03a36a54a29f # jan 15, 2025 - with: - CLI_VERSION: 7.10.0 - - - name: Setup Sui CLI v1.61.2 - if: ${{ matrix.type.should-run == 'true' && matrix.type.setup-sui == 'true' }} - uses: ./.github/actions/setup-sui - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - version: mainnet-v1.61.2 - - - name: Setup wasmd - if: ${{ matrix.type.should-run == 'true' }} - uses: ./.github/actions/setup-wasmd - - - name: Setup Postgres - if: ${{ matrix.type.should-run == 'true' }} - uses: smartcontractkit/.github/actions/setup-postgres@setup-postgres/v1 - with: - tmpfs: "true" - image-tag: "16-alpine" - - name: Touching core/web/assets/index.html if: ${{ matrix.type.should-run == 'true' }} run: mkdir -p core/web/assets && touch core/web/assets/index.html @@ -303,16 +273,6 @@ jobs: if: ${{ matrix.type.should-run == 'true' }} run: go mod download - - name: Setup DB - if: ${{ matrix.type.should-run == 'true' }} - run: go run ./core/store/cmd/preparetest - env: - CL_DATABASE_URL: ${{ env.DB_URL }} - - - name: Install LOOP Plugins - if: ${{ matrix.type.should-run == 'true' && matrix.type.install-loopps == 'true' }} - run: make install-plugins - - name: Increase Timeouts for Fuzz/Race # Increase timeouts for scheduled runs only if: ${{ github.event.schedule != '' && matrix.type.should-run == 'true' }} @@ -328,9 +288,9 @@ jobs: id: run-tests shell: bash env: - CL_DATABASE_URL: ${{ env.DB_URL }} + TEST_REGEX: ${{ matrix.type.regex }} OUTPUT_FILE: ./output.txt - PRODUCE_JUNIT_XML: ${{ matrix.type.trunk-auto-quarantine }} + PRODUCE_JUNIT_XML: "true" TRUNK_AUTO_QUARANTINE: ${{ matrix.type.trunk-auto-quarantine }} RUN_QUARANTINED_TESTS: "true" # always run quarantined tests in CI JUNIT_FILE: ${{ github.workspace }}/junit.xml @@ -346,7 +306,6 @@ jobs: trunk-org-slug: chainlink trunk-token: ${{ secrets.TRUNK_API_KEY }} trunk-previous-step-outcome: ${{ steps.run-tests.outcome }} - trunk-job-url: ${{ format('https://github.com/{0}/actions/runs/{1}/job/{2}/attempts/{3}', github.repository, github.run_id, job.check_run_id, github.run_attempt) }} # when auto-quarantine is enabled, allow this to determine test failures trunk-upload-only: ${{ matrix.type.trunk-auto-quarantine != 'true' }} @@ -368,12 +327,6 @@ jobs: echo "github.event_name: ${{ github.event_name }}" echo "github.ref: ${{ github.ref }}" - - name: Print postgres logs - if: ${{ always() && matrix.type.should-run == 'true' }} - uses: smartcontractkit/.github/actions/setup-postgres@setup-postgres/v1 - with: - print-logs: "true" - - name: Store logs artifacts if: ${{ always() && matrix.type.should-run == 'true' }} uses: actions/upload-artifact@v4 diff --git a/.github/workflows/ci-integration.yml b/.github/workflows/ci-integration.yml new file mode 100644 index 00000000000..c9881338751 --- /dev/null +++ b/.github/workflows/ci-integration.yml @@ -0,0 +1,167 @@ +name: CI Core Integration +run-name: CI Core Integration + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} + cancel-in-progress: true + +# Run on key branches to make sure integration is good, otherwise run on all PR's +on: + push: + branches: + - develop + - "release/*" + merge_group: + pull_request: + + +jobs: + integration-tests: + name: "${{ matrix.type.module }} - ${{matrix.type.regex}}" + timeout-minutes: 20 + runs-on: runs-on=${{ github.run_id }}-${{ strategy.job-index }}/${{ matrix.type.os }} + permissions: + id-token: write + contents: read + actions: read + env: + # We explicitly have this env var not be "CL_DATABASE_URL" to avoid having it be used by core related tests + # when they should not be using it, while still allowing us to DRY up the setup + DB_URL: postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable + + strategy: + fail-fast: false + matrix: + type: + - module: Core + cmd: go_core_tests + os: cpu=32/ram=64/family=c5ad/spot=false/image=ubuntu24-full-x64/extras=s3-cache + regex: "^TestScripts" + + - module: Core + cmd: go_core_tests + os: cpu=32/ram=64/family=c5ad/spot=false/image=ubuntu24-full-x64/extras=s3-cache + regex: "^TestIntegration_Shared_" + + - module: Deployment + cmd: go_core_ccip_deployment_tests + os: cpu=32/ram=64/family=c5ad/spot=false/image=ubuntu24-full-x64/extras=s3-cache + regex: "TestIntegration_Solana_" + go-mod-directory: "deployment/" + setup-solana: "true" + setup-plugins: "true" + + - module: Deployment + cmd: go_core_ccip_deployment_tests + os: cpu=32/ram=64/family=c5ad/spot=false/image=ubuntu24-full-x64/extras=s3-cache + regex: "^TestIntegration_Aptos_" + go-mod-directory: "deployment/" + aptos-cli-version: "7.10.0" + setup-plugins: "true" + + - module: Deployment + cmd: go_core_ccip_deployment_tests + os: cpu=32/ram=64/family=c5ad/spot=false/image=ubuntu24-full-x64/extras=s3-cache + regex: "^TestIntegration_Shared_" + go-mod-directory: "deployment/" + setup-plugins: "true" + steps: + - name: Enable S3 Cache for Self-Hosted Runners + # these env vars are set (and exposed) when it is a self-hosted runner with extras=s3-cache + if: ${{ env.RUNS_ON_INSTANCE_ID != '' && env.ACTIONS_CACHE_URL != '' }} + uses: runs-on/action@66d4449b717b5462159659523d1241051ff470b9 # v1 + + - name: Checkout the repo + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Setup Go + uses: ./.github/actions/setup-go + with: + build-cache-version: ${{ matrix.type.cmd }} + go-version-file: ${{ matrix.type.go-mod-directory }}go.mod + go-module-file: ${{ matrix.type.go-mod-directory }}go.sum + + - name: Setup Postgres + uses: smartcontractkit/.github/actions/setup-postgres@setup-postgres/v1 + with: + tmpfs: "true" + image-tag: "16-alpine" + + - name: Setup DB + run: go run ./core/store/cmd/preparetest + env: + CL_DATABASE_URL: ${{ env.DB_URL }} + + - name: Touching core/web/assets/index.html + run: mkdir -p core/web/assets && touch core/web/assets/index.html + + - name: Download Go vendor packages + run: go mod download + + - name: Setup Solana + if: matrix.type.setup-solana == 'true' + uses: ./.github/actions/setup-solana + + - name: Setup Aptos + if: ${{ matrix.type.aptos-cli-version != '' }} + uses: aptos-labs/actions/install-aptos-cli@63740b290d839b87ecfafbcf75ed03a36a54a29f # jan 15, 2025 + with: + CLI_VERSION: ${{ matrix.type.aptos-cli-version }} + + - name: Setup Sui CLI v1.57.2 + if: ${{ matrix.type.sui-cli-version != '' }} + uses: ./.github/actions/setup-sui + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + version: ${{ matrix.type.sui-cli-version }} + + - name: Setup wasmd + if: matrix.type.setup-plugins == 'true' + uses: ./.github/actions/setup-wasmd + + - name: Install LOOP Plugins + if: matrix.type.setup-plugins == 'true' + run: make install-plugins + + - name: Run tests + timeout-minutes: 22 + id: run-tests + shell: bash + env: + TEST_REGEX: ${{ matrix.type.regex }} + CL_DATABASE_URL: ${{ env.DB_URL }} + OUTPUT_FILE: ./output.txt + PRODUCE_JUNIT_XML: "true" + JUNIT_FILE: ${{ github.workspace }}/junit.xml + RUN_QUARANTINED_TESTS: "true" # always run quarantined tests in CI + run: | + GODEBUG=goindex=0 ./tools/bin/${{ matrix.type.cmd }} ./... + # See: https://github.com/golang/go/issues/69179 + + - name: Artifact name + id: artifact-name + if: ${{ always() }} + env: + CMD: ${{ matrix.type.cmd }} + REGEX: ${{ matrix.type.regex }} + run: | + REGEX_SANITIZED=$(echo "$REGEX" | sed 's/[\\^$.*+?{}()|\[\]]//g' | tr ' ' '_') + ARTIFACT_NAME="${CMD}_${REGEX_SANITIZED}_logs" + echo "artifact-name=$ARTIFACT_NAME" | tee -a "$GITHUB_OUTPUT" + + - name: Store logs artifacts + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.artifact-name.outputs.artifact-name }} + path: | + ./output.txt + ./output-short.txt + ./race.* + ./coverage.txt + ./postgres_logs.txt + ./junit.xml + ./deployment/junit.xml + retention-days: 7 diff --git a/.github/workflows/integration-in-memory-tests.yml b/.github/workflows/integration-in-memory-tests.yml index e21de702571..ebdb9fd9d6d 100644 --- a/.github/workflows/integration-in-memory-tests.yml +++ b/.github/workflows/integration-in-memory-tests.yml @@ -81,7 +81,8 @@ jobs: id-token: write contents: read needs: changes - if: github.event_name == 'pull_request' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') + if: false + # if: github.event_name == 'pull_request' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@9874c1f4ab4a4c70433df6d8f862044ca18456df # 2025-11-26 with: workflow_name: Run CCIP Integration Tests For PR diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index dddaa80f231..17bd3420d13 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -137,7 +137,8 @@ jobs: labels: name: Get PR labels and set runner labels - if: github.actor != 'dependabot[bot]' + # if: github.actor != 'dependabot[bot]' + if: false runs-on: ubuntu-latest permissions: contents: read @@ -192,7 +193,8 @@ jobs: build-chainlink: name: Build Chainlink Image ${{ matrix.image.name }} - if: github.actor != 'dependabot[bot]' + # if: github.actor != 'dependabot[bot]' + if: false environment: integration runs-on: ${{ matrix.image.runner }} needs: diff --git a/config_docs_test.go b/config_docs_test.go index c9576cf10cd..3b732a945ee 100644 --- a/config_docs_test.go +++ b/config_docs_test.go @@ -16,7 +16,7 @@ var ( secretsMD string ) -func TestConfigDocs(t *testing.T) { +func TestUnit_ConfigDocs(t *testing.T) { config, err := docs.GenerateConfig() assert.NoError(t, err, "invalid config docs") assert.Equal(t, configMD, config, "docs/CONFIG.md is out of date. Run 'make config-docs' to regenerate.") diff --git a/core/bridges/bridge_type_test.go b/core/bridges/bridge_type_test.go index 344ff931db4..ae14d31da1b 100644 --- a/core/bridges/bridge_type_test.go +++ b/core/bridges/bridge_type_test.go @@ -19,7 +19,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestBridgeTypeRequest(t *testing.T) { +func TestUnit_BridgeTypeRequest(t *testing.T) { u, err := url.Parse("http://example.com/test") require.NoError(t, err) r := bridges.BridgeTypeRequest{ @@ -36,7 +36,7 @@ func TestBridgeTypeRequest(t *testing.T) { assert.Error(t, r.SetID("abc123.,<>/.foobar")) } -func TestBridgeType_Authenticate(t *testing.T) { +func TestIntegration_Shared_BridgeType_Authenticate(t *testing.T) { t.Parallel() bta, bt := cltest.NewBridgeType(t, cltest.BridgeOpts{}) @@ -83,7 +83,7 @@ func BenchmarkParseBridgeName(b *testing.B) { } } -func TestBridgeName_UnmarshalJSON(t *testing.T) { +func TestUnit_BridgeName_UnmarshalJSON(t *testing.T) { var b bridges.BridgeName require.NoError(t, json.Unmarshal([]byte(`"asdf123test"`), &b)) require.Equal(t, "asdf123test", b.String()) @@ -95,7 +95,7 @@ func TestBridgeName_UnmarshalJSON(t *testing.T) { require.Error(t, json.Unmarshal([]byte(`"invalid,.<>/asdf?"`), &b)) } -func TestMarshalBridgeMetaData(t *testing.T) { +func TestIntegration_Shared_MarshalBridgeMetaData(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/bridges/cache_test.go b/core/bridges/cache_test.go index 4e88631f910..0546880ed44 100644 --- a/core/bridges/cache_test.go +++ b/core/bridges/cache_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func TestBridgeCache_Type(t *testing.T) { +func TestIntegration_Shared_BridgeCache_Type(t *testing.T) { t.Parallel() t.Run("loads bridge from data source - single", func(t *testing.T) { @@ -128,7 +128,7 @@ func TestBridgeCache_Type(t *testing.T) { }) } -func TestBridgeCache_Response(t *testing.T) { +func TestIntegration_Shared_BridgeCache_Response(t *testing.T) { t.Parallel() t.Run("loads response from data source", func(t *testing.T) { diff --git a/core/bridges/external_initiator_test.go b/core/bridges/external_initiator_test.go index 9f59c8e0030..7b7493363ab 100644 --- a/core/bridges/external_initiator_test.go +++ b/core/bridges/external_initiator_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestNewExternalInitiator(t *testing.T) { +func TestUnit_NewExternalInitiator(t *testing.T) { eia := auth.NewToken() assert.Len(t, eia.AccessKey, 32) assert.Len(t, eia.Secret, 64) @@ -30,7 +30,7 @@ func TestNewExternalInitiator(t *testing.T) { assert.Equal(t, ei.AccessKey, eia.AccessKey) } -func TestAuthenticateExternalInitiator(t *testing.T) { +func TestUnit_AuthenticateExternalInitiator(t *testing.T) { eia := auth.NewToken() ok, err := bridges.AuthenticateExternalInitiator(eia, &bridges.ExternalInitiator{ Salt: "salt", diff --git a/core/bridges/orm_test.go b/core/bridges/orm_test.go index 2ef6807f841..ce85e062a3f 100644 --- a/core/bridges/orm_test.go +++ b/core/bridges/orm_test.go @@ -30,7 +30,7 @@ func setupORM(t *testing.T) (*sqlx.DB, bridges.ORM) { return db, orm } -func TestORM_FindBridges(t *testing.T) { +func TestIntegration_Shared_ORM_FindBridges(t *testing.T) { t.Parallel() _, orm := setupORM(t) @@ -67,7 +67,7 @@ func TestORM_FindBridges(t *testing.T) { require.Error(t, err, bts) } -func TestORM_FindBridge(t *testing.T) { +func TestIntegration_Shared_ORM_FindBridge(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -103,7 +103,7 @@ func TestORM_FindBridge(t *testing.T) { }) } } -func TestORM_UpdateBridgeType(t *testing.T) { +func TestIntegration_Shared_ORM_UpdateBridgeType(t *testing.T) { ctx := testutils.Context(t) _, orm := setupORM(t) @@ -137,7 +137,7 @@ func TestORM_UpdateBridgeType(t *testing.T) { require.Empty(t, bs) } -func TestORM_TestCachedResponse(t *testing.T) { +func TestIntegration_Shared_ORM_TestCachedResponse(t *testing.T) { ctx := testutils.Context(t) cfg := configtest.NewGeneralConfig(t, nil) db := pgtest.NewSqlxDB(t) @@ -159,7 +159,7 @@ func TestORM_TestCachedResponse(t *testing.T) { require.Equal(t, []byte{111, 222, 2}, val) } -func TestORM_CreateExternalInitiator(t *testing.T) { +func TestIntegration_Shared_ORM_CreateExternalInitiator(t *testing.T) { ctx := testutils.Context(t) _, orm := setupORM(t) @@ -177,7 +177,7 @@ func TestORM_CreateExternalInitiator(t *testing.T) { require.Contains(t, orm.CreateExternalInitiator(ctx, exi2).Error(), `ERROR: duplicate key value violates unique constraint "external_initiators_name_key" (SQLSTATE 23505)`) } -func TestORM_DeleteExternalInitiator(t *testing.T) { +func TestUnit_ORM_DeleteExternalInitiator(t *testing.T) { ctx := testutils.Context(t) _, orm := setupORM(t) diff --git a/core/capabilities/ccip/ccip_integration_tests/home_chain_test.go b/core/capabilities/ccip/ccip_integration_tests/home_chain_test.go index c81e001e9d2..700e43335de 100644 --- a/core/capabilities/ccip/ccip_integration_tests/home_chain_test.go +++ b/core/capabilities/ccip/ccip_integration_tests/home_chain_test.go @@ -22,7 +22,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" ) -func TestHomeChainReader_ChainConfigs(t *testing.T) { +func TestUnit_HomeChainReader_ChainConfigs(t *testing.T) { ctx := testutils.Context(t) lggr := logger.Test(t) uni := integrationhelpers.NewTestUniverse(ctx, t, lggr) diff --git a/core/capabilities/ccip/ccip_integration_tests/rmn/rmn_home_test.go b/core/capabilities/ccip/ccip_integration_tests/rmn/rmn_home_test.go index ba19bd70f9b..1f3ec1c4d0e 100644 --- a/core/capabilities/ccip/ccip_integration_tests/rmn/rmn_home_test.go +++ b/core/capabilities/ccip/ccip_integration_tests/rmn/rmn_home_test.go @@ -23,7 +23,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" ) -func TestRMNHomeReader_GetRMNNodesInfo(t *testing.T) { +func TestUnit_RMNHomeReader_GetRMNNodesInfo(t *testing.T) { ctx := testutils.Context(t) lggr := logger.Test(t) uni := integrationhelpers.NewTestUniverse(ctx, t, lggr) diff --git a/core/capabilities/ccip/ccip_integration_tests/usdcreader/usdcreader_test.go b/core/capabilities/ccip/ccip_integration_tests/usdcreader/usdcreader_test.go index 659838b281b..3e31cbcf02e 100644 --- a/core/capabilities/ccip/ccip_integration_tests/usdcreader/usdcreader_test.go +++ b/core/capabilities/ccip/ccip_integration_tests/usdcreader/usdcreader_test.go @@ -45,7 +45,7 @@ import ( const ChainID = 1337 -func Test_USDCReader_MessageHashes(t *testing.T) { +func TestUnit_USDCReader_MessageHashes(t *testing.T) { finalityDepth := 5 ctx := testutils.Context(t) diff --git a/core/capabilities/ccip/ccipaptos/addresscodec_test.go b/core/capabilities/ccip/ccipaptos/addresscodec_test.go index 18fc28f1449..1775de94aa4 100644 --- a/core/capabilities/ccip/ccipaptos/addresscodec_test.go +++ b/core/capabilities/ccip/ccipaptos/addresscodec_test.go @@ -33,7 +33,7 @@ func generateAddressString() string { return addressString } -func TestAddressBytesToString(t *testing.T) { +func TestUnit_AddressBytesToString(t *testing.T) { tests := []struct { name string inHex string @@ -84,7 +84,7 @@ func TestAddressBytesToString(t *testing.T) { } } -func TestAddressStringToBytes(t *testing.T) { +func TestUnit_AddressStringToBytes(t *testing.T) { tests := []struct { name string in string diff --git a/core/capabilities/ccip/ccipaptos/commitcodec_test.go b/core/capabilities/ccip/ccipaptos/commitcodec_test.go index 3b3d370213d..0ceab401f21 100644 --- a/core/capabilities/ccip/ccipaptos/commitcodec_test.go +++ b/core/capabilities/ccip/ccipaptos/commitcodec_test.go @@ -77,7 +77,7 @@ var randomCommitReport = func() cciptypes.CommitPluginReport { } } -func TestCommitPluginCodecV1(t *testing.T) { +func TestUnit_CommitPluginCodecV1(t *testing.T) { testCases := []struct { name string report func(report cciptypes.CommitPluginReport) cciptypes.CommitPluginReport @@ -141,7 +141,7 @@ func TestCommitPluginCodecV1(t *testing.T) { // Go equivalent of test_deserialize_commit_report // https://github.com/smartcontractkit/chainlink-aptos/blob/cb70d13f90d16ea7fea7f0f52f02fbebc38d16a9/contracts/ccip/ccip_offramp/tests/offramp_test.move#L525 -func TestCommitPluginCodecV1_Decode(t *testing.T) { +func TestUnit_CommitPluginCodecV1_Decode(t *testing.T) { expectedSourceToken := "0x000000000000000000000000000000000000000000000000000000000000000a" expectedUsdPerToken, ok := new(big.Int).SetString("500000000000000000000", 10) require.True(t, ok) diff --git a/core/capabilities/ccip/ccipaptos/executecodec_test.go b/core/capabilities/ccip/ccipaptos/executecodec_test.go index 8653cd12c63..c75e8557446 100644 --- a/core/capabilities/ccip/ccipaptos/executecodec_test.go +++ b/core/capabilities/ccip/ccipaptos/executecodec_test.go @@ -91,7 +91,7 @@ var randomExecuteReport = func(t *testing.T, chainSelector uint64, gasLimit *big return cciptypes.ExecutePluginReport{ChainReports: chainReports} } -func TestExecutePluginCodecV1(t *testing.T) { +func TestUnit_ExecutePluginCodecV1(t *testing.T) { ctx := t.Context() mockExtraDataCodec := &mocks.SourceChainExtraDataCodec{} destGasAmount := rand.Uint32() @@ -194,7 +194,7 @@ func TestExecutePluginCodecV1(t *testing.T) { // Go equivalent of test_deserialize_execution_report // https://github.com/smartcontractkit/chainlink-aptos/blob/4a9525abbbc024af87ed6277c57dcf8aa58dd268/contracts/ccip/ccip_offramp/tests/offramp_test.move#L453 -func TestExecutePluginCodecV1_Decode(t *testing.T) { +func TestUnit_ExecutePluginCodecV1_Decode(t *testing.T) { expectedSender, err := hexutil.Decode("0xd87929a32cf0cbdc9e2d07ffc7c33344079de727") require.NoError(t, err) expectedData, err := hexutil.Decode("0x68656c6c6f20434349505265636569766572") // "hello CCIPReceiver" diff --git a/core/capabilities/ccip/ccipaptos/extradatadecoder_test.go b/core/capabilities/ccip/ccipaptos/extradatadecoder_test.go index 42b9cabe835..1cd0777a5cd 100644 --- a/core/capabilities/ccip/ccipaptos/extradatadecoder_test.go +++ b/core/capabilities/ccip/ccipaptos/extradatadecoder_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" ) -func Test_decodeExtraData(t *testing.T) { +func TestUnit_decodeExtraData(t *testing.T) { extraDataDecoder := &ExtraDataDecoder{} t.Run("decode extra args into map evm v1", func(t *testing.T) { diff --git a/core/capabilities/ccip/ccipaptos/msghasher_test.go b/core/capabilities/ccip/ccipaptos/msghasher_test.go index fa06a9fb2b7..70ea5c4f0e6 100644 --- a/core/capabilities/ccip/ccipaptos/msghasher_test.go +++ b/core/capabilities/ccip/ccipaptos/msghasher_test.go @@ -9,7 +9,7 @@ import ( ) // the equivalent test with the same values exists in the Aptos offramp.move contract, see test_calculate_message_hash -func TestComputeMessageDataHash(t *testing.T) { +func TestUnit_ComputeMessageDataHash(t *testing.T) { expectedHashStr := "0xc8d6cf666864a60dd6ecd89e5c294734c53b3218d3f83d2d19a3c3f9e200e00d" metadataHashBytes, err := hexutil.Decode("0xaabbccddeeff00112233445566778899aabbccddeeff00112233445566778899") @@ -75,7 +75,7 @@ func TestComputeMessageDataHash(t *testing.T) { } // the equivalent test with the same values exists in the Aptos offramp.move contract, see test_calculate_metadata_hash -func TestComputeMetadataHash(t *testing.T) { +func TestUnit_ComputeMetadataHash(t *testing.T) { expectedHashStr := "0x812acb01df318f85be452cf6664891cf5481a69dac01e0df67102a295218dd17" expectedHashAlternateStr := "0x6caf8756ae02ee4f12b83b38e0f21b5e43e90d203bd06729486fd4a0fc8bcc5e" diff --git a/core/capabilities/ccip/ccipevm/addresscodec_test.go b/core/capabilities/ccip/ccipevm/addresscodec_test.go index f8daec603f1..b0531689156 100644 --- a/core/capabilities/ccip/ccipevm/addresscodec_test.go +++ b/core/capabilities/ccip/ccipevm/addresscodec_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestAddressBytesToString(t *testing.T) { +func TestUnit_AddressBytesToString(t *testing.T) { addressCodec := AddressCodec{} addr := []byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13} want := "0x000102030405060708090a0b0c0d0e0f10111213" @@ -16,7 +16,7 @@ func TestAddressBytesToString(t *testing.T) { require.Equal(t, want, got) } -func TestAddressStringToBytes(t *testing.T) { +func TestUnit_AddressStringToBytes(t *testing.T) { addressCodec := AddressCodec{} addr := "0x000102030405060708090a0b0c0d0e0f10111213" want := []byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13} @@ -33,14 +33,14 @@ func TestAddressStringToBytes(t *testing.T) { // require.Error(t, err) // } -func TestInvalidAddressStringToBytes(t *testing.T) { +func TestUnit_InvalidAddressStringToBytes(t *testing.T) { addressCodec := AddressCodec{} addr := "0x000102030405060708090a0b0c0d0e0f1011121" _, err := addressCodec.AddressStringToBytes(addr) require.Error(t, err) } -func TestValidEVMAddress(t *testing.T) { +func TestUnit_ValidEVMAddress(t *testing.T) { addressCodec := AddressCodec{} addr := []byte{0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef} want := "0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF" @@ -49,14 +49,14 @@ func TestValidEVMAddress(t *testing.T) { require.Equal(t, want, got) } -func TestInvalidHexString(t *testing.T) { +func TestUnit_InvalidHexString(t *testing.T) { addressCodec := AddressCodec{} addr := "0xZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ" _, err := addressCodec.AddressStringToBytes(addr) require.Error(t, err) } -func TestAddressCodec_OracleIDAsAddressBytes(t *testing.T) { +func TestUnit_AddressCodec_OracleIDAsAddressBytes(t *testing.T) { codec := AddressCodec{} testCases := []struct { diff --git a/core/capabilities/ccip/ccipevm/commitcodec_test.go b/core/capabilities/ccip/ccipevm/commitcodec_test.go index 6c969bb33d2..8d30c4f69d7 100644 --- a/core/capabilities/ccip/ccipevm/commitcodec_test.go +++ b/core/capabilities/ccip/ccipevm/commitcodec_test.go @@ -77,7 +77,7 @@ var randomCommitReport = func() cciptypes.CommitPluginReport { } } -func TestCommitPluginCodecV1(t *testing.T) { +func TestUnit_CommitPluginCodecV1(t *testing.T) { testCases := []struct { name string report func(report cciptypes.CommitPluginReport) cciptypes.CommitPluginReport diff --git a/core/capabilities/ccip/ccipevm/executecodec_test.go b/core/capabilities/ccip/ccipevm/executecodec_test.go index 50553c18838..400c6f40bb5 100644 --- a/core/capabilities/ccip/ccipevm/executecodec_test.go +++ b/core/capabilities/ccip/ccipevm/executecodec_test.go @@ -96,7 +96,7 @@ var randomExecuteReport = func(t *testing.T, d *testSetupData, chainSelector uin return cciptypes.ExecutePluginReport{ChainReports: chainReports} } -func TestExecutePluginCodecV1(t *testing.T) { +func TestUnit_ExecutePluginCodecV1(t *testing.T) { d := testSetup(t) ctx := testutils.Context(t) mockExtraDataCodec := mocks.NewSourceChainExtraDataCodec(t) @@ -230,7 +230,7 @@ func TestExecutePluginCodecV1(t *testing.T) { } } -func Test_DecodeReport(t *testing.T) { +func TestUnit_DecodeReport(t *testing.T) { offRampABI, err := offramp.OffRampMetaData.GetAbi() require.NoError(t, err) diff --git a/core/capabilities/ccip/ccipevm/extradatacodec_test.go b/core/capabilities/ccip/ccipevm/extradatacodec_test.go index 64b7a494475..29f63d61962 100644 --- a/core/capabilities/ccip/ccipevm/extradatacodec_test.go +++ b/core/capabilities/ccip/ccipevm/extradatacodec_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/message_hasher" ) -func Test_decodeExtraData(t *testing.T) { +func TestUnit_decodeExtraData(t *testing.T) { d := testSetup(t) gasLimit := big.NewInt(rand.Int63()) extraDataDecoder := &ExtraDataDecoder{} @@ -66,7 +66,7 @@ func Test_decodeExtraData(t *testing.T) { }) } -func TestExtraDataDecoder_DecodeExtraArgsToMap_SVMDestination(t *testing.T) { +func TestUnit_ExtraDataDecoder_DecodeExtraArgsToMap_SVMDestination(t *testing.T) { d := testSetup(t) extraDataDecoder := &ExtraDataDecoder{} diff --git a/core/capabilities/ccip/ccipevm/gas_helpers_test.go b/core/capabilities/ccip/ccipevm/gas_helpers_test.go index 9410d9a969d..7b36501062d 100644 --- a/core/capabilities/ccip/ccipevm/gas_helpers_test.go +++ b/core/capabilities/ccip/ccipevm/gas_helpers_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" ) -func Test_calculateMessageMaxGas(t *testing.T) { +func TestUnit_calculateMessageMaxGas(t *testing.T) { type args struct { dataLen int numTokens int @@ -90,7 +90,7 @@ func Test_calculateMessageMaxGas(t *testing.T) { // TestCalculateMaxGas is taken from the ccip repo where the CalculateMerkleTreeGas and CalculateMessageMaxGas values // are combined to one function. -func TestCalculateMaxGas(t *testing.T) { +func TestUnit_CalculateMaxGas(t *testing.T) { tests := []struct { name string numRequests int diff --git a/core/capabilities/ccip/ccipevm/helpers_test.go b/core/capabilities/ccip/ccipevm/helpers_test.go index f42deb71310..54db3dd13d3 100644 --- a/core/capabilities/ccip/ccipevm/helpers_test.go +++ b/core/capabilities/ccip/ccipevm/helpers_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/message_hasher" ) -func Test_decodeExtraArgs(t *testing.T) { +func TestUnit_decodeExtraArgs(t *testing.T) { d := testSetup(t) gasLimit := big.NewInt(rand.Int63()) extraDataDecoder := &ExtraDataDecoder{} diff --git a/core/capabilities/ccip/ccipevm/msghasher_test.go b/core/capabilities/ccip/ccipevm/msghasher_test.go index 5240a6e4ac7..a47a8051221 100644 --- a/core/capabilities/ccip/ccipevm/msghasher_test.go +++ b/core/capabilities/ccip/ccipevm/msghasher_test.go @@ -47,7 +47,7 @@ var extraDataCodec = ccipocr3.ExtraDataCodecMap(map[string]ccipocr3.SourceChainE // NOTE: these test cases are only EVM <-> EVM. // Update these cases once we have non-EVM examples. -func TestMessageHasher_EVM2EVM(t *testing.T) { +func TestUnit_MessageHasher_EVM2EVM(t *testing.T) { ctx := testutils.Context(t) d := testSetup(t) @@ -220,7 +220,7 @@ func testSetup(t *testing.T) *testSetupData { } } -func TestMessagerHasher_againstRmnSharedVector(t *testing.T) { +func TestUnit_MessagerHasher_againstRmnSharedVector(t *testing.T) { transactor := evmtestutils.MustNewSimTransactor(t) backend := backends.NewSimulatedBackend(types.GenesisAlloc{ transactor.From: {Balance: assets.Ether(1000).ToInt()}, diff --git a/core/capabilities/ccip/ccipevm/rmncrypto_test.go b/core/capabilities/ccip/ccipevm/rmncrypto_test.go index f5822b3cc07..f581db48c64 100644 --- a/core/capabilities/ccip/ccipevm/rmncrypto_test.go +++ b/core/capabilities/ccip/ccipevm/rmncrypto_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" ) -func Test_VerifyRmnReportSignatures(t *testing.T) { +func TestUnit_VerifyRmnReportSignatures(t *testing.T) { // NOTE: The following test data (public keys, signatures, ...) are shared from the RMN team. onchainRmnRemoteAddr := common.HexToAddress("0x7821bcd6944457d17c631157efeb0c621baa76eb") diff --git a/core/capabilities/ccip/ccipevm/tokendata_test.go b/core/capabilities/ccip/ccipevm/tokendata_test.go index f2e28cabc3f..85f71a0c9b3 100644 --- a/core/capabilities/ccip/ccipevm/tokendata_test.go +++ b/core/capabilities/ccip/ccipevm/tokendata_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" ) -func Test_EVMTokenDataEncoder(t *testing.T) { +func TestUnit_EVMTokenDataEncoder(t *testing.T) { var empty usdcAttestationPayload encoder := NewEVMTokenDataEncoder() diff --git a/core/capabilities/ccip/ccipsolana/addresscodec_test.go b/core/capabilities/ccip/ccipsolana/addresscodec_test.go index a9419292543..382998f1953 100644 --- a/core/capabilities/ccip/ccipsolana/addresscodec_test.go +++ b/core/capabilities/ccip/ccipsolana/addresscodec_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestPublicKeyFromBytes(t *testing.T) { +func TestUnit_PublicKeyFromBytes(t *testing.T) { tests := []struct { name string inHex string @@ -61,7 +61,7 @@ func TestPublicKeyFromBytes(t *testing.T) { } } -func TestPublicKeyFromBase58(t *testing.T) { +func TestUnit_PublicKeyFromBase58(t *testing.T) { tests := []struct { name string in string @@ -96,7 +96,7 @@ func TestPublicKeyFromBase58(t *testing.T) { } } -func TestAddressCodec_OracleIDAsAddressBytes(t *testing.T) { +func TestUnit_AddressCodec_OracleIDAsAddressBytes(t *testing.T) { codec := AddressCodec{} testCases := []struct { diff --git a/core/capabilities/ccip/ccipsolana/commitcodec_test.go b/core/capabilities/ccip/ccipsolana/commitcodec_test.go index 2ad136c5139..5e914223cbf 100644 --- a/core/capabilities/ccip/ccipsolana/commitcodec_test.go +++ b/core/capabilities/ccip/ccipsolana/commitcodec_test.go @@ -57,7 +57,7 @@ var randomBlessedCommitReport = func() cciptypes.CommitPluginReport { } } -func TestCommitPluginCodecV1(t *testing.T) { +func TestUnit_CommitPluginCodecV1(t *testing.T) { testCases := []struct { name string report func(report cciptypes.CommitPluginReport) cciptypes.CommitPluginReport @@ -198,7 +198,7 @@ func BenchmarkCommitPluginCodecV1_Encode_Decode(b *testing.B) { } } -func Test_DecodingCommitReport(t *testing.T) { +func TestUnit_DecodingCommitReport(t *testing.T) { t.Run("decode on-chain commit report", func(t *testing.T) { chainSel := cciptypes.ChainSelector(rand.Uint64()) minSeqNr := rand.Uint64() diff --git a/core/capabilities/ccip/ccipsolana/executecodec_test.go b/core/capabilities/ccip/ccipsolana/executecodec_test.go index 51268fb275e..04b8f79bd30 100644 --- a/core/capabilities/ccip/ccipsolana/executecodec_test.go +++ b/core/capabilities/ccip/ccipsolana/executecodec_test.go @@ -102,7 +102,7 @@ var randomExecuteReport = func(t *testing.T, sourceChainSelector uint64) ccipocr return ccipocr3.ExecutePluginReport{ChainReports: chainReports} } -func TestExecutePluginCodecV1(t *testing.T) { +func TestUnit_ExecutePluginCodecV1(t *testing.T) { testCases := []struct { name string report func(report ccipocr3.ExecutePluginReport) ccipocr3.ExecutePluginReport @@ -214,7 +214,7 @@ func TestExecutePluginCodecV1(t *testing.T) { } } -func Test_DecodingExecuteReport(t *testing.T) { +func TestUnit_DecodingExecuteReport(t *testing.T) { mockExtraDataCodec := mocks.NewSourceChainExtraDataCodec(t) mockExtraDataCodec.On("DecodeDestExecDataToMap", mock.Anything, mock.Anything).Return(map[string]any{ "destGasAmount": uint32(10), diff --git a/core/capabilities/ccip/ccipsolana/extradatacodec_test.go b/core/capabilities/ccip/ccipsolana/extradatacodec_test.go index cdad6b92aeb..4b88b80bf16 100644 --- a/core/capabilities/ccip/ccipsolana/extradatacodec_test.go +++ b/core/capabilities/ccip/ccipsolana/extradatacodec_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/latest/fee_quoter" ) -func Test_decodeExtraArgs(t *testing.T) { +func TestUnit_decodeExtraArgs(t *testing.T) { extraDataDecoder := &ExtraDataDecoder{} t.Run("decode dest exec data into map svm", func(t *testing.T) { destGasAmount := uint32(10000) diff --git a/core/capabilities/ccip/ccipsolana/gas_helpers_test.go b/core/capabilities/ccip/ccipsolana/gas_helpers_test.go index 807bb3d8c80..93504fa7f20 100644 --- a/core/capabilities/ccip/ccipsolana/gas_helpers_test.go +++ b/core/capabilities/ccip/ccipsolana/gas_helpers_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" ) -func Test_calculateMessageMaxGas(t *testing.T) { +func TestUnit_calculateMessageMaxGas(t *testing.T) { type args struct { dataLen int numTokens int @@ -70,7 +70,7 @@ func Test_calculateMessageMaxGas(t *testing.T) { // TestCalculateMaxGas is taken from the ccip repo where the CalculateMerkleTreeGas and CalculateMessageMaxGas values // are combined to one function. -func TestCalculateMaxGas(t *testing.T) { +func TestUnit_CalculateMaxGas(t *testing.T) { tests := []struct { name string numRequests int diff --git a/core/capabilities/ccip/ccipsolana/msghasher_test.go b/core/capabilities/ccip/ccipsolana/msghasher_test.go index 9a30c4d0b93..1095af71b5f 100644 --- a/core/capabilities/ccip/ccipsolana/msghasher_test.go +++ b/core/capabilities/ccip/ccipsolana/msghasher_test.go @@ -26,7 +26,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" ) -func TestMessageHasher_EVM2SVM(t *testing.T) { +func TestUnit_MessageHasher_EVM2SVM(t *testing.T) { registeredExtraDataCodecMap := map[string]ccipocr3.SourceChainExtraDataCodec{ chainsel.FamilyAptos: ccipaptos.ExtraDataDecoder{}, chainsel.FamilyEVM: ccipevm.ExtraDataDecoder{}, @@ -43,7 +43,7 @@ func TestMessageHasher_EVM2SVM(t *testing.T) { require.Equal(t, expectedHash, actualHash[:32]) } -func TestMessageHasher_InvalidReceiver(t *testing.T) { +func TestUnit_MessageHasher_InvalidReceiver(t *testing.T) { any2AnyMsg, _, _ := createEVM2SolanaMessages(t) // Set receiver to a []byte of 2 length @@ -73,7 +73,7 @@ func TestMessageHasher_InvalidReceiver(t *testing.T) { require.Error(t, err) } -func TestMessageHasher_InvalidDestinationTokenAddress(t *testing.T) { +func TestUnit_MessageHasher_InvalidDestinationTokenAddress(t *testing.T) { any2AnyMsg, _, _ := createEVM2SolanaMessages(t) // Set DestTokenAddress to a []byte of 2 length @@ -195,7 +195,7 @@ func abiEncodeUint32(data uint32) ([]byte, error) { return utils.ABIEncode(`[{ "type": "uint32" }]`, data) } -func TestToLittleEndian(t *testing.T) { +func TestUnit_ToLittleEndian(t *testing.T) { mustSetString := func(s string) *big.Int { b, ok := big.NewInt(0).SetString(s, 10) if !ok { diff --git a/core/capabilities/ccip/common/common_test.go b/core/capabilities/ccip/common/common_test.go index b490009ff95..606c4769df5 100644 --- a/core/capabilities/ccip/common/common_test.go +++ b/core/capabilities/ccip/common/common_test.go @@ -14,7 +14,7 @@ import ( capcommon "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common" ) -func Test_HashedCapabilityId(t *testing.T) { +func TestUnit_HashedCapabilityId(t *testing.T) { transactor := testutils.MustNewSimTransactor(t) sb := backends.NewSimulatedBackend(core.GenesisAlloc{ transactor.From: {Balance: assets.Ether(1000).ToInt()}, diff --git a/core/capabilities/ccip/configs/evm/chain_writer_test.go b/core/capabilities/ccip/configs/evm/chain_writer_test.go index a8851ab6e48..9dbf172b322 100644 --- a/core/capabilities/ccip/configs/evm/chain_writer_test.go +++ b/core/capabilities/ccip/configs/evm/chain_writer_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/configs/evm" ) -func TestChainWriterConfigRaw(t *testing.T) { +func TestUnit_ChainWriterConfigRaw(t *testing.T) { tests := []struct { name string fromAddress common.Address diff --git a/core/capabilities/ccip/configs/evm/init_test.go b/core/capabilities/ccip/configs/evm/init_test.go index 010592b6dc9..b9f1183781b 100644 --- a/core/capabilities/ccip/configs/evm/init_test.go +++ b/core/capabilities/ccip/configs/evm/init_test.go @@ -4,7 +4,7 @@ import ( "testing" ) -func TestConfig(t *testing.T) { +func TestUnit_Config(t *testing.T) { // Config is created during initialization, the following functions may panic: // MustGetABI // mustGetMethodName diff --git a/core/capabilities/ccip/configs/solana/chain_writer_test.go b/core/capabilities/ccip/configs/solana/chain_writer_test.go index 7167c6aa4ec..ba230deb0e0 100644 --- a/core/capabilities/ccip/configs/solana/chain_writer_test.go +++ b/core/capabilities/ccip/configs/solana/chain_writer_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink-solana/pkg/solana/chainwriter" ) -func TestChainWriterConfigRaw(t *testing.T) { +func TestUnit_ChainWriterConfigRaw(t *testing.T) { tests := []struct { name string fromAddress string diff --git a/core/capabilities/ccip/configs/solana/contract_reader_test.go b/core/capabilities/ccip/configs/solana/contract_reader_test.go index f4e343f07f4..f05dcce40f6 100644 --- a/core/capabilities/ccip/configs/solana/contract_reader_test.go +++ b/core/capabilities/ccip/configs/solana/contract_reader_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" ) -func TestContractReaderConfigRaw(t *testing.T) { +func TestUnit_ContractReaderConfigRaw(t *testing.T) { cfg, err := DestContractReaderConfig() require.NoError(t, err) diff --git a/core/capabilities/ccip/launcher/deployment_test.go b/core/capabilities/ccip/launcher/deployment_test.go index 0ceb1d822b3..5a5c984448f 100644 --- a/core/capabilities/ccip/launcher/deployment_test.go +++ b/core/capabilities/ccip/launcher/deployment_test.go @@ -12,7 +12,7 @@ import ( mocktypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types/mocks" ) -func Test_ccipDeployment_Transitions(t *testing.T) { +func TestUnit_ccipDeployment_Transitions(t *testing.T) { // we use a pointer to the oracle here for mock assertions type args struct { prevDeployment map[ocrtypes.ConfigDigest]*mocktypes.CCIPOracle diff --git a/core/capabilities/ccip/launcher/diff_test.go b/core/capabilities/ccip/launcher/diff_test.go index 37c4a229580..1f3b4bdf4d7 100644 --- a/core/capabilities/ccip/launcher/diff_test.go +++ b/core/capabilities/ccip/launcher/diff_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" ) -func Test_diff(t *testing.T) { +func TestUnit_diff(t *testing.T) { type args struct { capabilityID string oldState registrysyncer.LocalRegistry @@ -115,7 +115,7 @@ func Test_diff(t *testing.T) { } } -func Test_compareDONs(t *testing.T) { +func TestUnit_compareDONs(t *testing.T) { type args struct { currCCIPDONs map[registrysyncer.DonID]registrysyncer.DON newCCIPDONs map[registrysyncer.DonID]registrysyncer.DON @@ -197,7 +197,7 @@ func Test_compareDONs(t *testing.T) { } } -func Test_filterCCIPDONs(t *testing.T) { +func TestUnit_filterCCIPDONs(t *testing.T) { type args struct { ccipCapability registrysyncer.Capability state registrysyncer.LocalRegistry @@ -277,7 +277,7 @@ func Test_filterCCIPDONs(t *testing.T) { } } -func Test_checkCapabilityPresence(t *testing.T) { +func TestUnit_checkCapabilityPresence(t *testing.T) { type args struct { capabilityID string state registrysyncer.LocalRegistry @@ -329,7 +329,7 @@ func Test_checkCapabilityPresence(t *testing.T) { } } -func Test_isMemberOfDON(t *testing.T) { +func TestUnit_isMemberOfDON(t *testing.T) { var p2pIDs []ragep2ptypes.PeerID for i := range [4]struct{}{} { p2pIDs = append(p2pIDs, ragep2ptypes.PeerID(p2pkey.MustNewV2XXXTestingOnly(big.NewInt(int64(i+1))).PeerID())) diff --git a/core/capabilities/ccip/launcher/launcher_test.go b/core/capabilities/ccip/launcher/launcher_test.go index 4f5a115aaa6..9b970d01433 100644 --- a/core/capabilities/ccip/launcher/launcher_test.go +++ b/core/capabilities/ccip/launcher/launcher_test.go @@ -22,7 +22,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" ) -func Test_createDON(t *testing.T) { +func TestUnit_createDON(t *testing.T) { type args struct { lggr logger.Logger p2pID ragep2ptypes.PeerID @@ -245,7 +245,7 @@ func Test_createDON(t *testing.T) { } } -func Test_updateDON(t *testing.T) { +func TestUnit_updateDON(t *testing.T) { var ( digest1 = utils.RandomBytes32() digest2 = utils.RandomBytes32() @@ -509,7 +509,7 @@ func Test_updateDON(t *testing.T) { } } -func Test_launcher_processDiff(t *testing.T) { +func TestUnit_launcher_processDiff(t *testing.T) { var ( digest1 = utils.RandomBytes32() digest2 = utils.RandomBytes32() diff --git a/core/capabilities/ccip/ocrimpls/contract_transmitter_test.go b/core/capabilities/ccip/ocrimpls/contract_transmitter_test.go index 811a9965d8b..e3f0f909ae0 100644 --- a/core/capabilities/ccip/ocrimpls/contract_transmitter_test.go +++ b/core/capabilities/ccip/ocrimpls/contract_transmitter_test.go @@ -55,7 +55,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" ) -func Test_ContractTransmitter_TransmitWithoutSignatures(t *testing.T) { +func TestIntegration_Shared_ContractTransmitter_TransmitWithoutSignatures(t *testing.T) { type testCase struct { name string pluginType uint8 @@ -189,7 +189,7 @@ func abiEncodeUint32(data uint32) ([]byte, error) { } // Test EVM -> SVM extra data decoding in contract transmitter -func TestSVMExecCallDataFuncExtraDataDecoding(t *testing.T) { +func TestUnit_SVMExecCallDataFuncExtraDataDecoding(t *testing.T) { extraDataCodec := ccipocr3.ExtraDataCodecMap(map[string]ccipocr3.SourceChainExtraDataCodec{ chainsel.FamilyEVM: ccipevm.ExtraDataDecoder{}, chainsel.FamilySolana: ccipsolana.ExtraDataDecoder{}, diff --git a/core/capabilities/ccip/oraclecreator/bootstrap_test.go b/core/capabilities/ccip/oraclecreator/bootstrap_test.go index 4a31b10a3d6..24103210a62 100644 --- a/core/capabilities/ccip/oraclecreator/bootstrap_test.go +++ b/core/capabilities/ccip/oraclecreator/bootstrap_test.go @@ -12,7 +12,7 @@ import ( cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" ) -func TestCalculateSyncActions(t *testing.T) { +func TestUnit_CalculateSyncActions(t *testing.T) { tests := []struct { name string currentDigests []cciptypes.Bytes32 diff --git a/core/capabilities/ccip/oraclecreator/create_test.go b/core/capabilities/ccip/oraclecreator/create_test.go index c36c3b56448..9603be30c96 100644 --- a/core/capabilities/ccip/oraclecreator/create_test.go +++ b/core/capabilities/ccip/oraclecreator/create_test.go @@ -35,7 +35,7 @@ import ( // TestPluginOracleCreatorCreate_InvalidSelector ensures that Create returns an error when an // unknown chain selector is provided. This exercises the early-return error path // before any heavy initialisation takes place. -func TestPluginOracleCreatorCreate_InvalidSelector(t *testing.T) { +func TestUnit_PluginOracleCreatorCreate_InvalidSelector(t *testing.T) { t.Parallel() lggr := logger.Test(t) @@ -83,7 +83,7 @@ func TestPluginOracleCreatorCreate_InvalidSelector(t *testing.T) { // TestCreateFactoryAndTransmitter_PeerWrapperNotStarted verifies that the // helper returns an error when called for a commit plugin but the peer wrapper // has not been started – this guards a critical control-flow condition. -func TestCreateFactoryAndTransmitter_PeerWrapperNotStarted(t *testing.T) { +func TestUnit_CreateFactoryAndTransmitter_PeerWrapperNotStarted(t *testing.T) { t.Parallel() lggr := logger.Test(t) @@ -123,7 +123,7 @@ func TestCreateFactoryAndTransmitter_PeerWrapperNotStarted(t *testing.T) { // TestCreateFactoryAndTransmitter_NilDestChainWriter verifies that a NoOpTransmitter // is created when destChainWriter is nil for both commit and execute plugin types. -func TestCreateFactoryAndTransmitter_NilDestChainWriter(t *testing.T) { +func TestUnit_CreateFactoryAndTransmitter_NilDestChainWriter(t *testing.T) { t.Parallel() lggr := logger.Test(t) diff --git a/core/capabilities/ccip/oraclecreator/plugin_test.go b/core/capabilities/ccip/oraclecreator/plugin_test.go index 83360b0299e..e69bede23f5 100644 --- a/core/capabilities/ccip/oraclecreator/plugin_test.go +++ b/core/capabilities/ccip/oraclecreator/plugin_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/synchronization" ) -func TestPluginTypeToTelemetryType(t *testing.T) { +func TestUnit_PluginTypeToTelemetryType(t *testing.T) { tests := []struct { name string pluginType types.PluginType @@ -58,7 +58,7 @@ func TestPluginTypeToTelemetryType(t *testing.T) { } } -func TestPluginOracleCreator_getTransmitterFromPublicConfig(t *testing.T) { +func TestUnit_PluginOracleCreator_getTransmitterFromPublicConfig(t *testing.T) { key := p2pkey.MustNewV2XXXTestingOnly(big.NewInt(1)) poc := &pluginOracleCreator{p2pID: key} @@ -128,7 +128,7 @@ func TestPluginOracleCreator_getTransmitterFromPublicConfig(t *testing.T) { } // Sanity-check that these parameters are not accidentally changed without breaking CI -func Test_defaultLocalConfigProperties(t *testing.T) { +func TestUnit_defaultLocalConfigProperties(t *testing.T) { lc := defaultLocalConfig() assert.Equal(t, 30*time.Second, lc.DefaultMaxDurationInitialization) diff --git a/core/capabilities/ccip/oraclecreator/wrapped_oracle_test.go b/core/capabilities/ccip/oraclecreator/wrapped_oracle_test.go index 062ed8d56c8..a3548cafd18 100644 --- a/core/capabilities/ccip/oraclecreator/wrapped_oracle_test.go +++ b/core/capabilities/ccip/oraclecreator/wrapped_oracle_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" ) -func Test_wrappedOracle_Close(t *testing.T) { +func TestUnit_wrappedOracle_Close(t *testing.T) { tests := []struct { name string oracleErr error diff --git a/core/capabilities/ccip/validate/validate_test.go b/core/capabilities/ccip/validate/validate_test.go index 97958f4cf9d..a037f650a82 100644 --- a/core/capabilities/ccip/validate/validate_test.go +++ b/core/capabilities/ccip/validate/validate_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/job" ) -func TestNewCCIPSpecToml(t *testing.T) { +func TestUnit_NewCCIPSpecToml(t *testing.T) { tests := []struct { name string specArgs validate.SpecArgs @@ -32,7 +32,7 @@ func TestNewCCIPSpecToml(t *testing.T) { } } -func TestValidatedCCIPSpec(t *testing.T) { +func TestUnit_ValidatedCCIPSpec(t *testing.T) { type args struct { tomlString string } diff --git a/core/capabilities/compute/cache_test.go b/core/capabilities/compute/cache_test.go index 1b59553ce28..4bf36c54b1d 100644 --- a/core/capabilities/compute/cache_test.go +++ b/core/capabilities/compute/cache_test.go @@ -22,7 +22,7 @@ const ( ) // Verify that cache evicts an expired module. -func TestCache(t *testing.T) { +func TestUnit_Cache(t *testing.T) { tests.SkipFlakey(t, "https://smartcontract-it.atlassian.net/browse/DX-558") t.Parallel() @@ -63,7 +63,7 @@ func TestCache(t *testing.T) { } // Verify that an expired module is not evicted because evictAfterSize is 1 -func TestCache_EvictAfterSize(t *testing.T) { +func TestUnit_Cache_EvictAfterSize(t *testing.T) { t.Parallel() clock := clockwork.NewFakeClock() tick := 1 * time.Second @@ -106,7 +106,7 @@ func TestCache_EvictAfterSize(t *testing.T) { assert.True(t, ok) } -func TestCache_AddDuplicatedModule(t *testing.T) { +func TestUnit_Cache_AddDuplicatedModule(t *testing.T) { tests.SkipFlakey(t, "https://smartcontract-it.atlassian.net/browse/DX-574") t.Parallel() diff --git a/core/capabilities/compute/compute_test.go b/core/capabilities/compute/compute_test.go index 2d5da9df504..09b306441ef 100644 --- a/core/capabilities/compute/compute_test.go +++ b/core/capabilities/compute/compute_test.go @@ -91,7 +91,7 @@ func setup(t *testing.T, config Config) testHarness { } } -func TestComputeStartAddsToRegistry(t *testing.T) { +func TestUnit_ComputeStartAddsToRegistry(t *testing.T) { th := setup(t, defaultConfig) require.NoError(t, th.compute.Start(t.Context())) @@ -105,7 +105,7 @@ func TestComputeStartAddsToRegistry(t *testing.T) { assert.Equal(t, th.compute, *loader.Load()) } -func TestComputeExecuteMissingConfig(t *testing.T) { +func TestUnit_ComputeExecuteMissingConfig(t *testing.T) { t.Parallel() th := setup(t, defaultConfig) require.NoError(t, th.compute.Start(t.Context())) @@ -127,7 +127,7 @@ func TestComputeExecuteMissingConfig(t *testing.T) { assert.ErrorContains(t, err, "invalid request: could not find \"config\" in map") } -func TestComputeExecuteMissingBinary(t *testing.T) { +func TestUnit_ComputeExecuteMissingBinary(t *testing.T) { th := setup(t, defaultConfig) require.NoError(t, th.compute.Start(t.Context())) @@ -147,7 +147,7 @@ func TestComputeExecuteMissingBinary(t *testing.T) { assert.ErrorContains(t, err, "invalid request: could not find \"binary\" in map") } -func TestComputeExecute(t *testing.T) { +func TestUnit_ComputeExecute(t *testing.T) { t.Parallel() th := setup(t, defaultConfig) @@ -206,7 +206,7 @@ func TestComputeExecute(t *testing.T) { assert.Less(t, spendValue, uint64(400)) } -func TestComputeFetch(t *testing.T) { +func TestUnit_ComputeFetch(t *testing.T) { t.Parallel() workflowID := "15c631d295ef5e32deb99a10ee6804bc4af13855687559d7ff6552ac6dbb2ce0" workflowExecutionID := "95ef5e32deb99a10ee6804bc4af13855687559d7ff6552ac6dbb2ce0abbadeed" @@ -297,7 +297,7 @@ func TestComputeFetch(t *testing.T) { assert.Less(t, spendValue, uint64(400)) } -func TestCompute_SpendValueRelativeToComputeTime(t *testing.T) { +func TestUnit_Compute_SpendValueRelativeToComputeTime(t *testing.T) { t.Parallel() // because we are using ms precision and test overhead can result in variance, we use a range of 400ms @@ -381,7 +381,7 @@ func TestCompute_SpendValueRelativeToComputeTime(t *testing.T) { } } -func TestComputeFetchMaxResponseSizeBytes(t *testing.T) { +func TestUnit_ComputeFetchMaxResponseSizeBytes(t *testing.T) { t.Parallel() workflowID := "15c631d295ef5e32deb99a10ee6804bc4af13855687559d7ff6552ac6dbb2ce0" workflowExecutionID := "95ef5e32deb99a10ee6804bc4af13855687559d7ff6552ac6dbb2ce0abbadeed" diff --git a/core/capabilities/compute/transformer_test.go b/core/capabilities/compute/transformer_test.go index 295ad9f043e..a267b4f107a 100644 --- a/core/capabilities/compute/transformer_test.go +++ b/core/capabilities/compute/transformer_test.go @@ -14,12 +14,12 @@ import ( "github.com/stretchr/testify/require" ) -func Test_NotFoundError(t *testing.T) { +func TestUnit_NotFoundError(t *testing.T) { nfe := NewNotFoundError("test") assert.Equal(t, "could not find \"test\" in map", nfe.Error()) } -func Test_popValue(t *testing.T) { +func TestUnit_popValue(t *testing.T) { m, err := values.NewMap( map[string]any{ "test": "value", @@ -50,7 +50,7 @@ func Test_popValue(t *testing.T) { assert.Empty(t, m.Underlying) } -func Test_popOptionalValue(t *testing.T) { +func TestUnit_popOptionalValue(t *testing.T) { m, err := values.NewMap( map[string]any{ "test": "value", @@ -82,7 +82,7 @@ func Test_popOptionalValue(t *testing.T) { assert.Empty(t, m.Underlying) } -func Test_transformer(t *testing.T) { +func TestUnit_transformer(t *testing.T) { var ( lgger = logger.Test(t) emitter = custmsg.NewLabeler() diff --git a/core/capabilities/don_notifier_test.go b/core/capabilities/don_notifier_test.go index cf9d204a6d3..3214e133fd9 100644 --- a/core/capabilities/don_notifier_test.go +++ b/core/capabilities/don_notifier_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/capabilities" ) -func TestDonNotifier_WaitForDon(t *testing.T) { +func TestUnit_DonNotifier_WaitForDon(t *testing.T) { notifier := capabilities.NewDonNotifier() don := commoncap.DON{ ID: 1, @@ -44,7 +44,7 @@ func TestDonNotifier_WaitForDon(t *testing.T) { assert.Equal(t, don, result) } -func TestDonNotifier_WaitForDon_ContextTimeout(t *testing.T) { +func TestUnit_DonNotifier_WaitForDon_ContextTimeout(t *testing.T) { notifier := capabilities.NewDonNotifier() ctx, cancel := context.WithCancel(context.Background()) @@ -55,7 +55,7 @@ func TestDonNotifier_WaitForDon_ContextTimeout(t *testing.T) { assert.ErrorContains(t, err, context.Canceled.Error()) } -func TestDonNotifier_DonUpdate(t *testing.T) { +func TestUnit_DonNotifier_DonUpdate(t *testing.T) { notifier := capabilities.NewDonNotifier() notifyChs := []chan struct{}{ make(chan struct{}), diff --git a/core/capabilities/encoder_factory_test.go b/core/capabilities/encoder_factory_test.go index 93509d94338..a81a97f4ce5 100644 --- a/core/capabilities/encoder_factory_test.go +++ b/core/capabilities/encoder_factory_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/require" ) -func Test_NewEncoder(t *testing.T) { +func TestUnit_NewEncoder(t *testing.T) { t.Parallel() t.Run("All ocr3 encoder types return a factory", func(t *testing.T) { evmEncoding, err := values.NewMap(map[string]any{"abi": "bytes[] Full_reports"}) diff --git a/core/capabilities/fakes/consensus_nodag_test.go b/core/capabilities/fakes/consensus_nodag_test.go index dc28ef3dfd8..4aa8efaa6df 100644 --- a/core/capabilities/fakes/consensus_nodag_test.go +++ b/core/capabilities/fakes/consensus_nodag_test.go @@ -25,7 +25,7 @@ const ( testRefID = "0011" ) -func Test_Simple_EVMEncoder(t *testing.T) { +func TestUnit_Simple_EVMEncoder(t *testing.T) { nSigners := 4 signers := []ocr2key.KeyBundle{} for range nSigners { diff --git a/core/capabilities/gateway_connector/service_wrapper_test.go b/core/capabilities/gateway_connector/service_wrapper_test.go index 9d6561ecd3d..8be9c061804 100644 --- a/core/capabilities/gateway_connector/service_wrapper_test.go +++ b/core/capabilities/gateway_connector/service_wrapper_test.go @@ -47,7 +47,7 @@ func generateWrapper(t *testing.T, privateKey *ecdsa.PrivateKey, keystoreKey *ec return wrapper, err } -func TestGatewayConnectorServiceWrapper_CleanStartClose(t *testing.T) { +func TestUnit_GatewayConnectorServiceWrapper_CleanStartClose(t *testing.T) { t.Parallel() key, _ := testutils.NewPrivateKeyAndAddress(t) @@ -63,7 +63,7 @@ func TestGatewayConnectorServiceWrapper_CleanStartClose(t *testing.T) { }) } -func TestGatewayConnectorServiceWrapper_NonexistentKey(t *testing.T) { +func TestUnit_GatewayConnectorServiceWrapper_NonexistentKey(t *testing.T) { t.Parallel() key, _ := testutils.NewPrivateKeyAndAddress(t) diff --git a/core/capabilities/integration_tests/keystone/keystone_test.go b/core/capabilities/integration_tests/keystone/keystone_test.go index aad68ed4acb..caad44be04e 100644 --- a/core/capabilities/integration_tests/keystone/keystone_test.go +++ b/core/capabilities/integration_tests/keystone/keystone_test.go @@ -22,11 +22,11 @@ import ( reporttypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v3/types" ) -func Test_AllAtOnceTransmissionSchedule(t *testing.T) { +func TestIntegration_Shared_AllAtOnceTransmissionSchedule(t *testing.T) { testTransmissionSchedule(t, "2s", "allAtOnce") } -func Test_OneAtATimeTransmissionSchedule(t *testing.T) { +func TestIntegration_Shared_OneAtATimeTransmissionSchedule(t *testing.T) { testTransmissionSchedule(t, "2s", "oneAtATime") } diff --git a/core/capabilities/integration_tests/keystone/llo_feed_test.go b/core/capabilities/integration_tests/keystone/llo_feed_test.go index b2ef9635eae..a3864415e61 100644 --- a/core/capabilities/integration_tests/keystone/llo_feed_test.go +++ b/core/capabilities/integration_tests/keystone/llo_feed_test.go @@ -25,7 +25,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/llo/cre" ) -func Test_runLLOWorkflow(t *testing.T) { +func TestIntegration_Shared_runLLOWorkflow(t *testing.T) { ctx := t.Context() lggr := logger.Test(t) diff --git a/core/capabilities/launcher_test.go b/core/capabilities/launcher_test.go index c2fd5fb390c..03d14facc04 100644 --- a/core/capabilities/launcher_test.go +++ b/core/capabilities/launcher_test.go @@ -71,7 +71,7 @@ func (m *mockCapability) UnregisterFromWorkflow(ctx context.Context, request cap return nil } -func TestLauncher(t *testing.T) { +func TestUnit_Launcher(t *testing.T) { t.Run("OK-wires_up_external_capabilities", func(t *testing.T) { lggr := logger.Test(t) registry := NewRegistry(lggr) @@ -279,7 +279,7 @@ func newTriggerEventMsg(t *testing.T, }, triggerEventValue } -func TestLauncher_RemoteTriggerModeAggregatorShim(t *testing.T) { +func TestUnit_Launcher_RemoteTriggerModeAggregatorShim(t *testing.T) { ctx := t.Context() lggr := logger.Test(t) registry := NewRegistry(lggr) @@ -388,7 +388,7 @@ func TestLauncher_RemoteTriggerModeAggregatorShim(t *testing.T) { require.Equal(t, response.Event.Outputs, triggerEventValue) } -func TestSyncer_IgnoresCapabilitiesForPrivateDON(t *testing.T) { +func TestUnit_Syncer_IgnoresCapabilitiesForPrivateDON(t *testing.T) { lggr := logger.Test(t) registry := NewRegistry(lggr) dispatcher := remoteMocks.NewDispatcher(t) @@ -435,7 +435,7 @@ func TestSyncer_IgnoresCapabilitiesForPrivateDON(t *testing.T) { assert.Empty(t, launcher.subServices) } -func TestLauncher_WiresUpClientsForPublicWorkflowDON(t *testing.T) { +func TestUnit_Launcher_WiresUpClientsForPublicWorkflowDON(t *testing.T) { lggr := logger.Test(t) registry := NewRegistry(lggr) dispatcher := remoteMocks.NewDispatcher(t) @@ -496,7 +496,7 @@ func TestLauncher_WiresUpClientsForPublicWorkflowDON(t *testing.T) { require.NoError(t, err) } -func TestLauncher_WiresUpClientsForPublicWorkflowDONButIgnoresPrivateCapabilities(t *testing.T) { +func TestUnit_Launcher_WiresUpClientsForPublicWorkflowDONButIgnoresPrivateCapabilities(t *testing.T) { lggr := logger.Test(t) registry := NewRegistry(lggr) dispatcher := remoteMocks.NewDispatcher(t) @@ -551,7 +551,7 @@ func TestLauncher_WiresUpClientsForPublicWorkflowDONButIgnoresPrivateCapabilitie require.NoError(t, err) } -func TestLauncher_SucceedsEvenIfDispatcherAlreadyHasReceiver(t *testing.T) { +func TestUnit_Launcher_SucceedsEvenIfDispatcherAlreadyHasReceiver(t *testing.T) { lggr := logger.Test(t) registry := NewRegistry(lggr) dispatcher := remoteMocks.NewDispatcher(t) @@ -617,7 +617,7 @@ func TestLauncher_SucceedsEvenIfDispatcherAlreadyHasReceiver(t *testing.T) { require.NoError(t, err) } -func TestLauncher_SuccessfullyFilterDon2Don(t *testing.T) { +func TestUnit_Launcher_SuccessfullyFilterDon2Don(t *testing.T) { lggr := logger.Test(t) registry := NewRegistry(lggr) dispatcher := remoteMocks.NewDispatcher(t) @@ -710,7 +710,7 @@ func TestLauncher_SuccessfullyFilterDon2Don(t *testing.T) { require.NoError(t, err) } -func TestLauncher_DonPairsToUpdate(t *testing.T) { +func TestUnit_Launcher_DonPairsToUpdate(t *testing.T) { registry := NewRegistry(logger.Test(t)) dispatcher := remoteMocks.NewDispatcher(t) @@ -768,7 +768,7 @@ func TestLauncher_DonPairsToUpdate(t *testing.T) { require.Equal(t, p2ptypes.DonPair{localRegistry.IDsToDONs[wfDONID].DON, localRegistry.IDsToDONs[mixedDONID].DON}, res[1]) } -func TestLauncher_DonPairsToUpdate_SkipsDifferentFamilies(t *testing.T) { +func TestUnit_Launcher_DonPairsToUpdate_SkipsDifferentFamilies(t *testing.T) { registry := NewRegistry(logger.Test(t)) dispatcher := remoteMocks.NewDispatcher(t) @@ -822,7 +822,7 @@ func TestLauncher_DonPairsToUpdate_SkipsDifferentFamilies(t *testing.T) { require.Equal(t, p2ptypes.DonPair{localRegistry.IDsToDONs[registrysyncer.DonID(wfDONID)].DON, localRegistry.IDsToDONs[registrysyncer.DonID(capDONZoneAID)].DON}, res[0]) } -func TestLauncher_V2CapabilitiesAddViaCombinedClient(t *testing.T) { +func TestUnit_Launcher_V2CapabilitiesAddViaCombinedClient(t *testing.T) { lggr := logger.Test(t) registry := NewRegistry(lggr) dispatcher := remoteMocks.NewDispatcher(t) @@ -944,7 +944,7 @@ func TestLauncher_V2CapabilitiesAddViaCombinedClient(t *testing.T) { assert.Len(t, capInfo.DON.Members, 5) } -func TestLauncher_V2CapabilitiesExposeRemotely(t *testing.T) { +func TestUnit_Launcher_V2CapabilitiesExposeRemotely(t *testing.T) { lggr := logger.Test(t) registry := NewRegistry(lggr) fullTriggerCapID := "streams-trigger@1.0.0" diff --git a/core/capabilities/remote/aggregation/default_mode_test.go b/core/capabilities/remote/aggregation/default_mode_test.go index 2121fdcadce..1160fae7a14 100644 --- a/core/capabilities/remote/aggregation/default_mode_test.go +++ b/core/capabilities/remote/aggregation/default_mode_test.go @@ -15,7 +15,7 @@ var ( triggerEvent2 = map[string]any{"event": "triggerEvent2"} ) -func TestDefaultModeAggregator_Aggregate(t *testing.T) { +func TestUnit_DefaultModeAggregator_Aggregate(t *testing.T) { val, err := values.NewMap(triggerEvent1) require.NoError(t, err) capResponse1 := commoncap.TriggerResponse{ diff --git a/core/capabilities/remote/aggregation/signed_report_test.go b/core/capabilities/remote/aggregation/signed_report_test.go index cab27fd07de..3b2ab20528a 100644 --- a/core/capabilities/remote/aggregation/signed_report_test.go +++ b/core/capabilities/remote/aggregation/signed_report_test.go @@ -25,7 +25,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" ) -func TestSignedReportAggregator_Aggregate(t *testing.T) { +func TestUnit_SignedReportAggregator_Aggregate(t *testing.T) { t.Parallel() // Setup test keys diff --git a/core/capabilities/remote/combined_client_test.go b/core/capabilities/remote/combined_client_test.go index 02ebfa2d5cc..00dbef37f95 100644 --- a/core/capabilities/remote/combined_client_test.go +++ b/core/capabilities/remote/combined_client_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" ) -func TestCombinedClient_Info(t *testing.T) { +func TestUnit_CombinedClient_Info(t *testing.T) { ctx := testutils.Context(t) info := createTestCapabilityInfo("test-capability-info", commoncap.CapabilityTypeAction) client := remote.NewCombinedClient(info) @@ -23,7 +23,7 @@ func TestCombinedClient_Info(t *testing.T) { assert.Equal(t, info, returnedInfo) } -func TestCombinedClient_RegisterTrigger_Success(t *testing.T) { +func TestUnit_CombinedClient_RegisterTrigger_Success(t *testing.T) { ctx := testutils.Context(t) info := createTestCapabilityInfo("test-trigger", commoncap.CapabilityTypeTrigger) client := remote.NewCombinedClient(info) @@ -46,7 +46,7 @@ func TestCombinedClient_RegisterTrigger_Success(t *testing.T) { assert.Equal(t, responseChan, result) } -func TestCombinedClient_RegisterTrigger_MethodNotDefined(t *testing.T) { +func TestUnit_CombinedClient_RegisterTrigger_MethodNotDefined(t *testing.T) { ctx := testutils.Context(t) info := createTestCapabilityInfo("test-trigger", commoncap.CapabilityTypeTrigger) client := remote.NewCombinedClient(info) @@ -62,7 +62,7 @@ func TestCombinedClient_RegisterTrigger_MethodNotDefined(t *testing.T) { assert.Contains(t, err.Error(), "method undefined-method not defined") } -func TestCombinedClient_RegisterTrigger_ErrorFromSubscriber(t *testing.T) { +func TestUnit_CombinedClient_RegisterTrigger_ErrorFromSubscriber(t *testing.T) { ctx := testutils.Context(t) info := createTestCapabilityInfo("test-trigger", commoncap.CapabilityTypeTrigger) client := remote.NewCombinedClient(info) @@ -86,7 +86,7 @@ func TestCombinedClient_RegisterTrigger_ErrorFromSubscriber(t *testing.T) { assert.Equal(t, expectedError, err) } -func TestCombinedClient_UnregisterTrigger_Success(t *testing.T) { +func TestUnit_CombinedClient_UnregisterTrigger_Success(t *testing.T) { ctx := testutils.Context(t) info := createTestCapabilityInfo("test-trigger", commoncap.CapabilityTypeTrigger) client := remote.NewCombinedClient(info) @@ -106,7 +106,7 @@ func TestCombinedClient_UnregisterTrigger_Success(t *testing.T) { require.NoError(t, err) } -func TestCombinedClient_UnregisterTrigger_MethodNotDefined(t *testing.T) { +func TestUnit_CombinedClient_UnregisterTrigger_MethodNotDefined(t *testing.T) { ctx := testutils.Context(t) info := createTestCapabilityInfo("test-trigger", commoncap.CapabilityTypeTrigger) client := remote.NewCombinedClient(info) @@ -121,7 +121,7 @@ func TestCombinedClient_UnregisterTrigger_MethodNotDefined(t *testing.T) { assert.Contains(t, err.Error(), "method undefined-method not defined") } -func TestCombinedClient_UnregisterTrigger_ErrorFromSubscriber(t *testing.T) { +func TestUnit_CombinedClient_UnregisterTrigger_ErrorFromSubscriber(t *testing.T) { ctx := testutils.Context(t) info := createTestCapabilityInfo("test-trigger", commoncap.CapabilityTypeTrigger) client := remote.NewCombinedClient(info) @@ -144,7 +144,7 @@ func TestCombinedClient_UnregisterTrigger_ErrorFromSubscriber(t *testing.T) { assert.Equal(t, expectedError, err) } -func TestCombinedClient_RegisterToWorkflow_NotSupported(t *testing.T) { +func TestUnit_CombinedClient_RegisterToWorkflow_NotSupported(t *testing.T) { ctx := testutils.Context(t) info := createTestCapabilityInfo("test-capability", commoncap.CapabilityTypeTrigger) client := remote.NewCombinedClient(info) @@ -160,7 +160,7 @@ func TestCombinedClient_RegisterToWorkflow_NotSupported(t *testing.T) { assert.Contains(t, err.Error(), "RegisterToWorkflow is not supported by remote capabilities") } -func TestCombinedClient_UnregisterFromWorkflow_NotSupported(t *testing.T) { +func TestUnit_CombinedClient_UnregisterFromWorkflow_NotSupported(t *testing.T) { ctx := testutils.Context(t) info := createTestCapabilityInfo("test-capability", commoncap.CapabilityTypeTrigger) client := remote.NewCombinedClient(info) @@ -176,7 +176,7 @@ func TestCombinedClient_UnregisterFromWorkflow_NotSupported(t *testing.T) { assert.Contains(t, err.Error(), "UnregisterFromWorkflow is not supported by remote capabilities") } -func TestCombinedClient_Execute_Success(t *testing.T) { +func TestUnit_CombinedClient_Execute_Success(t *testing.T) { ctx := testutils.Context(t) info := createTestCapabilityInfo("test-executable", commoncap.CapabilityTypeAction) client := remote.NewCombinedClient(info) @@ -207,7 +207,7 @@ func TestCombinedClient_Execute_Success(t *testing.T) { assert.Equal(t, expectedResponse, result) } -func TestCombinedClient_Execute_MethodNotDefined(t *testing.T) { +func TestUnit_CombinedClient_Execute_MethodNotDefined(t *testing.T) { ctx := testutils.Context(t) info := createTestCapabilityInfo("test-executable", commoncap.CapabilityTypeAction) client := remote.NewCombinedClient(info) @@ -228,7 +228,7 @@ func TestCombinedClient_Execute_MethodNotDefined(t *testing.T) { assert.Contains(t, err.Error(), "method undefined-method not defined") } -func TestCombinedClient_Execute_ErrorFromExecutable(t *testing.T) { +func TestUnit_CombinedClient_Execute_ErrorFromExecutable(t *testing.T) { ctx := testutils.Context(t) info := createTestCapabilityInfo("test-executable", commoncap.CapabilityTypeAction) client := remote.NewCombinedClient(info) @@ -258,7 +258,7 @@ func TestCombinedClient_Execute_ErrorFromExecutable(t *testing.T) { assert.Equal(t, expectedError, err) } -func TestCombinedClient_SetTriggerSubscriber(t *testing.T) { +func TestUnit_CombinedClient_SetTriggerSubscriber(t *testing.T) { info := createTestCapabilityInfo("test-capability", commoncap.CapabilityTypeTrigger) client := remote.NewCombinedClient(info) @@ -280,7 +280,7 @@ func TestCombinedClient_SetTriggerSubscriber(t *testing.T) { require.NoError(t, err) } -func TestCombinedClient_SetExecutableClient(t *testing.T) { +func TestUnit_CombinedClient_SetExecutableClient(t *testing.T) { info := createTestCapabilityInfo("test-capability", commoncap.CapabilityTypeAction) client := remote.NewCombinedClient(info) @@ -310,7 +310,7 @@ func TestCombinedClient_SetExecutableClient(t *testing.T) { require.NoError(t, err) } -func TestCombinedClient_MultipleMethodsAndCapabilities(t *testing.T) { +func TestUnit_CombinedClient_MultipleMethodsAndCapabilities(t *testing.T) { ctx := testutils.Context(t) info := createTestCapabilityInfo("test-multi-capability", commoncap.CapabilityTypeAction) client := remote.NewCombinedClient(info) diff --git a/core/capabilities/remote/dispatcher_test.go b/core/capabilities/remote/dispatcher_test.go index b97250331d7..cd9cd955c73 100644 --- a/core/capabilities/remote/dispatcher_test.go +++ b/core/capabilities/remote/dispatcher_test.go @@ -79,7 +79,7 @@ func (c testConfig) SendToSharedPeer() bool { return c.sendToSharedPeer } -func TestDispatcher_CleanStartClose(t *testing.T) { +func TestUnit_Dispatcher_CleanStartClose(t *testing.T) { lggr := logger.Test(t) ctx := testutils.Context(t) peer := mocks.NewPeer(t) @@ -98,7 +98,7 @@ func TestDispatcher_CleanStartClose(t *testing.T) { require.NoError(t, dispatcher.Close()) } -func TestDispatcher_Receive(t *testing.T) { +func TestUnit_Dispatcher_Receive(t *testing.T) { lggr := logger.Test(t) ctx := testutils.Context(t) privKey1, peerID1 := newKeyPair(t) @@ -143,7 +143,7 @@ func TestDispatcher_Receive(t *testing.T) { require.NoError(t, dispatcher.Close()) } -func TestDispatcher_ReceiveForMethod(t *testing.T) { +func TestUnit_Dispatcher_ReceiveForMethod(t *testing.T) { lggr := logger.Test(t) ctx := testutils.Context(t) privKey1, peerID1 := newKeyPair(t) @@ -195,7 +195,7 @@ func TestDispatcher_ReceiveForMethod(t *testing.T) { require.NoError(t, dispatcher.Close()) } -func TestDispatcher_RespondWithError(t *testing.T) { +func TestUnit_Dispatcher_RespondWithError(t *testing.T) { lggr := logger.Test(t) ctx := testutils.Context(t) privKey1, peerID1 := newKeyPair(t) @@ -229,7 +229,7 @@ func TestDispatcher_RespondWithError(t *testing.T) { require.NoError(t, dispatcher.Close()) } -func TestDispatcher_ReceiveFromBothPeers(t *testing.T) { +func TestUnit_Dispatcher_ReceiveFromBothPeers(t *testing.T) { lggr := logger.Test(t) ctx := testutils.Context(t) privKey1, peerID1 := newKeyPair(t) @@ -270,7 +270,7 @@ func TestDispatcher_ReceiveFromBothPeers(t *testing.T) { require.NoError(t, dispatcher.Close()) } -func TestDispatcher_SendToSharedPeer(t *testing.T) { +func TestUnit_Dispatcher_SendToSharedPeer(t *testing.T) { lggr := logger.Test(t) ctx := testutils.Context(t) _, peerID1 := newKeyPair(t) diff --git a/core/capabilities/remote/executable/client_test.go b/core/capabilities/remote/executable/client_test.go index fe5b52879cc..430969d82b2 100644 --- a/core/capabilities/remote/executable/client_test.go +++ b/core/capabilities/remote/executable/client_test.go @@ -32,7 +32,7 @@ const ( workflowOwnerID = "0xAA" ) -func Test_Client_DonTopologies(t *testing.T) { +func TestUnit_Client_DonTopologies(t *testing.T) { tests.SkipFlakey(t, "https://smartcontract-it.atlassian.net/browse/CAPPL-322") ctx := testutils.Context(t) @@ -83,7 +83,7 @@ func Test_Client_DonTopologies(t *testing.T) { } } -func Test_Client_TransmissionSchedules(t *testing.T) { +func TestUnit_Client_TransmissionSchedules(t *testing.T) { tests.SkipFlakey(t, "https://smartcontract-it.atlassian.net/browse/DX-104") ctx := testutils.Context(t) @@ -143,7 +143,7 @@ func Test_Client_TransmissionSchedules(t *testing.T) { }) } -func Test_Client_TimesOutIfInsufficientCapabilityPeerResponses(t *testing.T) { +func TestUnit_Client_TimesOutIfInsufficientCapabilityPeerResponses(t *testing.T) { ctx := testutils.Context(t) responseTest := func(t *testing.T, response commoncap.CapabilityResponse, responseError error) { @@ -170,7 +170,7 @@ func Test_Client_TimesOutIfInsufficientCapabilityPeerResponses(t *testing.T) { }) } -func Test_Client_ContextCanceledBeforeQuorumReached(t *testing.T) { +func TestUnit_Client_ContextCanceledBeforeQuorumReached(t *testing.T) { ctx, cancel := context.WithCancel(testutils.Context(t)) responseTest := func(t *testing.T, response commoncap.CapabilityResponse, responseError error) { @@ -371,7 +371,7 @@ func (t *clientTestServer) sendResponse(messageID string, responseErr error, } } -func TestClient_SetConfig(t *testing.T) { +func TestUnit_Client_SetConfig(t *testing.T) { lggr := logger.Test(t) capabilityID := "test_capability@1.0.0" @@ -460,7 +460,7 @@ func TestClient_SetConfig(t *testing.T) { }) } -func TestClient_SetConfig_StartClose(t *testing.T) { +func TestUnit_Client_SetConfig_StartClose(t *testing.T) { ctx := testutils.Context(t) lggr := logger.Test(t) capabilityID := "test_capability@1.0.0" diff --git a/core/capabilities/remote/executable/endtoend_test.go b/core/capabilities/remote/executable/endtoend_test.go index 996c0ca4657..f6c6765ed5d 100644 --- a/core/capabilities/remote/executable/endtoend_test.go +++ b/core/capabilities/remote/executable/endtoend_test.go @@ -27,7 +27,7 @@ import ( p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" ) -func Test_RemoteExecutableCapability_ExecutionNotBlockedBySlowCapabilityExecution_AllAtOnce(t *testing.T) { +func TestUnit_RemoteExecutableCapability_ExecutionNotBlockedBySlowCapabilityExecution_AllAtOnce(t *testing.T) { ctx := testutils.Context(t) workflowIDToPause := map[string]time.Duration{} @@ -90,7 +90,7 @@ func Test_RemoteExecutableCapability_ExecutionNotBlockedBySlowCapabilityExecutio }, 1*time.Minute, 10*time.Millisecond, "require 10 callbacks from 1s delay capability") } -func Test_RemoteExecutableCapability_ExecutionNotBlockedBySlowCapabilityExecution_OneAtATime(t *testing.T) { +func TestUnit_RemoteExecutableCapability_ExecutionNotBlockedBySlowCapabilityExecution_OneAtATime(t *testing.T) { ctx := testutils.Context(t) workflowIDToPause := map[string]time.Duration{} @@ -153,7 +153,7 @@ func Test_RemoteExecutableCapability_ExecutionNotBlockedBySlowCapabilityExecutio }, 1*time.Minute, 10*time.Millisecond, "require 10 callbacks from 1s delay capability") } -func Test_RemoteExecutableCapability_TransmissionSchedules(t *testing.T) { +func TestUnit_RemoteExecutableCapability_TransmissionSchedules(t *testing.T) { tests.SkipFlakey(t, "https://smartcontract-it.atlassian.net/browse/DX-108") ctx := testutils.Context(t) @@ -193,7 +193,7 @@ func Test_RemoteExecutableCapability_TransmissionSchedules(t *testing.T) { testRemoteExecutableCapability(ctx, t, capability, 10, 9, timeOut, 10, 9, timeOut, method, true) } -func Test_RemoteExecutionCapability_CapabilityError(t *testing.T) { +func TestUnit_RemoteExecutionCapability_CapabilityError(t *testing.T) { ctx := testutils.Context(t) capability := &TestErrorCapability{} @@ -217,7 +217,7 @@ func Test_RemoteExecutionCapability_CapabilityError(t *testing.T) { } } -func Test_RemoteExecutableCapability_RandomCapabilityError(t *testing.T) { +func TestUnit_RemoteExecutableCapability_RandomCapabilityError(t *testing.T) { ctx := testutils.Context(t) capability := &TestRandomErrorCapability{} diff --git a/core/capabilities/remote/executable/hasher_test.go b/core/capabilities/remote/executable/hasher_test.go index 10f49267dfc..867834822fe 100644 --- a/core/capabilities/remote/executable/hasher_test.go +++ b/core/capabilities/remote/executable/hasher_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types" ) -func TestWriteReportExcludeSignaturesHasher_Hash(t *testing.T) { +func TestUnit_WriteReportExcludeSignaturesHasher_Hash(t *testing.T) { req1a := getRequest(t, []byte("testdata"), [][]byte{[]byte("sig1"), []byte("sig2")}) req1b := getRequest(t, []byte("testdata"), [][]byte{[]byte("sig3"), []byte("sig4")}) req2 := getRequest(t, []byte("otherdata"), [][]byte{[]byte("sig1"), []byte("sig2")}) @@ -30,7 +30,7 @@ func TestWriteReportExcludeSignaturesHasher_Hash(t *testing.T) { require.NotEqual(t, hash1a, hash2) // different data, same signatures } -func TestWriteReportExcludeSignaturesHasher_Hash_NilPayload(t *testing.T) { +func TestUnit_WriteReportExcludeSignaturesHasher_Hash_NilPayload(t *testing.T) { nilReq := capabilities.CapabilityRequest{Payload: nil} nilReqBytes, err := pb.MarshalCapabilityRequest(nilReq) require.NoError(t, err) @@ -43,7 +43,7 @@ func TestWriteReportExcludeSignaturesHasher_Hash_NilPayload(t *testing.T) { require.Contains(t, err.Error(), "capability request payload is nil") } -func TestWriteReportExcludeSignaturesHasher_Hash_NilReport(t *testing.T) { +func TestUnit_WriteReportExcludeSignaturesHasher_Hash_NilReport(t *testing.T) { nilReq := &evmcappb.WriteReportRequest{Report: nil} nilPb, err := anypb.New(nilReq) require.NoError(t, err) @@ -60,7 +60,7 @@ func TestWriteReportExcludeSignaturesHasher_Hash_NilReport(t *testing.T) { require.Contains(t, err.Error(), "WriteReportRequest.Report is nil") } -func TestWriteReportExcludeSignaturesHasher_Hash_InvalidPayload(t *testing.T) { +func TestUnit_WriteReportExcludeSignaturesHasher_Hash_InvalidPayload(t *testing.T) { // Test with completely invalid payload that cannot be unmarshaled msgBody := &types.MessageBody{ Payload: []byte("invalid protobuf data"), @@ -72,7 +72,7 @@ func TestWriteReportExcludeSignaturesHasher_Hash_InvalidPayload(t *testing.T) { require.Contains(t, err.Error(), "failed to unmarshal capability request") } -func TestSimpleHasher_ExcludesSpendLimits(t *testing.T) { +func TestUnit_SimpleHasher_ExcludesSpendLimits(t *testing.T) { // Create two requests with identical payloads but different SpendLimits req1 := getRequestWithSpendLimits(t, []byte("testdata"), []capabilities.SpendLimit{ {SpendType: "gas", Limit: "1000"}, @@ -99,7 +99,7 @@ func TestSimpleHasher_ExcludesSpendLimits(t *testing.T) { require.NotEqual(t, hash1, hash3) // different data should produce different hash } -func TestWriteReportExcludeSignaturesHasher_ExcludesSpendLimits(t *testing.T) { +func TestUnit_WriteReportExcludeSignaturesHasher_ExcludesSpendLimits(t *testing.T) { // Create two requests with identical payloads but different SpendLimits req1 := getWriteReportRequestWithSpendLimits(t, []byte("testdata"), [][]byte{[]byte("sig1"), []byte("sig2")}, []capabilities.SpendLimit{ {SpendType: "gas", Limit: "1000"}, diff --git a/core/capabilities/remote/executable/parallel_executor_test.go b/core/capabilities/remote/executable/parallel_executor_test.go index f7eb4535c4e..a117097921f 100644 --- a/core/capabilities/remote/executable/parallel_executor_test.go +++ b/core/capabilities/remote/executable/parallel_executor_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" ) -func Test_CancellingContext_StopsTask(t *testing.T) { +func TestUnit_CancellingContext_StopsTask(t *testing.T) { tp := newParallelExecutor(10) servicetest.Run(t, tp) @@ -44,7 +44,7 @@ func Test_CancellingContext_StopsTask(t *testing.T) { }, 10*time.Second, 10*time.Millisecond) } -func Test_ExecuteRequestTimesOutWhenParallelExecutionLimitReached(t *testing.T) { +func TestUnit_ExecuteRequestTimesOutWhenParallelExecutionLimitReached(t *testing.T) { tp := newParallelExecutor(3) servicetest.Run(t, tp) @@ -63,7 +63,7 @@ func Test_ExecuteRequestTimesOutWhenParallelExecutionLimitReached(t *testing.T) require.ErrorIs(t, err, context.DeadlineExceeded) } -func Test_ExecutingMultipleTasksInParallel(t *testing.T) { +func TestUnit_ExecutingMultipleTasksInParallel(t *testing.T) { tp := newParallelExecutor(10) servicetest.Run(t, tp) @@ -82,7 +82,7 @@ func Test_ExecutingMultipleTasksInParallel(t *testing.T) { }, 10*time.Second, 10*time.Millisecond) } -func Test_StopsExecutingMultipleParallelTasksWhenClosed(t *testing.T) { +func TestUnit_StopsExecutingMultipleParallelTasksWhenClosed(t *testing.T) { tp := newParallelExecutor(10) var counter int32 t.Cleanup(func() { diff --git a/core/capabilities/remote/executable/request/client_request_test.go b/core/capabilities/remote/executable/request/client_request_test.go index 1ecb6bad722..33975985322 100644 --- a/core/capabilities/remote/executable/request/client_request_test.go +++ b/core/capabilities/remote/executable/request/client_request_test.go @@ -33,7 +33,7 @@ const ( stepRef1 = "stepRef1" ) -func Test_ClientRequest_MessageValidation(t *testing.T) { +func TestUnit_ClientRequest_MessageValidation(t *testing.T) { numWorkflowPeers := 2 workflowPeers := make([]p2ptypes.PeerID, numWorkflowPeers) for i := range numWorkflowPeers { diff --git a/core/capabilities/remote/executable/request/server_request_test.go b/core/capabilities/remote/executable/request/server_request_test.go index aad90136892..7d4ed1666cf 100644 --- a/core/capabilities/remote/executable/request/server_request_test.go +++ b/core/capabilities/remote/executable/request/server_request_test.go @@ -21,7 +21,7 @@ import ( p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" ) -func Test_ServerRequest_MessageValidation(t *testing.T) { +func TestUnit_ServerRequest_MessageValidation(t *testing.T) { lggr := logger.Test(t) capability := TestCapability{} capabilityPeerID := NewP2PPeerID(t) diff --git a/core/capabilities/remote/executable/server_test.go b/core/capabilities/remote/executable/server_test.go index 63a2c9753b2..6470efe253b 100644 --- a/core/capabilities/remote/executable/server_test.go +++ b/core/capabilities/remote/executable/server_test.go @@ -27,7 +27,7 @@ import ( p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" ) -func Test_Server_Execute_SlowCapabilityExecutionDoesNotImpactSubsequentCall(t *testing.T) { +func TestUnit_Server_Execute_SlowCapabilityExecutionDoesNotImpactSubsequentCall(t *testing.T) { ctx := testutils.Context(t) numCapabilityPeers := 4 @@ -80,7 +80,7 @@ func Test_Server_Execute_SlowCapabilityExecutionDoesNotImpactSubsequentCall(t *t closeServices(t, srvcs) } -func Test_Server_DefaultExcludedAttributes(t *testing.T) { +func TestUnit_Server_DefaultExcludedAttributes(t *testing.T) { ctx := testutils.Context(t) numCapabilityPeers := 4 @@ -116,7 +116,7 @@ func Test_Server_DefaultExcludedAttributes(t *testing.T) { closeServices(t, srvcs) } -func Test_Server_ExcludesNonDeterministicInputAttributes(t *testing.T) { +func TestUnit_Server_ExcludesNonDeterministicInputAttributes(t *testing.T) { ctx := testutils.Context(t) numCapabilityPeers := 4 @@ -152,7 +152,7 @@ func Test_Server_ExcludesNonDeterministicInputAttributes(t *testing.T) { closeServices(t, srvcs) } -func Test_Server_Execute_RespondsAfterSufficientRequests(t *testing.T) { +func TestUnit_Server_Execute_RespondsAfterSufficientRequests(t *testing.T) { ctx := testutils.Context(t) numCapabilityPeers := 4 @@ -179,7 +179,7 @@ func Test_Server_Execute_RespondsAfterSufficientRequests(t *testing.T) { closeServices(t, srvcs) } -func Test_Server_InsufficientCallers(t *testing.T) { +func TestUnit_Server_InsufficientCallers(t *testing.T) { ctx := testutils.Context(t) numCapabilityPeers := 4 @@ -206,7 +206,7 @@ func Test_Server_InsufficientCallers(t *testing.T) { closeServices(t, srvcs) } -func Test_Server_CapabilityError(t *testing.T) { +func TestUnit_Server_CapabilityError(t *testing.T) { ctx := testutils.Context(t) numCapabilityPeers := 4 @@ -233,7 +233,7 @@ func Test_Server_CapabilityError(t *testing.T) { closeServices(t, srvcs) } -func Test_Server_V2Request_ExcludesNonDeterministicInputAttributes(t *testing.T) { +func TestUnit_Server_V2Request_ExcludesNonDeterministicInputAttributes(t *testing.T) { ctx := testutils.Context(t) numCapabilityPeers := 4 @@ -443,7 +443,7 @@ func (r *serverTestClient) Execute(ctx context.Context, req commoncap.Capability return nil, nil } -func Test_Server_SetConfig(t *testing.T) { +func TestUnit_Server_SetConfig(t *testing.T) { lggr := logger.Test(t) peerID := NewP2PPeerID(t) @@ -570,7 +570,7 @@ func Test_Server_SetConfig(t *testing.T) { }) } -func Test_Server_SetConfig_ConfigReplacement(t *testing.T) { +func TestUnit_Server_SetConfig_ConfigReplacement(t *testing.T) { lggr := logger.Test(t) peerID := NewP2PPeerID(t) broker := newTestAsyncMessageBroker(t, 100) @@ -627,7 +627,7 @@ func Test_Server_SetConfig_ConfigReplacement(t *testing.T) { require.NoError(t, err) } -func Test_Server_SetConfig_StartValidation(t *testing.T) { +func TestUnit_Server_SetConfig_StartValidation(t *testing.T) { ctx := testutils.Context(t) t.Run("Start without SetConfig should fail", func(t *testing.T) { @@ -688,7 +688,7 @@ func Test_Server_SetConfig_StartValidation(t *testing.T) { }) } -func Test_Server_SetConfig_DONMembershipChange(t *testing.T) { +func TestUnit_Server_SetConfig_DONMembershipChange(t *testing.T) { ctx := testutils.Context(t) lggr := logger.Test(t) peerID := NewP2PPeerID(t) @@ -776,7 +776,7 @@ func Test_Server_SetConfig_DONMembershipChange(t *testing.T) { require.NoError(t, broker.Close()) } -func Test_Server_SetConfig_ShutdownRaces(t *testing.T) { +func TestUnit_Server_SetConfig_ShutdownRaces(t *testing.T) { ctx := testutils.Context(t) lggr := logger.Test(t) peerID := NewP2PPeerID(t) @@ -841,7 +841,7 @@ func Test_Server_SetConfig_ShutdownRaces(t *testing.T) { // Test passes if no panic occurs } -func Test_Server_Execute_WithConcurrentSetConfig(t *testing.T) { +func TestUnit_Server_Execute_WithConcurrentSetConfig(t *testing.T) { ctx := testutils.Context(t) lggr := logger.Test(t) numWorkflowPeers := 4 diff --git a/core/capabilities/remote/messagecache/message_cache_test.go b/core/capabilities/remote/messagecache/message_cache_test.go index 2d059adef32..95dad4edc84 100644 --- a/core/capabilities/remote/messagecache/message_cache_test.go +++ b/core/capabilities/remote/messagecache/message_cache_test.go @@ -16,7 +16,7 @@ const ( payloadA = "payloadA" ) -func TestMessageCache_InsertReady(t *testing.T) { +func TestUnit_MessageCache_InsertReady(t *testing.T) { cache := messagecache.NewMessageCache[string, string]() // not ready with one message @@ -42,7 +42,7 @@ func TestMessageCache_InsertReady(t *testing.T) { require.False(t, ready) } -func TestMessageCache_DeleteOlderThan(t *testing.T) { +func TestUnit_MessageCache_DeleteOlderThan(t *testing.T) { cache := messagecache.NewMessageCache[string, string]() ts := cache.Insert(eventID1, peerID1, 100, []byte(payloadA)) diff --git a/core/capabilities/remote/trigger_publisher_test.go b/core/capabilities/remote/trigger_publisher_test.go index bad3b4cd905..5b210b93410 100644 --- a/core/capabilities/remote/trigger_publisher_test.go +++ b/core/capabilities/remote/trigger_publisher_test.go @@ -20,7 +20,7 @@ import ( const capID = "cap_id@1" -func TestTriggerPublisher_Register(t *testing.T) { +func TestUnit_TriggerPublisher_Register(t *testing.T) { ctx := testutils.Context(t) capabilityDONID, workflowDONID := uint32(1), uint32(2) @@ -41,7 +41,7 @@ func TestTriggerPublisher_Register(t *testing.T) { require.NoError(t, publisher.Close()) } -func TestTriggerPublisher_ReceiveTriggerEvents_NoBatching(t *testing.T) { +func TestUnit_TriggerPublisher_ReceiveTriggerEvents_NoBatching(t *testing.T) { ctx := testutils.Context(t) capabilityDONID, workflowDONID := uint32(1), uint32(2) @@ -61,7 +61,7 @@ func TestTriggerPublisher_ReceiveTriggerEvents_NoBatching(t *testing.T) { require.NoError(t, publisher.Close()) } -func TestTriggerPublisher_ReceiveTriggerEvents_BatchingEnabled(t *testing.T) { +func TestUnit_TriggerPublisher_ReceiveTriggerEvents_BatchingEnabled(t *testing.T) { ctx := testutils.Context(t) capabilityDONID, workflowDONID := uint32(1), uint32(2) @@ -99,7 +99,7 @@ func TestTriggerPublisher_ReceiveTriggerEvents_BatchingEnabled(t *testing.T) { require.NoError(t, publisher.Close()) } -func TestTriggerPublisher_SetConfig_Basic(t *testing.T) { +func TestUnit_TriggerPublisher_SetConfig_Basic(t *testing.T) { t.Parallel() lggr := logger.Test(t) capInfo := commoncap.CapabilityInfo{ diff --git a/core/capabilities/remote/trigger_subscriber_test.go b/core/capabilities/remote/trigger_subscriber_test.go index 16223504557..7644c501d03 100644 --- a/core/capabilities/remote/trigger_subscriber_test.go +++ b/core/capabilities/remote/trigger_subscriber_test.go @@ -30,7 +30,7 @@ var ( triggerEvent1 = map[string]any{"event": "triggerEvent1"} ) -func TestTriggerSubscriber_RegisterAndReceive(t *testing.T) { +func TestUnit_TriggerSubscriber_RegisterAndReceive(t *testing.T) { t.Parallel() lggr := logger.Test(t) capInfo, capDon, workflowDon := buildTwoTestDONs(t, 1, 1) @@ -79,7 +79,7 @@ func TestTriggerSubscriber_RegisterAndReceive(t *testing.T) { require.Equal(t, response.Event.Outputs, triggerEventValue) } -func TestTriggerSubscriber_CorrectEventExpiryCheck(t *testing.T) { +func TestUnit_TriggerSubscriber_CorrectEventExpiryCheck(t *testing.T) { t.Parallel() lggr := logger.Test(t) capInfo, capDon, workflowDon := buildTwoTestDONs(t, 3, 1) @@ -144,7 +144,7 @@ func TestTriggerSubscriber_CorrectEventExpiryCheck(t *testing.T) { require.Equal(t, response.Event.Outputs, triggerEventValue) } -func TestTriggerSubscriber_SetConfig_Basic(t *testing.T) { +func TestUnit_TriggerSubscriber_SetConfig_Basic(t *testing.T) { t.Parallel() lggr := logger.Test(t) capInfo, capDon, workflowDon := buildTwoTestDONs(t, 3, 1) @@ -209,7 +209,7 @@ func TestTriggerSubscriber_SetConfig_Basic(t *testing.T) { }) } -func TestTriggerSubscriber_RegistrationLoopWithConfigUpdate(t *testing.T) { +func TestUnit_TriggerSubscriber_RegistrationLoopWithConfigUpdate(t *testing.T) { t.Parallel() lggr := logger.Test(t) capInfo, capDon, _ := buildTwoTestDONs(t, 1, 1) diff --git a/core/capabilities/remote/utils_test.go b/core/capabilities/remote/utils_test.go index 28a5fddd021..bb6160f07b7 100644 --- a/core/capabilities/remote/utils_test.go +++ b/core/capabilities/remote/utils_test.go @@ -23,7 +23,7 @@ const ( payload2 = "goodbye world" ) -func TestValidateMessage(t *testing.T) { +func TestUnit_ValidateMessage(t *testing.T) { privKey1, peerID1 := newKeyPair(t) _, peerID2 := newKeyPair(t) @@ -95,13 +95,13 @@ func signBody(t *testing.T, senderPrivKey ed25519.PrivateKey, body *remotetypes. } } -func TestToPeerID(t *testing.T) { +func TestUnit_ToPeerID(t *testing.T) { id, err := remote.ToPeerID([]byte("12345678901234567890123456789012")) require.NoError(t, err) require.Equal(t, "12D3KooWD8QYTQVYjB6oog4Ej8PcPpqTrPRnxLQap8yY8KUQRVvq", id.String()) } -func TestSanitizeLogString(t *testing.T) { +func TestUnit_SanitizeLogString(t *testing.T) { require.Equal(t, "hello", remote.SanitizeLogString("hello")) require.Equal(t, "[UNPRINTABLE] 0a", remote.SanitizeLogString("\n")) diff --git a/core/capabilities/streams/codec_test.go b/core/capabilities/streams/codec_test.go index c73ee1ccb6e..5d66cf24794 100644 --- a/core/capabilities/streams/codec_test.go +++ b/core/capabilities/streams/codec_test.go @@ -22,7 +22,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v3/reportcodec" ) -func TestCodec_WrapUnwrap(t *testing.T) { +func TestUnit_Codec_WrapUnwrap(t *testing.T) { codec := streams.NewCodec(logger.Test(t)) id1, id1Str := newFeedID(t) diff --git a/core/capabilities/streams/consensus_agg_test.go b/core/capabilities/streams/consensus_agg_test.go index f9d67bbde49..6f6fe28cf03 100644 --- a/core/capabilities/streams/consensus_agg_test.go +++ b/core/capabilities/streams/consensus_agg_test.go @@ -18,7 +18,7 @@ import ( // Integration/load test that combines Data Feeds Consensus Aggregator and Streams Codec. // For more meaningful measurements, increase the values of parameters P and T. -func TestStreamsConsensusAggregator(t *testing.T) { +func TestUnit_StreamsConsensusAggregator(t *testing.T) { Nt := 10 // trigger DON nodes Ft := 3 // trigger DON faulty nodes Nw := 10 // workflow DON nodes diff --git a/core/capabilities/streams/trigger_test.go b/core/capabilities/streams/trigger_test.go index cd1aae63292..a51e47a971d 100644 --- a/core/capabilities/streams/trigger_test.go +++ b/core/capabilities/streams/trigger_test.go @@ -57,7 +57,7 @@ type node struct { // Integration/load test that combines Trigger Subscriber, Streams Trigger Aggregator and Streams Codec. // It measures time needed to receive and process trigger events from multiple nodes and produce a local aggregated event. // For more meaningful measurements, increase the values of parameters P and T. -func TestStreamsTrigger(t *testing.T) { +func TestUnit_StreamsTrigger(t *testing.T) { N := 31 // trigger DON nodes F := 10 // faulty nodes R := 5 // different reports per feed (i.e. prices and timestamps) diff --git a/core/capabilities/transmission/local_target_capability_test.go b/core/capabilities/transmission/local_target_capability_test.go index a6b7b8303c5..5cf663c72c2 100644 --- a/core/capabilities/transmission/local_target_capability_test.go +++ b/core/capabilities/transmission/local_target_capability_test.go @@ -20,7 +20,7 @@ func assertBetween(t *testing.T, got time.Duration, low time.Duration, high time assert.LessOrEqual(t, got, high) } -func TestScheduledExecutionStrategy_LocalDON(t *testing.T) { +func TestUnit_ScheduledExecutionStrategy_LocalDON(t *testing.T) { var gotTime time.Time var called bool diff --git a/core/capabilities/transmission/transmission_test.go b/core/capabilities/transmission/transmission_test.go index eed5fe8ef97..add9a0c9668 100644 --- a/core/capabilities/transmission/transmission_test.go +++ b/core/capabilities/transmission/transmission_test.go @@ -13,7 +13,7 @@ import ( p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" ) -func Test_GetPeerIDToTransmissionDelay(t *testing.T) { +func TestUnit_GetPeerIDToTransmissionDelay(t *testing.T) { peer1 := [32]byte(fmt.Appendf(nil, "%-32s", "one")) peer2 := [32]byte(fmt.Appendf(nil, "%-32s", "two")) peer3 := [32]byte(fmt.Appendf(nil, "%-32s", "three")) diff --git a/core/capabilities/triggers/logevent/log_event_trigger_test.go b/core/capabilities/triggers/logevent/log_event_trigger_test.go index ee6fbcfd954..7d3c9434c21 100644 --- a/core/capabilities/triggers/logevent/log_event_trigger_test.go +++ b/core/capabilities/triggers/logevent/log_event_trigger_test.go @@ -18,7 +18,7 @@ import ( ) // Test for Log Event Trigger Capability happy path for EVM -func TestLogEventTriggerEVMHappyPath(t *testing.T) { +func TestIntegration_Shared_LogEventTriggerEVMHappyPath(t *testing.T) { t.Parallel() th := testutils.NewContractReaderTH(t) @@ -65,7 +65,7 @@ func TestLogEventTriggerEVMHappyPath(t *testing.T) { // Test if Log Event Trigger Capability is able to receive only new logs // by using cursor and does not receive duplicate logs -func TestLogEventTriggerCursorNewLogs(t *testing.T) { +func TestIntegration_Shared_LogEventTriggerCursorNewLogs(t *testing.T) { t.Parallel() th := testutils.NewContractReaderTH(t) diff --git a/core/capabilities/validation/validation_test.go b/core/capabilities/validation/validation_test.go index 5429e040b6d..b32055b5d25 100644 --- a/core/capabilities/validation/validation_test.go +++ b/core/capabilities/validation/validation_test.go @@ -6,13 +6,13 @@ import ( "github.com/stretchr/testify/require" ) -func TestIsValidWorkflowID(t *testing.T) { +func TestUnit_IsValidWorkflowID(t *testing.T) { require.Error(t, ValidateWorkflowOrExecutionID("too_short")) require.Error(t, ValidateWorkflowOrExecutionID("nothex--95ef5e32deb99a10ee6804bc4af13855687559d7ff6552ac6dbb2ce0")) require.NoError(t, ValidateWorkflowOrExecutionID("15c631d295ef5e32deb99a10ee6804bc4af13855687559d7ff6552ac6dbb2ce0")) } -func TestIsValidTriggerEventID(t *testing.T) { +func TestUnit_IsValidTriggerEventID(t *testing.T) { require.False(t, IsValidID("")) require.False(t, IsValidID("\n\n")) require.True(t, IsValidID("id_id_2")) diff --git a/core/capabilities/vault/capability_test.go b/core/capabilities/vault/capability_test.go index b2948755bc2..5c6171c0136 100644 --- a/core/capabilities/vault/capability_test.go +++ b/core/capabilities/vault/capability_test.go @@ -29,7 +29,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func TestCapability_CapabilityCall(t *testing.T) { +func TestUnit_Capability_CapabilityCall(t *testing.T) { lggr := logger.TestLogger(t) clock := clockwork.NewFakeClock() expiry := 10 * time.Second @@ -127,7 +127,7 @@ func TestCapability_CapabilityCall(t *testing.T) { assert.True(t, proto.Equal(expectedResponse, typedResponse)) } -func TestCapability_CapabilityCall_DuringSubscriptionPhase(t *testing.T) { +func TestUnit_Capability_CapabilityCall_DuringSubscriptionPhase(t *testing.T) { lggr := logger.TestLogger(t) clock := clockwork.NewFakeClock() expiry := 10 * time.Second @@ -224,7 +224,7 @@ func TestCapability_CapabilityCall_DuringSubscriptionPhase(t *testing.T) { assert.True(t, proto.Equal(expectedResponse, typedResponse)) } -func TestCapability_CapabilityCall_ReturnsIncorrectType(t *testing.T) { +func TestUnit_Capability_CapabilityCall_ReturnsIncorrectType(t *testing.T) { lggr := logger.TestLogger(t) clock := clockwork.NewFakeClock() expiry := 10 * time.Second @@ -299,7 +299,7 @@ func TestCapability_CapabilityCall_ReturnsIncorrectType(t *testing.T) { assert.ErrorContains(t, err, "cannot parse invalid wire-format data") } -func TestCapability_CapabilityCall_TimeOut(t *testing.T) { +func TestUnit_Capability_CapabilityCall_TimeOut(t *testing.T) { lggr := logger.TestLogger(t) fakeClock := clockwork.NewFakeClock() expiry := 10 * time.Second @@ -370,7 +370,7 @@ func TestCapability_CapabilityCall_TimeOut(t *testing.T) { assert.ErrorContains(t, err, "timeout exceeded") } -func TestCapability_CRUD(t *testing.T) { +func TestUnit_Capability_CRUD(t *testing.T) { owner := "0x0001020304050607080900010203040506070809" requestID := owner + "::" + "test-request-id" sid := &vault.SecretIdentifier{ @@ -1072,7 +1072,7 @@ func TestCapability_CRUD(t *testing.T) { } } -func TestCapability_Lifecycle(t *testing.T) { +func TestUnit_Capability_Lifecycle(t *testing.T) { lggr := logger.TestLogger(t) clock := clockwork.NewFakeClock() expiry := 10 * time.Second @@ -1104,7 +1104,7 @@ func TestCapability_Lifecycle(t *testing.T) { require.Nil(t, loader.Load()) } -func TestCapability_PublicKeyGet(t *testing.T) { +func TestUnit_Capability_PublicKeyGet(t *testing.T) { lggr := logger.TestLogger(t) clock := clockwork.NewFakeClock() expiry := 10 * time.Second diff --git a/core/capabilities/vault/gw_handler_test.go b/core/capabilities/vault/gw_handler_test.go index e5a74116810..7a1c8483859 100644 --- a/core/capabilities/vault/gw_handler_test.go +++ b/core/capabilities/vault/gw_handler_test.go @@ -21,7 +21,7 @@ import ( connector_mocks "github.com/smartcontractkit/chainlink/v2/core/services/gateway/connector/mocks" ) -func TestGatewayHandler_HandleGatewayMessage(t *testing.T) { +func TestUnit_GatewayHandler_HandleGatewayMessage(t *testing.T) { lggr := logger.TestLogger(t) ctx := context.Background() @@ -186,7 +186,7 @@ func TestGatewayHandler_HandleGatewayMessage(t *testing.T) { } } -func TestGatewayHandler_Lifecycle(t *testing.T) { +func TestUnit_GatewayHandler_Lifecycle(t *testing.T) { lggr := logger.TestLogger(t) ctx := context.Background() diff --git a/core/capabilities/vault/models_test.go b/core/capabilities/vault/models_test.go index 95dfea8c1db..1c7a1965da6 100644 --- a/core/capabilities/vault/models_test.go +++ b/core/capabilities/vault/models_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/capabilities/vault/vaulttypes" ) -func Test_ValidateSignatures_Valid(t *testing.T) { +func TestUnit_ValidateSignatures_Valid(t *testing.T) { ctx, err := hex.DecodeString("000ec4f6a2ba011e909eccf64628855b848e08876a1edd938a1372a9e51adff100000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000") require.NoError(t, err) sig1, err := hex.DecodeString("d1067844e2849b404d903730c4cae19f090d53a578a1e8dc16ecbdc0285c1f186599108abbe0073b78bc148a6504907474ed3a6881df917e6d142cff70acfb5900") @@ -38,7 +38,7 @@ func Test_ValidateSignatures_Valid(t *testing.T) { require.NoError(t, err) } -func Test_ValidateSignatures_InsufficientSignatures(t *testing.T) { +func TestUnit_ValidateSignatures_InsufficientSignatures(t *testing.T) { ctx, err := hex.DecodeString("000ec4f6a2ba011e909eccf64628855b848e08876a1edd938a1372a9e51adff100000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000") require.NoError(t, err) sig1, err := hex.DecodeString("d1067844e2849b404d903730c4cae19f090d53a578a1e8dc16ecbdc0285c1f186599108abbe0073b78bc148a6504907474ed3a6881df917e6d142cff70acfb5900") @@ -62,7 +62,7 @@ func Test_ValidateSignatures_InsufficientSignatures(t *testing.T) { require.ErrorContains(t, err, "not enough signatures: expected min 2, got 1") } -func Test_ValidateSignatures_DoesntCountDuplicates(t *testing.T) { +func TestUnit_ValidateSignatures_DoesntCountDuplicates(t *testing.T) { ctx, err := hex.DecodeString("000ec4f6a2ba011e909eccf64628855b848e08876a1edd938a1372a9e51adff100000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000") require.NoError(t, err) sig1, err := hex.DecodeString("d1067844e2849b404d903730c4cae19f090d53a578a1e8dc16ecbdc0285c1f186599108abbe0073b78bc148a6504907474ed3a6881df917e6d142cff70acfb5900") @@ -87,7 +87,7 @@ func Test_ValidateSignatures_DoesntCountDuplicates(t *testing.T) { require.ErrorContains(t, err, "only 1 valid signatures, need at least 2") } -func Test_ValidateSignatures_InvalidSignature(t *testing.T) { +func TestUnit_ValidateSignatures_InvalidSignature(t *testing.T) { ctx, err := hex.DecodeString("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000") require.NoError(t, err) sig1, err := hex.DecodeString("d1067844e2849b404d903730c4cae19f090d53a578a1e8dc16ecbdc0285c1f186599108abbe0073b78bc148a6504907474ed3a6881df917e6d142cff70acfb5900") diff --git a/core/capabilities/vault/request_authorizer_test.go b/core/capabilities/vault/request_authorizer_test.go index f0422463a27..b8da48e822f 100644 --- a/core/capabilities/vault/request_authorizer_test.go +++ b/core/capabilities/vault/request_authorizer_test.go @@ -19,7 +19,7 @@ import ( syncerv2mocks "github.com/smartcontractkit/chainlink/v2/core/services/workflows/syncer/v2/mocks" ) -func TestRequestAuthorizer_CreateSecrets(t *testing.T) { +func TestUnit_RequestAuthorizer_CreateSecrets(t *testing.T) { params, err := json.Marshal(vaultcommon.CreateSecretsRequest{ EncryptedSecrets: []*vaultcommon.EncryptedSecret{ { @@ -59,7 +59,7 @@ func TestRequestAuthorizer_CreateSecrets(t *testing.T) { testAuthForRequests(t, allowListedReq, notAllowListedReq) } -func TestRequestAuthorizer_UpdateSecrets(t *testing.T) { +func TestUnit_RequestAuthorizer_UpdateSecrets(t *testing.T) { params, err := json.Marshal(vaultcommon.UpdateSecretsRequest{ EncryptedSecrets: []*vaultcommon.EncryptedSecret{ { @@ -98,7 +98,7 @@ func TestRequestAuthorizer_UpdateSecrets(t *testing.T) { testAuthForRequests(t, allowListedReq, notAllowListedReq) } -func TestRequestAuthorizer_DeleteSecrets(t *testing.T) { +func TestUnit_RequestAuthorizer_DeleteSecrets(t *testing.T) { params, err := json.Marshal(vaultcommon.DeleteSecretsRequest{ Ids: []*vaultcommon.SecretIdentifier{ { @@ -131,7 +131,7 @@ func TestRequestAuthorizer_DeleteSecrets(t *testing.T) { testAuthForRequests(t, allowListedReq, notAllowListedReq) } -func TestRequestAuthorizer_ListSecrets(t *testing.T) { +func TestUnit_RequestAuthorizer_ListSecrets(t *testing.T) { params, err := json.Marshal(vaultcommon.ListSecretIdentifiersRequest{ Namespace: "b", }) diff --git a/core/capabilities/vault/vaultutils/json_test.go b/core/capabilities/vault/vaultutils/json_test.go index 557bd71defd..d3c1c77a62d 100644 --- a/core/capabilities/vault/vaultutils/json_test.go +++ b/core/capabilities/vault/vaultutils/json_test.go @@ -8,7 +8,7 @@ import ( "google.golang.org/protobuf/types/known/structpb" ) -func TestToCanonicalJSON(t *testing.T) { +func TestUnit_ToCanonicalJSON(t *testing.T) { testData, err := structpb.NewValue(map[string]any{ "field1": "value1", "field2": 42, diff --git a/core/capabilities/webapi/outgoing_connector_handler_test.go b/core/capabilities/webapi/outgoing_connector_handler_test.go index 5f3f4443d75..1ee49891b91 100644 --- a/core/capabilities/webapi/outgoing_connector_handler_test.go +++ b/core/capabilities/webapi/outgoing_connector_handler_test.go @@ -30,7 +30,7 @@ const ( privateKey = "6c358b4f16344f03cfce12ebf7b768301bbe6a8977c98a2a2d76699f8bc56161" ) -func TestOutgoingConnectorHandler_AwaitConnection(t *testing.T) { +func TestUnit_OutgoingConnectorHandler_AwaitConnection(t *testing.T) { gateways := []string{"gateway1", "gateway2"} type testCase struct { @@ -144,7 +144,7 @@ func TestOutgoingConnectorHandler_AwaitConnection(t *testing.T) { } } -func TestHandleSingleNodeRequest(t *testing.T) { +func TestUnit_HandleSingleNodeRequest(t *testing.T) { t.Run("uses default timeout if no timeout is provided", func(t *testing.T) { msgID := "msgID" testURL := "http://localhost:8080" @@ -408,7 +408,7 @@ func gatewayResponse(t *testing.T, msgID string, privateKey string) *jsonrpc.Req return req } -func TestServiceConfigDefaults(t *testing.T) { +func TestUnit_ServiceConfigDefaults(t *testing.T) { t.Run("fills default RateLimiterConfigs", func(t *testing.T) { var cfg ServiceConfig @@ -428,7 +428,7 @@ func TestServiceConfigDefaults(t *testing.T) { require.InDelta(t, DefaultWorkflowRPS, oRLConf.PerSenderRPS, 0.001) }) } -func TestOutgoingConnectorHandler_HandleGatewayMessage_InvalidMessage(t *testing.T) { +func TestUnit_OutgoingConnectorHandler_HandleGatewayMessage_InvalidMessage(t *testing.T) { _, handler := newFunctionWithDefaultConfig( t, func(gc *gcmocks.GatewayConnector) {}, diff --git a/core/capabilities/webapi/target/target_test.go b/core/capabilities/webapi/target/target_test.go index 92d3c165d6e..e75d06a76c9 100644 --- a/core/capabilities/webapi/target/target_test.go +++ b/core/capabilities/webapi/target/target_test.go @@ -150,7 +150,7 @@ func gatewayResponse(t *testing.T, msgID string, privateKey string) *jsonrpc.Req return req } -func TestRegisterUnregister(t *testing.T) { +func TestUnit_RegisterUnregister(t *testing.T) { th := setup(t, defaultConfig) ctx := testutils.Context(t) @@ -195,7 +195,7 @@ func TestRegisterUnregister(t *testing.T) { }) } -func TestCapability_Execute(t *testing.T) { +func TestUnit_Capability_Execute(t *testing.T) { th := setup(t, defaultConfig) ctx := testutils.Context(t) th.connector.EXPECT().DonID(matches.AnyContext).Return("donID", nil) diff --git a/core/capabilities/webapi/trigger/trigger_test.go b/core/capabilities/webapi/trigger/trigger_test.go index 58605499877..1b856e8c95d 100644 --- a/core/capabilities/webapi/trigger/trigger_test.go +++ b/core/capabilities/webapi/trigger/trigger_test.go @@ -159,7 +159,7 @@ func requireChanMsg[T capabilities.TriggerResponse](t *testing.T, ch <-chan capa return capabilities.TriggerResponse{}, errors.New("channel timeout") } -func TestTriggerExecute(t *testing.T) { +func TestUnit_TriggerExecute(t *testing.T) { th := setup(t) ctx := testutils.Context(t) ctx, cancelContext := context.WithDeadline(ctx, time.Now().Add(10*time.Second)) @@ -323,7 +323,7 @@ func TestTriggerExecute(t *testing.T) { cancelContext() } -func TestRegisterNoAllowedSenders(t *testing.T) { +func TestUnit_RegisterNoAllowedSenders(t *testing.T) { th := setup(t) ctx := testutils.Context(t) Config, _ := workflowTriggerConfig(th, []string{}, []string{"daily_price_update"}) @@ -342,7 +342,7 @@ func TestRegisterNoAllowedSenders(t *testing.T) { gatewayRequest(t, privateKey1, []string{"daily_price_update"}, "") } -func TestTriggerExecute2WorkflowsSameTopicDifferentAllowLists(t *testing.T) { +func TestUnit_TriggerExecute2WorkflowsSameTopicDifferentAllowLists(t *testing.T) { th := setup(t) ctx := testutils.Context(t) ctx, cancelContext := context.WithDeadline(ctx, time.Now().Add(10*time.Second)) @@ -401,7 +401,7 @@ func TestTriggerExecute2WorkflowsSameTopicDifferentAllowLists(t *testing.T) { cancelContext() } -func TestRegisterUnregister(t *testing.T) { +func TestUnit_RegisterUnregister(t *testing.T) { th := setup(t) ctx := testutils.Context(t) Config, err := workflowTriggerConfig(th, []string{address1}, []string{"daily_price_update"}) diff --git a/core/cbor/cbor_test.go b/core/cbor/cbor_test.go index 5883daf976f..ef73140767b 100644 --- a/core/cbor/cbor_test.go +++ b/core/cbor/cbor_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" ) -func Test_ParseCBOR(t *testing.T) { +func TestUnit_ParseCBOR(t *testing.T) { t.Parallel() address, err := hex.DecodeString("0x8bd112d3f8f92e41c861939545ad387307af9703") @@ -151,7 +151,7 @@ func Test_ParseCBOR(t *testing.T) { } } -func Test_ParseCBORToStruct_Success(t *testing.T) { +func TestUnit_ParseCBORToStruct_Success(t *testing.T) { t.Parallel() hexCBOR := `0xbf6375726c781a68747470733a2f2f657468657270726963652e636f6d2f61706964706174689f66726563656e7463757364ffff000000` @@ -169,7 +169,7 @@ func Test_ParseCBORToStruct_Success(t *testing.T) { require.Equal(t, []string{"recent", "usd"}, parsed.Path) } -func Test_ParseCBORToStruct_WrongFieldType(t *testing.T) { +func TestUnit_ParseCBORToStruct_WrongFieldType(t *testing.T) { t.Parallel() hexCBOR := `0xbf6375726c781a68747470733a2f2f657468657270726963652e636f6d2f61706964706174689f66726563656e7463757364ffff000000` @@ -185,7 +185,7 @@ func Test_ParseCBORToStruct_WrongFieldType(t *testing.T) { require.Error(t, err) } -func Test_ParseCBORToStruct_BinaryStringOfWrongType(t *testing.T) { +func TestUnit_ParseCBORToStruct_BinaryStringOfWrongType(t *testing.T) { t.Parallel() // {"key":"value"} but with last byte replaced with invalid unicode (0x88) @@ -200,7 +200,7 @@ func Test_ParseCBORToStruct_BinaryStringOfWrongType(t *testing.T) { require.Error(t, err) } -func Test_autoAddMapDelimiters(t *testing.T) { +func TestUnit_autoAddMapDelimiters(t *testing.T) { t.Parallel() tests := []struct { @@ -264,7 +264,7 @@ func jsonMustUnmarshal(t *testing.T, in string) any { return j } -func TestCoerceInterfaceMapToStringMap(t *testing.T) { +func TestUnit_CoerceInterfaceMapToStringMap(t *testing.T) { t.Parallel() tests := []struct { @@ -308,7 +308,7 @@ func TestCoerceInterfaceMapToStringMap(t *testing.T) { } } -func TestCoerceInterfaceMapToStringMap_BadInputs(t *testing.T) { +func TestUnit_CoerceInterfaceMapToStringMap_BadInputs(t *testing.T) { t.Parallel() tests := []struct { @@ -327,7 +327,7 @@ func TestCoerceInterfaceMapToStringMap_BadInputs(t *testing.T) { } } -func TestJSON_CBOR(t *testing.T) { +func TestUnit_JSON_CBOR(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/cmd/admin_commands_test.go b/core/cmd/admin_commands_test.go index d631ad907a0..886fda86ece 100644 --- a/core/cmd/admin_commands_test.go +++ b/core/cmd/admin_commands_test.go @@ -21,7 +21,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func TestShell_CreateUser(t *testing.T) { +func TestIntegration_Shared_Shell_CreateUser(t *testing.T) { app := startNewApplicationV2(t, nil) client, _ := app.NewShellAndRenderer() client.PasswordPrompter = cltest.MockPasswordPrompter{ @@ -60,7 +60,7 @@ func TestShell_CreateUser(t *testing.T) { } } -func TestShell_ChangeRole(t *testing.T) { +func TestIntegration_Shared_Shell_ChangeRole(t *testing.T) { ctx := testutils.Context(t) app := startNewApplicationV2(t, nil) client, _ := app.NewShellAndRenderer() @@ -100,7 +100,7 @@ func TestShell_ChangeRole(t *testing.T) { } } -func TestShell_DeleteUser(t *testing.T) { +func TestIntegration_Shared_Shell_DeleteUser(t *testing.T) { ctx := testutils.Context(t) app := startNewApplicationV2(t, nil) client, _ := app.NewShellAndRenderer() @@ -135,7 +135,7 @@ func TestShell_DeleteUser(t *testing.T) { } } -func TestShell_ListUsers(t *testing.T) { +func TestIntegration_Shared_Shell_ListUsers(t *testing.T) { ctx := testutils.Context(t) app := startNewApplicationV2(t, nil) client, _ := app.NewShellAndRenderer() @@ -165,7 +165,7 @@ func TestShell_ListUsers(t *testing.T) { assert.Truef(t, userPresenterFound, "expected to find user %s in presenter list", user.Email) } -func TestAdminUsersPresenter_RenderTable(t *testing.T) { +func TestIntegration_Shared_AdminUsersPresenter_RenderTable(t *testing.T) { user := sessions.User{ Email: "foo@bar.com", Role: "admin", diff --git a/core/cmd/app_test.go b/core/cmd/app_test.go index d152687165e..c8697bf4bf6 100644 --- a/core/cmd/app_test.go +++ b/core/cmd/app_test.go @@ -55,7 +55,7 @@ func withDefaults(t *testing.T, c chainlink.Config, s chainlink.Secrets) chainli return cfg } -func Test_initServerConfig(t *testing.T) { +func TestUnit_initServerConfig(t *testing.T) { type args struct { opts *chainlink.GeneralConfigOpts fileNames []string diff --git a/core/cmd/aptos_keys_commands_test.go b/core/cmd/aptos_keys_commands_test.go index 5343e3ae601..29092403c5d 100644 --- a/core/cmd/aptos_keys_commands_test.go +++ b/core/cmd/aptos_keys_commands_test.go @@ -20,7 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func TestAptosKeyPresenter_RenderTable(t *testing.T) { +func TestIntegration_Shared_AptosKeyPresenter_RenderTable(t *testing.T) { t.Parallel() var ( @@ -55,7 +55,7 @@ func TestAptosKeyPresenter_RenderTable(t *testing.T) { assert.Contains(t, output, pubKey) } -func TestShell_AptosKeys(t *testing.T) { +func TestIntegration_Shared_Shell_AptosKeys(t *testing.T) { app := startNewApplicationV2(t, nil) ks := app.GetKeyStore().Aptos() cleanup := func() { diff --git a/core/cmd/blocks_commands_test.go b/core/cmd/blocks_commands_test.go index eae71a4d139..250528b0cbe 100644 --- a/core/cmd/blocks_commands_test.go +++ b/core/cmd/blocks_commands_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" ) -func Test_ReplayFromBlock(t *testing.T) { +func TestIntegration_Shared_ReplayFromBlock(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { @@ -69,7 +69,7 @@ func Test_ReplayFromBlock(t *testing.T) { }) } -func Test_FindLCA(t *testing.T) { +func TestIntegration_Shared_FindLCA(t *testing.T) { t.Parallel() // ethClient.On("BalanceAt", mock.Anything, mock.Anything, mock.Anything).Return(big.NewInt(42), nil) diff --git a/core/cmd/bridge_commands_test.go b/core/cmd/bridge_commands_test.go index 14042261a5e..fa3197f69b9 100644 --- a/core/cmd/bridge_commands_test.go +++ b/core/cmd/bridge_commands_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func TestBridgePresenter_RenderTable(t *testing.T) { +func TestIntegration_Shared_BridgePresenter_RenderTable(t *testing.T) { t.Parallel() var ( @@ -62,7 +62,7 @@ func TestBridgePresenter_RenderTable(t *testing.T) { assert.NotContains(t, output, outgoingToken) } -func TestShell_IndexBridges(t *testing.T) { +func TestIntegration_Shared_Shell_IndexBridges(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -99,7 +99,7 @@ func TestShell_IndexBridges(t *testing.T) { assert.Equal(t, bt2.Confirmations, p.Confirmations) } -func TestShell_ShowBridge(t *testing.T) { +func TestIntegration_Shared_Shell_ShowBridge(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, nil) @@ -127,7 +127,7 @@ func TestShell_ShowBridge(t *testing.T) { assert.Equal(t, bt.Confirmations, p.Confirmations) } -func TestShell_CreateBridge(t *testing.T) { +func TestIntegration_Shared_Shell_CreateBridge(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, nil) @@ -164,7 +164,7 @@ func TestShell_CreateBridge(t *testing.T) { } } -func TestShell_RemoveBridge(t *testing.T) { +func TestIntegration_Shared_Shell_RemoveBridge(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, nil) @@ -192,7 +192,7 @@ func TestShell_RemoveBridge(t *testing.T) { assert.Equal(t, bt.URL.String(), p.URL) assert.Equal(t, bt.Confirmations, p.Confirmations) } -func TestShell_UpdateBridge(t *testing.T) { +func TestIntegration_Shared_Shell_UpdateBridge(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, nil) diff --git a/core/cmd/chains_commands_integration_test.go b/core/cmd/chains_commands_integration_test.go index 8427f483b3e..e9d7f3b7929 100644 --- a/core/cmd/chains_commands_integration_test.go +++ b/core/cmd/chains_commands_integration_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" ) -func TestShell_IndexCosmosChains(t *testing.T) { +func TestUnit_Shell_IndexCosmosChains(t *testing.T) { t.Parallel() chainID := cosmostest.RandomChainID() diff --git a/core/cmd/chains_commands_test.go b/core/cmd/chains_commands_test.go index 82768e9987c..51e714a6fbb 100644 --- a/core/cmd/chains_commands_test.go +++ b/core/cmd/chains_commands_test.go @@ -22,7 +22,7 @@ func newRandChainID() *big.Big { return big.New(testutils.NewRandomEVMChainID()) } -func TestShell_IndexEVMChains(t *testing.T) { +func TestIntegration_Shared_Shell_IndexEVMChains(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { @@ -40,7 +40,7 @@ func TestShell_IndexEVMChains(t *testing.T) { assertTableRenders(t, r) } -func TestShell_IndexSolanaChains(t *testing.T) { +func TestIntegration_Shared_Shell_IndexSolanaChains(t *testing.T) { t.Parallel() id := solanatest.RandomChainID() diff --git a/core/cmd/cosmos_keys_commands_test.go b/core/cmd/cosmos_keys_commands_test.go index 0f934a84624..d0f0e9c677f 100644 --- a/core/cmd/cosmos_keys_commands_test.go +++ b/core/cmd/cosmos_keys_commands_test.go @@ -20,7 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func TestCosmosKeyPresenter_RenderTable(t *testing.T) { +func TestIntegration_Shared_CosmosKeyPresenter_RenderTable(t *testing.T) { t.Parallel() var ( @@ -55,7 +55,7 @@ func TestCosmosKeyPresenter_RenderTable(t *testing.T) { assert.Contains(t, output, pubKey) } -func TestShell_CosmosKeys(t *testing.T) { +func TestIntegration_Shared_Shell_CosmosKeys(t *testing.T) { app := startNewApplicationV2(t, nil) ks := app.GetKeyStore().Cosmos() cleanup := func() { diff --git a/core/cmd/csa_keys_commands_test.go b/core/cmd/csa_keys_commands_test.go index aa296bd80e7..aae58056de7 100644 --- a/core/cmd/csa_keys_commands_test.go +++ b/core/cmd/csa_keys_commands_test.go @@ -20,7 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func TestCSAKeyPresenter_RenderTable(t *testing.T) { +func TestIntegration_Shared_CSAKeyPresenter_RenderTable(t *testing.T) { t.Parallel() var ( @@ -52,7 +52,7 @@ func TestCSAKeyPresenter_RenderTable(t *testing.T) { assert.Contains(t, output, pubKey) } -func TestShell_ListCSAKeys(t *testing.T) { +func TestIntegration_Shared_Shell_ListCSAKeys(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -70,7 +70,7 @@ func TestShell_ListCSAKeys(t *testing.T) { assert.Equal(t, "csa_"+key.PublicKeyString(), keys[0].PubKey) } -func TestShell_CreateCSAKey(t *testing.T) { +func TestIntegration_Shared_Shell_CreateCSAKey(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, nil) @@ -83,7 +83,7 @@ func TestShell_CreateCSAKey(t *testing.T) { requireCSAKeyCount(t, app, 1) } -func TestShell_ImportExportCsaKey(t *testing.T) { +func TestIntegration_Shared_Shell_ImportExportCsaKey(t *testing.T) { t.Parallel() defer deleteKeyExportFile(t) diff --git a/core/cmd/eth_keys_commands_test.go b/core/cmd/eth_keys_commands_test.go index d8cd494babb..fbf54a32d92 100644 --- a/core/cmd/eth_keys_commands_test.go +++ b/core/cmd/eth_keys_commands_test.go @@ -30,7 +30,7 @@ import ( func ptr[T any](t T) *T { return &t } -func TestEthKeysPresenter_RenderTable(t *testing.T) { +func TestIntegration_Shared_EthKeysPresenter_RenderTable(t *testing.T) { t.Parallel() var ( @@ -86,7 +86,7 @@ func TestEthKeysPresenter_RenderTable(t *testing.T) { assert.Contains(t, output, maxGasPriceWei.String()) } -func TestShell_ListETHKeys(t *testing.T) { +func TestIntegration_Shared_Shell_ListETHKeys(t *testing.T) { t.Parallel() ethClient := newEthMock(t) @@ -111,7 +111,7 @@ func TestShell_ListETHKeys(t *testing.T) { assert.Equal(t, "13", balances[0].LinkBalance.String()) } -func TestShell_ListETHKeys_Error(t *testing.T) { +func TestIntegration_Shared_Shell_ListETHKeys_Error(t *testing.T) { t.Parallel() ethClient := newEthMock(t) @@ -136,7 +136,7 @@ func TestShell_ListETHKeys_Error(t *testing.T) { assert.Nil(t, balances[0].LinkBalance) } -func TestShell_ListETHKeys_Disabled(t *testing.T) { +func TestIntegration_Shared_Shell_ListETHKeys_Disabled(t *testing.T) { t.Parallel() ethClient := newEthMock(t) @@ -165,7 +165,7 @@ func TestShell_ListETHKeys_Disabled(t *testing.T) { }, balances[0].ToRow()) } -func TestShell_CreateETHKey(t *testing.T) { +func TestIntegration_Shared_Shell_CreateETHKey(t *testing.T) { t.Parallel() ethClient := newEthMock(t) @@ -206,7 +206,7 @@ func TestShell_CreateETHKey(t *testing.T) { require.Len(t, keys, 2) } -func TestShell_DeleteETHKey(t *testing.T) { +func TestIntegration_Shared_Shell_DeleteETHKey(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { @@ -238,7 +238,7 @@ func TestShell_DeleteETHKey(t *testing.T) { assert.Error(t, err) } -func TestShell_ImportExportETHKey_NoChains(t *testing.T) { +func TestIntegration_Shared_Shell_ImportExportETHKey_NoChains(t *testing.T) { t.Parallel() t.Cleanup(func() { deleteKeyExportFile(t) }) @@ -344,7 +344,7 @@ func TestShell_ImportExportETHKey_NoChains(t *testing.T) { require.Error(t, err, "Error exporting") require.Error(t, utils.JustError(os.Stat(keyName))) } -func TestShell_ImportExportETHKey_WithChains(t *testing.T) { +func TestIntegration_Shared_Shell_ImportExportETHKey_WithChains(t *testing.T) { t.Parallel() t.Cleanup(func() { deleteKeyExportFile(t) }) diff --git a/core/cmd/evm_transaction_commands_test.go b/core/cmd/evm_transaction_commands_test.go index 97f1b362fcd..79aafd22438 100644 --- a/core/cmd/evm_transaction_commands_test.go +++ b/core/cmd/evm_transaction_commands_test.go @@ -25,7 +25,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" ) -func TestShell_IndexTransactions(t *testing.T) { +func TestIntegration_Shared_Shell_IndexTransactions(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, nil) @@ -65,7 +65,7 @@ func TestShell_IndexTransactions(t *testing.T) { assert.Empty(t, renderedTxs) } -func TestShell_ShowTransaction(t *testing.T) { +func TestIntegration_Shared_Shell_ShowTransaction(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, nil) @@ -90,7 +90,7 @@ func TestShell_ShowTransaction(t *testing.T) { assert.Equal(t, &tx.FromAddress, renderedTx.From) } -func TestShell_IndexTxAttempts(t *testing.T) { +func TestIntegration_Shared_Shell_IndexTxAttempts(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, nil) @@ -129,7 +129,7 @@ func TestShell_IndexTxAttempts(t *testing.T) { assert.Empty(t, renderedAttempts) } -func TestShell_SendEther_From_Txm(t *testing.T) { +func TestIntegration_Shared_Shell_SendEther_From_Txm(t *testing.T) { t.Parallel() key := cltest.MustGenerateRandomKey(t) @@ -192,7 +192,7 @@ func TestShell_SendEther_From_Txm(t *testing.T) { assert.Equal(t, attempts[0].Hash, output.Hash) } -func TestShell_SendEther_From_Txm_WEI(t *testing.T) { +func TestIntegration_Shared_Shell_SendEther_From_Txm_WEI(t *testing.T) { t.Parallel() key := cltest.MustGenerateRandomKey(t) diff --git a/core/cmd/external_initiator_commands_test.go b/core/cmd/external_initiator_commands_test.go index 6231e1fe46f..78fd224b830 100644 --- a/core/cmd/external_initiator_commands_test.go +++ b/core/cmd/external_initiator_commands_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func TestExternalInitiatorPresenter_RenderTable(t *testing.T) { +func TestIntegration_Shared_ExternalInitiatorPresenter_RenderTable(t *testing.T) { t.Parallel() var ( diff --git a/core/cmd/forwarders_commands_test.go b/core/cmd/forwarders_commands_test.go index c7dddae817b..ee41db723cd 100644 --- a/core/cmd/forwarders_commands_test.go +++ b/core/cmd/forwarders_commands_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func TestEVMForwarderPresenter_RenderTable(t *testing.T) { +func TestIntegration_Shared_EVMForwarderPresenter_RenderTable(t *testing.T) { t.Parallel() var ( @@ -62,7 +62,7 @@ func TestEVMForwarderPresenter_RenderTable(t *testing.T) { assert.Contains(t, output, createdAt.Format(time.RFC3339)) } -func TestShell_TrackEVMForwarder(t *testing.T) { +func TestIntegration_Shared_Shell_TrackEVMForwarder(t *testing.T) { t.Parallel() id := newRandChainID() @@ -107,7 +107,7 @@ func TestShell_TrackEVMForwarder(t *testing.T) { require.Empty(t, fwds) } -func TestShell_TrackEVMForwarder_BadAddress(t *testing.T) { +func TestIntegration_Shared_Shell_TrackEVMForwarder_BadAddress(t *testing.T) { t.Parallel() id := newRandChainID() @@ -128,7 +128,7 @@ func TestShell_TrackEVMForwarder_BadAddress(t *testing.T) { require.Contains(t, err.Error(), "could not decode address: invalid hex string") } -func TestShell_DeleteEVMForwarders_MissingFwdId(t *testing.T) { +func TestIntegration_Shared_Shell_DeleteEVMForwarders_MissingFwdId(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { diff --git a/core/cmd/jobs_commands_test.go b/core/cmd/jobs_commands_test.go index 8dc5686f567..182c345c597 100644 --- a/core/cmd/jobs_commands_test.go +++ b/core/cmd/jobs_commands_test.go @@ -25,7 +25,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func TestJobPresenter_RenderTable(t *testing.T) { +func TestIntegration_Shared_JobPresenter_RenderTable(t *testing.T) { t.Parallel() var ( @@ -89,7 +89,7 @@ func TestJobPresenter_RenderTable(t *testing.T) { assert.Contains(t, output, createdAt.Format(time.RFC3339)) } -func TestJobRenderer_GetTasks(t *testing.T) { +func TestIntegration_Shared_JobRenderer_GetTasks(t *testing.T) { t.Parallel() r := &cmd.JobPresenter{} @@ -121,7 +121,7 @@ func TestJobRenderer_GetTasks(t *testing.T) { }) } -func TestJob_FriendlyTasks(t *testing.T) { +func TestIntegration_Shared_Job_FriendlyTasks(t *testing.T) { t.Parallel() r := &cmd.JobPresenter{} @@ -147,7 +147,7 @@ func TestJob_FriendlyTasks(t *testing.T) { }) } -func TestJob_FriendlyCreatedAt(t *testing.T) { +func TestIntegration_Shared_Job_FriendlyCreatedAt(t *testing.T) { t.Parallel() now := time.Now() @@ -268,7 +268,7 @@ func TestJob_FriendlyCreatedAt(t *testing.T) { } } -func TestJob_ToRows(t *testing.T) { +func TestIntegration_Shared_Job_ToRows(t *testing.T) { t.Parallel() now := time.Now() @@ -307,7 +307,7 @@ func getDirectRequestSpec() string { return fmt.Sprintf(directRequestSpecTemplate, testutils.FixtureChainID.String(), uuid.New(), uuid.New()) } -func TestShell_ListFindJobs(t *testing.T) { +func TestIntegration_Shared_Shell_ListFindJobs(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { @@ -333,7 +333,7 @@ func TestShell_ListFindJobs(t *testing.T) { assert.Equal(t, createOutput.ID, jobs[0].ID) } -func TestShell_ShowJob(t *testing.T) { +func TestIntegration_Shared_Shell_ShowJob(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { @@ -366,7 +366,7 @@ func TestShell_ShowJob(t *testing.T) { //go:embed ocr-bootstrap-spec.yml var ocrBootstrapSpec string -func TestShell_CreateJobV2(t *testing.T) { +func TestIntegration_Shared_Shell_CreateJobV2(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { @@ -404,7 +404,7 @@ func TestShell_CreateJobV2(t *testing.T) { assert.Equal(t, "0x27548a32b9aD5D64c5945EaE9Da5337bc3169D15", output.OffChainReportingSpec.ContractAddress.String()) } -func TestShell_DeleteJob(t *testing.T) { +func TestIntegration_Shared_Shell_DeleteJob(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { diff --git a/core/cmd/node_commands_integration_test.go b/core/cmd/node_commands_integration_test.go index 5e81319ae54..e9c0a48ba01 100644 --- a/core/cmd/node_commands_integration_test.go +++ b/core/cmd/node_commands_integration_test.go @@ -25,7 +25,7 @@ func cosmosStartNewApplication(t *testing.T, cfgs ...chainlink.RawConfig) *cltes }) } -func TestShell_IndexCosmosNodes(t *testing.T) { +func TestUnit_Shell_IndexCosmosNodes(t *testing.T) { t.Parallel() chainID := cosmostest.RandomChainID() @@ -74,7 +74,7 @@ func starknetStartNewApplication(t *testing.T, cfgs ...chainlink.RawConfig) *clt }) } -func TestShell_IndexStarkNetNodes(t *testing.T) { +func TestUnit_Shell_IndexStarkNetNodes(t *testing.T) { t.Parallel() id := "starknet chain ID" diff --git a/core/cmd/node_commands_test.go b/core/cmd/node_commands_test.go index 53021b33216..7a8ab24715d 100644 --- a/core/cmd/node_commands_test.go +++ b/core/cmd/node_commands_test.go @@ -28,7 +28,7 @@ func assertTableRenders(t *testing.T, r *cltest.RendererMock) { } } -func TestShell_IndexEVMNodes(t *testing.T) { +func TestIntegration_Shared_Shell_IndexEVMNodes(t *testing.T) { t.Parallel() chainID := newRandChainID() @@ -106,7 +106,7 @@ func solanaStartNewApplication(t *testing.T, cfgs ...*solcfg.TOMLConfig) *cltest }) } -func TestShell_IndexSolanaNodes(t *testing.T) { +func TestIntegration_Shared_Shell_IndexSolanaNodes(t *testing.T) { t.Parallel() id := solanatest.RandomChainID() diff --git a/core/cmd/ocr2_keys_commands_test.go b/core/cmd/ocr2_keys_commands_test.go index c3c0c17c34e..ffc393ad0b5 100644 --- a/core/cmd/ocr2_keys_commands_test.go +++ b/core/cmd/ocr2_keys_commands_test.go @@ -21,7 +21,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func TestOCR2KeyBundlePresenter_RenderTable(t *testing.T) { +func TestIntegration_Shared_OCR2KeyBundlePresenter_RenderTable(t *testing.T) { t.Parallel() var ( @@ -67,7 +67,7 @@ func TestOCR2KeyBundlePresenter_RenderTable(t *testing.T) { assert.Contains(t, output, hex.EncodeToString(pubKeyConfig[:])) } -func TestShell_OCR2Keys(t *testing.T) { +func TestIntegration_Shared_Shell_OCR2Keys(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, nil) diff --git a/core/cmd/ocr_keys_commands_test.go b/core/cmd/ocr_keys_commands_test.go index cbe15fc7808..536bd7260f8 100644 --- a/core/cmd/ocr_keys_commands_test.go +++ b/core/cmd/ocr_keys_commands_test.go @@ -20,7 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func TestOCRKeyBundlePresenter_RenderTable(t *testing.T) { +func TestIntegration_Shared_OCRKeyBundlePresenter_RenderTable(t *testing.T) { t.Parallel() var ( @@ -64,7 +64,7 @@ func TestOCRKeyBundlePresenter_RenderTable(t *testing.T) { assert.Contains(t, output, hex.EncodeToString(pubKeyConfig[:])) } -func TestShell_ListOCRKeyBundles(t *testing.T) { +func TestIntegration_Shared_Shell_ListOCRKeyBundles(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -82,7 +82,7 @@ func TestShell_ListOCRKeyBundles(t *testing.T) { require.Equal(t, key.ID(), output[0].ID) } -func TestShell_CreateOCRKeyBundle(t *testing.T) { +func TestIntegration_Shared_Shell_CreateOCRKeyBundle(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, nil) @@ -101,7 +101,7 @@ func TestShell_CreateOCRKeyBundle(t *testing.T) { require.Equal(t, output.ID, keys[0].ID()) } -func TestShell_DeleteOCRKeyBundle(t *testing.T) { +func TestIntegration_Shared_Shell_DeleteOCRKeyBundle(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -129,7 +129,7 @@ func TestShell_DeleteOCRKeyBundle(t *testing.T) { assert.Equal(t, key.ID(), output.ID) } -func TestShell_ImportExportOCRKey(t *testing.T) { +func TestIntegration_Shared_Shell_ImportExportOCRKey(t *testing.T) { defer deleteKeyExportFile(t) ctx := testutils.Context(t) diff --git a/core/cmd/p2p_keys_commands_test.go b/core/cmd/p2p_keys_commands_test.go index df267e08366..35f82977920 100644 --- a/core/cmd/p2p_keys_commands_test.go +++ b/core/cmd/p2p_keys_commands_test.go @@ -20,7 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func TestP2PKeyPresenter_RenderTable(t *testing.T) { +func TestIntegration_Shared_P2PKeyPresenter_RenderTable(t *testing.T) { t.Parallel() var ( @@ -59,7 +59,7 @@ func TestP2PKeyPresenter_RenderTable(t *testing.T) { assert.Contains(t, output, pubKey) } -func TestShell_ListP2PKeys(t *testing.T) { +func TestIntegration_Shared_Shell_ListP2PKeys(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -77,7 +77,7 @@ func TestShell_ListP2PKeys(t *testing.T) { assert.Equal(t, key.PublicKeyHex(), keys[0].PubKey) } -func TestShell_CreateP2PKey(t *testing.T) { +func TestIntegration_Shared_Shell_CreateP2PKey(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, nil) @@ -91,7 +91,7 @@ func TestShell_CreateP2PKey(t *testing.T) { require.Len(t, keys, 1) } -func TestShell_DeleteP2PKey(t *testing.T) { +func TestIntegration_Shared_Shell_DeleteP2PKey(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -118,7 +118,7 @@ func TestShell_DeleteP2PKey(t *testing.T) { requireP2PKeyCount(t, app, 0) } -func TestShell_ImportExportP2PKeyBundle(t *testing.T) { +func TestIntegration_Shared_Shell_ImportExportP2PKeyBundle(t *testing.T) { t.Parallel() ctx := testutils.Context(t) diff --git a/core/cmd/presenters_test.go b/core/cmd/presenters_test.go index 070930be386..5f1dab241c2 100644 --- a/core/cmd/presenters_test.go +++ b/core/cmd/presenters_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/cmd" ) -func TestJAID(t *testing.T) { +func TestIntegration_Shared_JAID(t *testing.T) { t.Parallel() jaid := cmd.JAID{ID: "1"} diff --git a/core/cmd/renderer_test.go b/core/cmd/renderer_test.go index 0cd9e75f168..adef3b5da30 100644 --- a/core/cmd/renderer_test.go +++ b/core/cmd/renderer_test.go @@ -15,7 +15,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestRendererJSON_RenderVRFKeys(t *testing.T) { +func TestIntegration_Shared_RendererJSON_RenderVRFKeys(t *testing.T) { t.Parallel() r := cmd.RendererJSON{Writer: io.Discard} @@ -31,7 +31,7 @@ func TestRendererJSON_RenderVRFKeys(t *testing.T) { assert.NoError(t, r.Render(&keys)) } -func TestRendererTable_RenderConfigurationV2(t *testing.T) { +func TestIntegration_Shared_RendererTable_RenderConfigurationV2(t *testing.T) { t.Parallel() app := cltest.NewApplicationEVMDisabled(t) @@ -71,7 +71,7 @@ func (w *testWriter) Write(actual []byte) (int, error) { return len(actual), nil } -func TestRendererTable_RenderExternalInitiatorAuthentication(t *testing.T) { +func TestIntegration_Shared_RendererTable_RenderExternalInitiatorAuthentication(t *testing.T) { t.Parallel() eia := webpresenters.ExternalInitiatorAuthentication{ @@ -104,7 +104,7 @@ func TestRendererTable_RenderExternalInitiatorAuthentication(t *testing.T) { } } -func TestRendererTable_RenderUnknown(t *testing.T) { +func TestIntegration_Shared_RendererTable_RenderUnknown(t *testing.T) { t.Parallel() r := cmd.RendererTable{Writer: io.Discard} anon := struct{ Name string }{"Romeo"} diff --git a/core/cmd/shell_local_test.go b/core/cmd/shell_local_test.go index 6d7cd256685..d331ea2fd02 100644 --- a/core/cmd/shell_local_test.go +++ b/core/cmd/shell_local_test.go @@ -83,7 +83,7 @@ func genTestEVMRelayers(t *testing.T, cfg chainlink.GeneralConfig, ds sqlutil.Da return relayers } -func TestShell_RunNodeWithAPICredentialsFile(t *testing.T) { +func TestIntegration_Shared_Shell_RunNodeWithAPICredentialsFile(t *testing.T) { tests := []struct { name string apiFile string @@ -162,7 +162,7 @@ func TestShell_RunNodeWithAPICredentialsFile(t *testing.T) { } } -func TestShell_DiskMaxSizeBeforeRotateOptionDisablesAsExpected(t *testing.T) { +func TestUnit_Shell_DiskMaxSizeBeforeRotateOptionDisablesAsExpected(t *testing.T) { tests := []struct { name string logFileSize func(t *testing.T) utils.FileSize @@ -199,7 +199,7 @@ func TestShell_DiskMaxSizeBeforeRotateOptionDisablesAsExpected(t *testing.T) { } } -func TestShell_RebroadcastTransactions_Txm(t *testing.T) { +func TestIntegration_Shared_Shell_RebroadcastTransactions_Txm(t *testing.T) { // Use a non-transactional db for this test because we need to // test multiple connections to the database, and changes made within // the transaction cannot be seen from another connection. @@ -268,7 +268,7 @@ func TestShell_RebroadcastTransactions_Txm(t *testing.T) { assert.NoError(t, c.RebroadcastTransactions(ctx)) } -func TestShell_RebroadcastTransactions_OutsideRange_Txm(t *testing.T) { +func TestIntegration_Shared_Shell_RebroadcastTransactions_OutsideRange_Txm(t *testing.T) { beginningNonce := uint(7) endingNonce := uint(10) gasPrice := big.NewInt(100000000000) @@ -356,7 +356,7 @@ func TestShell_RebroadcastTransactions_OutsideRange_Txm(t *testing.T) { } } -func TestShell_RebroadcastTransactions_AddressCheck(t *testing.T) { +func TestIntegration_Shared_Shell_RebroadcastTransactions_AddressCheck(t *testing.T) { tests := []struct { name string enableAddress bool @@ -430,7 +430,7 @@ func TestShell_RebroadcastTransactions_AddressCheck(t *testing.T) { } } -func TestShell_CleanupChainTables(t *testing.T) { +func TestIntegration_Shared_Shell_CleanupChainTables(t *testing.T) { // Just check if it doesn't error, command itself shouldn't be changed unless major schema changes were made. // It would be really hard to write a test that accounts for schema changes, so this should be enough to alarm us that something broke. config, _ := heavyweight.FullTestDBV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { c.Database.DriverName = pgcommon.DriverPostgres }) @@ -450,7 +450,7 @@ func TestShell_CleanupChainTables(t *testing.T) { require.NoError(t, client.CleanupChainTables(c)) } -func TestShell_RemoveBlocks(t *testing.T) { +func TestIntegration_Shared_Shell_RemoveBlocks(t *testing.T) { db := pgtest.NewSqlxDB(t) cfg := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { s.Password.Keystore = models.NewSecret("dummy") @@ -505,7 +505,7 @@ func TestShell_RemoveBlocks(t *testing.T) { }) } -func TestShell_BeforeNode(t *testing.T) { +func TestIntegration_Shared_Shell_BeforeNode(t *testing.T) { tests := []struct { name string pwdfile string @@ -575,7 +575,7 @@ func TestShell_BeforeNode(t *testing.T) { } } -func TestShell_RunNode_WithBeforeNode(t *testing.T) { +func TestIntegration_Shared_Shell_RunNode_WithBeforeNode(t *testing.T) { tests := []struct { name string pwdfile string diff --git a/core/cmd/shell_remote_test.go b/core/cmd/shell_remote_test.go index bd9e8f2a25a..98ed0722035 100644 --- a/core/cmd/shell_remote_test.go +++ b/core/cmd/shell_remote_test.go @@ -116,7 +116,7 @@ func deleteKeyExportFile(t *testing.T) { require.NoError(t, err) } -func TestShell_ReplayBlocks(t *testing.T) { +func TestIntegration_Shared_Shell_ReplayBlocks(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { c.EVM[0].Enabled = ptr(true) @@ -151,7 +151,7 @@ func TestShell_ReplayBlocks(t *testing.T) { assert.NoError(t, client.ReplayFromBlock(c)) } -func TestShell_CreateExternalInitiator(t *testing.T) { +func TestIntegration_Shared_Shell_CreateExternalInitiator(t *testing.T) { t.Parallel() tests := []struct { @@ -191,7 +191,7 @@ func TestShell_CreateExternalInitiator(t *testing.T) { } } -func TestShell_CreateExternalInitiator_Errors(t *testing.T) { +func TestIntegration_Shared_Shell_CreateExternalInitiator_Errors(t *testing.T) { t.Parallel() tests := []struct { @@ -228,7 +228,7 @@ func TestShell_CreateExternalInitiator_Errors(t *testing.T) { } } -func TestShell_DestroyExternalInitiator(t *testing.T) { +func TestIntegration_Shared_Shell_DestroyExternalInitiator(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { @@ -254,7 +254,7 @@ func TestShell_DestroyExternalInitiator(t *testing.T) { assert.Empty(t, r.Renders) } -func TestShell_DestroyExternalInitiator_NotFound(t *testing.T) { +func TestIntegration_Shared_Shell_DestroyExternalInitiator_NotFound(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { @@ -272,7 +272,7 @@ func TestShell_DestroyExternalInitiator_NotFound(t *testing.T) { assert.Empty(t, r.Renders) } -func TestShell_RemoteLogin(t *testing.T) { +func TestIntegration_Shared_Shell_RemoteLogin(t *testing.T) { app := startNewApplicationV2(t, nil) orm := app.AuthenticationProvider() @@ -313,7 +313,7 @@ func TestShell_RemoteLogin(t *testing.T) { } } -func TestShell_RemoteBuildCompatibility(t *testing.T) { +func TestIntegration_Shared_Shell_RemoteBuildCompatibility(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, nil) @@ -352,7 +352,7 @@ func TestShell_RemoteBuildCompatibility(t *testing.T) { assert.EqualError(t, err, expErr) } -func TestShell_CheckRemoteBuildCompatibility(t *testing.T) { +func TestIntegration_Shared_Shell_CheckRemoteBuildCompatibility(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, nil) @@ -428,7 +428,7 @@ func (h *mockHTTPClient) Delete(ctx context.Context, path string) (*http.Respons return h.HTTP.Delete(ctx, path) } -func TestShell_ChangePassword(t *testing.T) { +func TestIntegration_Shared_Shell_ChangePassword(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, nil) @@ -478,7 +478,7 @@ func TestShell_ChangePassword(t *testing.T) { require.Contains(t, err.Error(), "Unauthorized") } -func TestShell_Profile(t *testing.T) { +func TestIntegration_Shared_Shell_Profile(t *testing.T) { quarantine.Flaky(t, "DX-1796") t.Parallel() @@ -513,7 +513,7 @@ func TestShell_Profile(t *testing.T) { require.NotEmpty(t, ents, "ents %+v", ents) } -func TestShell_Profile_Unauthenticated(t *testing.T) { +func TestIntegration_Shared_Shell_Profile_Unauthenticated(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, nil) @@ -529,7 +529,7 @@ func TestShell_Profile_Unauthenticated(t *testing.T) { require.ErrorContains(t, err, "Unauthorized") } -func TestShell_ConfigV2(t *testing.T) { +func TestIntegration_Shared_Shell_ConfigV2(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, nil) @@ -548,7 +548,7 @@ func TestShell_ConfigV2(t *testing.T) { }) } -func TestShell_RunOCRJob_HappyPath(t *testing.T) { +func TestIntegration_Shared_Shell_RunOCRJob_HappyPath(t *testing.T) { t.Parallel() ctx := testutils.Context(t) app := startNewApplicationV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { @@ -594,7 +594,7 @@ func TestShell_RunOCRJob_HappyPath(t *testing.T) { require.NoError(t, client.TriggerPipelineRun(c)) } -func TestShell_RunOCRJob_MissingJobID(t *testing.T) { +func TestIntegration_Shared_Shell_RunOCRJob_MissingJobID(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, nil) @@ -611,7 +611,7 @@ func TestShell_RunOCRJob_MissingJobID(t *testing.T) { assert.EqualError(t, client.TriggerPipelineRun(c), "Must pass the job id to trigger a run") } -func TestShell_RunOCRJob_JobNotFound(t *testing.T) { +func TestIntegration_Shared_Shell_RunOCRJob_JobNotFound(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, nil) @@ -630,7 +630,7 @@ func TestShell_RunOCRJob_JobNotFound(t *testing.T) { assert.Contains(t, err.Error(), "findJob failed: failed to load job") } -func TestShell_AutoLogin(t *testing.T) { +func TestIntegration_Shared_Shell_AutoLogin(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -659,7 +659,7 @@ func TestShell_AutoLogin(t *testing.T) { require.NoError(t, err) } -func TestShell_AutoLogin_AuthFails(t *testing.T) { +func TestIntegration_Shared_Shell_AutoLogin_AuthFails(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -698,7 +698,7 @@ func (FailingAuthenticator) Logout() error { return errors.New("no luck") } -func TestShell_SetLogConfig(t *testing.T) { +func TestIntegration_Shared_Shell_SetLogConfig(t *testing.T) { t.Parallel() app := startNewApplicationV2(t, nil) diff --git a/core/cmd/shell_test.go b/core/cmd/shell_test.go index c5a72a93a1d..d7fc502d63d 100644 --- a/core/cmd/shell_test.go +++ b/core/cmd/shell_test.go @@ -40,7 +40,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/plugins" ) -func TestTerminalCookieAuthenticator_AuthenticateWithoutSession(t *testing.T) { +func TestIntegration_Shared_TerminalCookieAuthenticator_AuthenticateWithoutSession(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -71,7 +71,7 @@ func TestTerminalCookieAuthenticator_AuthenticateWithoutSession(t *testing.T) { } } -func TestTerminalCookieAuthenticator_AuthenticateWithSession(t *testing.T) { +func TestIntegration_Shared_TerminalCookieAuthenticator_AuthenticateWithSession(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -121,7 +121,7 @@ func (d diskCookieStoreConfig) RootDir() string { return d.rootdir } -func TestDiskCookieStore_Retrieve(t *testing.T) { +func TestIntegration_Shared_DiskCookieStore_Retrieve(t *testing.T) { t.Parallel() cfg := diskCookieStoreConfig{} @@ -150,7 +150,7 @@ func TestDiskCookieStore_Retrieve(t *testing.T) { }) } -func TestTerminalAPIInitializer_InitializeWithoutAPIUser(t *testing.T) { +func TestIntegration_Shared_TerminalAPIInitializer_InitializeWithoutAPIUser(t *testing.T) { email := "good@email.com" tests := []struct { @@ -196,7 +196,7 @@ func TestTerminalAPIInitializer_InitializeWithoutAPIUser(t *testing.T) { } } -func TestTerminalAPIInitializer_InitializeWithExistingAPIUser(t *testing.T) { +func TestUnit_TerminalAPIInitializer_InitializeWithExistingAPIUser(t *testing.T) { ctx := testutils.Context(t) db := pgtest.NewSqlxDB(t) lggr := logger.TestLogger(t) @@ -223,7 +223,7 @@ func TestTerminalAPIInitializer_InitializeWithExistingAPIUser(t *testing.T) { assert.Equal(t, initialUser.HashedPassword, user.HashedPassword) } -func TestFileAPIInitializer_InitializeWithoutAPIUser(t *testing.T) { +func TestUnit_FileAPIInitializer_InitializeWithoutAPIUser(t *testing.T) { tests := []struct { name string file string @@ -260,7 +260,7 @@ func TestFileAPIInitializer_InitializeWithoutAPIUser(t *testing.T) { } } -func TestFileAPIInitializer_InitializeWithExistingAPIUser(t *testing.T) { +func TestUnit_FileAPIInitializer_InitializeWithExistingAPIUser(t *testing.T) { db := pgtest.NewSqlxDB(t) orm := localauth.NewORM(db, time.Minute, logger.TestLogger(t), audit.NoopLogger) @@ -289,7 +289,7 @@ func TestFileAPIInitializer_InitializeWithExistingAPIUser(t *testing.T) { } } -func TestPromptingSessionRequestBuilder(t *testing.T) { +func TestUnit_PromptingSessionRequestBuilder(t *testing.T) { t.Parallel() tests := []struct { @@ -312,7 +312,7 @@ func TestPromptingSessionRequestBuilder(t *testing.T) { } } -func TestFileSessionRequestBuilder(t *testing.T) { +func TestUnit_FileSessionRequestBuilder(t *testing.T) { t.Parallel() builder := cmd.NewFileSessionRequestBuilder(logger.TestLogger(t)) @@ -338,7 +338,7 @@ func TestFileSessionRequestBuilder(t *testing.T) { } } -func TestNewUserCache(t *testing.T) { +func TestUnit_NewUserCache(t *testing.T) { r, err := rand.Int(rand.Reader, big.NewInt(256*1024*1024)) require.NoError(t, err) // NewUserCache owns it's Dir. @@ -355,7 +355,7 @@ func TestNewUserCache(t *testing.T) { assert.DirExists(t, c.RootDir()) } -func TestSetupSolanaRelayer(t *testing.T) { +func TestUnit_SetupSolanaRelayer(t *testing.T) { lggr := logger.TestLogger(t) reg := plugins.NewTestLoopRegistry(lggr) ks := &keystore.StarknetLooppSigner{StarkNet: mocks.NewStarkNet(t)} @@ -483,7 +483,7 @@ func TestSetupSolanaRelayer(t *testing.T) { }) } -func TestSetupStarkNetRelayer(t *testing.T) { +func TestUnit_SetupStarkNetRelayer(t *testing.T) { lggr := logger.TestLogger(t) reg := plugins.NewTestLoopRegistry(lggr) ks := &keystore.StarknetLooppSigner{StarkNet: mocks.NewStarkNet(t)} @@ -623,7 +623,7 @@ func getFuncName(i any) string { return runtime.FuncForPC(reflect.ValueOf(i).Pointer()).Name() } -func TestShell_emitNodeConfig(t *testing.T) { +func TestUnit_Shell_emitNodeConfig(t *testing.T) { // t.Parallel() // beholder tester uses t.SetEnv and cannot use t.Parallel ctx := testutils.Context(t) diff --git a/core/cmd/solana_keys_commands_test.go b/core/cmd/solana_keys_commands_test.go index ca6c4678b8d..92799f6707b 100644 --- a/core/cmd/solana_keys_commands_test.go +++ b/core/cmd/solana_keys_commands_test.go @@ -20,7 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func TestSolanaKeyPresenter_RenderTable(t *testing.T) { +func TestUnit_SolanaKeyPresenter_RenderTable(t *testing.T) { t.Parallel() var ( @@ -55,7 +55,7 @@ func TestSolanaKeyPresenter_RenderTable(t *testing.T) { assert.Contains(t, output, pubKey) } -func TestShell_SolanaKeys(t *testing.T) { +func TestUnit_Shell_SolanaKeys(t *testing.T) { app := startNewApplicationV2(t, nil) ks := app.GetKeyStore().Solana() cleanup := func() { diff --git a/core/cmd/solana_transaction_commands_test.go b/core/cmd/solana_transaction_commands_test.go index d0d20fe451a..3741192cfa8 100644 --- a/core/cmd/solana_transaction_commands_test.go +++ b/core/cmd/solana_transaction_commands_test.go @@ -24,7 +24,7 @@ import ( ) // TODO: move this test to `chainlink-solana` https://smartcontract-it.atlassian.net/browse/NONEVM-790 -func TestShell_SolanaSendSol(t *testing.T) { +func TestUnit_Shell_SolanaSendSol(t *testing.T) { ctx := testutils.Context(t) chainID := "localnet" url := solanatesting.SetupLocalSolNode(t) diff --git a/core/cmd/starknet_keys_commands_test.go b/core/cmd/starknet_keys_commands_test.go index 683a78cb3ee..344ef87960e 100644 --- a/core/cmd/starknet_keys_commands_test.go +++ b/core/cmd/starknet_keys_commands_test.go @@ -20,7 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func TestStarkNetKeyPresenter_RenderTable(t *testing.T) { +func TestUnit_StarkNetKeyPresenter_RenderTable(t *testing.T) { t.Parallel() var ( @@ -54,7 +54,7 @@ func TestStarkNetKeyPresenter_RenderTable(t *testing.T) { assert.Contains(t, output, starkKey) } -func TestShell_StarkNetKeys(t *testing.T) { +func TestUnit_Shell_StarkNetKeys(t *testing.T) { app := startNewApplicationV2(t, nil) ks := app.GetKeyStore().StarkNet() cleanup := func() { diff --git a/core/cmd/sui_keys_commands_test.go b/core/cmd/sui_keys_commands_test.go index e57db1ef5cf..0adaa30a699 100644 --- a/core/cmd/sui_keys_commands_test.go +++ b/core/cmd/sui_keys_commands_test.go @@ -21,7 +21,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func TestSuiKeyPresenter_RenderTable(t *testing.T) { +func TestUnit_SuiKeyPresenter_RenderTable(t *testing.T) { t.Parallel() var ( @@ -56,7 +56,7 @@ func TestSuiKeyPresenter_RenderTable(t *testing.T) { assert.Contains(t, output, pubKey) } -func TestShell_SuiKeys(t *testing.T) { +func TestUnit_Shell_SuiKeys(t *testing.T) { app := startNewApplicationV2(t, nil) ks := app.GetKeyStore().Sui() cleanup := func() { diff --git a/core/cmd/ton_keys_commands_test.go b/core/cmd/ton_keys_commands_test.go index 3af934868a8..bd220034eec 100644 --- a/core/cmd/ton_keys_commands_test.go +++ b/core/cmd/ton_keys_commands_test.go @@ -20,7 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func TestTONKeyPresenter_RenderTable(t *testing.T) { +func TestUnit_TONKeyPresenter_RenderTable(t *testing.T) { t.Parallel() var ( @@ -55,7 +55,7 @@ func TestTONKeyPresenter_RenderTable(t *testing.T) { assert.Contains(t, output, pubKey) } -func TestShell_TONKeys(t *testing.T) { +func TestUnit_Shell_TONKeys(t *testing.T) { app := startNewApplicationV2(t, nil) ks := app.GetKeyStore().TON() cleanup := func() { diff --git a/core/cmd/tron_keys_commands_test.go b/core/cmd/tron_keys_commands_test.go index 29480600d74..dffd8e14c48 100644 --- a/core/cmd/tron_keys_commands_test.go +++ b/core/cmd/tron_keys_commands_test.go @@ -20,7 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func TestTronKeyPresenter_RenderTable(t *testing.T) { +func TestUnit_TronKeyPresenter_RenderTable(t *testing.T) { t.Parallel() var ( @@ -55,7 +55,7 @@ func TestTronKeyPresenter_RenderTable(t *testing.T) { assert.Contains(t, output, pubKey) } -func TestShell_TronKeys(t *testing.T) { +func TestUnit_Shell_TronKeys(t *testing.T) { app := startNewApplicationV2(t, nil) ks := app.GetKeyStore().Tron() cleanup := func() { diff --git a/core/cmd/vrf_keys_commands_test.go b/core/cmd/vrf_keys_commands_test.go index 0876a64bcbb..3bf75276165 100644 --- a/core/cmd/vrf_keys_commands_test.go +++ b/core/cmd/vrf_keys_commands_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func TestVRFKeyPresenter_RenderTable(t *testing.T) { +func TestUnit_VRFKeyPresenter_RenderTable(t *testing.T) { t.Parallel() var ( @@ -66,7 +66,7 @@ func AssertKeysEqualNoTimestamps(t *testing.T, k1, k2 cmd.VRFKeyPresenter) { assert.Equal(t, k1.Uncompressed, k2.Uncompressed) } -func TestShellVRF_CRUD(t *testing.T) { +func TestUnit_ShellVRF_CRUD(t *testing.T) { t.Parallel() // Test application boots with vrf password loaded in memory. @@ -124,7 +124,7 @@ func TestShellVRF_CRUD(t *testing.T) { assert.Len(t, allKeys, 1) } -func TestVRF_ImportExport(t *testing.T) { +func TestUnit_VRF_ImportExport(t *testing.T) { t.Parallel() // Test application boots with vrf password loaded in memory. // i.e. as if a user had booted with --vrfpassword= diff --git a/core/config/config_internal_test.go b/core/config/config_internal_test.go index 41c6a4bb19d..a051004905f 100644 --- a/core/config/config_internal_test.go +++ b/core/config/config_internal_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/config/parse" ) -func TestStore_bigIntParser(t *testing.T) { +func TestUnit_Store_bigIntParser(t *testing.T) { val, err := parse.BigInt("0") assert.NoError(t, err) assert.Equal(t, new(big.Int).SetInt64(0), val) @@ -30,7 +30,7 @@ func TestStore_bigIntParser(t *testing.T) { assert.Nil(t, val) } -func TestStore_levelParser(t *testing.T) { +func TestUnit_Store_levelParser(t *testing.T) { val, err := parse.LogLevel("ERROR") assert.NoError(t, err) assert.Equal(t, zapcore.ErrorLevel, val) @@ -44,7 +44,7 @@ func TestStore_levelParser(t *testing.T) { assert.Equal(t, val, zapcore.Level(0)) } -func TestStore_urlParser(t *testing.T) { +func TestUnit_Store_urlParser(t *testing.T) { tests := []struct { name string input string @@ -71,7 +71,7 @@ func TestStore_urlParser(t *testing.T) { } } -func TestStore_boolParser(t *testing.T) { +func TestUnit_Store_boolParser(t *testing.T) { val, err := parse.Bool("true") assert.NoError(t, err) assert.Equal(t, true, val) diff --git a/core/config/docs/defaults_test.go b/core/config/docs/defaults_test.go index 1f56bf9386d..72c5cd4f038 100644 --- a/core/config/docs/defaults_test.go +++ b/core/config/docs/defaults_test.go @@ -6,6 +6,6 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/config/configtest" ) -func TestCoreDefaults_notNil(t *testing.T) { +func TestUnit_CoreDefaults_notNil(t *testing.T) { configtest.AssertFieldsNotNil(t, CoreDefaults()) } diff --git a/core/config/docs/docs_test.go b/core/config/docs/docs_test.go index cc4d1f28948..26b90aceda6 100644 --- a/core/config/docs/docs_test.go +++ b/core/config/docs/docs_test.go @@ -9,6 +9,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" ) -func TestDocsTOMLComplete(t *testing.T) { +func TestUnit_DocsTOMLComplete(t *testing.T) { configtest.AssertDocsTOMLComplete[chainlink.Config](t, docs.DocsTOML) } diff --git a/core/config/env/env_test.go b/core/config/env/env_test.go index a0e9a309ca7..cafda78eeed 100644 --- a/core/config/env/env_test.go +++ b/core/config/env/env_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestNewPlugin(t *testing.T) { +func TestUnit_NewPlugin(t *testing.T) { for _, tt := range []struct { name string kind string diff --git a/core/config/toml/types_test.go b/core/config/toml/types_test.go index 9134a226066..c3c4e60ec47 100644 --- a/core/config/toml/types_test.go +++ b/core/config/toml/types_test.go @@ -20,7 +20,7 @@ import ( configutils "github.com/smartcontractkit/chainlink/v2/core/utils/config" ) -func TestMercurySecrets_valid(t *testing.T) { +func TestUnit_MercurySecrets_valid(t *testing.T) { ms := MercurySecrets{ Credentials: map[string]MercuryCredentials{ "cred1": { @@ -46,7 +46,7 @@ func TestMercurySecrets_valid(t *testing.T) { assert.NoError(t, err) } -func TestMercurySecrets_duplicateURLs(t *testing.T) { +func TestUnit_MercurySecrets_duplicateURLs(t *testing.T) { ms := MercurySecrets{ Credentials: map[string]MercuryCredentials{ "cred1": { @@ -67,7 +67,7 @@ func TestMercurySecrets_duplicateURLs(t *testing.T) { assert.Equal(t, "URL: invalid value (https://GOOGLE.COM): duplicate - must be unique", err.Error()) } -func TestMercurySecrets_emptyURL(t *testing.T) { +func TestUnit_MercurySecrets_emptyURL(t *testing.T) { ms := MercurySecrets{ Credentials: map[string]MercuryCredentials{ "cred1": { @@ -83,7 +83,7 @@ func TestMercurySecrets_emptyURL(t *testing.T) { assert.Equal(t, "URL: missing: must be provided and non-empty", err.Error()) } -func Test_validateDBURL(t *testing.T) { +func TestUnit_validateDBURL(t *testing.T) { t.Parallel() tests := []struct { @@ -113,7 +113,7 @@ func Test_validateDBURL(t *testing.T) { } } -func TestDatabaseSecrets_ValidateConfig(t *testing.T) { +func TestUnit_DatabaseSecrets_ValidateConfig(t *testing.T) { validUrl := commonconfig.URL(url.URL{Scheme: "https", Host: "localhost"}) validSecretURL := *models.NewSecretURL(&validUrl) @@ -186,7 +186,7 @@ func TestDatabaseSecrets_ValidateConfig(t *testing.T) { }) } } -func TestTracing_ValidateCollectorTarget(t *testing.T) { +func TestUnit_Tracing_ValidateCollectorTarget(t *testing.T) { tests := []struct { name string collectorTarget *string @@ -314,7 +314,7 @@ func TestTracing_ValidateCollectorTarget(t *testing.T) { } } -func TestTracing_ValidateSamplingRatio(t *testing.T) { +func TestUnit_Tracing_ValidateSamplingRatio(t *testing.T) { tests := []struct { name string samplingRatio *float64 @@ -374,7 +374,7 @@ func TestTracing_ValidateSamplingRatio(t *testing.T) { } } -func TestTracing_ValidateTLSCertPath(t *testing.T) { +func TestUnit_Tracing_ValidateTLSCertPath(t *testing.T) { // tests for Tracing.Mode = 'tls' tls_tests := []struct { name string @@ -474,7 +474,7 @@ func TestTracing_ValidateTLSCertPath(t *testing.T) { } } -func TestTracing_ValidateMode(t *testing.T) { +func TestUnit_Tracing_ValidateMode(t *testing.T) { tests := []struct { name string mode *string @@ -536,7 +536,7 @@ func TestTracing_ValidateMode(t *testing.T) { } } -func TestMercuryTLS_ValidateTLSCertPath(t *testing.T) { +func TestUnit_MercuryTLS_ValidateTLSCertPath(t *testing.T) { tests := []struct { name string tlsCertPath *string @@ -581,7 +581,7 @@ func TestMercuryTLS_ValidateTLSCertPath(t *testing.T) { } } -func TestEthKeys_TOMLSerialization(t *testing.T) { +func TestUnit_EthKeys_TOMLSerialization(t *testing.T) { t.Parallel() t.Run("encode", func(t *testing.T) { ethKeysWrapper := EthKeys{ @@ -622,7 +622,7 @@ Password = 'something'` }) } -func TestSolKeys_TOMLSerialization(t *testing.T) { +func TestUnit_SolKeys_TOMLSerialization(t *testing.T) { t.Parallel() t.Run("encode", func(t *testing.T) { @@ -664,7 +664,7 @@ Password = 'secret'` }) } -func TestSolKeys_SetFrom(t *testing.T) { +func TestUnit_SolKeys_SetFrom(t *testing.T) { t.Parallel() solKeysWrapper1 := &SolKeys{} @@ -683,7 +683,7 @@ func TestSolKeys_SetFrom(t *testing.T) { assert.Equal(t, solKeysWrapper2, *solKeysWrapper1) } -func TestEthKeys_SetFrom(t *testing.T) { +func TestUnit_EthKeys_SetFrom(t *testing.T) { ethKeysWrapper1 := &EthKeys{} ethKeysWrapper2 := EthKeys{ Keys: []*EthKey{ @@ -699,7 +699,7 @@ func TestEthKeys_SetFrom(t *testing.T) { // ptr is a utility function for converting a value to a pointer to the value. func ptr[T any](t T) *T { return &t } -func TestBridgeStatusReporter_ValidateConfig(t *testing.T) { +func TestUnit_BridgeStatusReporter_ValidateConfig(t *testing.T) { testCases := []struct { name string config *BridgeStatusReporter diff --git a/core/internal/testutils/pgtest/txdb_test.go b/core/internal/testutils/pgtest/txdb_test.go index 37339bf28be..ba1be5462f3 100644 --- a/core/internal/testutils/pgtest/txdb_test.go +++ b/core/internal/testutils/pgtest/txdb_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" ) -func TestTxDBDriver(t *testing.T) { +func TestUnit_TxDBDriver(t *testing.T) { db := NewSqlxDB(t) dropTable := func() error { _, err := db.Exec(`DROP TABLE IF EXISTS txdb_test`) diff --git a/core/logger/audit/audit_logger_test.go b/core/logger/audit/audit_logger_test.go index f3a41821b85..d09b4340d7d 100644 --- a/core/logger/audit/audit_logger_test.go +++ b/core/logger/audit/audit_logger_test.go @@ -82,7 +82,7 @@ func (c Config) JsonWrapperKey() string { return "" } -func TestCheckLoginAuditLog(t *testing.T) { +func TestUnit_CheckLoginAuditLog(t *testing.T) { t.Parallel() // Create a channel that will be used instead of an HTTP client diff --git a/core/logger/disk_stats_test.go b/core/logger/disk_stats_test.go index ee0e5bbf99a..9934bbbb705 100644 --- a/core/logger/disk_stats_test.go +++ b/core/logger/disk_stats_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" ) -func Test_diskSpaceAvailable(t *testing.T) { +func TestUnit_diskSpaceAvailable(t *testing.T) { t.Parallel() size, err := diskSpaceAvailable(".") diff --git a/core/logger/fields_test.go b/core/logger/fields_test.go index 511756cfc13..c1093a4adce 100644 --- a/core/logger/fields_test.go +++ b/core/logger/fields_test.go @@ -8,7 +8,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func TestFields_Merge(t *testing.T) { +func TestUnit_Fields_Merge(t *testing.T) { t.Parallel() f1 := make(logger.Fields) @@ -36,7 +36,7 @@ func TestFields_Merge(t *testing.T) { }) } -func TestFields_Slice(t *testing.T) { +func TestUnit_Fields_Slice(t *testing.T) { t.Parallel() f := make(logger.Fields) @@ -62,7 +62,7 @@ func TestFields_Slice(t *testing.T) { }) } -func TestFields_With(t *testing.T) { +func TestUnit_Fields_With(t *testing.T) { t.Parallel() f := make(logger.Fields) diff --git a/core/logger/internal/colortest/prettyconsole_test.go b/core/logger/internal/colortest/prettyconsole_test.go index 125f5a2ea50..dbaf2a7e6dc 100644 --- a/core/logger/internal/colortest/prettyconsole_test.go +++ b/core/logger/internal/colortest/prettyconsole_test.go @@ -12,7 +12,7 @@ func init() { logger.InitColor(true) } -func TestPrettyConsole_Write(t *testing.T) { +func TestUnit_PrettyConsole_Write(t *testing.T) { tests := []struct { name string input string diff --git a/core/logger/logger_test.go b/core/logger/logger_test.go index db0bf5073c3..9c223355424 100644 --- a/core/logger/logger_test.go +++ b/core/logger/logger_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger/otelzap" ) -func TestConfig(t *testing.T) { +func TestUnit_Config(t *testing.T) { // no sampling assert.Nil(t, newZapConfigBase().Sampling) assert.Nil(t, newZapConfigProd(false, false).Sampling) @@ -21,7 +21,7 @@ func TestConfig(t *testing.T) { assert.False(t, newZapConfigProd(false, false).Development) } -func TestStderrWriter(t *testing.T) { +func TestUnit_StderrWriter(t *testing.T) { sw := stderrWriter{} // Test Write @@ -34,7 +34,7 @@ func TestStderrWriter(t *testing.T) { require.NoError(t, err) } -func TestOtelCore(t *testing.T) { +func TestUnit_OtelCore(t *testing.T) { testCases := []struct { name string enableOtel bool diff --git a/core/logger/null_logger_test.go b/core/logger/null_logger_test.go index 6df99942647..237e73266e7 100644 --- a/core/logger/null_logger_test.go +++ b/core/logger/null_logger_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func TestNullLogger(t *testing.T) { +func TestUnit_NullLogger(t *testing.T) { t.Parallel() t.Run("names", func(t *testing.T) { diff --git a/core/logger/passthrough_test.go b/core/logger/passthrough_test.go index b56880ccd45..5a49b5d6d82 100644 --- a/core/logger/passthrough_test.go +++ b/core/logger/passthrough_test.go @@ -12,7 +12,7 @@ import ( var errTest = errors.New("error") -func TestLogger_Passthrough(t *testing.T) { +func TestUnit_Logger_Passthrough(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/logger/prometheus_test.go b/core/logger/prometheus_test.go index e1763678122..4a10afc1b2e 100644 --- a/core/logger/prometheus_test.go +++ b/core/logger/prometheus_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestPrometheusLogger_Counters(t *testing.T) { +func TestUnit_PrometheusLogger_Counters(t *testing.T) { t.Parallel() createRandomNameCounter := func() prometheus.Counter { diff --git a/core/logger/sentry_test.go b/core/logger/sentry_test.go index 6d9e8fe0f1c..71b875c2d87 100644 --- a/core/logger/sentry_test.go +++ b/core/logger/sentry_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" ) -func Test_toMap(t *testing.T) { +func TestUnit_toMap(t *testing.T) { t.Run("with even number of keys/values", func(t *testing.T) { keysAndValues := []any{ "foo", 1, "bar", 42.43, "boggly", "str", diff --git a/core/logger/test_logger_test.go b/core/logger/test_logger_test.go index fdc059132d1..87be96d5532 100644 --- a/core/logger/test_logger_test.go +++ b/core/logger/test_logger_test.go @@ -14,7 +14,7 @@ func init() { InitColor(false) } -func TestTestLogger(t *testing.T) { +func TestUnit_TestLogger(t *testing.T) { lgr, observed := TestLoggerObserved(t, zapcore.DebugLevel) const ( diff --git a/core/logger/trace_noop_test.go b/core/logger/trace_noop_test.go index 0a261290a7c..e17874734d7 100644 --- a/core/logger/trace_noop_test.go +++ b/core/logger/trace_noop_test.go @@ -9,7 +9,7 @@ import ( "go.uber.org/zap/zapcore" ) -func TestTrace(t *testing.T) { +func TestUnit_Trace(t *testing.T) { lgr, observed := TestLoggerObserved(t, zapcore.InfoLevel) const ( diff --git a/core/logger/trace_test.go b/core/logger/trace_test.go index bbaebf01148..9df720284b3 100644 --- a/core/logger/trace_test.go +++ b/core/logger/trace_test.go @@ -9,7 +9,7 @@ import ( "go.uber.org/zap/zapcore" ) -func TestTrace(t *testing.T) { +func TestUnit_Trace(t *testing.T) { lgr, observed := TestLoggerObserved(t, zapcore.DebugLevel) lgr.SetLogLevel(zapcore.InfoLevel) diff --git a/core/logger/zap_test.go b/core/logger/zap_test.go index 655341efcd3..700f8990374 100644 --- a/core/logger/zap_test.go +++ b/core/logger/zap_test.go @@ -22,7 +22,7 @@ func newTestLogger(t *testing.T, cfg Config) Logger { return lggr } -func TestZapLogger_OutOfDiskSpace(t *testing.T) { +func TestUnit_ZapLogger_OutOfDiskSpace(t *testing.T) { maxSize := utils.FileSize(5 * utils.MB) logsDir := t.TempDir() @@ -206,7 +206,7 @@ func TestZapLogger_OutOfDiskSpace(t *testing.T) { }) } -func TestZapLogger_LogCaller(t *testing.T) { +func TestUnit_ZapLogger_LogCaller(t *testing.T) { maxSize := utils.FileSize(5 * utils.MB) logsDir := t.TempDir() @@ -258,7 +258,7 @@ func TestZapLogger_LogCaller(t *testing.T) { require.Contains(t, lines[0], "logger/zap_test.go:246") } -func TestZapLogger_Name(t *testing.T) { +func TestUnit_ZapLogger_Name(t *testing.T) { cfg := Config{} lggr := newTestLogger(t, cfg) require.Empty(t, lggr.Name()) diff --git a/core/monitoring/utils_test.go b/core/monitoring/utils_test.go index 878f927890c..caff67aff5e 100644 --- a/core/monitoring/utils_test.go +++ b/core/monitoring/utils_test.go @@ -7,7 +7,7 @@ import ( "go.opentelemetry.io/otel/attribute" ) -func TestKvMapToOtelAttributes(t *testing.T) { +func TestUnit_KvMapToOtelAttributes(t *testing.T) { tests := []struct { name string input map[string]string diff --git a/core/null/int64_test.go b/core/null/int64_test.go index a3cbadf4357..15b52253550 100644 --- a/core/null/int64_test.go +++ b/core/null/int64_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/null" ) -func TestInt64From(t *testing.T) { +func TestUnit_Int64From(t *testing.T) { tests := []struct { input int64 }{ @@ -29,7 +29,7 @@ func TestInt64From(t *testing.T) { } } -func TestUnmarshalInt64_Valid(t *testing.T) { +func TestUnit_UnmarshalInt64_Valid(t *testing.T) { tests := []struct { name, input string }{ @@ -48,7 +48,7 @@ func TestUnmarshalInt64_Valid(t *testing.T) { } } -func TestUnmarshalInt64_Invalid(t *testing.T) { +func TestUnit_UnmarshalInt64_Invalid(t *testing.T) { tests := []struct { name, input string }{ @@ -66,7 +66,7 @@ func TestUnmarshalInt64_Invalid(t *testing.T) { } } -func TestUnmarshalInt64_Error(t *testing.T) { +func TestUnit_UnmarshalInt64_Error(t *testing.T) { tests := []struct { name, input string }{ @@ -85,7 +85,7 @@ func TestUnmarshalInt64_Error(t *testing.T) { } } -func TestUnmarshalUint64Overflow(t *testing.T) { +func TestUnit_UnmarshalUint64Overflow(t *testing.T) { // Max int64 should decode successfully var i null.Int64 err := json.Unmarshal([]byte(strconv.FormatInt(math.MaxInt64, 10)), &i) @@ -96,7 +96,7 @@ func TestUnmarshalUint64Overflow(t *testing.T) { require.Error(t, err) } -func TestTextUnmarshalInt64_Valid(t *testing.T) { +func TestUnit_TextUnmarshalInt64_Valid(t *testing.T) { var i null.Int64 err := i.UnmarshalText([]byte("12345")) require.NoError(t, err) @@ -104,7 +104,7 @@ func TestTextUnmarshalInt64_Valid(t *testing.T) { assert.Equal(t, int64(12345), i.Int64) } -func TestTextUnmarshalInt64_Invalid(t *testing.T) { +func TestUnit_TextUnmarshalInt64_Invalid(t *testing.T) { tests := []struct { name, input string }{ @@ -122,7 +122,7 @@ func TestTextUnmarshalInt64_Invalid(t *testing.T) { } } -func TestMarshalInt64(t *testing.T) { +func TestUnit_MarshalInt64(t *testing.T) { i := null.Int64From(12345) data, err := json.Marshal(i) require.NoError(t, err) @@ -135,7 +135,7 @@ func TestMarshalInt64(t *testing.T) { assertJSONEquals(t, data, "null", "null json marshal") } -func TestMarshalInt64Text(t *testing.T) { +func TestUnit_MarshalInt64Text(t *testing.T) { i := null.Int64From(12345) data, err := i.MarshalText() require.NoError(t, err) @@ -148,14 +148,14 @@ func TestMarshalInt64Text(t *testing.T) { assertJSONEquals(t, data, "", "null text marshal") } -func TestInt64SetValid(t *testing.T) { +func TestUnit_Int64SetValid(t *testing.T) { change := null.NewInt64(0, false) change.SetValid(12345) assert.True(t, change.Valid) assert.Equal(t, int64(12345), change.Int64) } -func TestInt64Scan(t *testing.T) { +func TestUnit_Int64Scan(t *testing.T) { var i null.Int64 err := i.Scan(int(12345)) require.NoError(t, err) diff --git a/core/null/uint32_test.go b/core/null/uint32_test.go index 45a9cc223f1..54410b33b18 100644 --- a/core/null/uint32_test.go +++ b/core/null/uint32_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/null" ) -func TestUint32From(t *testing.T) { +func TestUnit_Uint32From(t *testing.T) { tests := []struct { input uint32 }{ @@ -29,7 +29,7 @@ func TestUint32From(t *testing.T) { } } -func TestUnmarshalUint32_Valid(t *testing.T) { +func TestUnit_UnmarshalUint32_Valid(t *testing.T) { tests := []struct { name, input string }{ @@ -48,7 +48,7 @@ func TestUnmarshalUint32_Valid(t *testing.T) { } } -func TestUnmarshalUint32_Invalid(t *testing.T) { +func TestUnit_UnmarshalUint32_Invalid(t *testing.T) { tests := []struct { name, input string }{ @@ -66,7 +66,7 @@ func TestUnmarshalUint32_Invalid(t *testing.T) { } } -func TestUnmarshalUint32_Error(t *testing.T) { +func TestUnit_UnmarshalUint32_Error(t *testing.T) { tests := []struct { name, input string }{ @@ -85,7 +85,7 @@ func TestUnmarshalUint32_Error(t *testing.T) { } } -func TestUnmarshalUint32Overflow(t *testing.T) { +func TestUnit_UnmarshalUint32Overflow(t *testing.T) { maxUint32 := uint64(math.MaxUint32) // Max uint32 should decode successfully @@ -98,7 +98,7 @@ func TestUnmarshalUint32Overflow(t *testing.T) { require.Error(t, err) } -func TestTextUnmarshalInt_Valid(t *testing.T) { +func TestUnit_TextUnmarshalInt_Valid(t *testing.T) { var i null.Uint32 err := i.UnmarshalText([]byte("12345")) require.NoError(t, err) @@ -106,7 +106,7 @@ func TestTextUnmarshalInt_Valid(t *testing.T) { assert.Equal(t, uint32(12345), i.Uint32) } -func TestTextUnmarshalInt_Invalid(t *testing.T) { +func TestUnit_TextUnmarshalInt_Invalid(t *testing.T) { tests := []struct { name, input string }{ @@ -124,7 +124,7 @@ func TestTextUnmarshalInt_Invalid(t *testing.T) { } } -func TestMarshalInt(t *testing.T) { +func TestUnit_MarshalInt(t *testing.T) { i := null.Uint32From(12345) data, err := json.Marshal(i) require.NoError(t, err) @@ -137,7 +137,7 @@ func TestMarshalInt(t *testing.T) { assertJSONEquals(t, data, "null", "null json marshal") } -func TestMarshalIntText(t *testing.T) { +func TestUnit_MarshalIntText(t *testing.T) { i := null.Uint32From(12345) data, err := i.MarshalText() require.NoError(t, err) @@ -150,14 +150,14 @@ func TestMarshalIntText(t *testing.T) { assertJSONEquals(t, data, "", "null text marshal") } -func TestUint32SetValid(t *testing.T) { +func TestUnit_Uint32SetValid(t *testing.T) { change := null.NewUint32(0, false) change.SetValid(12345) assert.True(t, change.Valid) assert.Equal(t, uint32(12345), change.Uint32) } -func TestUint32Scan(t *testing.T) { +func TestUnit_Uint32Scan(t *testing.T) { var i null.Uint32 err := i.Scan(12345) require.NoError(t, err) diff --git a/core/services/blockhashstore/bhs_test.go b/core/services/blockhashstore/bhs_test.go index 6effae4c914..58a27671cd6 100644 --- a/core/services/blockhashstore/bhs_test.go +++ b/core/services/blockhashstore/bhs_test.go @@ -23,7 +23,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/blockhashstore" ) -func TestStoreRotatesFromAddresses(t *testing.T) { +func TestIntegration_Shared_StoreRotatesFromAddresses(t *testing.T) { ctx := testutils.Context(t) db := pgtest.NewSqlxDB(t) ethClient := clienttest.NewClientWithDefaultChainID(t) diff --git a/core/services/blockhashstore/delegate_test.go b/core/services/blockhashstore/delegate_test.go index c5acde73a42..7fa1ed3c085 100644 --- a/core/services/blockhashstore/delegate_test.go +++ b/core/services/blockhashstore/delegate_test.go @@ -29,7 +29,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" ) -func TestDelegate_JobType(t *testing.T) { +func TestUnit_Delegate_JobType(t *testing.T) { t.Parallel() lggr := logger.TestLogger(t) @@ -83,7 +83,7 @@ func createTestDelegate(t *testing.T) (*blockhashstore.Delegate, *testData) { } } -func TestDelegate_ServicesForSpec(t *testing.T) { +func TestIntegration_Shared_Delegate_ServicesForSpec(t *testing.T) { t.Parallel() delegate, testData := createTestDelegate(t) @@ -150,7 +150,7 @@ func TestDelegate_ServicesForSpec(t *testing.T) { }) } -func TestDelegate_StartStop(t *testing.T) { +func TestIntegration_Shared_Delegate_StartStop(t *testing.T) { t.Parallel() delegate, testData := createTestDelegate(t) diff --git a/core/services/blockhashstore/feeder_test.go b/core/services/blockhashstore/feeder_test.go index 736e4abe92d..d068ce606b0 100644 --- a/core/services/blockhashstore/feeder_test.go +++ b/core/services/blockhashstore/feeder_test.go @@ -223,7 +223,7 @@ var ( } ) -func TestStartHeartbeats(t *testing.T) { +func TestUnit_StartHeartbeats(t *testing.T) { t.Skip("fails after geth upgrade https://github.com/smartcontractkit/chainlink/pull/11809") t.Run("bhs_heartbeat_happy_path", func(t *testing.T) { expectedDuration := 600 * time.Second @@ -360,7 +360,7 @@ type testCase struct { expectedErrMsg string } -func TestFeeder(t *testing.T) { +func TestUnit_Feeder(t *testing.T) { for _, test := range tests { t.Run(test.name, test.testFeeder) } @@ -397,7 +397,7 @@ func (test testCase) testFeeder(t *testing.T) { require.ElementsMatch(t, test.expectedStoredMapBlocks, maps.Keys(feeder.stored)) } -func TestFeederWithLogPollerVRFv1(t *testing.T) { +func TestUnit_FeederWithLogPollerVRFv1(t *testing.T) { for _, test := range tests { t.Run(test.name, test.testFeederWithLogPollerVRFv1) } @@ -491,7 +491,7 @@ func (test testCase) testFeederWithLogPollerVRFv1(t *testing.T) { require.ElementsMatch(t, test.expectedStoredMapBlocks, maps.Keys(feeder.stored)) } -func TestFeederWithLogPollerVRFv2(t *testing.T) { +func TestUnit_FeederWithLogPollerVRFv2(t *testing.T) { for _, test := range tests { t.Run(test.name, test.testFeederWithLogPollerVRFv2) } @@ -589,7 +589,7 @@ func (test testCase) testFeederWithLogPollerVRFv2(t *testing.T) { require.ElementsMatch(t, test.expectedStoredMapBlocks, maps.Keys(feeder.stored)) } -func TestFeederWithLogPollerVRFv2Plus(t *testing.T) { +func TestUnit_FeederWithLogPollerVRFv2Plus(t *testing.T) { for _, test := range tests { t.Run(test.name, test.testFeederWithLogPollerVRFv2Plus) } @@ -687,7 +687,7 @@ func (test testCase) testFeederWithLogPollerVRFv2Plus(t *testing.T) { require.ElementsMatch(t, test.expectedStoredMapBlocks, maps.Keys(feeder.stored)) } -func TestFeeder_CachesStoredBlocks(t *testing.T) { +func TestUnit_Feeder_CachesStoredBlocks(t *testing.T) { coordinator := &TestCoordinator{ RequestEvents: []Event{{Block: 100, ID: "1000"}}, } diff --git a/core/services/blockhashstore/validate_test.go b/core/services/blockhashstore/validate_test.go index 8dea0a6f2fa..f8bc4d8ba66 100644 --- a/core/services/blockhashstore/validate_test.go +++ b/core/services/blockhashstore/validate_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/job" ) -func TestValidate(t *testing.T) { +func TestUnit_Validate(t *testing.T) { v1Coordinator := types.EIP55Address("0x1F72B4A5DCf7CC6d2E38423bF2f4BFA7db97d139") v2Coordinator := types.EIP55Address("0x2be990eE17832b59E0086534c5ea2459Aa75E38F") fromAddresses := []types.EIP55Address{("0x469aA2CD13e037DC5236320783dCfd0e641c0559")} diff --git a/core/services/blockheaderfeeder/block_header_feeder_test.go b/core/services/blockheaderfeeder/block_header_feeder_test.go index 3b6d1939c4e..7ac03638fc6 100644 --- a/core/services/blockheaderfeeder/block_header_feeder_test.go +++ b/core/services/blockheaderfeeder/block_header_feeder_test.go @@ -34,7 +34,7 @@ type testCase struct { batchBHS blockhashstore.TestBatchBHS } -func TestFeeder(t *testing.T) { +func TestUnit_Feeder(t *testing.T) { tests := []testCase{ { name: "single missing block", @@ -232,7 +232,7 @@ func (test testCase) testFeeder(t *testing.T) { require.Equal(t, test.storeBatchCallCount, test.batchBHS.StoreVerifyHeaderCallCounter) } -func TestFeeder_CachesStoredBlocks(t *testing.T) { +func TestUnit_Feeder_CachesStoredBlocks(t *testing.T) { coordinator := &blockhashstore.TestCoordinator{ RequestEvents: []blockhashstore.Event{{Block: 74, ID: "request"}}, } diff --git a/core/services/blockheaderfeeder/validate_test.go b/core/services/blockheaderfeeder/validate_test.go index dd48ad9face..3c7d33c5fcc 100644 --- a/core/services/blockheaderfeeder/validate_test.go +++ b/core/services/blockheaderfeeder/validate_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/job" ) -func TestValidate(t *testing.T) { +func TestUnit_Validate(t *testing.T) { v1Coordinator := types.EIP55Address("0x1F72B4A5DCf7CC6d2E38423bF2f4BFA7db97d139") v2Coordinator := types.EIP55Address("0x2be990eE17832b59E0086534c5ea2459Aa75E38F") v2PlusCoordinator := types.EIP55Address("0x92B5e28Ac583812874e4271380c7d070C5FB6E6b") diff --git a/core/services/ccip/observability_test.go b/core/services/ccip/observability_test.go index 2e8809fcbc0..94949f15374 100644 --- a/core/services/ccip/observability_test.go +++ b/core/services/ccip/observability_test.go @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func Test_MetricsAreTrackedForAllMethods(t *testing.T) { +func TestUnit_MetricsAreTrackedForAllMethods(t *testing.T) { ctx := testutils.Context(t) db := pgtest.NewSqlxDB(t) ccipORM, err := NewObservedORM(db, logger.TestLogger(t)) diff --git a/core/services/ccip/orm_test.go b/core/services/ccip/orm_test.go index f8418ad7112..dc42d67697f 100644 --- a/core/services/ccip/orm_test.go +++ b/core/services/ccip/orm_test.go @@ -108,14 +108,14 @@ func getTokenTableRowCount(t *testing.T, ds sqlutil.DataSource) int { return count } -func TestInitORM(t *testing.T) { +func TestUnit_InitORM(t *testing.T) { t.Parallel() orm, _ := setupORM(t) assert.NotNil(t, orm) } -func TestORM_EmptyGasPrices(t *testing.T) { +func TestUnit_ORM_EmptyGasPrices(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -126,7 +126,7 @@ func TestORM_EmptyGasPrices(t *testing.T) { assert.NoError(t, err) } -func TestORM_EmptyTokenPrices(t *testing.T) { +func TestUnit_ORM_EmptyTokenPrices(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -137,7 +137,7 @@ func TestORM_EmptyTokenPrices(t *testing.T) { assert.NoError(t, err) } -func TestORM_InsertAndGetGasPrices(t *testing.T) { +func TestUnit_ORM_InsertAndGetGasPrices(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -206,7 +206,7 @@ func TestORM_InsertAndGetGasPrices(t *testing.T) { } } -func TestORM_UpsertGasPrices(t *testing.T) { +func TestUnit_ORM_UpsertGasPrices(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -240,7 +240,7 @@ func TestORM_UpsertGasPrices(t *testing.T) { assert.Equal(t, numSourceChainSelectors, getGasTableRowCount(t, db)) } -func TestORM_InsertAndGetTokenPrices(t *testing.T) { +func TestUnit_ORM_InsertAndGetTokenPrices(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -309,7 +309,7 @@ func TestORM_InsertAndGetTokenPrices(t *testing.T) { } } -func TestORM_InsertTokenPricesWhenExpired(t *testing.T) { +func TestUnit_ORM_InsertTokenPricesWhenExpired(t *testing.T) { t.Parallel() ctx := testutils.Context(t) orm, _ := setupORM(t) diff --git a/core/services/chainlink/config_audit_logger_test.go b/core/services/chainlink/config_audit_logger_test.go index 482968a14bc..d5a45622c28 100644 --- a/core/services/chainlink/config_audit_logger_test.go +++ b/core/services/chainlink/config_audit_logger_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestAuditLoggerConfig(t *testing.T) { +func TestUnit_AuditLoggerConfig(t *testing.T) { opts := GeneralConfigOpts{ ConfigStrings: []string{fullTOML}, } diff --git a/core/services/chainlink/config_auto_pprof_test.go b/core/services/chainlink/config_auto_pprof_test.go index ac3024c27db..b1f51be8d27 100644 --- a/core/services/chainlink/config_auto_pprof_test.go +++ b/core/services/chainlink/config_auto_pprof_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils" ) -func TestAutoPprofTest(t *testing.T) { +func TestUnit_AutoPprofTest(t *testing.T) { opts := GeneralConfigOpts{ ConfigStrings: []string{fullTOML}, } diff --git a/core/services/chainlink/config_capabilities_test.go b/core/services/chainlink/config_capabilities_test.go index 7ff3f3fed08..412b5ca2ac9 100644 --- a/core/services/chainlink/config_capabilities_test.go +++ b/core/services/chainlink/config_capabilities_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/libocr/commontypes" ) -func TestCapabilitiesConfig(t *testing.T) { +func TestUnit_CapabilitiesConfig(t *testing.T) { opts := GeneralConfigOpts{ ConfigStrings: []string{fullTOML}, } diff --git a/core/services/chainlink/config_ccv_test.go b/core/services/chainlink/config_ccv_test.go index 342f2476bf7..10fec4ceb54 100644 --- a/core/services/chainlink/config_ccv_test.go +++ b/core/services/chainlink/config_ccv_test.go @@ -24,7 +24,7 @@ APISecret = "indexer-api-secret" ` ) -func TestCCVConfig(t *testing.T) { +func TestUnit_CCVConfig(t *testing.T) { opts := GeneralConfigOpts{ SecretsStrings: []string{secretsCCV}, } diff --git a/core/services/chainlink/config_cre_test.go b/core/services/chainlink/config_cre_test.go index e39aa12b78f..0c56d307e1c 100644 --- a/core/services/chainlink/config_cre_test.go +++ b/core/services/chainlink/config_cre_test.go @@ -33,7 +33,7 @@ URL = "file:///path/to/workflows" ` ) -func TestCREConfig(t *testing.T) { +func TestUnit_CREConfig(t *testing.T) { opts := GeneralConfigOpts{ SecretsStrings: []string{secretsCRE}, ConfigStrings: []string{configCRE}, @@ -54,7 +54,7 @@ func TestCREConfig(t *testing.T) { assert.Equal(t, "http://workflow-server.example.com/workflows", fetcher.URL()) } -func TestCREConfigWithFileURL(t *testing.T) { +func TestUnit_CREConfigWithFileURL(t *testing.T) { opts := GeneralConfigOpts{ ConfigStrings: []string{configCREWithFileURL}, } @@ -67,7 +67,7 @@ func TestCREConfigWithFileURL(t *testing.T) { assert.Equal(t, "file:///path/to/workflows", fetcher.URL()) } -func TestEmptyCREConfig(t *testing.T) { +func TestUnit_EmptyCREConfig(t *testing.T) { cfg := creConfig{s: toml.CreSecrets{}, c: toml.CreConfig{}} assert.Empty(t, cfg.StreamsAPIKey()) assert.Empty(t, cfg.StreamsAPISecret()) @@ -80,7 +80,7 @@ func TestEmptyCREConfig(t *testing.T) { assert.Empty(t, fetcher.URL(), "Empty WorkflowFetcher should have empty URL") } -func TestWorkflowFetcherConfig(t *testing.T) { +func TestUnit_WorkflowFetcherConfig(t *testing.T) { testCases := []struct { name string config string diff --git a/core/services/chainlink/config_database_test.go b/core/services/chainlink/config_database_test.go index aff1f57a8b8..0da335cda1f 100644 --- a/core/services/chainlink/config_database_test.go +++ b/core/services/chainlink/config_database_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/config" ) -func TestDatabaseConfig(t *testing.T) { +func TestUnit_DatabaseConfig(t *testing.T) { opts := GeneralConfigOpts{ ConfigStrings: []string{fullTOML}, SecretsStrings: []string{`[Database] diff --git a/core/services/chainlink/config_feature_test.go b/core/services/chainlink/config_feature_test.go index 8fa5884450a..cc2226422bd 100644 --- a/core/services/chainlink/config_feature_test.go +++ b/core/services/chainlink/config_feature_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestFeatureConfig(t *testing.T) { +func TestUnit_FeatureConfig(t *testing.T) { opts := GeneralConfigOpts{ ConfigStrings: []string{fullTOML}, } diff --git a/core/services/chainlink/config_flux_monitor_test.go b/core/services/chainlink/config_flux_monitor_test.go index 673c4465db7..0d20706d4e1 100644 --- a/core/services/chainlink/config_flux_monitor_test.go +++ b/core/services/chainlink/config_flux_monitor_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestFluxMonitorConfig(t *testing.T) { +func TestUnit_FluxMonitorConfig(t *testing.T) { opts := GeneralConfigOpts{ ConfigStrings: []string{fullTOML}, } diff --git a/core/services/chainlink/config_general_dev_test.go b/core/services/chainlink/config_general_dev_test.go index 78558fbdcc2..ac6eb0ec50e 100644 --- a/core/services/chainlink/config_general_dev_test.go +++ b/core/services/chainlink/config_general_dev_test.go @@ -14,7 +14,7 @@ import ( // Tests in this file only run in dev mode // /usr/bin/go test --tags=dev -timeout 360s -run ^TestTOMLGeneralConfig_DevModeInsecureConfig github.com/smartcontractkit/chainlink/v2/core/services/chainlink -func TestTOMLGeneralConfig_DevModeInsecureConfig(t *testing.T) { +func TestUnit_TOMLGeneralConfig_DevModeInsecureConfig(t *testing.T) { t.Parallel() t.Run("all insecure configs are false by default", func(t *testing.T) { diff --git a/core/services/chainlink/config_general_test.go b/core/services/chainlink/config_general_test.go index e610b7a6921..5df91e84d0b 100644 --- a/core/services/chainlink/config_general_test.go +++ b/core/services/chainlink/config_general_test.go @@ -19,7 +19,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/config/toml" ) -func TestTOMLGeneralConfig_Defaults(t *testing.T) { +func TestUnit_TOMLGeneralConfig_Defaults(t *testing.T) { config, err := GeneralConfigOpts{}.New() require.NoError(t, err) assert.Equal(t, (*url.URL)(nil), config.WebServer().BridgeResponseURL()) @@ -33,7 +33,7 @@ func TestTOMLGeneralConfig_Defaults(t *testing.T) { assert.Equal(t, 15*time.Minute, config.WebServer().SessionTimeout().Duration()) } -func TestTOMLGeneralConfig_InsecureConfig(t *testing.T) { +func TestIntegration_Shared_TOMLGeneralConfig_InsecureConfig(t *testing.T) { t.Parallel() t.Run("all insecure configs are false by default", func(t *testing.T) { @@ -82,7 +82,7 @@ func TestTOMLGeneralConfig_InsecureConfig(t *testing.T) { }) } -func TestValidateDB(t *testing.T) { +func TestUnit_ValidateDB(t *testing.T) { t.Setenv(string(env.Config), "") t.Run("unset db url", func(t *testing.T) { @@ -117,7 +117,7 @@ func TestValidateDB(t *testing.T) { }) } -func TestConfig_LogSQL(t *testing.T) { +func TestUnit_Config_LogSQL(t *testing.T) { config, err := GeneralConfigOpts{}.New() require.NoError(t, err) @@ -155,7 +155,7 @@ var WebServerLDAPSecretsTOML string //go:embed testdata/mergingsecretsdata/secrets-webserver-oidc.toml var WebServerOIDCSecretsTOML string -func TestConfig_SecretsMerging(t *testing.T) { +func TestUnit_Config_SecretsMerging(t *testing.T) { t.Run("verify secrets merging in GeneralConfigOpts.New()", func(t *testing.T) { databaseSecrets, err := parseSecrets(databaseSecretsTOML) require.NoErrorf(t, err, "error: %s", err) diff --git a/core/services/chainlink/config_insecure_test.go b/core/services/chainlink/config_insecure_test.go index 72f1cf28bb8..7c6e9ec937f 100644 --- a/core/services/chainlink/config_insecure_test.go +++ b/core/services/chainlink/config_insecure_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestInsecureConfig(t *testing.T) { +func TestUnit_InsecureConfig(t *testing.T) { opts := GeneralConfigOpts{ ConfigStrings: []string{fullTOML}, } diff --git a/core/services/chainlink/config_job_distributor_test.go b/core/services/chainlink/config_job_distributor_test.go index 423b3b4ca00..e396190de56 100644 --- a/core/services/chainlink/config_job_distributor_test.go +++ b/core/services/chainlink/config_job_distributor_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestJobDistributorConfig(t *testing.T) { +func TestUnit_JobDistributorConfig(t *testing.T) { opts := GeneralConfigOpts{ ConfigStrings: []string{fullTOML}, } diff --git a/core/services/chainlink/config_job_pipeline_test.go b/core/services/chainlink/config_job_pipeline_test.go index 9a865569eb3..22e7bbd16c6 100644 --- a/core/services/chainlink/config_job_pipeline_test.go +++ b/core/services/chainlink/config_job_pipeline_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils" ) -func TestJobPipelineConfigTest(t *testing.T) { +func TestUnit_JobPipelineConfigTest(t *testing.T) { opts := GeneralConfigOpts{ ConfigStrings: []string{fullTOML}, } diff --git a/core/services/chainlink/config_keeper_test.go b/core/services/chainlink/config_keeper_test.go index 7fd571c8880..2db912a79ae 100644 --- a/core/services/chainlink/config_keeper_test.go +++ b/core/services/chainlink/config_keeper_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestKeeperConfig(t *testing.T) { +func TestUnit_KeeperConfig(t *testing.T) { opts := GeneralConfigOpts{ ConfigStrings: []string{fullTOML}, } diff --git a/core/services/chainlink/config_log_test.go b/core/services/chainlink/config_log_test.go index bc5828a2056..d4da9d13177 100644 --- a/core/services/chainlink/config_log_test.go +++ b/core/services/chainlink/config_log_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils" ) -func TestLogConfig(t *testing.T) { +func TestUnit_LogConfig(t *testing.T) { opts := GeneralConfigOpts{ ConfigStrings: []string{fullTOML}, } diff --git a/core/services/chainlink/config_mercury_test.go b/core/services/chainlink/config_mercury_test.go index 1ae8dc0ba2e..89951f9018e 100644 --- a/core/services/chainlink/config_mercury_test.go +++ b/core/services/chainlink/config_mercury_test.go @@ -25,7 +25,7 @@ Password = "password2" ` ) -func TestMercuryConfig(t *testing.T) { +func TestUnit_MercuryConfig(t *testing.T) { opts := GeneralConfigOpts{ SecretsStrings: []string{secretsMercury}, } @@ -37,7 +37,7 @@ func TestMercuryConfig(t *testing.T) { assert.Equal(t, &types.MercuryCredentials{URL: "https://chain2.link", Username: "username2", Password: "password2"}, m.Credentials("cred2")) } -func TestMercuryTLS(t *testing.T) { +func TestUnit_MercuryTLS(t *testing.T) { certPath := "/path/to/cert.pem" transmission := toml.Mercury{ TLS: toml.MercuryTLS{ diff --git a/core/services/chainlink/config_ocr2_test.go b/core/services/chainlink/config_ocr2_test.go index ebaef4e7f0b..601e23c07ec 100644 --- a/core/services/chainlink/config_ocr2_test.go +++ b/core/services/chainlink/config_ocr2_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestOCR2Config(t *testing.T) { +func TestUnit_OCR2Config(t *testing.T) { opts := GeneralConfigOpts{ ConfigStrings: []string{fullTOML}, } diff --git a/core/services/chainlink/config_ocr_test.go b/core/services/chainlink/config_ocr_test.go index 0a3038f1d34..d54d33b41d9 100644 --- a/core/services/chainlink/config_ocr_test.go +++ b/core/services/chainlink/config_ocr_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestOCRConfig(t *testing.T) { +func TestUnit_OCRConfig(t *testing.T) { opts := GeneralConfigOpts{ ConfigStrings: []string{fullTOML}, } diff --git a/core/services/chainlink/config_p2p_test.go b/core/services/chainlink/config_p2p_test.go index 12ee01b85d7..930a396b7a3 100644 --- a/core/services/chainlink/config_p2p_test.go +++ b/core/services/chainlink/config_p2p_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/libocr/commontypes" ) -func TestP2PConfig(t *testing.T) { +func TestUnit_P2PConfig(t *testing.T) { opts := GeneralConfigOpts{ ConfigStrings: []string{fullTOML}, } diff --git a/core/services/chainlink/config_password_test.go b/core/services/chainlink/config_password_test.go index fddcea0936b..c4d1133895a 100644 --- a/core/services/chainlink/config_password_test.go +++ b/core/services/chainlink/config_password_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestPasswordConfig(t *testing.T) { +func TestUnit_PasswordConfig(t *testing.T) { opts := GeneralConfigOpts{ ConfigStrings: []string{fullTOML}, } diff --git a/core/services/chainlink/config_prometheus_test.go b/core/services/chainlink/config_prometheus_test.go index 654a07e1824..053f37fe822 100644 --- a/core/services/chainlink/config_prometheus_test.go +++ b/core/services/chainlink/config_prometheus_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestPrometheusConfig(t *testing.T) { +func TestUnit_PrometheusConfig(t *testing.T) { opts := GeneralConfigOpts{ ConfigStrings: []string{fullTOML}, } diff --git a/core/services/chainlink/config_pyroscope_test.go b/core/services/chainlink/config_pyroscope_test.go index 33078f41621..9441d30e328 100644 --- a/core/services/chainlink/config_pyroscope_test.go +++ b/core/services/chainlink/config_pyroscope_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestPyroscopeConfigTest(t *testing.T) { +func TestUnit_PyroscopeConfigTest(t *testing.T) { opts := GeneralConfigOpts{ ConfigStrings: []string{fullTOML}, SecretsStrings: []string{secretsFullTOML}, diff --git a/core/services/chainlink/config_telemetry_ingress_test.go b/core/services/chainlink/config_telemetry_ingress_test.go index 2bcdf3c80b1..38cb718142f 100644 --- a/core/services/chainlink/config_telemetry_ingress_test.go +++ b/core/services/chainlink/config_telemetry_ingress_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/config/toml" ) -func TestTelemetryIngressConfig(t *testing.T) { +func TestUnit_TelemetryIngressConfig(t *testing.T) { opts := GeneralConfigOpts{ ConfigStrings: []string{fullTOML}, } @@ -35,7 +35,7 @@ func TestTelemetryIngressConfig(t *testing.T) { assert.Equal(t, "test-pub-key", tec[0].ServerPubKey()) } -func TestTelemetryIngressConfig_ChipIngressEnabled(t *testing.T) { +func TestUnit_TelemetryIngressConfig_ChipIngressEnabled(t *testing.T) { t.Run("returns false when ChipIngressEnabled is explicitly false", func(t *testing.T) { falseVal := false config := &telemetryIngressConfig{ diff --git a/core/services/chainlink/config_telemetry_test.go b/core/services/chainlink/config_telemetry_test.go index 6fbeabf2c62..bf91d52e2ae 100644 --- a/core/services/chainlink/config_telemetry_test.go +++ b/core/services/chainlink/config_telemetry_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/static" ) -func TestTelemetryConfig_Enabled(t *testing.T) { +func TestUnit_TelemetryConfig_Enabled(t *testing.T) { trueVal := true falseVal := false @@ -33,7 +33,7 @@ func TestTelemetryConfig_Enabled(t *testing.T) { } } -func TestTelemetryConfig_InsecureConnection(t *testing.T) { +func TestUnit_TelemetryConfig_InsecureConnection(t *testing.T) { trueVal := true falseVal := false @@ -54,7 +54,7 @@ func TestTelemetryConfig_InsecureConnection(t *testing.T) { } } -func TestTelemetryConfig_CACertFile(t *testing.T) { +func TestUnit_TelemetryConfig_CACertFile(t *testing.T) { tests := []struct { name string telemetry toml.Telemetry @@ -72,7 +72,7 @@ func TestTelemetryConfig_CACertFile(t *testing.T) { } } -func TestTelemetryConfig_OtelExporterGRPCEndpoint(t *testing.T) { +func TestUnit_TelemetryConfig_OtelExporterGRPCEndpoint(t *testing.T) { tests := []struct { name string telemetry toml.Telemetry @@ -90,7 +90,7 @@ func TestTelemetryConfig_OtelExporterGRPCEndpoint(t *testing.T) { } } -func TestTelemetryConfig_ResourceAttributes(t *testing.T) { +func TestUnit_TelemetryConfig_ResourceAttributes(t *testing.T) { tests := []struct { name string telemetry toml.Telemetry @@ -127,7 +127,7 @@ func TestTelemetryConfig_ResourceAttributes(t *testing.T) { } } -func TestTelemetryConfig_TraceSampleRatio(t *testing.T) { +func TestUnit_TelemetryConfig_TraceSampleRatio(t *testing.T) { tests := []struct { name string telemetry toml.Telemetry @@ -144,7 +144,7 @@ func TestTelemetryConfig_TraceSampleRatio(t *testing.T) { } } -func TestTelemetryConfig_EmitterBatchProcessor(t *testing.T) { +func TestUnit_TelemetryConfig_EmitterBatchProcessor(t *testing.T) { tests := []struct { name string telemetry toml.Telemetry @@ -162,7 +162,7 @@ func TestTelemetryConfig_EmitterBatchProcessor(t *testing.T) { } } -func TestTelemetryConfig_EmitterExportTimeout(t *testing.T) { +func TestUnit_TelemetryConfig_EmitterExportTimeout(t *testing.T) { tests := []struct { name string telemetry toml.Telemetry @@ -181,7 +181,7 @@ func TestTelemetryConfig_EmitterExportTimeout(t *testing.T) { } } -func TestTelemetryConfig_ChipIngressEndpoint(t *testing.T) { +func TestUnit_TelemetryConfig_ChipIngressEndpoint(t *testing.T) { tests := []struct { name string telemetry toml.Telemetry @@ -200,7 +200,7 @@ func TestTelemetryConfig_ChipIngressEndpoint(t *testing.T) { } } -func TestTelemetryConfig_ChipIngressInsecureConnection(t *testing.T) { +func TestUnit_TelemetryConfig_ChipIngressInsecureConnection(t *testing.T) { tests := []struct { name string telemetry toml.Telemetry @@ -226,7 +226,7 @@ func ptrFloat(f float64) *float64 { return &f } -func TestTelemetryConfig_HeartbeatInterval(t *testing.T) { +func TestUnit_TelemetryConfig_HeartbeatInterval(t *testing.T) { tests := []struct { name string telemetry toml.Telemetry @@ -245,7 +245,7 @@ func TestTelemetryConfig_HeartbeatInterval(t *testing.T) { } } -func TestTelemetryConfig_LogStreamingEnabled(t *testing.T) { +func TestUnit_TelemetryConfig_LogStreamingEnabled(t *testing.T) { tests := []struct { name string telemetry toml.Telemetry @@ -263,7 +263,7 @@ func TestTelemetryConfig_LogStreamingEnabled(t *testing.T) { } } -func TestTelemetryConfig_LogLevel(t *testing.T) { +func TestUnit_TelemetryConfig_LogLevel(t *testing.T) { tests := []struct { name string telemetry toml.Telemetry @@ -285,7 +285,7 @@ func TestTelemetryConfig_LogLevel(t *testing.T) { } } -func TestTelemetryConfig_LogBatchProcessor(t *testing.T) { +func TestUnit_TelemetryConfig_LogBatchProcessor(t *testing.T) { tests := []struct { name string telemetry toml.Telemetry @@ -304,7 +304,7 @@ func TestTelemetryConfig_LogBatchProcessor(t *testing.T) { } } -func TestTelemetryConfig_LogExportTimeout(t *testing.T) { +func TestUnit_TelemetryConfig_LogExportTimeout(t *testing.T) { tests := []struct { name string telemetry toml.Telemetry @@ -321,7 +321,7 @@ func TestTelemetryConfig_LogExportTimeout(t *testing.T) { }) } } -func TestTelemetryConfig_LogExportMaxBatchSize(t *testing.T) { +func TestUnit_TelemetryConfig_LogExportMaxBatchSize(t *testing.T) { tests := []struct { name string telemetry toml.Telemetry @@ -343,7 +343,7 @@ func ptrInt(i int) *int { return &i } -func TestTelemetryConfig_LogExportInterval(t *testing.T) { +func TestUnit_TelemetryConfig_LogExportInterval(t *testing.T) { tests := []struct { name string telemetry toml.Telemetry @@ -361,7 +361,7 @@ func TestTelemetryConfig_LogExportInterval(t *testing.T) { } } -func TestTelemetryConfig_LogMaxQueueSize(t *testing.T) { +func TestUnit_TelemetryConfig_LogMaxQueueSize(t *testing.T) { tests := []struct { name string telemetry toml.Telemetry diff --git a/core/services/chainlink/config_test.go b/core/services/chainlink/config_test.go index c6a5fa5f770..75550906f6d 100644 --- a/core/services/chainlink/config_test.go +++ b/core/services/chainlink/config_test.go @@ -220,7 +220,7 @@ var ( } ) -func TestConfig_Marshal(t *testing.T) { +func TestUnit_Config_Marshal(t *testing.T) { zeroSeconds := *commoncfg.MustNewDuration(time.Second * 0) second := *commoncfg.MustNewDuration(time.Second) minute := *commoncfg.MustNewDuration(time.Minute) @@ -1470,7 +1470,7 @@ ReaperMaxAge = '678h0m0s' } } -func TestConfig_full(t *testing.T) { +func TestUnit_Config_full(t *testing.T) { var got Config require.NoError(t, commoncfg.DecodeTOML(strings.NewReader(fullTOML), &got)) // Except for some EVM node fields. @@ -1550,7 +1550,7 @@ func TestConfig_full(t *testing.T) { //go:embed testdata/config-invalid.toml var invalidTOML string -func TestConfig_Validate(t *testing.T) { +func TestUnit_Config_Validate(t *testing.T) { for _, tt := range []struct { name string toml string @@ -1705,7 +1705,7 @@ var ( secretsMultiRedactedTOML string ) -func Test_generalConfig_LogConfiguration(t *testing.T) { +func TestUnit_generalConfig_LogConfiguration(t *testing.T) { const ( secrets = "# Secrets:\n" input = "# Input Configuration:\n" @@ -1777,7 +1777,7 @@ func Test_generalConfig_LogConfiguration(t *testing.T) { } } -func TestNewGeneralConfig_ParsingError_InvalidSyntax(t *testing.T) { +func TestUnit_NewGeneralConfig_ParsingError_InvalidSyntax(t *testing.T) { invalidTOML := "{ bad syntax {" opts := GeneralConfigOpts{ ConfigStrings: []string{invalidTOML}, @@ -1787,7 +1787,7 @@ func TestNewGeneralConfig_ParsingError_InvalidSyntax(t *testing.T) { assert.EqualError(t, err, "failed to decode config TOML: toml: invalid character at start of key: {") } -func TestNewGeneralConfig_ParsingError_DuplicateField(t *testing.T) { +func TestUnit_NewGeneralConfig_ParsingError_DuplicateField(t *testing.T) { invalidTOML := `Dev = false Dev = true` opts := GeneralConfigOpts{ @@ -1798,7 +1798,7 @@ Dev = true` assert.EqualError(t, err, "failed to decode config TOML: toml: key Dev is already defined") } -func TestNewGeneralConfig_SecretsOverrides(t *testing.T) { +func TestUnit_NewGeneralConfig_SecretsOverrides(t *testing.T) { // Provide a keystore password file and an env var with DB URL const PWD_OVERRIDE = "great_password" const DBURL_OVERRIDE = "http://user@db" @@ -1818,7 +1818,7 @@ func TestNewGeneralConfig_SecretsOverrides(t *testing.T) { assert.Equal(t, DBURL_OVERRIDE, (&dbURL).String()) } -func TestSecrets_Validate(t *testing.T) { +func TestUnit_Secrets_Validate(t *testing.T) { for _, tt := range []struct { name string toml string @@ -1882,7 +1882,7 @@ func assertValidationError(t *testing.T, invalid interface{ Validate() error }, } } -func TestConfig_setDefaults(t *testing.T) { +func TestUnit_Config_setDefaults(t *testing.T) { var c Config c.EVM = evmcfg.EVMConfigs{{ChainID: ubig.NewI(99999133712345)}} c.Cosmos = RawConfigs{{"ChainID": ptr("unknown cosmos chain")}} @@ -1896,7 +1896,7 @@ func TestConfig_setDefaults(t *testing.T) { configtest.AssertFieldsNotNil(t, c.Core) } -func Test_validateEnv(t *testing.T) { +func TestUnit_validateEnv(t *testing.T) { t.Setenv("LOG_LEVEL", "warn") t.Setenv("DATABASE_URL", "foo") assert.ErrorContains(t, validateEnv(), `invalid environment: 2 errors: @@ -1912,7 +1912,7 @@ func Test_validateEnv(t *testing.T) { - environment variable GAS_UPDATER_ENABLED must not be set: unsupported with config v2`) } -func TestConfig_SetFrom(t *testing.T) { +func TestIntegration_Shared_Config_SetFrom(t *testing.T) { t.Parallel() for _, tt := range []struct { name string @@ -1940,7 +1940,7 @@ func TestConfig_SetFrom(t *testing.T) { } } -func TestConfig_warnings(t *testing.T) { +func TestUnit_Config_warnings(t *testing.T) { tests := []struct { name string config Config @@ -1988,7 +1988,7 @@ func mustHexToBig(t *testing.T, hx string) *big.Int { return n } -func TestRawConfig_IsEnabled(t *testing.T) { +func TestUnit_RawConfig_IsEnabled(t *testing.T) { assert.True(t, RawConfig{"Enabled": true}.IsEnabled()) assert.True(t, RawConfig{"Enabled": nil}.IsEnabled()) assert.True(t, RawConfig{}.IsEnabled()) @@ -1997,7 +1997,7 @@ func TestRawConfig_IsEnabled(t *testing.T) { assert.False(t, RawConfig{"Enabled": "garbage"}.IsEnabled()) } -func TestRawConfig_SetDefaults(t *testing.T) { +func TestUnit_RawConfig_SetDefaults(t *testing.T) { c := RawConfig{"Enabled": true} c.SetDefaults() require.NotContains(t, c, "Enabled") diff --git a/core/services/chainlink/config_threshold_test.go b/core/services/chainlink/config_threshold_test.go index d847f65e3ed..a0c65247a46 100644 --- a/core/services/chainlink/config_threshold_test.go +++ b/core/services/chainlink/config_threshold_test.go @@ -14,7 +14,7 @@ ThresholdKeyShare = "something" ` ) -func TestThresholdConfig(t *testing.T) { +func TestUnit_ThresholdConfig(t *testing.T) { opts := GeneralConfigOpts{ SecretsStrings: []string{thresholdSecrets}, } diff --git a/core/services/chainlink/config_tracing_test.go b/core/services/chainlink/config_tracing_test.go index 37653729cf3..7e540deacbf 100644 --- a/core/services/chainlink/config_tracing_test.go +++ b/core/services/chainlink/config_tracing_test.go @@ -8,7 +8,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/config/toml" ) -func TestTracing_Config(t *testing.T) { +func TestUnit_Tracing_Config(t *testing.T) { // Test when all fields are non-nil enabled := true collectorTarget := "http://localhost:9000" diff --git a/core/services/chainlink/config_web_server_test.go b/core/services/chainlink/config_web_server_test.go index d96e6c05d5e..9599f4ef368 100644 --- a/core/services/chainlink/config_web_server_test.go +++ b/core/services/chainlink/config_web_server_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestWebServerConfig(t *testing.T) { +func TestUnit_WebServerConfig(t *testing.T) { opts := GeneralConfigOpts{ ConfigStrings: []string{fullTOML}, } diff --git a/core/services/chainlink/config_workflows_test.go b/core/services/chainlink/config_workflows_test.go index 6912b409b25..64a19dfccc1 100644 --- a/core/services/chainlink/config_workflows_test.go +++ b/core/services/chainlink/config_workflows_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestWorkflowsConfig(t *testing.T) { +func TestUnit_WorkflowsConfig(t *testing.T) { workflowsTOML := `[Workflows] [Workflows.Limits] Global = 200 diff --git a/core/services/chainlink/heartbeat_test.go b/core/services/chainlink/heartbeat_test.go index c494b3f9094..5ca5237bc53 100644 --- a/core/services/chainlink/heartbeat_test.go +++ b/core/services/chainlink/heartbeat_test.go @@ -19,7 +19,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" ) -func TestNewHeartbeat_ConfiguresHeartbeatInterval(t *testing.T) { +func TestIntegration_Shared_NewHeartbeat_ConfiguresHeartbeatInterval(t *testing.T) { t.Parallel() tests := []struct { @@ -51,7 +51,7 @@ func TestNewHeartbeat_ConfiguresHeartbeatInterval(t *testing.T) { } } -func TestHeartbeat_MeterEvents(t *testing.T) { +func TestUnit_Heartbeat_MeterEvents(t *testing.T) { lggr := logger.TestLogger(t) // Use a thread-safe byte collector diff --git a/core/services/chainlink/relayer_chain_interoperators_test.go b/core/services/chainlink/relayer_chain_interoperators_test.go index 6bfe29050d7..8da3b8a305d 100644 --- a/core/services/chainlink/relayer_chain_interoperators_test.go +++ b/core/services/chainlink/relayer_chain_interoperators_test.go @@ -32,7 +32,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/plugins" ) -func TestCoreRelayerChainInteroperators(t *testing.T) { +func TestIntegration_Shared_CoreRelayerChainInteroperators(t *testing.T) { evmChainID1, evmChainID2 := ubig.New(big.NewInt(1)), ubig.New(big.NewInt(2)) solanaChainID1, solanaChainID2 := "solana-id-1", "solana-id-2" diff --git a/core/services/chainlink/secret_generator_test.go b/core/services/chainlink/secret_generator_test.go index 115884d7901..049f8d9875b 100644 --- a/core/services/chainlink/secret_generator_test.go +++ b/core/services/chainlink/secret_generator_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestFilePersistedSecretGenerator(t *testing.T) { +func TestIntegration_Shared_FilePersistedSecretGenerator(t *testing.T) { t.Parallel() rootDir := t.TempDir() var secretGenerator FilePersistedSecretGenerator diff --git a/core/services/cresettings/validate_test.go b/core/services/cresettings/validate_test.go index cd9a71eec4b..8204337349d 100644 --- a/core/services/cresettings/validate_test.go +++ b/core/services/cresettings/validate_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/job" ) -func TestValidatedCRESettingsSpec(t *testing.T) { +func TestUnit_ValidatedCRESettingsSpec(t *testing.T) { settingsString := `Foo = "bar" ` noHash := fmt.Sprintf(`type = "cresettings" diff --git a/core/services/cron/cron_test.go b/core/services/cron/cron_test.go index 38684e982d9..071f6639417 100644 --- a/core/services/cron/cron_test.go +++ b/core/services/cron/cron_test.go @@ -20,7 +20,7 @@ import ( pipelinemocks "github.com/smartcontractkit/chainlink/v2/core/services/pipeline/mocks" ) -func TestCronV2Pipeline(t *testing.T) { +func TestUnit_CronV2Pipeline(t *testing.T) { runner := pipelinemocks.NewRunner(t) cfg := configtest.NewTestGeneralConfig(t) db := pgtest.NewSqlxDB(t) @@ -51,7 +51,7 @@ func TestCronV2Pipeline(t *testing.T) { defer func() { assert.NoError(t, service.Close()) }() } -func TestCronV2Schedule(t *testing.T) { +func TestUnit_CronV2Schedule(t *testing.T) { t.Parallel() spec := job.Job{ diff --git a/core/services/cron/validate_test.go b/core/services/cron/validate_test.go index a5412971436..bb26e96c672 100644 --- a/core/services/cron/validate_test.go +++ b/core/services/cron/validate_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/job" ) -func TestValidatedCronJobSpec(t *testing.T) { +func TestUnit_ValidatedCronJobSpec(t *testing.T) { var tt = []struct { name string toml string diff --git a/core/services/directrequest/delegate_test.go b/core/services/directrequest/delegate_test.go index e2b4f0c54eb..a6d748aad63 100644 --- a/core/services/directrequest/delegate_test.go +++ b/core/services/directrequest/delegate_test.go @@ -39,7 +39,7 @@ import ( pipeline_mocks "github.com/smartcontractkit/chainlink/v2/core/services/pipeline/mocks" ) -func TestDelegate_ServicesForSpec(t *testing.T) { +func TestIntegration_Shared_Delegate_ServicesForSpec(t *testing.T) { ethClient := clienttest.NewClientWithDefaultChainID(t) runner := pipeline_mocks.NewRunner(t) db := pgtest.NewSqlxDB(t) @@ -153,7 +153,7 @@ func (uni *DirectRequestUniverse) Cleanup() { uni.cleanup() } -func TestDelegate_ServicesListenerHandleLog(t *testing.T) { +func TestIntegration_Shared_Delegate_ServicesListenerHandleLog(t *testing.T) { quarantine.Flaky(t, "DX-1909") testutils.SkipShortDB(t) t.Parallel() diff --git a/core/services/directrequest/validate_test.go b/core/services/directrequest/validate_test.go index 91cd7ece712..c2f4028fae3 100644 --- a/core/services/directrequest/validate_test.go +++ b/core/services/directrequest/validate_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestValidatedDirectRequestSpec(t *testing.T) { +func TestIntegration_Shared_ValidatedDirectRequestSpec(t *testing.T) { t.Parallel() toml := ` @@ -37,7 +37,7 @@ observationSource = """ assert.Equal(t, time.Time{}, s.DirectRequestSpec.UpdatedAt) } -func TestValidatedDirectRequestSpec_MinIncomingConfirmations(t *testing.T) { +func TestIntegration_Shared_ValidatedDirectRequestSpec_MinIncomingConfirmations(t *testing.T) { t.Parallel() t.Run("no minIncomingConfirmations specified", func(t *testing.T) { diff --git a/core/services/feeds/connection_manager_test.go b/core/services/feeds/connection_manager_test.go index b2d592983af..26c1e6a5afd 100644 --- a/core/services/feeds/connection_manager_test.go +++ b/core/services/feeds/connection_manager_test.go @@ -4,7 +4,7 @@ import ( "testing" ) -func Test_connectionsManager_IsConnected(t *testing.T) { +func TestUnit_connectionsManager_IsConnected(t *testing.T) { type fields struct { connections map[int64]*connection } diff --git a/core/services/feeds/models_test.go b/core/services/feeds/models_test.go index 908751d6d8e..b36d1a1bc17 100644 --- a/core/services/feeds/models_test.go +++ b/core/services/feeds/models_test.go @@ -9,7 +9,7 @@ import ( "gopkg.in/guregu/null.v4" ) -func Test_NewChainType(t *testing.T) { +func TestIntegration_Shared_NewChainType(t *testing.T) { t.Parallel() tests := []struct { @@ -58,7 +58,7 @@ func Test_NewChainType(t *testing.T) { } } -func Test_ToPluginType(t *testing.T) { +func TestIntegration_Shared_ToPluginType(t *testing.T) { t.Parallel() pt, err := ToPluginType("commit") @@ -87,7 +87,7 @@ func Test_ToPluginType(t *testing.T) { assert.EqualError(t, err, "unknown plugin type") } -func Test_FromPluginType(t *testing.T) { +func TestIntegration_Shared_FromPluginType(t *testing.T) { t.Parallel() assert.Equal(t, "commit", FromPluginTypeInput(PluginTypeCommit)) @@ -98,7 +98,7 @@ func Test_FromPluginType(t *testing.T) { assert.Equal(t, "unknown", FromPluginTypeInput(PluginTypeUnknown)) } -func Test_FluxMonitorConfig_Value(t *testing.T) { +func TestIntegration_Shared_FluxMonitorConfig_Value(t *testing.T) { t.Parallel() cfg := FluxMonitorConfig{Enabled: true} @@ -113,7 +113,7 @@ func Test_FluxMonitorConfig_Value(t *testing.T) { assert.Equal(t, want, string(actual)) } -func Test_FluxMonitorConfig_Scan(t *testing.T) { +func TestIntegration_Shared_FluxMonitorConfig_Scan(t *testing.T) { t.Parallel() var ( @@ -128,7 +128,7 @@ func Test_FluxMonitorConfig_Scan(t *testing.T) { assert.Equal(t, want, actual) } -func Test_OCR1Config_Value(t *testing.T) { +func TestIntegration_Shared_OCR1Config_Value(t *testing.T) { t.Parallel() var ( @@ -190,7 +190,7 @@ func Test_OCR1Config_Value(t *testing.T) { } } -func Test_OCR1Config_Scan(t *testing.T) { +func TestIntegration_Shared_OCR1Config_Scan(t *testing.T) { t.Parallel() var ( @@ -250,7 +250,7 @@ func Test_OCR1Config_Scan(t *testing.T) { } } -func Test_Plugins_Value(t *testing.T) { +func TestIntegration_Shared_Plugins_Value(t *testing.T) { t.Parallel() var ( @@ -273,7 +273,7 @@ func Test_Plugins_Value(t *testing.T) { assert.Equal(t, want, string(actual)) } -func Test_Plugins_Scan(t *testing.T) { +func TestIntegration_Shared_Plugins_Scan(t *testing.T) { t.Parallel() var ( @@ -294,7 +294,7 @@ func Test_Plugins_Scan(t *testing.T) { assert.Equal(t, want, actual) } -func Test_OCR2Config_Value(t *testing.T) { +func TestIntegration_Shared_OCR2Config_Value(t *testing.T) { t.Parallel() var ( @@ -325,7 +325,7 @@ func Test_OCR2Config_Value(t *testing.T) { assert.Equal(t, want, string(actual)) } -func Test_OCR2Config_Scan(t *testing.T) { +func TestIntegration_Shared_OCR2Config_Scan(t *testing.T) { t.Parallel() var ( @@ -354,7 +354,7 @@ func Test_OCR2Config_Scan(t *testing.T) { assert.Equal(t, want, actual) } -func Test_JobProposal_CanEditDefinition(t *testing.T) { +func TestIntegration_Shared_JobProposal_CanEditDefinition(t *testing.T) { t.Parallel() tests := []struct { @@ -395,7 +395,7 @@ func Test_JobProposal_CanEditDefinition(t *testing.T) { } // Test_toMetrics tests the toMetrics method -func Test_toMetrics(t *testing.T) { +func TestIntegration_Shared_toMetrics(t *testing.T) { t.Parallel() jpCounts := JobProposalCounts{ diff --git a/core/services/feeds/orm_test.go b/core/services/feeds/orm_test.go index bb2009399a6..26ff730ec0c 100644 --- a/core/services/feeds/orm_test.go +++ b/core/services/feeds/orm_test.go @@ -52,7 +52,7 @@ func setupORM(t *testing.T) *TestORM { // Managers -func Test_ORM_CreateManager_CountManagers(t *testing.T) { +func TestIntegration_Shared_ORM_CreateManager_CountManagers(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -79,7 +79,7 @@ func Test_ORM_CreateManager_CountManagers(t *testing.T) { assert.NotZero(t, id) } -func Test_ORM_CreateManager(t *testing.T) { +func TestIntegration_Shared_ORM_CreateManager(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -106,7 +106,7 @@ func Test_ORM_CreateManager(t *testing.T) { assert.NotZero(t, id) } -func Test_ORM_GetManager(t *testing.T) { +func TestIntegration_Shared_ORM_GetManager(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -135,7 +135,7 @@ func Test_ORM_GetManager(t *testing.T) { require.Error(t, err) } -func Test_ORM_ListManagers(t *testing.T) { +func TestIntegration_Shared_ORM_ListManagers(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -163,7 +163,7 @@ func Test_ORM_ListManagers(t *testing.T) { assert.Nil(t, actual.DisabledAt) } -func Test_ORM_ListManagersByIDs(t *testing.T) { +func TestIntegration_Shared_ORM_ListManagersByIDs(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -191,7 +191,7 @@ func Test_ORM_ListManagersByIDs(t *testing.T) { assert.Nil(t, actual.DisabledAt) } -func Test_ORM_UpdateManager(t *testing.T) { +func TestIntegration_Shared_ORM_UpdateManager(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -225,7 +225,7 @@ func Test_ORM_UpdateManager(t *testing.T) { assert.Equal(t, updatedMgr.PublicKey, actual.PublicKey) } -func Test_ORM_EnableAndDisableManager(t *testing.T) { +func TestIntegration_Shared_ORM_EnableAndDisableManager(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -255,7 +255,7 @@ func Test_ORM_EnableAndDisableManager(t *testing.T) { // Chain Config -func Test_ORM_CreateChainConfig(t *testing.T) { +func TestIntegration_Shared_ORM_CreateChainConfig(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -305,7 +305,7 @@ func Test_ORM_CreateChainConfig(t *testing.T) { }, *actual) } -func Test_ORM_CreateBatchChainConfig(t *testing.T) { +func TestIntegration_Shared_ORM_CreateBatchChainConfig(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -369,7 +369,7 @@ func Test_ORM_CreateBatchChainConfig(t *testing.T) { require.Empty(t, ids) } -func Test_ORM_DeleteChainConfig(t *testing.T) { +func TestIntegration_Shared_ORM_DeleteChainConfig(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -399,7 +399,7 @@ func Test_ORM_DeleteChainConfig(t *testing.T) { require.Error(t, err) } -func Test_ORM_ListChainConfigsByManagerIDs(t *testing.T) { +func TestIntegration_Shared_ORM_ListChainConfigsByManagerIDs(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -450,7 +450,7 @@ func Test_ORM_ListChainConfigsByManagerIDs(t *testing.T) { }, actual[0]) } -func Test_ORM_UpdateChainConfig(t *testing.T) { +func TestIntegration_Shared_ORM_UpdateChainConfig(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -513,7 +513,7 @@ func Test_ORM_UpdateChainConfig(t *testing.T) { // Job Proposals -func Test_ORM_CreateJobProposal(t *testing.T) { +func TestIntegration_Shared_ORM_CreateJobProposal(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -547,7 +547,7 @@ func Test_ORM_CreateJobProposal(t *testing.T) { assert.NotZero(t, id) } -func Test_ORM_GetJobProposal(t *testing.T) { +func TestIntegration_Shared_ORM_GetJobProposal(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -612,7 +612,7 @@ func Test_ORM_GetJobProposal(t *testing.T) { }) } -func Test_ORM_CountJobProposalsByStatus(t *testing.T) { +func TestIntegration_Shared_ORM_CountJobProposalsByStatus(t *testing.T) { t.Parallel() testCases := []struct { @@ -806,7 +806,7 @@ func Test_ORM_CountJobProposalsByStatus(t *testing.T) { } } -func Test_ORM_ListJobProposalByManagersIDs(t *testing.T) { +func TestIntegration_Shared_ORM_ListJobProposalByManagersIDs(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -839,7 +839,7 @@ func Test_ORM_ListJobProposalByManagersIDs(t *testing.T) { assert.Equal(t, jp.FeedsManagerID, actual.FeedsManagerID) } -func Test_ORM_UpdateJobProposalStatus(t *testing.T) { +func TestIntegration_Shared_ORM_UpdateJobProposalStatus(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -861,7 +861,7 @@ func Test_ORM_UpdateJobProposalStatus(t *testing.T) { assert.Equal(t, actualCreated.CreatedAt, actual.CreatedAt) } -func Test_ORM_UpsertJobProposal(t *testing.T) { +func TestIntegration_Shared_ORM_UpsertJobProposal(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -979,7 +979,7 @@ func Test_ORM_UpsertJobProposal(t *testing.T) { // Job Proposal Specs -func Test_ORM_ApproveSpec(t *testing.T) { +func TestIntegration_Shared_ORM_ApproveSpec(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -1021,7 +1021,7 @@ func Test_ORM_ApproveSpec(t *testing.T) { assert.False(t, actualJP.PendingUpdate) } -func Test_ORM_CancelSpec(t *testing.T) { +func TestIntegration_Shared_ORM_CancelSpec(t *testing.T) { t.Parallel() testCases := []struct { @@ -1094,7 +1094,7 @@ func Test_ORM_CancelSpec(t *testing.T) { } } -func Test_ORM_DeleteProposal(t *testing.T) { +func TestIntegration_Shared_ORM_DeleteProposal(t *testing.T) { t.Parallel() testCases := []struct { @@ -1249,7 +1249,7 @@ func Test_ORM_DeleteProposal(t *testing.T) { } } -func Test_ORM_RevokeSpec(t *testing.T) { +func TestIntegration_Shared_ORM_RevokeSpec(t *testing.T) { t.Parallel() testCases := []struct { @@ -1369,7 +1369,7 @@ func Test_ORM_RevokeSpec(t *testing.T) { } } -func Test_ORM_ExistsSpecByJobProposalIDAndVersion(t *testing.T) { +func TestIntegration_Shared_ORM_ExistsSpecByJobProposalIDAndVersion(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -1390,7 +1390,7 @@ func Test_ORM_ExistsSpecByJobProposalIDAndVersion(t *testing.T) { require.False(t, exists) } -func Test_ORM_GetSpec(t *testing.T) { +func TestIntegration_Shared_ORM_GetSpec(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -1410,7 +1410,7 @@ func Test_ORM_GetSpec(t *testing.T) { assert.Equal(t, jpID, actual.JobProposalID) } -func Test_ORM_GetApprovedSpec(t *testing.T) { +func TestIntegration_Shared_ORM_GetApprovedSpec(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -1446,7 +1446,7 @@ func Test_ORM_GetApprovedSpec(t *testing.T) { assert.ErrorIs(t, err, sql.ErrNoRows) } -func Test_ORM_GetLatestSpec(t *testing.T) { +func TestIntegration_Shared_ORM_GetLatestSpec(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -1475,7 +1475,7 @@ func Test_ORM_GetLatestSpec(t *testing.T) { assert.Equal(t, jpID, actual.JobProposalID) } -func Test_ORM_ListSpecsByJobProposalIDs(t *testing.T) { +func TestIntegration_Shared_ORM_ListSpecsByJobProposalIDs(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -1510,7 +1510,7 @@ func Test_ORM_ListSpecsByJobProposalIDs(t *testing.T) { assert.Equal(t, jp2ID, actual.JobProposalID) } -func Test_ORM_RejectSpec(t *testing.T) { +func TestIntegration_Shared_ORM_RejectSpec(t *testing.T) { t.Parallel() testCases := []struct { @@ -1618,7 +1618,7 @@ func Test_ORM_RejectSpec(t *testing.T) { } } -func Test_ORM_UpdateSpecDefinition(t *testing.T) { +func TestIntegration_Shared_ORM_UpdateSpecDefinition(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -1649,7 +1649,7 @@ func Test_ORM_UpdateSpecDefinition(t *testing.T) { // Other -func Test_ORM_IsJobManaged(t *testing.T) { +func TestIntegration_Shared_ORM_IsJobManaged(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -1683,7 +1683,7 @@ func Test_ORM_IsJobManaged(t *testing.T) { assert.False(t, isManaged) } -func Test_ORM_IsJobManagedByFeedsManager(t *testing.T) { +func TestIntegration_Shared_ORM_IsJobManagedByFeedsManager(t *testing.T) { t.Parallel() ctx := testutils.Context(t) diff --git a/core/services/feeds/rpc_handlers_test.go b/core/services/feeds/rpc_handlers_test.go index a9c8f680d8d..99d08fd19cd 100644 --- a/core/services/feeds/rpc_handlers_test.go +++ b/core/services/feeds/rpc_handlers_test.go @@ -35,7 +35,7 @@ func setupTestHandlers(t *testing.T) *TestRPCHandlers { } } -func Test_RPCHandlers_ProposeJob(t *testing.T) { +func TestUnit_RPCHandlers_ProposeJob(t *testing.T) { var ( ctx = testutils.Context(t) jobID = uuid.New() @@ -62,7 +62,7 @@ func Test_RPCHandlers_ProposeJob(t *testing.T) { require.NoError(t, err) } -func Test_RPCHandlers_DeleteJob(t *testing.T) { +func TestUnit_RPCHandlers_DeleteJob(t *testing.T) { var ( ctx = testutils.Context(t) jobID = uuid.New() @@ -82,7 +82,7 @@ func Test_RPCHandlers_DeleteJob(t *testing.T) { require.NoError(t, err) } -func Test_RPCHandlers_RevokeJob(t *testing.T) { +func TestUnit_RPCHandlers_RevokeJob(t *testing.T) { var ( ctx = testutils.Context(t) jobID = uuid.New() @@ -102,7 +102,7 @@ func Test_RPCHandlers_RevokeJob(t *testing.T) { require.NoError(t, err) } -func Test_RPCHandlers_GetJobRuns(t *testing.T) { +func TestUnit_RPCHandlers_GetJobRuns(t *testing.T) { var ( ctx = testutils.Context(t) jobID = uuid.New() @@ -157,7 +157,7 @@ func Test_RPCHandlers_GetJobRuns(t *testing.T) { require.Equal(t, "fatal1", run2.FatalErrors[0]) } -func Test_RPCHandlers_GetJobRuns_InvalidUUID(t *testing.T) { +func TestUnit_RPCHandlers_GetJobRuns_InvalidUUID(t *testing.T) { ctx := testutils.Context(t) h := setupTestHandlers(t) @@ -170,7 +170,7 @@ func Test_RPCHandlers_GetJobRuns_InvalidUUID(t *testing.T) { require.Contains(t, err.Error(), "invalid UUID") } -func Test_RPCHandlers_GetJobRuns_DefaultLimit(t *testing.T) { +func TestUnit_RPCHandlers_GetJobRuns_DefaultLimit(t *testing.T) { var ( ctx = testutils.Context(t) jobID = uuid.New() @@ -192,7 +192,7 @@ func Test_RPCHandlers_GetJobRuns_DefaultLimit(t *testing.T) { require.NoError(t, err) } -func Test_RPCHandlers_GetJobRuns_ExceedsMaxLimit(t *testing.T) { +func TestUnit_RPCHandlers_GetJobRuns_ExceedsMaxLimit(t *testing.T) { var ( ctx = testutils.Context(t) jobID = uuid.New() diff --git a/core/services/feeds/service_test.go b/core/services/feeds/service_test.go index a731c03a1a7..e01020f2c04 100644 --- a/core/services/feeds/service_test.go +++ b/core/services/feeds/service_test.go @@ -271,7 +271,7 @@ func setupTestServiceCfg( } } -func Test_Service_RegisterManager(t *testing.T) { +func TestIntegration_Shared_Service_RegisterManager(t *testing.T) { t.Parallel() var ( @@ -318,7 +318,7 @@ func Test_Service_RegisterManager(t *testing.T) { assert.Equal(t, actual, id) } -func Test_Service_RegisterManager_MultiFeedsManager(t *testing.T) { +func TestIntegration_Shared_Service_RegisterManager_MultiFeedsManager(t *testing.T) { t.Parallel() var ( @@ -369,7 +369,7 @@ func Test_Service_RegisterManager_MultiFeedsManager(t *testing.T) { assert.Equal(t, actual, id) } -func Test_Service_RegisterManager_InvalidCreateManager(t *testing.T) { +func TestIntegration_Shared_Service_RegisterManager_InvalidCreateManager(t *testing.T) { t.Parallel() var ( @@ -412,7 +412,7 @@ func Test_Service_RegisterManager_InvalidCreateManager(t *testing.T) { assert.Equal(t, "orm error", err.Error()) } -func Test_Service_RegisterManager_DuplicateFeedsManager(t *testing.T) { +func TestIntegration_Shared_Service_RegisterManager_DuplicateFeedsManager(t *testing.T) { t.Parallel() pubKeyHex := "0f17c3bf72de8beef6e2d17a14c0a972f5d7e0e66e70722373f12b88382d40f9" @@ -449,7 +449,7 @@ func Test_Service_RegisterManager_DuplicateFeedsManager(t *testing.T) { assert.Equal(t, "manager was previously registered using the same public key", err.Error()) } -func Test_Service_ListManagers(t *testing.T) { +func TestIntegration_Shared_Service_ListManagers(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -468,7 +468,7 @@ func Test_Service_ListManagers(t *testing.T) { assert.Equal(t, mgrs, actual) } -func Test_Service_GetManager(t *testing.T) { +func TestIntegration_Shared_Service_GetManager(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -488,7 +488,7 @@ func Test_Service_GetManager(t *testing.T) { assert.Equal(t, actual, &mgr) } -func Test_Service_UpdateFeedsManager(t *testing.T) { +func TestIntegration_Shared_Service_UpdateFeedsManager(t *testing.T) { mgr := feeds.FeedsManager{ID: 1} svc := setupTestService(t) @@ -501,7 +501,7 @@ func Test_Service_UpdateFeedsManager(t *testing.T) { require.NoError(t, err) } -func Test_Service_EnableFeedsManager(t *testing.T) { +func TestIntegration_Shared_Service_EnableFeedsManager(t *testing.T) { mgr := feeds.FeedsManager{ID: 1} svc := setupTestService(t) @@ -516,7 +516,7 @@ func Test_Service_EnableFeedsManager(t *testing.T) { require.NotNil(t, actual) } -func Test_Service_DisableFeedsManager(t *testing.T) { +func TestIntegration_Shared_Service_DisableFeedsManager(t *testing.T) { mgr := feeds.FeedsManager{ID: 1} svc := setupTestService(t) @@ -530,7 +530,7 @@ func Test_Service_DisableFeedsManager(t *testing.T) { require.NotNil(t, actual) } -func Test_Service_ListManagersByIDs(t *testing.T) { +func TestIntegration_Shared_Service_ListManagersByIDs(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -550,7 +550,7 @@ func Test_Service_ListManagersByIDs(t *testing.T) { assert.Equal(t, mgrs, actual) } -func Test_Service_CreateChainConfig(t *testing.T) { +func TestIntegration_Shared_Service_CreateChainConfig(t *testing.T) { tests := []struct { name string chainType feeds.ChainType @@ -660,7 +660,7 @@ func Test_Service_CreateChainConfig(t *testing.T) { } } -func Test_Service_CreateChainConfig_InvalidAdminAddress(t *testing.T) { +func TestIntegration_Shared_Service_CreateChainConfig_InvalidAdminAddress(t *testing.T) { var ( mgr = feeds.FeedsManager{ID: 1} cfg = feeds.ChainConfig{ @@ -681,7 +681,7 @@ func Test_Service_CreateChainConfig_InvalidAdminAddress(t *testing.T) { assert.Equal(t, "invalid admin address: 0x00000000000", err.Error()) } -func Test_Service_DeleteChainConfig(t *testing.T) { +func TestIntegration_Shared_Service_DeleteChainConfig(t *testing.T) { var ( mgr = feeds.FeedsManager{ID: 1} nodeVersion = &versioning.NodeVersion{ @@ -721,7 +721,7 @@ func Test_Service_DeleteChainConfig(t *testing.T) { waitSyncNodeInfoCall(t, svc.logs) } -func Test_Service_ListChainConfigsByManagerIDs(t *testing.T) { +func TestIntegration_Shared_Service_ListChainConfigsByManagerIDs(t *testing.T) { ctx := testutils.Context(t) var ( mgr = feeds.FeedsManager{ID: 1} @@ -741,7 +741,7 @@ func Test_Service_ListChainConfigsByManagerIDs(t *testing.T) { assert.Equal(t, []feeds.ChainConfig{cfg}, actual) } -func Test_Service_UpdateChainConfig(t *testing.T) { +func TestIntegration_Shared_Service_UpdateChainConfig(t *testing.T) { tests := []struct { name string chainType feeds.ChainType @@ -838,7 +838,7 @@ func Test_Service_UpdateChainConfig(t *testing.T) { } } -func Test_Service_UpdateChainConfig_InvalidAdminAddress(t *testing.T) { +func TestIntegration_Shared_Service_UpdateChainConfig_InvalidAdminAddress(t *testing.T) { var ( mgr = feeds.FeedsManager{ID: 1} cfg = feeds.ChainConfig{ @@ -859,7 +859,7 @@ func Test_Service_UpdateChainConfig_InvalidAdminAddress(t *testing.T) { assert.Equal(t, "invalid admin address: 0x00000000000", err.Error()) } -func Test_Service_ProposeJob(t *testing.T) { +func TestIntegration_Shared_Service_ProposeJob(t *testing.T) { t.Parallel() var ( @@ -1340,7 +1340,7 @@ func Test_Service_ProposeJob(t *testing.T) { } } -func Test_Service_DeleteJob(t *testing.T) { +func TestIntegration_Shared_Service_DeleteJob(t *testing.T) { t.Parallel() var ( @@ -1656,7 +1656,7 @@ func Test_Service_DeleteJob(t *testing.T) { } } -func Test_Service_RevokeJob(t *testing.T) { +func TestIntegration_Shared_Service_RevokeJob(t *testing.T) { t.Parallel() var ( @@ -1883,7 +1883,7 @@ answer1 [type=median index=0]; } } -func Test_Service_SyncNodeInfo(t *testing.T) { +func TestIntegration_Shared_Service_SyncNodeInfo(t *testing.T) { tests := []struct { name string chainType feeds.ChainType @@ -2034,7 +2034,7 @@ func Test_Service_SyncNodeInfo(t *testing.T) { } } -func Test_Service_syncNodeInfoWithRetry(t *testing.T) { +func TestIntegration_Shared_Service_syncNodeInfoWithRetry(t *testing.T) { t.Parallel() mgr := feeds.FeedsManager{ID: 1} @@ -2212,7 +2212,7 @@ func Test_Service_syncNodeInfoWithRetry(t *testing.T) { } } -func Test_Service_IsJobManaged(t *testing.T) { +func TestIntegration_Shared_Service_IsJobManaged(t *testing.T) { t.Parallel() svc := setupTestService(t) @@ -2226,7 +2226,7 @@ func Test_Service_IsJobManaged(t *testing.T) { assert.True(t, isManaged) } -func Test_Service_ListJobProposalsByManagersIDs(t *testing.T) { +func TestIntegration_Shared_Service_ListJobProposalsByManagersIDs(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -2246,7 +2246,7 @@ func Test_Service_ListJobProposalsByManagersIDs(t *testing.T) { assert.Equal(t, actual, jps) } -func Test_Service_GetJobProposal(t *testing.T) { +func TestIntegration_Shared_Service_GetJobProposal(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -2265,7 +2265,7 @@ func Test_Service_GetJobProposal(t *testing.T) { assert.Equal(t, actual, &ms) } -func Test_Service_CancelSpec(t *testing.T) { +func TestIntegration_Shared_Service_CancelSpec(t *testing.T) { var ( externalJobID = uuid.New() jp = &feeds.JobProposal{ @@ -2496,7 +2496,7 @@ func Test_Service_CancelSpec(t *testing.T) { } } -func Test_Service_GetSpec(t *testing.T) { +func TestIntegration_Shared_Service_GetSpec(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -2515,7 +2515,7 @@ func Test_Service_GetSpec(t *testing.T) { assert.Equal(t, &spec, actual) } -func Test_Service_ListSpecsByJobProposalIDs(t *testing.T) { +func TestIntegration_Shared_Service_ListSpecsByJobProposalIDs(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -2536,7 +2536,7 @@ func Test_Service_ListSpecsByJobProposalIDs(t *testing.T) { assert.Equal(t, specs, actual) } -func Test_Service_ApproveSpec(t *testing.T) { +func TestIntegration_Shared_Service_ApproveSpec(t *testing.T) { var evmChainID *evmbig.Big address := types.EIP55AddressFromAddress(common.Address{}) externalJobID := uuid.New() @@ -3265,7 +3265,7 @@ answer1 [type=median index=0]; } } -func Test_Service_ApproveSpec_OCR2(t *testing.T) { +func TestIntegration_Shared_Service_ApproveSpec_OCR2(t *testing.T) { address := "0x613a38AC1659769640aaE063C651F48E0250454C" feedIDHex := "0x0000000000000000000000000000000000000000000000000000000000000001" feedID := common.HexToHash(feedIDHex) @@ -3856,7 +3856,7 @@ updateInterval = "20m" } } -func Test_Service_ApproveSpec_Stream(t *testing.T) { +func TestIntegration_Shared_Service_ApproveSpec_Stream(t *testing.T) { externalJobID := uuid.New() streamName := "LINK / ETH | version 3 | contract 0x0000000000000000000000000000000000000000" streamID := uint32(1009001032) @@ -4374,7 +4374,7 @@ func Test_Service_ApproveSpec_Stream(t *testing.T) { } } -func Test_Service_ApproveSpec_Bootstrap(t *testing.T) { +func TestIntegration_Shared_Service_ApproveSpec_Bootstrap(t *testing.T) { address := "0x613a38AC1659769640aaE063C651F48E0250454C" feedIDHex := "0x0000000000000000000000000000000000000000000000000000000000000001" feedID := common.HexToHash(feedIDHex) @@ -4919,7 +4919,7 @@ chainID = 0 } } -func Test_Service_RejectSpec(t *testing.T) { +func TestIntegration_Shared_Service_RejectSpec(t *testing.T) { var ( ctx = testutils.Context(t) jp = &feeds.JobProposal{ @@ -5058,7 +5058,7 @@ func Test_Service_RejectSpec(t *testing.T) { } } -func Test_Service_UpdateSpecDefinition(t *testing.T) { +func TestIntegration_Shared_Service_UpdateSpecDefinition(t *testing.T) { var ( ctx = testutils.Context(t) specID = int64(1) @@ -5147,7 +5147,7 @@ func Test_Service_UpdateSpecDefinition(t *testing.T) { } } -func Test_Service_StartStop(t *testing.T) { +func TestIntegration_Shared_Service_StartStop(t *testing.T) { key := cltest.DefaultCSAKey var ( @@ -5243,7 +5243,7 @@ func logMessages(logEntries []observer.LoggedEntry) []string { return messages } -func Test_Service_GetJobRuns(t *testing.T) { +func TestIntegration_Shared_Service_GetJobRuns(t *testing.T) { t.Parallel() var ( diff --git a/core/services/fluxmonitorv2/contract_submitter_test.go b/core/services/fluxmonitorv2/contract_submitter_test.go index 7dfd92e5acd..70221d6247f 100644 --- a/core/services/fluxmonitorv2/contract_submitter_test.go +++ b/core/services/fluxmonitorv2/contract_submitter_test.go @@ -14,7 +14,7 @@ import ( fmmocks "github.com/smartcontractkit/chainlink/v2/core/services/fluxmonitorv2/mocks" ) -func TestFluxAggregatorContractSubmitter_Submit(t *testing.T) { +func TestIntegration_Shared_FluxAggregatorContractSubmitter_Submit(t *testing.T) { t.Parallel() var ( fluxAggregator = mocks.NewFluxAggregator(t) diff --git a/core/services/fluxmonitorv2/deviation_checker_test.go b/core/services/fluxmonitorv2/deviation_checker_test.go index 66b813daa1b..d1918408b82 100644 --- a/core/services/fluxmonitorv2/deviation_checker_test.go +++ b/core/services/fluxmonitorv2/deviation_checker_test.go @@ -28,7 +28,7 @@ func (o outsideDeviationRow) String() string { o.threshold, o.absoluteThreshold, o.expectation) } -func TestDeviationChecker_OutsideDeviation(t *testing.T) { +func TestIntegration_Shared_DeviationChecker_OutsideDeviation(t *testing.T) { quarantine.Flaky(t, "DX-1856") t.Parallel() diff --git a/core/services/fluxmonitorv2/flags_test.go b/core/services/fluxmonitorv2/flags_test.go index 33f8f8781cd..7019521188e 100644 --- a/core/services/fluxmonitorv2/flags_test.go +++ b/core/services/fluxmonitorv2/flags_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/fluxmonitorv2" ) -func TestFlags_IsLowered(t *testing.T) { +func TestIntegration_Shared_Flags_IsLowered(t *testing.T) { t.Parallel() testCases := []struct { diff --git a/core/services/fluxmonitorv2/flux_monitor_test.go b/core/services/fluxmonitorv2/flux_monitor_test.go index 3745eeab688..0d50f969727 100644 --- a/core/services/fluxmonitorv2/flux_monitor_test.go +++ b/core/services/fluxmonitorv2/flux_monitor_test.go @@ -292,7 +292,7 @@ func setupFullDBWithKey(t *testing.T) (*sqlx.DB, common.Address) { return db, nodeAddr } -func TestFluxMonitor_PollIfEligible(t *testing.T) { +func TestIntegration_Shared_FluxMonitor_PollIfEligible(t *testing.T) { t.Parallel() testCases := []struct { name string @@ -500,7 +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) { +func TestIntegration_Shared_FluxMonitor_PollIfEligible_Creates_JobErr(t *testing.T) { t.Parallel() db, nodeAddr := setupStoreWithKey(t) oracles := []common.Address{nodeAddr, testutils.NewAddress()} @@ -532,7 +532,7 @@ func TestFluxMonitor_PollIfEligible_Creates_JobErr(t *testing.T) { fm.ExportedPollIfEligible(1, 1) } -func TestPollingDeviationChecker_BuffersLogs(t *testing.T) { +func TestIntegration_Shared_PollingDeviationChecker_BuffersLogs(t *testing.T) { t.Parallel() db, nodeAddr := setupStoreWithKey(t) oracles := []common.Address{nodeAddr, testutils.NewAddress()} @@ -732,7 +732,7 @@ func TestPollingDeviationChecker_BuffersLogs(t *testing.T) { readyToAssert.AwaitOrFail(t) } -func TestFluxMonitor_TriggerIdleTimeThreshold(t *testing.T) { +func TestIntegration_Shared_FluxMonitor_TriggerIdleTimeThreshold(t *testing.T) { t.Parallel() g := gomega.NewWithT(t) @@ -823,7 +823,7 @@ func TestFluxMonitor_TriggerIdleTimeThreshold(t *testing.T) { } } -func TestFluxMonitor_HibernationTickerFiresMultipleTimes(t *testing.T) { +func TestIntegration_Shared_FluxMonitor_HibernationTickerFiresMultipleTimes(t *testing.T) { t.Parallel() g := gomega.NewWithT(t) @@ -908,7 +908,7 @@ func TestFluxMonitor_HibernationTickerFiresMultipleTimes(t *testing.T) { g.Eventually(func() int { return len(pollOccured) }, testutils.WaitTimeout(t)).Should(gomega.Equal(3)) } -func TestFluxMonitor_HibernationIsEnteredAndRetryTickerStopped(t *testing.T) { +func TestIntegration_Shared_FluxMonitor_HibernationIsEnteredAndRetryTickerStopped(t *testing.T) { quarantine.Flaky(t, "DX-1806") t.Parallel() db, nodeAddr := setupFullDBWithKey(t) @@ -1028,7 +1028,7 @@ func TestFluxMonitor_HibernationIsEnteredAndRetryTickerStopped(t *testing.T) { } } -func TestFluxMonitor_IdleTimerResetsOnNewRound(t *testing.T) { +func TestIntegration_Shared_FluxMonitor_IdleTimerResetsOnNewRound(t *testing.T) { quarantine.Flaky(t, "DX-1857") t.Parallel() @@ -1133,7 +1133,7 @@ func TestFluxMonitor_IdleTimerResetsOnNewRound(t *testing.T) { g.Eventually(func() int { return len(idleDurationOccured) }, testutils.WaitTimeout(t)).Should(gomega.Equal(4)) } -func TestFluxMonitor_RoundTimeoutCausesPoll_timesOutAtZero(t *testing.T) { +func TestIntegration_Shared_FluxMonitor_RoundTimeoutCausesPoll_timesOutAtZero(t *testing.T) { t.Parallel() g := gomega.NewWithT(t) @@ -1180,7 +1180,7 @@ func TestFluxMonitor_RoundTimeoutCausesPoll_timesOutAtZero(t *testing.T) { g.Eventually(ch).Should(gomega.BeClosed()) } -func TestFluxMonitor_UsesPreviousRoundStateOnStartup_RoundTimeout(t *testing.T) { +func TestIntegration_Shared_FluxMonitor_UsesPreviousRoundStateOnStartup_RoundTimeout(t *testing.T) { quarantine.Flaky(t, "DX-1845") t.Parallel() g := gomega.NewWithT(t) @@ -1242,7 +1242,7 @@ func TestFluxMonitor_UsesPreviousRoundStateOnStartup_RoundTimeout(t *testing.T) } } -func TestFluxMonitor_UsesPreviousRoundStateOnStartup_IdleTimer(t *testing.T) { +func TestIntegration_Shared_FluxMonitor_UsesPreviousRoundStateOnStartup_IdleTimer(t *testing.T) { t.Parallel() g := gomega.NewWithT(t) @@ -1319,7 +1319,7 @@ func TestFluxMonitor_UsesPreviousRoundStateOnStartup_IdleTimer(t *testing.T) { } } -func TestFluxMonitor_RoundTimeoutCausesPoll_timesOutNotZero(t *testing.T) { +func TestIntegration_Shared_FluxMonitor_RoundTimeoutCausesPoll_timesOutNotZero(t *testing.T) { t.Parallel() g := gomega.NewWithT(t) @@ -1394,7 +1394,7 @@ func TestFluxMonitor_RoundTimeoutCausesPoll_timesOutNotZero(t *testing.T) { time.Sleep(time.Duration(2*timeout) * time.Second) } -func TestFluxMonitor_ConsumeLogBroadcast(t *testing.T) { +func TestIntegration_Shared_FluxMonitor_ConsumeLogBroadcast(t *testing.T) { t.Parallel() db := pgtest.NewSqlxDB(t) @@ -1413,7 +1413,7 @@ func TestFluxMonitor_ConsumeLogBroadcast(t *testing.T) { fm.ExportedProcessLogs() } -func TestFluxMonitor_ConsumeLogBroadcast_Error(t *testing.T) { +func TestIntegration_Shared_FluxMonitor_ConsumeLogBroadcast_Error(t *testing.T) { t.Parallel() testCases := []struct { @@ -1440,7 +1440,7 @@ func TestFluxMonitor_ConsumeLogBroadcast_Error(t *testing.T) { } } -func TestFluxMonitor_DoesNotDoubleSubmit(t *testing.T) { +func TestIntegration_Shared_FluxMonitor_DoesNotDoubleSubmit(t *testing.T) { t.Parallel() t.Run("when NewRound log arrives, then poll ticker fires", func(t *testing.T) { db, nodeAddr := setupStoreWithKey(t) @@ -1817,7 +1817,7 @@ func TestFluxMonitor_DoesNotDoubleSubmit(t *testing.T) { // For now, we let it use a custom EventuallyExpectationsMet instead of assert.Eventually because it flakes // with the latter approach (somehow assert.Eventually gives it a little bit more time, and then it fails // with the same unexpected call). -func TestFluxMonitor_DrumbeatTicker(t *testing.T) { +func TestIntegration_Shared_FluxMonitor_DrumbeatTicker(t *testing.T) { t.Parallel() db, nodeAddr := setupStoreWithKey(t) diff --git a/core/services/fluxmonitorv2/integrations_test.go b/core/services/fluxmonitorv2/integrations_test.go index dee82f72e55..a92a95d170e 100644 --- a/core/services/fluxmonitorv2/integrations_test.go +++ b/core/services/fluxmonitorv2/integrations_test.go @@ -435,7 +435,7 @@ func checkLogWasConsumed(t *testing.T, fa fluxAggregatorUniverse, ds sqlutil.Dat }, testutils.WaitTimeout(t), time.Second).Should(gomega.BeTrue()) } -func TestFluxMonitor_Deviation(t *testing.T) { +func TestIntegration_Shared_FluxMonitor_Deviation(t *testing.T) { quarantine.Flaky(t, "DX-1763") tests := []struct { name string @@ -620,7 +620,7 @@ func TestFluxMonitor_Deviation(t *testing.T) { } } -func TestFluxMonitor_NewRound(t *testing.T) { +func TestIntegration_Shared_FluxMonitor_NewRound(t *testing.T) { quarantine.Flaky(t, "DX-1865") g := gomega.NewWithT(t) fa := setupFluxAggregatorUniverse(t) @@ -732,7 +732,7 @@ ds1 -> ds1_parse ) } -func TestFluxMonitor_HibernationMode(t *testing.T) { +func TestIntegration_Shared_FluxMonitor_HibernationMode(t *testing.T) { g := gomega.NewWithT(t) fa := setupFluxAggregatorUniverse(t) @@ -848,7 +848,7 @@ ds1 -> ds1_parse assertNoSubmission(t, submissionReceived, 5*pollTimerPeriod, "should not trigger a new run, while flag is raised") } -func TestFluxMonitor_InvalidSubmission(t *testing.T) { +func TestIntegration_Shared_FluxMonitor_InvalidSubmission(t *testing.T) { // 8 decimals places used for prices. fa := setupFluxAggregatorUniverse(t, WithMinMaxSubmission( big.NewInt(100000000), // 1 * 10^8 @@ -926,7 +926,7 @@ ds1 -> ds1_parse assert.Contains(t, jse[0].Description, "Answer is outside acceptable range") } -func TestFluxMonitorAntiSpamLogic(t *testing.T) { +func TestIntegration_Shared_FluxMonitorAntiSpamLogic(t *testing.T) { // - deploy a brand new FM contract fa := setupFluxAggregatorUniverse(t) diff --git a/core/services/fluxmonitorv2/key_store_test.go b/core/services/fluxmonitorv2/key_store_test.go index 78804343981..295766a30e3 100644 --- a/core/services/fluxmonitorv2/key_store_test.go +++ b/core/services/fluxmonitorv2/key_store_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/fluxmonitorv2" ) -func TestKeyStore_EnabledKeysForChain(t *testing.T) { +func TestIntegration_Shared_KeyStore_EnabledKeysForChain(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -40,7 +40,7 @@ func TestKeyStore_EnabledKeysForChain(t *testing.T) { require.EqualExportedValues(t, key2, keys[0]) } -func TestKeyStore_GetRoundRobinAddress(t *testing.T) { +func TestIntegration_Shared_KeyStore_GetRoundRobinAddress(t *testing.T) { t.Parallel() ctx := testutils.Context(t) diff --git a/core/services/fluxmonitorv2/orm_test.go b/core/services/fluxmonitorv2/orm_test.go index 63aa0638106..859abc7e537 100644 --- a/core/services/fluxmonitorv2/orm_test.go +++ b/core/services/fluxmonitorv2/orm_test.go @@ -27,7 +27,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestORM_MostRecentFluxMonitorRoundID(t *testing.T) { +func TestIntegration_Shared_ORM_MostRecentFluxMonitorRoundID(t *testing.T) { t.Parallel() ctx := t.Context() @@ -82,7 +82,7 @@ func TestORM_MostRecentFluxMonitorRoundID(t *testing.T) { require.Equal(t, 5, count) } -func TestORM_UpdateFluxMonitorRoundStats(t *testing.T) { +func TestIntegration_Shared_ORM_UpdateFluxMonitorRoundStats(t *testing.T) { t.Parallel() ctx := t.Context() @@ -168,7 +168,7 @@ func makeJob(t *testing.T) *job.Job { } } -func TestORM_CreateEthTransaction(t *testing.T) { +func TestIntegration_Shared_ORM_CreateEthTransaction(t *testing.T) { t.Parallel() db := pgtest.NewSqlxDB(t) diff --git a/core/services/fluxmonitorv2/payment_checker_test.go b/core/services/fluxmonitorv2/payment_checker_test.go index 089ebcc4004..f1231893780 100644 --- a/core/services/fluxmonitorv2/payment_checker_test.go +++ b/core/services/fluxmonitorv2/payment_checker_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/fluxmonitorv2" ) -func TestPaymentChecker_SufficientFunds(t *testing.T) { +func TestIntegration_Shared_PaymentChecker_SufficientFunds(t *testing.T) { t.Parallel() var ( checker = fluxmonitorv2.NewPaymentChecker(nil, nil) @@ -43,7 +43,7 @@ func TestPaymentChecker_SufficientFunds(t *testing.T) { } } -func TestPaymentChecker_SufficientPayment(t *testing.T) { +func TestIntegration_Shared_PaymentChecker_SufficientPayment(t *testing.T) { t.Parallel() var ( payment int64 = 10 diff --git a/core/services/fluxmonitorv2/poll_manager_test.go b/core/services/fluxmonitorv2/poll_manager_test.go index dcf3527ee9e..d92ad9f466c 100644 --- a/core/services/fluxmonitorv2/poll_manager_test.go +++ b/core/services/fluxmonitorv2/poll_manager_test.go @@ -83,7 +83,7 @@ func watchTicks(t *testing.T, pm *fluxmonitorv2.PollManager, waitDuration time.D return ticks } -func TestPollManager_PollTicker(t *testing.T) { +func TestIntegration_Shared_PollManager_PollTicker(t *testing.T) { t.Parallel() pm, err := fluxmonitorv2.NewPollManager(fluxmonitorv2.PollManagerConfig{ PollTickerInterval: pollTickerDefaultDuration, @@ -104,7 +104,7 @@ func TestPollManager_PollTicker(t *testing.T) { assert.False(t, ticks.roundTicked) } -func TestPollManager_IdleTimer(t *testing.T) { +func TestIntegration_Shared_PollManager_IdleTimer(t *testing.T) { t.Parallel() pm, err := fluxmonitorv2.NewPollManager(fluxmonitorv2.PollManagerConfig{ PollTickerInterval: 100 * time.Millisecond, @@ -127,7 +127,7 @@ func TestPollManager_IdleTimer(t *testing.T) { assert.False(t, ticks.roundTicked) } -func TestPollManager_RoundTimer(t *testing.T) { +func TestIntegration_Shared_PollManager_RoundTimer(t *testing.T) { t.Parallel() pm, err := fluxmonitorv2.NewPollManager(fluxmonitorv2.PollManagerConfig{ PollTickerInterval: pollTickerDefaultDuration, @@ -151,7 +151,7 @@ func TestPollManager_RoundTimer(t *testing.T) { assert.True(t, ticks.roundTicked) } -func TestPollManager_RetryTimer(t *testing.T) { +func TestIntegration_Shared_PollManager_RetryTimer(t *testing.T) { t.Parallel() pm, err := fluxmonitorv2.NewPollManager(fluxmonitorv2.PollManagerConfig{ PollTickerInterval: pollTickerDefaultDuration, @@ -188,7 +188,7 @@ func TestPollManager_RetryTimer(t *testing.T) { assert.False(t, ticks.retryTicked) } -func TestPollManager_InitialPoll(t *testing.T) { +func TestIntegration_Shared_PollManager_InitialPoll(t *testing.T) { t.Parallel() pm := newPollManager(t) pm.Start(false, flux_aggregator_wrapper.OracleRoundState{}) @@ -197,7 +197,7 @@ func TestPollManager_InitialPoll(t *testing.T) { assert.True(t, ticks.initialPoll) } -func TestPollManager_HibernationTimer(t *testing.T) { +func TestIntegration_Shared_PollManager_HibernationTimer(t *testing.T) { t.Parallel() pm, err := fluxmonitorv2.NewPollManager(fluxmonitorv2.PollManagerConfig{ PollTickerInterval: pollTickerDefaultDuration, @@ -219,7 +219,7 @@ func TestPollManager_HibernationTimer(t *testing.T) { assert.True(t, ticks.hibernationTicked) } -func TestPollManager_HibernationOnStartThenAwaken(t *testing.T) { +func TestIntegration_Shared_PollManager_HibernationOnStartThenAwaken(t *testing.T) { t.Parallel() pm, err := fluxmonitorv2.NewPollManager(fluxmonitorv2.PollManagerConfig{ PollTickerInterval: pollTickerDefaultDuration, @@ -254,7 +254,7 @@ func TestPollManager_HibernationOnStartThenAwaken(t *testing.T) { assert.True(t, ticks.roundTicked) } -func TestPollManager_AwakeOnStartThenHibernate(t *testing.T) { +func TestIntegration_Shared_PollManager_AwakeOnStartThenHibernate(t *testing.T) { t.Parallel() pm := newPollManager(t) @@ -279,7 +279,7 @@ func TestPollManager_AwakeOnStartThenHibernate(t *testing.T) { assert.False(t, ticks.roundTicked) } -func TestPollManager_ShouldPerformInitialPoll(t *testing.T) { +func TestIntegration_Shared_PollManager_ShouldPerformInitialPoll(t *testing.T) { t.Parallel() testCases := []struct { name string @@ -344,7 +344,7 @@ func TestPollManager_ShouldPerformInitialPoll(t *testing.T) { } } -func TestPollManager_Stop(t *testing.T) { +func TestIntegration_Shared_PollManager_Stop(t *testing.T) { t.Parallel() pm := newPollManager(t) @@ -368,7 +368,7 @@ func TestPollManager_Stop(t *testing.T) { assert.False(t, ticks.roundTicked) } -func TestPollManager_ResetIdleTimer(t *testing.T) { +func TestIntegration_Shared_PollManager_ResetIdleTimer(t *testing.T) { t.Parallel() pm := newPollManager(t) @@ -389,7 +389,7 @@ func TestPollManager_ResetIdleTimer(t *testing.T) { assert.True(t, ticks.idleTicked) } -func TestPollManager_ResetIdleTimerWhenHibernating(t *testing.T) { +func TestIntegration_Shared_PollManager_ResetIdleTimerWhenHibernating(t *testing.T) { t.Parallel() pm := newPollManager(t) @@ -410,7 +410,7 @@ func TestPollManager_ResetIdleTimerWhenHibernating(t *testing.T) { assert.False(t, ticks.idleTicked) } -func TestPollManager_Reset(t *testing.T) { +func TestIntegration_Shared_PollManager_Reset(t *testing.T) { t.Parallel() pm := newPollManager(t) @@ -438,7 +438,7 @@ func TestPollManager_Reset(t *testing.T) { assert.True(t, ticks.roundTicked) } -func TestPollManager_ResetWhenHibernating(t *testing.T) { +func TestIntegration_Shared_PollManager_ResetWhenHibernating(t *testing.T) { t.Parallel() pm := newPollManager(t) diff --git a/core/services/fluxmonitorv2/submission_checker_test.go b/core/services/fluxmonitorv2/submission_checker_test.go index 4417a043ba9..35d0e8637e4 100644 --- a/core/services/fluxmonitorv2/submission_checker_test.go +++ b/core/services/fluxmonitorv2/submission_checker_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/fluxmonitorv2" ) -func TestSubmissionChecker_IsValid(t *testing.T) { +func TestIntegration_Shared_SubmissionChecker_IsValid(t *testing.T) { t.Parallel() testCases := []struct { name string diff --git a/core/services/fluxmonitorv2/validate_test.go b/core/services/fluxmonitorv2/validate_test.go index c3131592620..1f6efbfee7e 100644 --- a/core/services/fluxmonitorv2/validate_test.go +++ b/core/services/fluxmonitorv2/validate_test.go @@ -21,7 +21,7 @@ func (testcfg) DefaultHTTPTimeout() commonconfig.Duration { return *commonconfig.MustNewDuration(2 * time.Second) } -func TestValidate(t *testing.T) { +func TestIntegration_Shared_Validate(t *testing.T) { quarantine.Flaky(t, "DX-1852") t.Parallel() var tt = []struct { diff --git a/core/services/functions/connector_handler_test.go b/core/services/functions/connector_handler_test.go index 0381261b581..0457e1490ac 100644 --- a/core/services/functions/connector_handler_test.go +++ b/core/services/functions/connector_handler_test.go @@ -64,7 +64,7 @@ func newOffchainRequest(t *testing.T, sender []byte, ageSec uint64) (*api.Messag return msg, internalId } -func TestFunctionsConnectorHandler(t *testing.T) { +func TestIntegration_Shared_FunctionsConnectorHandler(t *testing.T) { t.Parallel() logger := logger.TestLogger(t) diff --git a/core/services/functions/external_adapter_client_test.go b/core/services/functions/external_adapter_client_test.go index ba3cc06e1a0..5fe28a3b2cb 100644 --- a/core/services/functions/external_adapter_client_test.go +++ b/core/services/functions/external_adapter_client_test.go @@ -64,7 +64,7 @@ func runRequestTest(t *testing.T, adapterJSONResponse, expectedUserResult, expec assert.Equal(t, expectedDomains, domains, "Unexpected domains") } -func TestFetchEncryptedSecrets_Success(t *testing.T) { +func TestUnit_FetchEncryptedSecrets_Success(t *testing.T) { runFetcherTest(t, `{ "result": "success", "data": { @@ -75,7 +75,7 @@ func TestFetchEncryptedSecrets_Success(t *testing.T) { }`, "abcdef", "", nil) } -func TestFetchEncryptedSecrets_UserError(t *testing.T) { +func TestUnit_FetchEncryptedSecrets_UserError(t *testing.T) { runFetcherTest(t, `{ "result": "error", "data": { @@ -86,14 +86,14 @@ func TestFetchEncryptedSecrets_UserError(t *testing.T) { }`, "", "abcdef", nil) } -func TestFetchEncryptedSecrets_UnexpectedResponse(t *testing.T) { +func TestUnit_FetchEncryptedSecrets_UnexpectedResponse(t *testing.T) { runFetcherTest(t, `{ "invalid": "invalid", "statusCode": 200 }`, "", "", errors.New("error fetching encrypted secrets: external adapter response data was empty")) } -func TestFetchEncryptedSecrets_FailedStatusCode(t *testing.T) { +func TestUnit_FetchEncryptedSecrets_FailedStatusCode(t *testing.T) { runFetcherTest(t, `{ "result": "success", "data": { @@ -104,14 +104,14 @@ func TestFetchEncryptedSecrets_FailedStatusCode(t *testing.T) { }`, "", "", errors.New("error fetching encrypted secrets: external adapter invalid StatusCode 400")) } -func TestFetchEncryptedSecrets_MissingData(t *testing.T) { +func TestUnit_FetchEncryptedSecrets_MissingData(t *testing.T) { runFetcherTest(t, `{ "result": "success", "statusCode": 200 }`, "", "", errors.New("error fetching encrypted secrets: external adapter response data was empty")) } -func TestFetchEncryptedSecrets_InvalidResponse(t *testing.T) { +func TestUnit_FetchEncryptedSecrets_InvalidResponse(t *testing.T) { runFetcherTest(t, `{ "result": "success", "data": { @@ -122,7 +122,7 @@ func TestFetchEncryptedSecrets_InvalidResponse(t *testing.T) { }`, "", "", errors.New("error fetching encrypted secrets: error decoding result hex string: hex string must have 0x prefix")) } -func TestFetchEncryptedSecrets_InvalidUserError(t *testing.T) { +func TestUnit_FetchEncryptedSecrets_InvalidUserError(t *testing.T) { runFetcherTest(t, `{ "result": "error", "data": { @@ -133,7 +133,7 @@ func TestFetchEncryptedSecrets_InvalidUserError(t *testing.T) { }`, "", "", errors.New("error fetching encrypted secrets: error decoding userError hex string: hex string must have 0x prefix")) } -func TestFetchEncryptedSecrets_UnexpectedResult(t *testing.T) { +func TestUnit_FetchEncryptedSecrets_UnexpectedResult(t *testing.T) { runFetcherTest(t, `{ "result": "unexpected", "data": { @@ -144,18 +144,18 @@ func TestFetchEncryptedSecrets_UnexpectedResult(t *testing.T) { }`, "", "", errors.New("error fetching encrypted secrets: unexpected result in response: 'unexpected'")) } -func TestRunComputation_Success(t *testing.T) { +func TestUnit_RunComputation_Success(t *testing.T) { runRequestTest(t, runComputationSuccessResponse, "abcdef", "", []string{"domain1", "domain2"}, nil) } -func TestRunComputation_MissingData(t *testing.T) { +func TestUnit_RunComputation_MissingData(t *testing.T) { runRequestTest(t, `{ "result": "success", "statusCode": 200 }`, "", "", nil, errors.New("error running computation: external adapter response data was empty")) } -func TestRunComputation_CorrectAdapterRequest(t *testing.T) { +func TestUnit_RunComputation_CorrectAdapterRequest(t *testing.T) { ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { body, err := io.ReadAll(r.Body) assert.NoError(t, err) @@ -183,7 +183,7 @@ func TestRunComputation_CorrectAdapterRequest(t *testing.T) { assert.Error(t, err) } -func TestRunComputation_HTTP500(t *testing.T) { +func TestUnit_RunComputation_HTTP500(t *testing.T) { ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusInternalServerError) })) @@ -197,7 +197,7 @@ func TestRunComputation_HTTP500(t *testing.T) { assert.Error(t, err) } -func TestRunComputation_ContextRespected(t *testing.T) { +func TestUnit_RunComputation_ContextRespected(t *testing.T) { done := make(chan struct{}) ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { <-done @@ -215,7 +215,7 @@ func TestRunComputation_ContextRespected(t *testing.T) { close(done) } -func TestRunComputationRetrial(t *testing.T) { +func TestUnit_RunComputationRetrial(t *testing.T) { t.Run("OK-retry_succeeds_after_one_failure", func(t *testing.T) { counter := 0 ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { diff --git a/core/services/functions/listener_test.go b/core/services/functions/listener_test.go index 0d4ec259226..f507dfeac02 100644 --- a/core/services/functions/listener_test.go +++ b/core/services/functions/listener_test.go @@ -164,7 +164,7 @@ func packFlags(requestSizeTier int, secretSizeTier int) [32]byte { return flags } -func TestFunctionsListener_HandleOracleRequestV1_Success(t *testing.T) { +func TestIntegration_Shared_FunctionsListener_HandleOracleRequestV1_Success(t *testing.T) { testutils.SkipShortDB(t) t.Parallel() @@ -192,7 +192,7 @@ func TestFunctionsListener_HandleOracleRequestV1_Success(t *testing.T) { <-doneCh } -func TestFunctionsListener_HandleOffchainRequest_Success(t *testing.T) { +func TestIntegration_Shared_FunctionsListener_HandleOffchainRequest_Success(t *testing.T) { testutils.SkipShortDB(t) t.Parallel() @@ -214,7 +214,7 @@ func TestFunctionsListener_HandleOffchainRequest_Success(t *testing.T) { require.NoError(t, uni.service.HandleOffchainRequest(testutils.Context(t), request)) } -func TestFunctionsListener_HandleOffchainRequest_Invalid(t *testing.T) { +func TestIntegration_Shared_FunctionsListener_HandleOffchainRequest_Invalid(t *testing.T) { testutils.SkipShortDB(t) t.Parallel() uni := NewFunctionsListenerUniverse(t, 0, 1_000_000) @@ -238,7 +238,7 @@ func TestFunctionsListener_HandleOffchainRequest_Invalid(t *testing.T) { require.Error(t, uni.service.HandleOffchainRequest(testutils.Context(t), request)) } -func TestFunctionsListener_HandleOffchainRequest_InternalError(t *testing.T) { +func TestIntegration_Shared_FunctionsListener_HandleOffchainRequest_InternalError(t *testing.T) { testutils.SkipShortDB(t) t.Parallel() uni := NewFunctionsListenerUniverse(t, 0, 1_000_000) @@ -258,7 +258,7 @@ func TestFunctionsListener_HandleOffchainRequest_InternalError(t *testing.T) { require.Error(t, uni.service.HandleOffchainRequest(testutils.Context(t), request)) } -func TestFunctionsListener_HandleOracleRequestV1_ComputationError(t *testing.T) { +func TestIntegration_Shared_FunctionsListener_HandleOracleRequestV1_ComputationError(t *testing.T) { testutils.SkipShortDB(t) t.Parallel() @@ -286,7 +286,7 @@ func TestFunctionsListener_HandleOracleRequestV1_ComputationError(t *testing.T) <-doneCh } -func TestFunctionsListener_HandleOracleRequestV1_ThresholdDecryptedSecrets(t *testing.T) { +func TestIntegration_Shared_FunctionsListener_HandleOracleRequestV1_ThresholdDecryptedSecrets(t *testing.T) { testutils.SkipShortDB(t) t.Parallel() @@ -327,7 +327,7 @@ func TestFunctionsListener_HandleOracleRequestV1_ThresholdDecryptedSecrets(t *te <-doneCh } -func TestFunctionsListener_HandleOracleRequestV1_CBORTooBig(t *testing.T) { +func TestIntegration_Shared_FunctionsListener_HandleOracleRequestV1_CBORTooBig(t *testing.T) { testutils.SkipShortDB(t) t.Parallel() @@ -353,7 +353,7 @@ func TestFunctionsListener_HandleOracleRequestV1_CBORTooBig(t *testing.T) { <-doneCh } -func TestFunctionsListener_ReportSourceCodeDomains(t *testing.T) { +func TestIntegration_Shared_FunctionsListener_ReportSourceCodeDomains(t *testing.T) { testutils.SkipShortDB(t) t.Parallel() @@ -393,7 +393,7 @@ func TestFunctionsListener_ReportSourceCodeDomains(t *testing.T) { assert.Equal(t, Domains, req.Domains) } -func TestFunctionsListener_PruneRequests(t *testing.T) { +func TestIntegration_Shared_FunctionsListener_PruneRequests(t *testing.T) { testutils.SkipShortDB(t) t.Parallel() @@ -408,7 +408,7 @@ func TestFunctionsListener_PruneRequests(t *testing.T) { <-doneCh } -func TestFunctionsListener_TimeoutRequests(t *testing.T) { +func TestIntegration_Shared_FunctionsListener_TimeoutRequests(t *testing.T) { testutils.SkipShortDB(t) t.Parallel() @@ -423,7 +423,7 @@ func TestFunctionsListener_TimeoutRequests(t *testing.T) { <-doneCh } -func TestFunctionsListener_ORMDoesNotFreezeHandlersForever(t *testing.T) { +func TestIntegration_Shared_FunctionsListener_ORMDoesNotFreezeHandlersForever(t *testing.T) { testutils.SkipShortDB(t) t.Parallel() diff --git a/core/services/functions/offchain_transmitter_test.go b/core/services/functions/offchain_transmitter_test.go index bec639bf27d..fae1e17f957 100644 --- a/core/services/functions/offchain_transmitter_test.go +++ b/core/services/functions/offchain_transmitter_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/functions" ) -func TestOffchainTransmitter(t *testing.T) { +func TestIntegration_Shared_OffchainTransmitter(t *testing.T) { t.Parallel() transmitter := functions.NewOffchainTransmitter(1) diff --git a/core/services/functions/orm_test.go b/core/services/functions/orm_test.go index e9638de845b..fd6cb36f15f 100644 --- a/core/services/functions/orm_test.go +++ b/core/services/functions/orm_test.go @@ -62,7 +62,7 @@ func createRequestWithTimestamp(t *testing.T, orm functions.ORM, ts time.Time) ( return id, txHash } -func TestORM_CreateRequestsAndFindByID(t *testing.T) { +func TestIntegration_Shared_ORM_CreateRequestsAndFindByID(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -103,7 +103,7 @@ func TestORM_CreateRequestsAndFindByID(t *testing.T) { }) } -func TestORM_SetResult(t *testing.T) { +func TestIntegration_Shared_ORM_SetResult(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -124,7 +124,7 @@ func TestORM_SetResult(t *testing.T) { require.Equal(t, []byte("result"), req.Result) } -func TestORM_SetError(t *testing.T) { +func TestIntegration_Shared_ORM_SetError(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -147,7 +147,7 @@ func TestORM_SetError(t *testing.T) { require.Equal(t, []byte("error"), req.Error) } -func TestORM_SetError_Internal(t *testing.T) { +func TestIntegration_Shared_ORM_SetError_Internal(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -167,7 +167,7 @@ func TestORM_SetError_Internal(t *testing.T) { require.Equal(t, []byte("error"), req.Error) } -func TestORM_SetFinalized(t *testing.T) { +func TestIntegration_Shared_ORM_SetFinalized(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -184,7 +184,7 @@ func TestORM_SetFinalized(t *testing.T) { require.Equal(t, functions.FINALIZED, req.State) } -func TestORM_SetConfirmed(t *testing.T) { +func TestIntegration_Shared_ORM_SetConfirmed(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -199,7 +199,7 @@ func TestORM_SetConfirmed(t *testing.T) { require.Equal(t, functions.CONFIRMED, req.State) } -func TestORM_StateTransitions(t *testing.T) { +func TestIntegration_Shared_ORM_StateTransitions(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -235,7 +235,7 @@ func TestORM_StateTransitions(t *testing.T) { require.Equal(t, functions.CONFIRMED, req.State) } -func TestORM_FindOldestEntriesByState(t *testing.T) { +func TestIntegration_Shared_ORM_FindOldestEntriesByState(t *testing.T) { t.Parallel() orm := setupORM(t) @@ -274,7 +274,7 @@ func TestORM_FindOldestEntriesByState(t *testing.T) { }) } -func TestORM_TimeoutExpiredResults(t *testing.T) { +func TestIntegration_Shared_ORM_TimeoutExpiredResults(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -323,7 +323,7 @@ func TestORM_TimeoutExpiredResults(t *testing.T) { } } -func TestORM_PruneOldestRequests(t *testing.T) { +func TestIntegration_Shared_ORM_PruneOldestRequests(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -367,7 +367,7 @@ func TestORM_PruneOldestRequests(t *testing.T) { require.Equal(t, ids[4], result[0].RequestID, "incorrect results order") } -func TestORM_PruneOldestRequests_Large(t *testing.T) { +func TestIntegration_Shared_ORM_PruneOldestRequests_Large(t *testing.T) { t.Parallel() ctx := testutils.Context(t) diff --git a/core/services/gateway/api/jsonrpccodec_test.go b/core/services/gateway/api/jsonrpccodec_test.go index fd094960663..28cb8e386c2 100644 --- a/core/services/gateway/api/jsonrpccodec_test.go +++ b/core/services/gateway/api/jsonrpccodec_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/gateway/api" ) -func TestJsonRPCRequest_Decode_Correct(t *testing.T) { +func TestUnit_JsonRPCRequest_Decode_Correct(t *testing.T) { t.Parallel() input := []byte(`{"jsonrpc": "2.0", "id": "aa-bb", "method": "upload", "params": {"body":{"don_id": "functions_local", "payload": {"field": 123}}}}`) @@ -32,7 +32,7 @@ func TestJsonRPCRequest_Decode_Correct(t *testing.T) { require.Equal(t, msg.Body.Payload, msg2.Body.Payload) } -func TestJsonRPCRequest_Decode_Incorrect(t *testing.T) { +func TestUnit_JsonRPCRequest_Decode_Incorrect(t *testing.T) { t.Parallel() testCases := map[string]string{ @@ -49,7 +49,7 @@ func TestJsonRPCRequest_Decode_Incorrect(t *testing.T) { } } -func TestJsonRPCRequest_Encode(t *testing.T) { +func TestUnit_JsonRPCRequest_Encode(t *testing.T) { t.Parallel() var msg api.Message @@ -69,7 +69,7 @@ func TestJsonRPCRequest_Encode(t *testing.T) { require.Equal(t, "upload", decoded.Body.Method) } -func TestJsonRPCResponse_Decode(t *testing.T) { +func TestUnit_JsonRPCResponse_Decode(t *testing.T) { t.Parallel() input := []byte(`{"jsonrpc": "2.0", "id": "aa-bb", "result": {"body": {"don_id": "functions_local", "payload": {"field": 123}}}}`) @@ -81,7 +81,7 @@ func TestJsonRPCResponse_Decode(t *testing.T) { require.NotEmpty(t, msg.Body.Payload) } -func TestJsonRPCResponse_Encode(t *testing.T) { +func TestUnit_JsonRPCResponse_Encode(t *testing.T) { t.Parallel() var msg api.Message diff --git a/core/services/gateway/api/message_test.go b/core/services/gateway/api/message_test.go index 832171803ab..51b8be9f710 100644 --- a/core/services/gateway/api/message_test.go +++ b/core/services/gateway/api/message_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/gateway/api" ) -func TestMessage_Validate(t *testing.T) { +func TestUnit_Message_Validate(t *testing.T) { msg := &api.Message{ Body: api.MessageBody{ MessageId: "abcd", @@ -69,7 +69,7 @@ func TestMessage_Validate(t *testing.T) { require.Error(t, msg.Validate()) } -func TestMessage_MessageSignAndValidateSignature(t *testing.T) { +func TestUnit_Message_MessageSignAndValidateSignature(t *testing.T) { t.Parallel() msg := &api.Message{ diff --git a/core/services/gateway/common/aggregation/common_test.go b/core/services/gateway/common/aggregation/common_test.go index 8e5ef86abd5..defc7847b0e 100644 --- a/core/services/gateway/common/aggregation/common_test.go +++ b/core/services/gateway/common/aggregation/common_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestStringSet(t *testing.T) { +func TestUnit_StringSet(t *testing.T) { t.Run("add and contains", func(t *testing.T) { s := make(StringSet) diff --git a/core/services/gateway/common/aggregation/response_aggregator_test.go b/core/services/gateway/common/aggregation/response_aggregator_test.go index 6fc372df8e3..66c11ef4173 100644 --- a/core/services/gateway/common/aggregation/response_aggregator_test.go +++ b/core/services/gateway/common/aggregation/response_aggregator_test.go @@ -9,7 +9,7 @@ import ( jsonrpc "github.com/smartcontractkit/chainlink-common/pkg/jsonrpc2" ) -func TestIdenticalNodeResponseAggregator_CollectAndAggregate(t *testing.T) { +func TestUnit_IdenticalNodeResponseAggregator_CollectAndAggregate(t *testing.T) { t.Run("single node response below threshold", func(t *testing.T) { agg, err := NewIdenticalNodeResponseAggregator(2) require.NoError(t, err) @@ -195,7 +195,7 @@ func TestIdenticalNodeResponseAggregator_CollectAndAggregate(t *testing.T) { }) } -func TestIdenticalNodeResponseAggregator_EdgeCases(t *testing.T) { +func TestUnit_IdenticalNodeResponseAggregator_EdgeCases(t *testing.T) { t.Run("empty response", func(t *testing.T) { agg, err := NewIdenticalNodeResponseAggregator(1) require.NoError(t, err) @@ -239,7 +239,7 @@ func TestIdenticalNodeResponseAggregator_EdgeCases(t *testing.T) { }) } -func TestIdenticalNodeResponseAggregator_NodeChangesResponse(t *testing.T) { +func TestUnit_IdenticalNodeResponseAggregator_NodeChangesResponse(t *testing.T) { t.Run("node changes response and reaches threshold", func(t *testing.T) { agg, err := NewIdenticalNodeResponseAggregator(2) require.NoError(t, err) diff --git a/core/services/gateway/common/aggregation/workflow_metadata_aggregator_test.go b/core/services/gateway/common/aggregation/workflow_metadata_aggregator_test.go index f6459db954c..216d6d12139 100644 --- a/core/services/gateway/common/aggregation/workflow_metadata_aggregator_test.go +++ b/core/services/gateway/common/aggregation/workflow_metadata_aggregator_test.go @@ -20,7 +20,7 @@ func createTestMetrics(t *testing.T) *metrics.Metrics { return m } -func TestWorkflowMetadataAggregator_StartStop(t *testing.T) { +func TestUnit_WorkflowMetadataAggregator_StartStop(t *testing.T) { lggr := logger.Test(t) testMetrics := createTestMetrics(t) agg := NewWorkflowMetadataAggregator(lggr, 2, 100*time.Millisecond, testMetrics) @@ -63,7 +63,7 @@ func createTestWorkflowMetadata(workflowID, workflowName, workflowOwner, workflo } } -func TestWorkflowMetadataAggregator_Collect(t *testing.T) { +func TestUnit_WorkflowMetadataAggregator_Collect(t *testing.T) { lggr := logger.Test(t) testMetrics := createTestMetrics(t) agg := NewWorkflowMetadataAggregator(lggr, 2, 10*time.Second, testMetrics) @@ -121,7 +121,7 @@ func TestWorkflowMetadataAggregator_Collect(t *testing.T) { require.NotEqual(t, timestamp1, timestamp2) } -func TestWorkflowMetadataAggregator_CollectDifferentObservations(t *testing.T) { +func TestUnit_WorkflowMetadataAggregator_CollectDifferentObservations(t *testing.T) { lggr := logger.Test(t) testMetrics := createTestMetrics(t) agg := NewWorkflowMetadataAggregator(lggr, 2, 10*time.Second, testMetrics) @@ -165,7 +165,7 @@ func TestWorkflowMetadataAggregator_CollectDifferentObservations(t *testing.T) { require.True(t, nodeObs2.nodes.Contains("node2")) } -func TestWorkflowMetadataAggregator_Aggregate(t *testing.T) { +func TestUnit_WorkflowMetadataAggregator_Aggregate(t *testing.T) { lggr := logger.Test(t) threshold := 2 testMetrics := createTestMetrics(t) @@ -230,7 +230,7 @@ func TestWorkflowMetadataAggregator_Aggregate(t *testing.T) { require.Len(t, result, 3) // observation3 reaches threshold } -func TestWorkflowMetadataAggregator_Aggregate_ChronologicalOrder(t *testing.T) { +func TestUnit_WorkflowMetadataAggregator_Aggregate_ChronologicalOrder(t *testing.T) { lggr := logger.Test(t) threshold := 2 testMetrics := createTestMetrics(t) @@ -282,7 +282,7 @@ func TestWorkflowMetadataAggregator_Aggregate_ChronologicalOrder(t *testing.T) { require.Equal(t, "workflowName1", result[2].WorkflowSelector.WorkflowName) } -func TestWorkflowMetadataAggregator_Aggregate_ChronologicalOrder_SameWorkflowNameOwnerTag(t *testing.T) { +func TestUnit_WorkflowMetadataAggregator_Aggregate_ChronologicalOrder_SameWorkflowNameOwnerTag(t *testing.T) { lggr := logger.Test(t) threshold := 2 testMetrics := createTestMetrics(t) @@ -349,7 +349,7 @@ func TestWorkflowMetadataAggregator_Aggregate_ChronologicalOrder_SameWorkflowNam require.Equal(t, "workflowID1", result[2].WorkflowSelector.WorkflowID) } -func TestWorkflowMetadataAggregator_ReapObservations(t *testing.T) { +func TestUnit_WorkflowMetadataAggregator_ReapObservations(t *testing.T) { lggr := logger.Test(t) cleanupInterval := 1 * time.Second testMetrics := createTestMetrics(t) @@ -384,7 +384,7 @@ func TestWorkflowMetadataAggregator_ReapObservations(t *testing.T) { require.Empty(t, agg.observations) } -func TestWorkflowMetadataAggregator_ReapObservations_UnexpiredObservation(t *testing.T) { +func TestUnit_WorkflowMetadataAggregator_ReapObservations_UnexpiredObservation(t *testing.T) { lggr := logger.Test(t) cleanupInterval := 1 * time.Second testMetrics := createTestMetrics(t) @@ -421,7 +421,7 @@ func TestWorkflowMetadataAggregator_ReapObservations_UnexpiredObservation(t *tes require.True(t, o.nodes.Contains("node3")) } -func TestWorkflowMetadataAggregator_Collect_EdgeCases(t *testing.T) { +func TestUnit_WorkflowMetadataAggregator_Collect_EdgeCases(t *testing.T) { lggr := logger.Test(t) t.Run("empty workflow ID", func(t *testing.T) { diff --git a/core/services/gateway/common/utils_test.go b/core/services/gateway/common/utils_test.go index 0faf0d4a7d6..a9f6d94b700 100644 --- a/core/services/gateway/common/utils_test.go +++ b/core/services/gateway/common/utils_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/gateway/common" ) -func TestUtils_BytesUint32Conversions(t *testing.T) { +func TestUnit_Utils_BytesUint32Conversions(t *testing.T) { t.Parallel() val := uint32(time.Now().Unix()) @@ -19,7 +19,7 @@ func TestUtils_BytesUint32Conversions(t *testing.T) { require.Equal(t, val, common.BytesToUint32(data)) } -func TestUtils_StringAlignedBytesConversions(t *testing.T) { +func TestUnit_Utils_StringAlignedBytesConversions(t *testing.T) { t.Parallel() val := "my_string" @@ -35,7 +35,7 @@ func TestUtils_StringAlignedBytesConversions(t *testing.T) { require.Equal(t, val, common.AlignedBytesToString(data)) } -func TestUtils_BytesSignAndValidate(t *testing.T) { +func TestUnit_Utils_BytesSignAndValidate(t *testing.T) { t.Parallel() data := []byte("data_data") diff --git a/core/services/gateway/connectionmanager_test.go b/core/services/gateway/connectionmanager_test.go index 05d1186d4ce..ef20bff2591 100644 --- a/core/services/gateway/connectionmanager_test.go +++ b/core/services/gateway/connectionmanager_test.go @@ -42,7 +42,7 @@ Name = "example_node" Address = "0x68902d681c28119f9b2531473a417088bf008e59" ` -func TestConnectionManager_NewConnectionManager_ValidConfig(t *testing.T) { +func TestUnit_ConnectionManager_NewConnectionManager_ValidConfig(t *testing.T) { t.Parallel() tomlConfig := parseTOMLConfig(t, defaultConfig) @@ -50,7 +50,7 @@ func TestConnectionManager_NewConnectionManager_ValidConfig(t *testing.T) { _ = newConnectionManager(t, tomlConfig, clockwork.NewFakeClock()) } -func TestConnectionManager_NewConnectionManager_InvalidConfig(t *testing.T) { +func TestUnit_ConnectionManager_NewConnectionManager_InvalidConfig(t *testing.T) { t.Parallel() invalidCases := map[string]string{ @@ -127,7 +127,7 @@ func signAndPackAuthHeader(t *testing.T, authHeaderElems *network.AuthHeaderElem return append(packedElems, signature...) } -func TestConnectionManager_StartHandshake(t *testing.T) { +func TestUnit_ConnectionManager_StartHandshake(t *testing.T) { t.Parallel() config, nodes := newTestConfig(t, 4) @@ -180,7 +180,7 @@ func TestConnectionManager_StartHandshake(t *testing.T) { require.ErrorIs(t, err, network.ErrAuthInvalidTimestamp) } -func TestConnectionManager_FinalizeHandshake(t *testing.T) { +func TestUnit_ConnectionManager_FinalizeHandshake(t *testing.T) { t.Parallel() config, nodes := newTestConfig(t, 4) @@ -213,7 +213,7 @@ func TestConnectionManager_FinalizeHandshake(t *testing.T) { require.ErrorIs(t, err, network.ErrChallengeInvalidSignature) } -func TestConnectionManager_SendToNode_Failures(t *testing.T) { +func TestUnit_ConnectionManager_SendToNode_Failures(t *testing.T) { t.Parallel() config, nodes := newTestConfig(t, 2) @@ -229,7 +229,7 @@ func TestConnectionManager_SendToNode_Failures(t *testing.T) { require.Error(t, err) } -func TestConnectionManager_CleanStartClose(t *testing.T) { +func TestUnit_ConnectionManager_CleanStartClose(t *testing.T) { t.Parallel() config, _ := newTestConfig(t, 2) diff --git a/core/services/gateway/connector/connector_test.go b/core/services/gateway/connector/connector_test.go index 4c1cc0d04bd..879b8032fda 100644 --- a/core/services/gateway/connector/connector_test.go +++ b/core/services/gateway/connector/connector_test.go @@ -54,7 +54,7 @@ func newTestConnector(t *testing.T, config *ConnectorConfig) (*gatewayConnector, return connector, signer, handler } -func TestGatewayConnector_NewGatewayConnector_ValidConfig(t *testing.T) { +func TestUnit_GatewayConnector_NewGatewayConnector_ValidConfig(t *testing.T) { t.Parallel() tomlConfig := parseTOMLConfig(t, ` @@ -69,7 +69,7 @@ URL = "ws://localhost:8081/node" newTestConnector(t, tomlConfig) } -func TestGatewayConnector_NewGatewayConnector_InvalidConfig(t *testing.T) { +func TestUnit_GatewayConnector_NewGatewayConnector_InvalidConfig(t *testing.T) { t.Parallel() invalidCases := map[string]string{ @@ -117,7 +117,7 @@ URL = "ws://localhost:8081/node" } } -func TestGatewayConnector_CleanStartAndClose(t *testing.T) { +func TestUnit_GatewayConnector_CleanStartAndClose(t *testing.T) { t.Parallel() connector, signer, _ := newTestConnector(t, parseTOMLConfig(t, defaultConfig)) @@ -125,7 +125,7 @@ func TestGatewayConnector_CleanStartAndClose(t *testing.T) { servicetest.Run(t, connector) } -func TestGatewayConnector_NewAuthHeader_SignerError(t *testing.T) { +func TestUnit_GatewayConnector_NewAuthHeader_SignerError(t *testing.T) { t.Parallel() connector, signer, _ := newTestConnector(t, parseTOMLConfig(t, defaultConfig)) @@ -137,7 +137,7 @@ func TestGatewayConnector_NewAuthHeader_SignerError(t *testing.T) { require.Error(t, err) } -func TestGatewayConnector_NewAuthHeader_Success(t *testing.T) { +func TestUnit_GatewayConnector_NewAuthHeader_Success(t *testing.T) { t.Parallel() testSignature := make([]byte, network.HandshakeSignatureLen) @@ -152,7 +152,7 @@ func TestGatewayConnector_NewAuthHeader_Success(t *testing.T) { require.Equal(t, testSignature, header[len(header)-65:]) } -func TestGatewayConnector_ChallengeResponse(t *testing.T) { +func TestUnit_GatewayConnector_ChallengeResponse(t *testing.T) { t.Parallel() testSignature := make([]byte, network.HandshakeSignatureLen) @@ -193,7 +193,7 @@ func TestGatewayConnector_ChallengeResponse(t *testing.T) { require.Equal(t, network.ErrAuthInvalidGateway, err) } -func TestGatewayConnector_AddHandler(t *testing.T) { +func TestUnit_GatewayConnector_AddHandler(t *testing.T) { t.Parallel() connector, _, _ := newTestConnector(t, parseTOMLConfig(t, defaultConfig)) diff --git a/core/services/gateway/delegate_test.go b/core/services/gateway/delegate_test.go index c255a24f657..4e108bbd1bd 100644 --- a/core/services/gateway/delegate_test.go +++ b/core/services/gateway/delegate_test.go @@ -8,7 +8,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/gateway" ) -func TestDelegate_JobSpecValidator(t *testing.T) { +func TestUnit_Delegate_JobSpecValidator(t *testing.T) { t.Parallel() var tt = []struct { diff --git a/core/services/gateway/gateway_test.go b/core/services/gateway/gateway_test.go index d6a55db059f..28db3c80635 100644 --- a/core/services/gateway/gateway_test.go +++ b/core/services/gateway/gateway_test.go @@ -57,7 +57,7 @@ func newGatewayHandler(t *testing.T) gateway.HandlerFactory { return gateway.NewHandlerFactory(nil, nil, nil, nil, nil, lggr, limits.Factory{Logger: lggr}) } -func TestGateway_NewGatewayFromConfig_ValidConfig(t *testing.T) { +func TestUnit_Gateway_NewGatewayFromConfig_ValidConfig(t *testing.T) { t.Parallel() tomlConfig := buildConfig(` @@ -79,7 +79,7 @@ Address = "0x0001020304050607080900010203040506070809" require.NoError(t, err) } -func TestGateway_NewGatewayFromConfig_DuplicateID(t *testing.T) { +func TestUnit_Gateway_NewGatewayFromConfig_DuplicateID(t *testing.T) { t.Parallel() tomlConfig := buildConfig(` @@ -97,7 +97,7 @@ HandlerName = "dummy" require.Error(t, err) } -func TestGateway_NewGatewayFromConfig_InvalidHandler(t *testing.T) { +func TestUnit_Gateway_NewGatewayFromConfig_InvalidHandler(t *testing.T) { t.Parallel() tomlConfig := buildConfig(` @@ -111,7 +111,7 @@ HandlerName = "no_such_handler" require.Error(t, err) } -func TestGateway_NewGatewayFromConfig_MissingID(t *testing.T) { +func TestUnit_Gateway_NewGatewayFromConfig_MissingID(t *testing.T) { t.Parallel() tomlConfig := buildConfig(` @@ -125,7 +125,7 @@ SomeOtherField = "abcd" require.Error(t, err) } -func TestGateway_NewGatewayFromConfig_InvalidNodeAddress(t *testing.T) { +func TestUnit_Gateway_NewGatewayFromConfig_InvalidNodeAddress(t *testing.T) { t.Parallel() tomlConfig := buildConfig(` @@ -143,7 +143,7 @@ Address = "0xnot_an_address" require.Error(t, err) } -func TestGateway_CleanStartAndClose(t *testing.T) { +func TestUnit_Gateway_CleanStartAndClose(t *testing.T) { t.Parallel() lggr := logger.Test(t) @@ -214,7 +214,7 @@ func newJSONRpcRequest(t *testing.T, requestID string, method string, payload [] return rawRequest } -func TestGateway_ProcessRequest_ParseError(t *testing.T) { +func TestUnit_Gateway_ProcessRequest_ParseError(t *testing.T) { t.Parallel() gw, _ := newGatewayWithMockHandler(t) @@ -223,7 +223,7 @@ func TestGateway_ProcessRequest_ParseError(t *testing.T) { require.Equal(t, 400, statusCode) } -func TestGateway_ProcessRequest_MessageValidationError(t *testing.T) { +func TestUnit_Gateway_ProcessRequest_MessageValidationError(t *testing.T) { t.Parallel() gw, _ := newGatewayWithMockHandler(t) @@ -233,7 +233,7 @@ func TestGateway_ProcessRequest_MessageValidationError(t *testing.T) { require.Equal(t, 400, statusCode) } -func TestGateway_ProcessRequest_MissingDonId(t *testing.T) { +func TestUnit_Gateway_ProcessRequest_MissingDonId(t *testing.T) { t.Parallel() gw, _ := newGatewayWithMockHandler(t) @@ -243,7 +243,7 @@ func TestGateway_ProcessRequest_MissingDonId(t *testing.T) { require.Equal(t, 400, statusCode) } -func TestGateway_ProcessRequest_IncorrectDonId(t *testing.T) { +func TestUnit_Gateway_ProcessRequest_IncorrectDonId(t *testing.T) { t.Parallel() gw, _ := newGatewayWithMockHandler(t) @@ -253,7 +253,7 @@ func TestGateway_ProcessRequest_IncorrectDonId(t *testing.T) { require.Equal(t, 400, statusCode) } -func TestGateway_LegacyRequest_HandlerResponse(t *testing.T) { +func TestUnit_Gateway_LegacyRequest_HandlerResponse(t *testing.T) { t.Parallel() gw, handler := newGatewayWithMockHandler(t) @@ -276,7 +276,7 @@ func TestGateway_LegacyRequest_HandlerResponse(t *testing.T) { require.Equal(t, 200, statusCode) } -func TestGateway_NewRequest_HandlerResponse(t *testing.T) { +func TestUnit_Gateway_NewRequest_HandlerResponse(t *testing.T) { t.Parallel() gw, handler := newGatewayWithMockHandler(t) @@ -303,7 +303,7 @@ func TestGateway_NewRequest_HandlerResponse(t *testing.T) { require.Equal(t, 200, statusCode) } -func TestGateway_ProcessRequest_HandlerTimeout(t *testing.T) { +func TestUnit_Gateway_ProcessRequest_HandlerTimeout(t *testing.T) { t.Parallel() gw, handler := newGatewayWithMockHandler(t) @@ -317,7 +317,7 @@ func TestGateway_ProcessRequest_HandlerTimeout(t *testing.T) { require.Equal(t, 504, statusCode) } -func TestGateway_ProcessRequest_HandlerError(t *testing.T) { +func TestUnit_Gateway_ProcessRequest_HandlerError(t *testing.T) { t.Parallel() gw, handler := newGatewayWithMockHandler(t) @@ -366,7 +366,7 @@ func newMockHandler(t *testing.T, method string) *handlermocks.Handler { return handler } -func TestGateway_Multihandler(t *testing.T) { +func TestUnit_Gateway_Multihandler(t *testing.T) { tomlConfig := buildConfig(` [[dons]] DonId = "1" diff --git a/core/services/gateway/handlers/capabilities/handler_test.go b/core/services/gateway/handlers/capabilities/handler_test.go index 13461b4d8ba..3095a931edd 100644 --- a/core/services/gateway/handlers/capabilities/handler_test.go +++ b/core/services/gateway/handlers/capabilities/handler_test.go @@ -77,7 +77,7 @@ func setupHandler(t *testing.T) (*handler, *mocks.HTTPClient, *handlermocks.DON, return handler, httpClient, don, nodes } -func TestHandler_SendHTTPMessageToClient(t *testing.T) { +func TestUnit_Handler_SendHTTPMessageToClient(t *testing.T) { handler, httpClient, don, nodes := setupHandler(t) ctx := testutils.Context(t) nodeAddr := nodes[0].Address @@ -259,7 +259,7 @@ func triggerRequest(t *testing.T, key *ecdsa.PrivateKey, topics []string, method return msg } -func TestHandlerReceiveHTTPMessageFromClient(t *testing.T) { +func TestUnit_HandlerReceiveHTTPMessageFromClient(t *testing.T) { handler, _, don, nodes := setupHandler(t) ctx := testutils.Context(t) msg := triggerRequest(t, nodes[0].PrivateKey, []string{"daily_price_update"}, "", "", "") @@ -365,7 +365,7 @@ func TestHandlerReceiveHTTPMessageFromClient(t *testing.T) { // TODO: Validate Senders and rate limit chck, pending question in trigger about where senders and rate limits are validated } -func TestHandleComputeActionMessage(t *testing.T) { +func TestUnit_HandleComputeActionMessage(t *testing.T) { handler, httpClient, don, nodes := setupHandler(t) ctx := testutils.Context(t) nodeAddr := nodes[0].Address diff --git a/core/services/gateway/handlers/capabilities/v2/http_handler_test.go b/core/services/gateway/handlers/capabilities/v2/http_handler_test.go index 16205a4e135..856b9d1f442 100644 --- a/core/services/gateway/handlers/capabilities/v2/http_handler_test.go +++ b/core/services/gateway/handlers/capabilities/v2/http_handler_test.go @@ -26,7 +26,7 @@ import ( httpmocks "github.com/smartcontractkit/chainlink/v2/core/services/gateway/network/mocks" ) -func TestNewGatewayHandler(t *testing.T) { +func TestUnit_NewGatewayHandler(t *testing.T) { t.Run("successful creation", func(t *testing.T) { cfg := serviceCfg() configBytes, err := json.Marshal(cfg) @@ -104,7 +104,7 @@ func TestNewGatewayHandler(t *testing.T) { }) } -func TestHandleNodeMessage(t *testing.T) { +func TestUnit_HandleNodeMessage(t *testing.T) { handler := createTestHandler(t) t.Run("successful node message handling", func(t *testing.T) { @@ -264,7 +264,7 @@ func TestHandleNodeMessage(t *testing.T) { }) } -func TestServiceLifecycle(t *testing.T) { +func TestUnit_ServiceLifecycle(t *testing.T) { handler := createTestHandler(t) t.Run("start and stop", func(t *testing.T) { @@ -282,7 +282,7 @@ func TestServiceLifecycle(t *testing.T) { require.NoError(t, err) }) } -func TestHandleNodeMessage_RoutesToTriggerHandler(t *testing.T) { +func TestUnit_HandleNodeMessage_RoutesToTriggerHandler(t *testing.T) { // This test covers the case where the response ID does not contain a "/" // and should be routed to the triggerHandler.HandleNodeTriggerResponse. mockTriggerHandler := triggermocks.NewHTTPTriggerHandler(t) @@ -306,7 +306,7 @@ func TestHandleNodeMessage_RoutesToTriggerHandler(t *testing.T) { mockTriggerHandler.AssertExpectations(t) } -func TestHandleNodeMessage_UnsupportedMethod(t *testing.T) { +func TestUnit_HandleNodeMessage_UnsupportedMethod(t *testing.T) { handler := createTestHandler(t) rawRes := json.RawMessage([]byte(`{}`)) resp := &jsonrpc.Response[json.RawMessage]{ @@ -320,7 +320,7 @@ func TestHandleNodeMessage_UnsupportedMethod(t *testing.T) { require.Contains(t, err.Error(), "unsupported method unsupportedMethod") } -func TestHandleNodeMessage_EmptyID(t *testing.T) { +func TestUnit_HandleNodeMessage_EmptyID(t *testing.T) { handler := createTestHandler(t) rawRes := json.RawMessage([]byte(`{}`)) resp := &jsonrpc.Response[json.RawMessage]{ @@ -365,7 +365,7 @@ func (m *mockResponseCache) DeleteExpired(ctx context.Context) int { return 0 } -func TestGatewayHandler_Start_CallsDeleteExpired(t *testing.T) { +func TestUnit_GatewayHandler_Start_CallsDeleteExpired(t *testing.T) { cfg := serviceCfg() cfg.CleanUpPeriodMs = 100 // fast cleanup for test @@ -433,7 +433,7 @@ func createTestHandlerWithConfig(t *testing.T, cfg ServiceConfig) *gatewayHandle return handler } -func TestCreateHTTPRequestCallback(t *testing.T) { +func TestUnit_CreateHTTPRequestCallback(t *testing.T) { ctx := testutils.Context(t) requestID := "test-request-id" @@ -535,7 +535,7 @@ func TestCreateHTTPRequestCallback(t *testing.T) { } // TestMakeOutgoingRequestCachingBehavior tests the specific caching logic in makeOutgoingRequest -func TestMakeOutgoingRequestCachingBehavior(t *testing.T) { +func TestUnit_MakeOutgoingRequestCachingBehavior(t *testing.T) { t.Run("MaxAgeMs=0 and Store=true calls Set", func(t *testing.T) { handler := createTestHandler(t) mockCache := newMockResponseCache() @@ -705,7 +705,7 @@ func expectSuccessfulRequest(mockHTTPClient *httpmocks.HTTPClient, mockDon *hand mockDon.EXPECT().SendToNode(mock.Anything, nodeAddr, mock.Anything).Return(nil).Once() } -func TestGatewayHandler_MakeOutgoingRequest_NodeRateLimiting(t *testing.T) { +func TestUnit_GatewayHandler_MakeOutgoingRequest_NodeRateLimiting(t *testing.T) { t.Run("node rate limiting with AllowVerbose", func(t *testing.T) { cfg := ServiceConfig{ NodeRateLimiter: ratelimit.RateLimiterConfig{ diff --git a/core/services/gateway/handlers/capabilities/v2/http_trigger_handler_test.go b/core/services/gateway/handlers/capabilities/v2/http_trigger_handler_test.go index 9cf4e32611c..2e4ac8517f7 100644 --- a/core/services/gateway/handlers/capabilities/v2/http_trigger_handler_test.go +++ b/core/services/gateway/handlers/capabilities/v2/http_trigger_handler_test.go @@ -43,7 +43,7 @@ func requireUserErrorSent(t *testing.T, payload handlers.UserCallbackPayload, er require.Equal(t, api.FromJSONRPCErrorCode(errorCode), payload.ErrorCode) } -func TestHttpTriggerHandler_HandleUserTriggerRequest(t *testing.T) { +func TestUnit_HttpTriggerHandler_HandleUserTriggerRequest(t *testing.T) { triggerReq := createTestTriggerRequest(workflowID) reqBytes, err := json.Marshal(triggerReq) require.NoError(t, err) @@ -406,7 +406,7 @@ func TestHttpTriggerHandler_HandleUserTriggerRequest(t *testing.T) { }) } -func TestHttpTriggerHandler_HandleNodeTriggerResponse(t *testing.T) { +func TestUnit_HttpTriggerHandler_HandleNodeTriggerResponse(t *testing.T) { t.Run("successful aggregation", func(t *testing.T) { handler, mockDon := createTestTriggerHandler(t) privateKey := createTestPrivateKey(t) @@ -482,7 +482,7 @@ func TestHttpTriggerHandler_HandleNodeTriggerResponse(t *testing.T) { }) } -func TestHttpTriggerHandler_ServiceLifecycle(t *testing.T) { +func TestUnit_HttpTriggerHandler_ServiceLifecycle(t *testing.T) { t.Run("start and stop", func(t *testing.T) { handler, _ := createTestTriggerHandler(t) @@ -526,7 +526,7 @@ func registerWorkflow(t *testing.T, handler *httpTriggerHandler, workflowID stri } } -func TestHttpTriggerHandler_ReapExpiredCallbacks(t *testing.T) { +func TestUnit_HttpTriggerHandler_ReapExpiredCallbacks(t *testing.T) { requestID := "test-request-id" triggerReq := gateway_common.HTTPTriggerRequest{ Workflow: gateway_common.WorkflowSelector{ @@ -604,7 +604,7 @@ func TestHttpTriggerHandler_ReapExpiredCallbacks(t *testing.T) { }) } -func TestIsValidJSON(t *testing.T) { +func TestUnit_IsValidJSON(t *testing.T) { tests := []struct { name string input []byte @@ -650,7 +650,7 @@ func TestIsValidJSON(t *testing.T) { } } -func TestHttpTriggerHandler_HandleUserTriggerRequest_Retries(t *testing.T) { +func TestUnit_HttpTriggerHandler_HandleUserTriggerRequest_Retries(t *testing.T) { lggr := logger.Test(t) cfg := ServiceConfig{ MaxTriggerRequestDurationMs: 2000, // 2 seconds for test @@ -711,7 +711,7 @@ func TestHttpTriggerHandler_HandleUserTriggerRequest_Retries(t *testing.T) { }) } -func TestHttpTriggerHandler_HandleUserTriggerRequest_JWTAuthorization(t *testing.T) { +func TestUnit_HttpTriggerHandler_HandleUserTriggerRequest_JWTAuthorization(t *testing.T) { handler, mockDon := createTestTriggerHandler(t) ctx := testutils.Context(t) @@ -856,7 +856,7 @@ func TestHttpTriggerHandler_HandleUserTriggerRequest_JWTAuthorization(t *testing }) } -func TestHttpTriggerHandler_HandleUserTriggerRequest_WorkflowLookup(t *testing.T) { +func TestUnit_HttpTriggerHandler_HandleUserTriggerRequest_WorkflowLookup(t *testing.T) { handler, mockDon := createTestTriggerHandler(t) ctx := testutils.Context(t) @@ -1058,7 +1058,7 @@ func TestHttpTriggerHandler_HandleUserTriggerRequest_WorkflowLookup(t *testing.T requireUserErrorSent(t, r, jsonrpc.ErrInvalidRequest) }) } -func TestHttpTriggerHandler_HandleUserTriggerRequest_Validation(t *testing.T) { +func TestUnit_HttpTriggerHandler_HandleUserTriggerRequest_Validation(t *testing.T) { handler, mockDon := createTestTriggerHandler(t) t.Run("workflowID uppercase", func(t *testing.T) { @@ -1572,7 +1572,7 @@ func createTestTriggerHandlerWithConfig(t *testing.T, cfg ServiceConfig) (*httpT return handler, mockDon } -func TestHttpTriggerHandler_HandleUserTriggerRequest_RateLimiting(t *testing.T) { +func TestUnit_HttpTriggerHandler_HandleUserTriggerRequest_RateLimiting(t *testing.T) { cfg := ServiceConfig{ CleanUpPeriodMs: 60000, MaxTriggerRequestDurationMs: 300000, @@ -1684,7 +1684,7 @@ func TestHttpTriggerHandler_HandleUserTriggerRequest_RateLimiting(t *testing.T) }) } -func TestHttpTriggerHandler_HandleUserTriggerRequest_StopsRetriesOnQuorum(t *testing.T) { +func TestUnit_HttpTriggerHandler_HandleUserTriggerRequest_StopsRetriesOnQuorum(t *testing.T) { lggr := logger.Test(t) cfg := WithDefaults(ServiceConfig{}) diff --git a/core/services/gateway/handlers/capabilities/v2/metrics/metrics_test.go b/core/services/gateway/handlers/capabilities/v2/metrics/metrics_test.go index 6e19b92674c..d0bbb32984e 100644 --- a/core/services/gateway/handlers/capabilities/v2/metrics/metrics_test.go +++ b/core/services/gateway/handlers/capabilities/v2/metrics/metrics_test.go @@ -8,7 +8,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/gateway/config" ) -func TestNewMetrics(t *testing.T) { +func TestUnit_NewMetrics(t *testing.T) { t.Parallel() donConfig := &config.DONConfig{ diff --git a/core/services/gateway/handlers/capabilities/v2/response_cache_test.go b/core/services/gateway/handlers/capabilities/v2/response_cache_test.go index e913bbf19fd..4dfe04a83be 100644 --- a/core/services/gateway/handlers/capabilities/v2/response_cache_test.go +++ b/core/services/gateway/handlers/capabilities/v2/response_cache_test.go @@ -42,7 +42,7 @@ func createTestResponse(statusCode int, body string) gateway_common.OutboundHTTP } } -func TestIsCacheableStatusCode(t *testing.T) { +func TestUnit_IsCacheableStatusCode(t *testing.T) { tests := []struct { name string statusCode int @@ -86,7 +86,7 @@ func TestIsCacheableStatusCode(t *testing.T) { } } -func TestRequestHash(t *testing.T) { +func TestUnit_RequestHash(t *testing.T) { req := createTestRequest("GET", "https://example.com") t.Run("generates consistent hash", func(t *testing.T) { @@ -170,7 +170,7 @@ func TestRequestHash(t *testing.T) { }) } -func TestIsExpiredOrNotCached(t *testing.T) { +func TestUnit_IsExpiredOrNotCached(t *testing.T) { testMetrics := createCacheTestMetrics(t) cache := newResponseCache(logger.Test(t), 1000, testMetrics) // 1 second TTL workflowID := "workflow-123" @@ -202,7 +202,7 @@ func TestIsExpiredOrNotCached(t *testing.T) { }) } -func TestFetch(t *testing.T) { +func TestUnit_Fetch(t *testing.T) { testMetrics := createCacheTestMetrics(t) cache := newResponseCache(logger.Test(t), 10000, testMetrics) // 10 seconds TTL workflowID := "workflow-123" @@ -317,7 +317,7 @@ func TestFetch(t *testing.T) { }) } -func TestSet(t *testing.T) { +func TestUnit_Set(t *testing.T) { testMetrics := createCacheTestMetrics(t) cache := newResponseCache(logger.Test(t), 10000, testMetrics) workflowID := "workflow-123" @@ -375,7 +375,7 @@ func TestSet(t *testing.T) { }) } -func TestDeleteExpired(t *testing.T) { +func TestUnit_DeleteExpired(t *testing.T) { testMetrics := createCacheTestMetrics(t) cache := newResponseCache(logger.Test(t), 1000, testMetrics) @@ -418,7 +418,7 @@ func TestDeleteExpired(t *testing.T) { }) } -func TestEdgeCases(t *testing.T) { +func TestUnit_EdgeCases(t *testing.T) { t.Run("zero TTL cache", func(t *testing.T) { testMetrics := createCacheTestMetrics(t) cache := newResponseCache(logger.Test(t), 0, testMetrics) diff --git a/core/services/gateway/handlers/capabilities/v2/workflow_metadata_handler_test.go b/core/services/gateway/handlers/capabilities/v2/workflow_metadata_handler_test.go index 19b9f085d1c..304f1e1a8e3 100644 --- a/core/services/gateway/handlers/capabilities/v2/workflow_metadata_handler_test.go +++ b/core/services/gateway/handlers/capabilities/v2/workflow_metadata_handler_test.go @@ -56,7 +56,7 @@ func createTestWorkflowMetadataHandler(t *testing.T) (*WorkflowMetadataHandler, return handler, mockDon, donConfig } -func TestSyncMetadata(t *testing.T) { +func TestUnit_SyncMetadata(t *testing.T) { handler, _, _ := createTestWorkflowMetadataHandler(t) // Test when aggregator has no data @@ -109,7 +109,7 @@ func TestSyncMetadata(t *testing.T) { require.Equal(t, testWorkflowID1, workflowID) } -func TestSyncMetadataMultipleWorkflows(t *testing.T) { +func TestUnit_SyncMetadataMultipleWorkflows(t *testing.T) { handler, _, _ := createTestWorkflowMetadataHandler(t) ctx := testutils.Context(t) @@ -161,7 +161,7 @@ func TestSyncMetadataMultipleWorkflows(t *testing.T) { } } -func TestSendMetadataPullRequest(t *testing.T) { +func TestUnit_SendMetadataPullRequest(t *testing.T) { handler, mockDon, donConfig := createTestWorkflowMetadataHandler(t) for _, member := range donConfig.Members { mockDon.EXPECT().SendToNode(mock.Anything, member.Address, mock.Anything).Return(nil).Once() @@ -172,7 +172,7 @@ func TestSendMetadataPullRequest(t *testing.T) { mockDon.AssertExpectations(t) } -func TestSendMetadataPullRequestWithErrors(t *testing.T) { +func TestUnit_SendMetadataPullRequestWithErrors(t *testing.T) { handler, mockDon, donConfig := createTestWorkflowMetadataHandler(t) // Mock errors for some nodes @@ -194,7 +194,7 @@ func TestSendMetadataPullRequestWithErrors(t *testing.T) { mockDon.AssertExpectations(t) } -func TestSendMetadataPullRequestVerifyPayload(t *testing.T) { +func TestUnit_SendMetadataPullRequestVerifyPayload(t *testing.T) { handler, mockDon, donConfig := createTestWorkflowMetadataHandler(t) // Capture the request payload var capturedReq *jsonrpc.Request[json.RawMessage] @@ -213,7 +213,7 @@ func TestSendMetadataPullRequestVerifyPayload(t *testing.T) { mockDon.AssertNumberOfCalls(t, "SendToNode", len(donConfig.Members)) } -func TestOnMetadataPush(t *testing.T) { +func TestUnit_OnMetadataPush(t *testing.T) { handler, _, _ := createTestWorkflowMetadataHandler(t) ctx := testutils.Context(t) @@ -257,7 +257,7 @@ func TestOnMetadataPush(t *testing.T) { require.Empty(t, handler.workflowRefToID) } -func TestOnMetadataPushInvalidJSON(t *testing.T) { +func TestUnit_OnMetadataPushInvalidJSON(t *testing.T) { handler, _, _ := createTestWorkflowMetadataHandler(t) ctx := testutils.Context(t) @@ -271,7 +271,7 @@ func TestOnMetadataPushInvalidJSON(t *testing.T) { require.Contains(t, err.Error(), "failed to unmarshal metadata") } -func TestOnMetadataPullResponse(t *testing.T) { +func TestUnit_OnMetadataPullResponse(t *testing.T) { handler, _, _ := createTestWorkflowMetadataHandler(t) ctx := testutils.Context(t) @@ -368,7 +368,7 @@ func TestOnMetadataPullResponse(t *testing.T) { require.Equal(t, ref2, r2) } -func TestOnMetadataPullResponseInvalidJSON(t *testing.T) { +func TestUnit_OnMetadataPullResponseInvalidJSON(t *testing.T) { handler, _, _ := createTestWorkflowMetadataHandler(t) ctx := testutils.Context(t) @@ -382,7 +382,7 @@ func TestOnMetadataPullResponseInvalidJSON(t *testing.T) { require.Contains(t, err.Error(), "failed to unmarshal metadata pull response") } -func TestStartAndClose(t *testing.T) { +func TestUnit_StartAndClose(t *testing.T) { handler, _, _ := createTestWorkflowMetadataHandler(t) ctx := testutils.Context(t) @@ -399,7 +399,7 @@ func TestStartAndClose(t *testing.T) { require.Error(t, err) } -func TestValidateAuthMetadata(t *testing.T) { +func TestUnit_ValidateAuthMetadata(t *testing.T) { handler, _, _ := createTestWorkflowMetadataHandler(t) tests := []struct { @@ -800,7 +800,7 @@ func TestValidateAuthMetadata(t *testing.T) { } } -func TestOnMetadataPushWithValidation(t *testing.T) { +func TestUnit_OnMetadataPushWithValidation(t *testing.T) { handler, _, _ := createTestWorkflowMetadataHandler(t) ctx := testutils.Context(t) @@ -866,7 +866,7 @@ func TestOnMetadataPushWithValidation(t *testing.T) { }) } -func TestOnMetadataPullResponseWithValidation(t *testing.T) { +func TestUnit_OnMetadataPullResponseWithValidation(t *testing.T) { handler, _, _ := createTestWorkflowMetadataHandler(t) ctx := testutils.Context(t) @@ -964,7 +964,7 @@ func TestOnMetadataPullResponseWithValidation(t *testing.T) { }) } -func TestWorkflowMetadataHandler_Authorize(t *testing.T) { +func TestUnit_WorkflowMetadataHandler_Authorize(t *testing.T) { handler, _, _ := createTestWorkflowMetadataHandler(t) privateKey, err := crypto.GenerateKey() require.NoError(t, err) @@ -1153,7 +1153,7 @@ func TestWorkflowMetadataHandler_Authorize(t *testing.T) { }) } -func TestWorkflowMetadataHandler_GetWorkflowID(t *testing.T) { +func TestUnit_WorkflowMetadataHandler_GetWorkflowID(t *testing.T) { handler, _, _ := createTestWorkflowMetadataHandler(t) workflowOwner := testWorkflowOwner1 @@ -1196,7 +1196,7 @@ func TestWorkflowMetadataHandler_GetWorkflowID(t *testing.T) { }) } -func TestWorkflowMetadataHandler_GetWorkflowReference(t *testing.T) { +func TestUnit_WorkflowMetadataHandler_GetWorkflowReference(t *testing.T) { handler, _, _ := createTestWorkflowMetadataHandler(t) workflowOwner := testWorkflowOwner1 diff --git a/core/services/gateway/handlers/capabilities/webapi_test.go b/core/services/gateway/handlers/capabilities/webapi_test.go index 2030c898053..70a7ac1d8fc 100644 --- a/core/services/gateway/handlers/capabilities/webapi_test.go +++ b/core/services/gateway/handlers/capabilities/webapi_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestResponseValidate(t *testing.T) { +func TestUnit_ResponseValidate(t *testing.T) { tt := []struct { name string response Response diff --git a/core/services/gateway/handlers/common/callback_test.go b/core/services/gateway/handlers/common/callback_test.go index 0d36c6a9d37..67bce966c49 100644 --- a/core/services/gateway/handlers/common/callback_test.go +++ b/core/services/gateway/handlers/common/callback_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers" ) -func Test_Callback(t *testing.T) { +func TestUnit_Callback(t *testing.T) { cb := NewCallback() payload := handlers.UserCallbackPayload{RawResponse: []byte("test")} diff --git a/core/services/gateway/handlers/common/message_util_test.go b/core/services/gateway/handlers/common/message_util_test.go index e77efdce92b..52c79ebef28 100644 --- a/core/services/gateway/handlers/common/message_util_test.go +++ b/core/services/gateway/handlers/common/message_util_test.go @@ -26,7 +26,7 @@ func unsignedMessage() api.Message { } } -func TestValidatedMessageFromReq(t *testing.T) { +func TestUnit_ValidatedMessageFromReq(t *testing.T) { validMsg := unsignedMessage() key, err := crypto.HexToECDSA(privateKey) require.NoError(t, err) @@ -117,7 +117,7 @@ func TestValidatedMessageFromReq(t *testing.T) { }) } -func TestValidatedMessageFromResp(t *testing.T) { +func TestUnit_ValidatedMessageFromResp(t *testing.T) { validMsg := unsignedMessage() key, err := crypto.HexToECDSA(privateKey) require.NoError(t, err) @@ -190,7 +190,7 @@ func TestValidatedMessageFromResp(t *testing.T) { }) } -func TestValidatedResponseFromMessage(t *testing.T) { +func TestUnit_ValidatedResponseFromMessage(t *testing.T) { validMsg := unsignedMessage() t.Run("valid message", func(t *testing.T) { @@ -223,7 +223,7 @@ func TestValidatedResponseFromMessage(t *testing.T) { }) } -func TestValidatedRequestFromMessage(t *testing.T) { +func TestUnit_ValidatedRequestFromMessage(t *testing.T) { validMsg := unsignedMessage() t.Run("valid message", func(t *testing.T) { diff --git a/core/services/gateway/handlers/common/requestcache_test.go b/core/services/gateway/handlers/common/requestcache_test.go index 41ccd497643..d294bf551a0 100644 --- a/core/services/gateway/handlers/common/requestcache_test.go +++ b/core/services/gateway/handlers/common/requestcache_test.go @@ -20,7 +20,7 @@ type requestState struct { counter int } -func TestRequestCache_Simple(t *testing.T) { +func TestUnit_RequestCache_Simple(t *testing.T) { t.Parallel() cache := common.NewRequestCache[requestState](time.Hour, 1000) @@ -50,7 +50,7 @@ func TestRequestCache_Simple(t *testing.T) { require.Equal(t, "aa", msg.Body.MessageId) } -func TestRequestCache_MultiResponse(t *testing.T) { +func TestUnit_RequestCache_MultiResponse(t *testing.T) { t.Parallel() nRequests := 10 @@ -102,7 +102,7 @@ func TestRequestCache_MultiResponse(t *testing.T) { } } -func TestRequestCache_Timeout(t *testing.T) { +func TestUnit_RequestCache_Timeout(t *testing.T) { t.Parallel() cache := common.NewRequestCache[requestState](time.Millisecond*10, 1000) @@ -122,7 +122,7 @@ func TestRequestCache_Timeout(t *testing.T) { require.Equal(t, api.RequestTimeoutError, finalResp.ErrorCode) } -func TestRequestCache_MaxSize(t *testing.T) { +func TestUnit_RequestCache_MaxSize(t *testing.T) { t.Parallel() cache := common.NewRequestCache[requestState](time.Hour, 2) diff --git a/core/services/gateway/handlers/functions/allowlist/allowlist_internal_test.go b/core/services/gateway/handlers/functions/allowlist/allowlist_internal_test.go index a27ecd460a9..8e63c04035e 100644 --- a/core/services/gateway/handlers/functions/allowlist/allowlist_internal_test.go +++ b/core/services/gateway/handlers/functions/allowlist/allowlist_internal_test.go @@ -17,7 +17,7 @@ import ( amocks "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/functions/allowlist/mocks" ) -func TestUpdateAllowedSendersInBatches(t *testing.T) { +func TestUnit_UpdateAllowedSendersInBatches(t *testing.T) { t.Run("OK-simple_update_in_batches", func(t *testing.T) { ctx := context.Background() config := OnchainAllowlistConfig{ diff --git a/core/services/gateway/handlers/functions/allowlist/allowlist_test.go b/core/services/gateway/handlers/functions/allowlist/allowlist_test.go index 1431fc38b82..7de5e4082a9 100644 --- a/core/services/gateway/handlers/functions/allowlist/allowlist_test.go +++ b/core/services/gateway/handlers/functions/allowlist/allowlist_test.go @@ -32,7 +32,7 @@ const ( ToSContractV110 = "Functions Terms of Service Allow List v1.1.0" ) -func TestUpdateAndCheck(t *testing.T) { +func TestIntegration_Shared_UpdateAndCheck(t *testing.T) { t.Parallel() t.Run("OK-with_ToS_V1.0.0", func(t *testing.T) { @@ -118,7 +118,7 @@ func TestUpdateAndCheck(t *testing.T) { }) } -func TestUnsupportedVersion(t *testing.T) { +func TestIntegration_Shared_UnsupportedVersion(t *testing.T) { t.Parallel() client := clienttest.NewClient(t) @@ -133,7 +133,7 @@ func TestUnsupportedVersion(t *testing.T) { require.Error(t, err) } -func TestUpdatePeriodically(t *testing.T) { +func TestIntegration_Shared_UpdatePeriodically(t *testing.T) { t.Parallel() t.Run("OK-with_ToS_V1.0.0", func(t *testing.T) { @@ -225,7 +225,7 @@ func TestUpdatePeriodically(t *testing.T) { }) } -func TestUpdateFromContract(t *testing.T) { +func TestIntegration_Shared_UpdateFromContract(t *testing.T) { t.Parallel() t.Run("OK-fetch_complete_list_of_allowed_senders", func(t *testing.T) { @@ -315,7 +315,7 @@ func TestUpdateFromContract(t *testing.T) { }) } -func TestExtractContractVersion(t *testing.T) { +func TestUnit_ExtractContractVersion(t *testing.T) { type tc struct { name string versionStr string diff --git a/core/services/gateway/handlers/functions/allowlist/orm_test.go b/core/services/gateway/handlers/functions/allowlist/orm_test.go index 10c923fa7a8..e4c9cd89695 100644 --- a/core/services/gateway/handlers/functions/allowlist/orm_test.go +++ b/core/services/gateway/handlers/functions/allowlist/orm_test.go @@ -36,7 +36,7 @@ func seedAllowedSenders(t *testing.T, orm allowlist.ORM, amount int) []common.Ad return storedAllowedSenders } -func TestORM_GetAllowedSenders(t *testing.T) { +func TestIntegration_Shared_ORM_GetAllowedSenders(t *testing.T) { t.Parallel() t.Run("fetch first page", func(t *testing.T) { ctx := testutils.Context(t) @@ -61,7 +61,7 @@ func TestORM_GetAllowedSenders(t *testing.T) { }) } -func TestORM_CreateAllowedSenders(t *testing.T) { +func TestIntegration_Shared_ORM_CreateAllowedSenders(t *testing.T) { t.Parallel() t.Run("OK-create_an_allowed_sender", func(t *testing.T) { @@ -139,7 +139,7 @@ func TestORM_CreateAllowedSenders(t *testing.T) { }) } -func TestORM_DeleteAllowedSenders(t *testing.T) { +func TestIntegration_Shared_ORM_DeleteAllowedSenders(t *testing.T) { t.Parallel() t.Run("OK-delete_blocked_sender_from_allowed_list", func(t *testing.T) { @@ -192,7 +192,7 @@ func TestORM_DeleteAllowedSenders(t *testing.T) { }) } -func TestORM_PurgeAllowedSenders(t *testing.T) { +func TestIntegration_Shared_ORM_PurgeAllowedSenders(t *testing.T) { t.Parallel() t.Run("OK-purge_allowed_list", func(t *testing.T) { @@ -259,7 +259,7 @@ func TestORM_PurgeAllowedSenders(t *testing.T) { }) } -func Test_NewORM(t *testing.T) { +func TestIntegration_Shared_NewORM(t *testing.T) { t.Run("OK-create_ORM", func(t *testing.T) { _, err := allowlist.NewORM(pgtest.NewSqlxDB(t), logger.Test(t), testutils.NewAddress()) require.NoError(t, err) diff --git a/core/services/gateway/handlers/functions/handler.functions_test.go b/core/services/gateway/handlers/functions/handler.functions_test.go index 1832ee90930..35dc4ae9406 100644 --- a/core/services/gateway/handlers/functions/handler.functions_test.go +++ b/core/services/gateway/handlers/functions/handler.functions_test.go @@ -99,7 +99,7 @@ func sendNodeReponse(t *testing.T, handler handlers.Handler, userRequestMsg api. } } -func TestFunctionsHandler_Minimal(t *testing.T) { +func TestUnit_FunctionsHandler_Minimal(t *testing.T) { handler, err := functions.NewFunctionsHandlerFromConfig(json.RawMessage("{}"), &config.DONConfig{}, nil, nil, nil, logger.Test(t)) require.NoError(t, err) @@ -109,14 +109,14 @@ func TestFunctionsHandler_Minimal(t *testing.T) { require.Error(t, err) } -func TestFunctionsHandler_CleanStartAndClose(t *testing.T) { +func TestUnit_FunctionsHandler_CleanStartAndClose(t *testing.T) { handler, err := functions.NewFunctionsHandlerFromConfig(json.RawMessage("{}"), &config.DONConfig{}, nil, nil, nil, logger.Test(t)) require.NoError(t, err) servicetest.Run(t, handler) } -func TestFunctionsHandler_HandleUserMessage_SecretsSet(t *testing.T) { +func TestUnit_FunctionsHandler_HandleUserMessage_SecretsSet(t *testing.T) { tests := []struct { name string nodeResults []bool @@ -165,7 +165,7 @@ func TestFunctionsHandler_HandleUserMessage_SecretsSet(t *testing.T) { } } -func TestFunctionsHandler_HandleUserMessage_Heartbeat(t *testing.T) { +func TestUnit_FunctionsHandler_HandleUserMessage_Heartbeat(t *testing.T) { tests := []struct { name string nodeResults []bool @@ -213,7 +213,7 @@ func TestFunctionsHandler_HandleUserMessage_Heartbeat(t *testing.T) { } } -func TestFunctionsHandler_HandleUserMessage_InvalidMethod(t *testing.T) { +func TestUnit_FunctionsHandler_HandleUserMessage_InvalidMethod(t *testing.T) { nodes, user := gc.NewTestNodes(t, 4), gc.NewTestNodes(t, 1)[0] handler, _, allowlist, _ := newFunctionsHandlerForATestDON(t, nodes, time.Hour*24, user.Address) userRequestMsg := newSignedMessage(t, "1234", "secrets_reveal_all_please", "don_id", user.PrivateKey) @@ -224,7 +224,7 @@ func TestFunctionsHandler_HandleUserMessage_InvalidMethod(t *testing.T) { require.Error(t, err) } -func TestFunctionsHandler_HandleUserMessage_Timeout(t *testing.T) { +func TestUnit_FunctionsHandler_HandleUserMessage_Timeout(t *testing.T) { nodes, user := gc.NewTestNodes(t, 4), gc.NewTestNodes(t, 1)[0] handler, don, allowlist, subscriptions := newFunctionsHandlerForATestDON(t, nodes, time.Millisecond*10, user.Address) userRequestMsg := newSignedMessage(t, "1234", "secrets_set", "don_id", user.PrivateKey) diff --git a/core/services/gateway/handlers/functions/subscriptions/orm_test.go b/core/services/gateway/handlers/functions/subscriptions/orm_test.go index 4780dac05bf..f561c1a9dfb 100644 --- a/core/services/gateway/handlers/functions/subscriptions/orm_test.go +++ b/core/services/gateway/handlers/functions/subscriptions/orm_test.go @@ -52,7 +52,7 @@ func seedSubscriptions(t *testing.T, orm subscriptions.ORM, amount int) []subscr return storedSubscriptions } -func TestORM_GetSubscriptions(t *testing.T) { +func TestIntegration_Shared_ORM_GetSubscriptions(t *testing.T) { t.Parallel() t.Run("fetch first page", func(t *testing.T) { ctx := testutils.Context(t) @@ -77,7 +77,7 @@ func TestORM_GetSubscriptions(t *testing.T) { }) } -func TestORM_UpsertSubscription(t *testing.T) { +func TestIntegration_Shared_ORM_UpsertSubscription(t *testing.T) { t.Parallel() t.Run("create a subscription", func(t *testing.T) { @@ -236,7 +236,7 @@ func TestORM_UpsertSubscription(t *testing.T) { require.Len(t, results, 1, "incorrect results length") }) } -func Test_NewORM(t *testing.T) { +func TestIntegration_Shared_NewORM(t *testing.T) { t.Parallel() t.Run("OK-create_ORM", func(t *testing.T) { _, err := subscriptions.NewORM(pgtest.NewSqlxDB(t), logger.Test(t), testutils.NewAddress()) diff --git a/core/services/gateway/handlers/functions/subscriptions/subscriptions_test.go b/core/services/gateway/handlers/functions/subscriptions/subscriptions_test.go index 0a2c1eeb16f..a20e6258ef2 100644 --- a/core/services/gateway/handlers/functions/subscriptions/subscriptions_test.go +++ b/core/services/gateway/handlers/functions/subscriptions/subscriptions_test.go @@ -28,7 +28,7 @@ const ( storedUser = "0x3E2dc0F9DB014aE19888F539E59285D2Ea04233G" ) -func TestSubscriptions_OnePass(t *testing.T) { +func TestIntegration_Shared_Subscriptions_OnePass(t *testing.T) { t.Parallel() getSubscriptionCount := hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000000003") getSubscriptionsInRange := hexutil.MustDecode("0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000240000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000109e6e1b12098cc8f3a1e9719a817ec53ab9b35c000000000000000000000000000000000000000000000000000034e23f515cb0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f5340f0968ee8b7dfd97e3327a6139273cc2c4fa000000000000000000000000000000000000000000000001158e460913d000000000000000000000000000009ed925d8206a4f88a2f643b28b3035b315753cd60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001bc14b92364c75e20000000000000000000000009ed925d8206a4f88a2f643b28b3035b315753cd60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000005439e5881a529f3ccbffc0e82d49f9db3950aefe") @@ -72,7 +72,7 @@ func TestSubscriptions_OnePass(t *testing.T) { }, testutils.WaitTimeout(t), time.Second).Should(gomega.BeTrue()) } -func TestSubscriptions_MultiPass(t *testing.T) { +func TestIntegration_Shared_Subscriptions_MultiPass(t *testing.T) { t.Parallel() const ncycles int32 = 5 var currentCycle atomic.Int32 @@ -120,7 +120,7 @@ func TestSubscriptions_MultiPass(t *testing.T) { }, testutils.WaitTimeout(t), time.Second).Should(gomega.BeTrue()) } -func TestSubscriptions_Stored(t *testing.T) { +func TestIntegration_Shared_Subscriptions_Stored(t *testing.T) { t.Parallel() getSubscriptionCount := hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000000003") getSubscriptionsInRange := hexutil.MustDecode("0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000240000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000109e6e1b12098cc8f3a1e9719a817ec53ab9b35c000000000000000000000000000000000000000000000000000034e23f515cb0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f5340f0968ee8b7dfd97e3327a6139273cc2c4fa000000000000000000000000000000000000000000000001158e460913d000000000000000000000000000009ed925d8206a4f88a2f643b28b3035b315753cd60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001bc14b92364c75e20000000000000000000000009ed925d8206a4f88a2f643b28b3035b315753cd60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000005439e5881a529f3ccbffc0e82d49f9db3950aefe") diff --git a/core/services/gateway/handlers/functions/subscriptions/user_subscriptions_test.go b/core/services/gateway/handlers/functions/subscriptions/user_subscriptions_test.go index 094dd0628b3..7d0aae64260 100644 --- a/core/services/gateway/handlers/functions/subscriptions/user_subscriptions_test.go +++ b/core/services/gateway/handlers/functions/subscriptions/user_subscriptions_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestUserSubscriptions(t *testing.T) { +func TestIntegration_Shared_UserSubscriptions(t *testing.T) { t.Parallel() us := subscriptions.NewUserSubscriptions() @@ -56,7 +56,7 @@ func TestUserSubscriptions(t *testing.T) { }) } -func TestUserSubscriptions_UpdateSubscription(t *testing.T) { +func TestIntegration_Shared_UserSubscriptions_UpdateSubscription(t *testing.T) { t.Parallel() t.Run("update balance", func(t *testing.T) { diff --git a/core/services/gateway/handlers/handler.dummy_test.go b/core/services/gateway/handlers/handler.dummy_test.go index beb39ddcf56..97180c9f560 100644 --- a/core/services/gateway/handlers/handler.dummy_test.go +++ b/core/services/gateway/handlers/handler.dummy_test.go @@ -36,7 +36,7 @@ func (m *testConnManager) SendToNode(ctx context.Context, nodeAddress string, re return nil } -func TestDummyHandler_BasicFlow(t *testing.T) { +func TestUnit_DummyHandler_BasicFlow(t *testing.T) { t.Parallel() config := config.DONConfig{ diff --git a/core/services/gateway/handlers/vault/aggregator_test.go b/core/services/gateway/handlers/vault/aggregator_test.go index 9d6680d0401..49cf1f190e9 100644 --- a/core/services/gateway/handlers/vault/aggregator_test.go +++ b/core/services/gateway/handlers/vault/aggregator_test.go @@ -26,7 +26,7 @@ func makeNodes(t *testing.T, signers []string) []capabilities.Node { return nodes } -func TestAggregator_Valid_Signatures(t *testing.T) { +func TestUnit_Aggregator_Valid_Signatures(t *testing.T) { signers := []string{ "d6da96fe596705b32bc3a0e11cdefad77feaad79000000000000000000000000", "327aa349c9718cd36c877d1e90458fe1929768ad000000000000000000000000", @@ -104,7 +104,7 @@ func newMessage(t *testing.T) *jsonrpc.Response[json.RawMessage] { } } -func TestAggregator_Valid_FallsBackToQuorum(t *testing.T) { +func TestUnit_Aggregator_Valid_FallsBackToQuorum(t *testing.T) { // No valid signers signers := []string{ hex.EncodeToString(mustRandom(64)), @@ -136,7 +136,7 @@ func TestAggregator_Valid_FallsBackToQuorum(t *testing.T) { assert.Equal(t, &currResp, resp) } -func TestAggregator_Valid_FallsBackToQuorum_ExcludesSignaturesInSha(t *testing.T) { +func TestUnit_Aggregator_Valid_FallsBackToQuorum_ExcludesSignaturesInSha(t *testing.T) { // No valid signers signers := []string{ hex.EncodeToString(mustRandom(64)), @@ -172,7 +172,7 @@ func TestAggregator_Valid_FallsBackToQuorum_ExcludesSignaturesInSha(t *testing.T assert.Contains(t, respDigests, digest) } -func TestAggregator_InsufficientResponses(t *testing.T) { +func TestUnit_Aggregator_InsufficientResponses(t *testing.T) { mcr := &mockCapabilitiesRegistry{F: 1} agg := &baseAggregator{capabilitiesRegistry: mcr} @@ -190,7 +190,7 @@ func TestAggregator_InsufficientResponses(t *testing.T) { require.ErrorContains(t, err, "insufficient valid responses to reach quorum") } -func TestAggregator_QuorumUnobtainable(t *testing.T) { +func TestUnit_Aggregator_QuorumUnobtainable(t *testing.T) { // No valid signers signers := []string{ hex.EncodeToString(mustRandom(64)), diff --git a/core/services/gateway/handlers/vault/handler_test.go b/core/services/gateway/handlers/vault/handler_test.go index ace800ea90e..c33a6e27767 100644 --- a/core/services/gateway/handlers/vault/handler_test.go +++ b/core/services/gateway/handlers/vault/handler_test.go @@ -103,7 +103,7 @@ func (m *mockCapabilitiesRegistry) DONsForCapability(_ context.Context, _ string }, nil } -func TestActiveRequest_SendResponse(t *testing.T) { +func TestUnit_ActiveRequest_SendResponse(t *testing.T) { rm := json.RawMessage([]byte(`{}`)) cb := common.NewCallback() activeRequest := &activeRequest{ @@ -127,7 +127,7 @@ func TestActiveRequest_SendResponse(t *testing.T) { require.ErrorContains(t, err, "response already sent: each callback can only be used once") } -func TestVaultHandler_HandleJSONRPCUserMessage(t *testing.T) { +func TestUnit_VaultHandler_HandleJSONRPCUserMessage(t *testing.T) { createSecretsRequest := &vaultcommon.CreateSecretsRequest{ RequestId: "test_request_id", EncryptedSecrets: []*vaultcommon.EncryptedSecret{ @@ -737,7 +737,7 @@ func TestVaultHandler_HandleJSONRPCUserMessage(t *testing.T) { }) } -func TestVaultHandler_PublicKeyGet(t *testing.T) { +func TestUnit_VaultHandler_PublicKeyGet(t *testing.T) { h, callback, don, _ := setupHandler(t) signers := []string{ "d6da96fe596705b32bc3a0e11cdefad77feaad79000000000000000000000000", diff --git a/core/services/gateway/network/httpclient_test.go b/core/services/gateway/network/httpclient_test.go index a05274e07ae..b34aaa84c89 100644 --- a/core/services/gateway/network/httpclient_test.go +++ b/core/services/gateway/network/httpclient_test.go @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" ) -func TestHTTPClient_Send(t *testing.T) { +func TestUnit_HTTPClient_Send(t *testing.T) { t.Parallel() // Setup the test environment @@ -306,7 +306,7 @@ func TestHTTPClient_Send(t *testing.T) { // IMPORTANT: The behaviour of Go's network stack is heavily dependent on the platform; // this means that the errors returned can change depending on whether the tests are // run on osx or on linux. -func TestHTTPClient_BlocksUnallowed(t *testing.T) { +func TestUnit_HTTPClient_BlocksUnallowed(t *testing.T) { t.Parallel() // Setup the test environment @@ -510,7 +510,7 @@ func TestHTTPClient_BlocksUnallowed(t *testing.T) { } } -func TestHTTPClient_AllowedIPsCIDR(t *testing.T) { +func TestUnit_HTTPClient_AllowedIPsCIDR(t *testing.T) { t.Parallel() // Setup the test environment @@ -580,7 +580,7 @@ func TestHTTPClient_AllowedIPsCIDR(t *testing.T) { } } -func Test_ConfigApplyDefaults(t *testing.T) { +func TestUnit_ConfigApplyDefaults(t *testing.T) { t.Parallel() t.Run("successfully overrides defaults", func(t *testing.T) { config := HTTPClientConfig{ @@ -604,7 +604,7 @@ func Test_ConfigApplyDefaults(t *testing.T) { }) } -func TestHTTPClient_ValidateMethod(t *testing.T) { +func TestUnit_HTTPClient_ValidateMethod(t *testing.T) { t.Parallel() lggr := logger.Test(t) @@ -665,7 +665,7 @@ func TestHTTPClient_ValidateMethod(t *testing.T) { } } -func TestHTTPClient_ValidateHeaders(t *testing.T) { +func TestUnit_HTTPClient_ValidateHeaders(t *testing.T) { t.Parallel() lggr := logger.Test(t) @@ -747,7 +747,7 @@ func TestHTTPClient_ValidateHeaders(t *testing.T) { } } -func TestHTTPClient_BlockedRequests_ReturnErrBlockedRequest(t *testing.T) { +func TestUnit_HTTPClient_BlockedRequests_ReturnErrBlockedRequest(t *testing.T) { t.Parallel() lggr := logger.Test(t) diff --git a/core/services/gateway/network/httpserver_test.go b/core/services/gateway/network/httpserver_test.go index 682808661c3..1fe9df1fb97 100644 --- a/core/services/gateway/network/httpserver_test.go +++ b/core/services/gateway/network/httpserver_test.go @@ -63,7 +63,7 @@ func sendRequest(t *testing.T, url string, body []byte, httpMethod string, origi return resp } -func TestHTTPServer_HandleRequest_Correct(t *testing.T) { +func TestUnit_HTTPServer_HandleRequest_Correct(t *testing.T) { t.Parallel() _, handler, url := startNewServer(t, 100_000, 100_000, false, nil) @@ -76,7 +76,7 @@ func TestHTTPServer_HandleRequest_Correct(t *testing.T) { require.Equal(t, []byte("response"), respBytes) } -func TestHTTPServer_HandleRequest_RequestBodyTooBig(t *testing.T) { +func TestUnit_HTTPServer_HandleRequest_RequestBodyTooBig(t *testing.T) { t.Parallel() _, _, url := startNewServer(t, 5, 100_000, false, nil) @@ -84,7 +84,7 @@ func TestHTTPServer_HandleRequest_RequestBodyTooBig(t *testing.T) { require.Equal(t, http.StatusBadRequest, resp.StatusCode) } -func TestHTTPServer_HandleHealthCheck(t *testing.T) { +func TestUnit_HTTPServer_HandleHealthCheck(t *testing.T) { t.Parallel() _, _, url := startNewServer(t, 100_000, 100_000, false, nil) @@ -96,7 +96,7 @@ func TestHTTPServer_HandleHealthCheck(t *testing.T) { require.Equal(t, []byte(network.HealthCheckResponse), respBytes) } -func TestHTTPServer_HandleRequest_CORSEnabled_FromAllowedOrigin(t *testing.T) { +func TestUnit_HTTPServer_HandleRequest_CORSEnabled_FromAllowedOrigin(t *testing.T) { t.Parallel() _, handler, url := startNewServer(t, 100_000, 100_000, true, []string{"https://remix.ethereum.org", "https://another.valid.origin.com"}) @@ -114,7 +114,7 @@ func TestHTTPServer_HandleRequest_CORSEnabled_FromAllowedOrigin(t *testing.T) { require.Equal(t, "Content-Type", resp.Header.Get("Access-Control-Allow-Headers")) } -func TestHTTPServer_HandleRequest_CORSEnabled_FromAllowedOriginWildcards(t *testing.T) { +func TestUnit_HTTPServer_HandleRequest_CORSEnabled_FromAllowedOriginWildcards(t *testing.T) { t.Parallel() _, handler, url := startNewServer(t, 100_000, 100_000, true, []string{"https://*.ethereum.org", "https://*.valid.domain.com", "http://*.gov"}) @@ -156,7 +156,7 @@ func TestHTTPServer_HandleRequest_CORSEnabled_FromAllowedOriginWildcards(t *test require.Equal(t, "Content-Type", resp.Header.Get("Access-Control-Allow-Headers")) } -func TestHTTPServer_HandleRequest_CORSEnabled_FromAllowedOrigin_PreflightRequest(t *testing.T) { +func TestUnit_HTTPServer_HandleRequest_CORSEnabled_FromAllowedOrigin_PreflightRequest(t *testing.T) { t.Parallel() _, _, url := startNewServer(t, 100_000, 100_000, true, []string{"https://remix.ethereum.org", "https://another.valid.origin.com"}) @@ -172,7 +172,7 @@ func TestHTTPServer_HandleRequest_CORSEnabled_FromAllowedOrigin_PreflightRequest require.Equal(t, "Content-Type", resp.Header.Get("Access-Control-Allow-Headers")) } -func TestHTTPServer_HandleRequest_CORSEnabled_FromNotAllowedOrigin(t *testing.T) { +func TestUnit_HTTPServer_HandleRequest_CORSEnabled_FromNotAllowedOrigin(t *testing.T) { t.Parallel() _, handler, url := startNewServer(t, 100_000, 100_000, true, []string{"https://remix.ethereum.org", "https://another.valid.origin.com"}) @@ -190,7 +190,7 @@ func TestHTTPServer_HandleRequest_CORSEnabled_FromNotAllowedOrigin(t *testing.T) require.Empty(t, resp.Header.Get("Access-Control-Allow-Headers")) } -func TestHTTPServer_HandleRequest_CORSEnabled_FromNotAllowedOriginWildcards(t *testing.T) { +func TestUnit_HTTPServer_HandleRequest_CORSEnabled_FromNotAllowedOriginWildcards(t *testing.T) { t.Parallel() _, handler, url := startNewServer(t, 100_000, 100_000, true, []string{"https://*.ethereum.org", "https://*.valid.domain.com", "http://example.gov:8080"}) diff --git a/core/services/gateway/network/wsconnection_test.go b/core/services/gateway/network/wsconnection_test.go index 86caaf4af67..7b4dcb6e8b2 100644 --- a/core/services/gateway/network/wsconnection_test.go +++ b/core/services/gateway/network/wsconnection_test.go @@ -31,7 +31,7 @@ func (ssl *serverSideLogic) wsHandler(w http.ResponseWriter, r *http.Request) { ssl.connWrapper.Reset(c) } -func TestWSConnectionWrapper_ClientReconnect(t *testing.T) { +func TestUnit_WSConnectionWrapper_ClientReconnect(t *testing.T) { t.Parallel() lggr := logger.Test(t) // server diff --git a/core/services/gateway/network/wsserver_test.go b/core/services/gateway/network/wsserver_test.go index 5f5270e496f..45d369c6277 100644 --- a/core/services/gateway/network/wsserver_test.go +++ b/core/services/gateway/network/wsserver_test.go @@ -67,7 +67,7 @@ func sendRequestWithHeader(t *testing.T, url string, headerName string, headerVa return resp } -func TestWSServer_HandleRequest_AuthHeaderTooBig(t *testing.T) { +func TestUnit_WSServer_HandleRequest_AuthHeaderTooBig(t *testing.T) { t.Parallel() _, _, urlStr := startNewWSServer(t, 100_000) @@ -80,7 +80,7 @@ func TestWSServer_HandleRequest_AuthHeaderTooBig(t *testing.T) { require.Equal(t, http.StatusBadRequest, resp.StatusCode) } -func TestWSServer_HandleRequest_AuthHeaderIncorrectlyBase64Encoded(t *testing.T) { +func TestUnit_WSServer_HandleRequest_AuthHeaderIncorrectlyBase64Encoded(t *testing.T) { t.Parallel() _, _, urlStr := startNewWSServer(t, 100_000) @@ -88,7 +88,7 @@ func TestWSServer_HandleRequest_AuthHeaderIncorrectlyBase64Encoded(t *testing.T) require.Equal(t, http.StatusBadRequest, resp.StatusCode) } -func TestWSServer_HandleRequest_AuthHeaderInvalid(t *testing.T) { +func TestUnit_WSServer_HandleRequest_AuthHeaderInvalid(t *testing.T) { t.Parallel() _, acceptor, urlStr := startNewWSServer(t, 100_000) @@ -99,7 +99,7 @@ func TestWSServer_HandleRequest_AuthHeaderInvalid(t *testing.T) { require.Equal(t, http.StatusUnauthorized, resp.StatusCode) } -func TestWSServer_WSClient_DefaultConfig_Success(t *testing.T) { +func TestUnit_WSServer_WSClient_DefaultConfig_Success(t *testing.T) { t.Parallel() _, acceptor, urlStr := startNewWSServer(t, 10_000) @@ -126,7 +126,7 @@ func TestWSServer_WSClient_DefaultConfig_Success(t *testing.T) { require.NoError(t, conn.Close()) } -func TestWSServer_WSClient_DefaultConfig_Failure(t *testing.T) { +func TestUnit_WSServer_WSClient_DefaultConfig_Failure(t *testing.T) { quarantine.Flaky(t, "DX-1752") t.Parallel() _, acceptor, urlStr := startNewWSServer(t, 10_000) diff --git a/core/services/headreporter/head_reporter_test.go b/core/services/headreporter/head_reporter_test.go index 635b6084145..f0ad4a9f139 100644 --- a/core/services/headreporter/head_reporter_test.go +++ b/core/services/headreporter/head_reporter_test.go @@ -20,7 +20,7 @@ func NewHead() evmtypes.Head { return evmtypes.Head{Number: 42, EVMChainID: ubig.New(testutils.FixtureChainID)} } -func Test_HeadReporterService(t *testing.T) { +func TestIntegration_Shared_HeadReporterService(t *testing.T) { t.Run("report everything", func(t *testing.T) { db := pgtest.NewSqlxDB(t) diff --git a/core/services/headreporter/prometheus_reporter_test.go b/core/services/headreporter/prometheus_reporter_test.go index 595118fde2f..9ba9254acc2 100644 --- a/core/services/headreporter/prometheus_reporter_test.go +++ b/core/services/headreporter/prometheus_reporter_test.go @@ -27,7 +27,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/headreporter" ) -func Test_PrometheusReporter(t *testing.T) { +func TestIntegration_Shared_PrometheusReporter(t *testing.T) { t.Run("with nothing in the database", func(t *testing.T) { db := pgtest.NewSqlxDB(t) diff --git a/core/services/headreporter/telemetry_reporter_test.go b/core/services/headreporter/telemetry_reporter_test.go index 5cfbf812c5b..4cbd95e27e4 100644 --- a/core/services/headreporter/telemetry_reporter_test.go +++ b/core/services/headreporter/telemetry_reporter_test.go @@ -30,7 +30,7 @@ import ( testutils2 "github.com/smartcontractkit/chainlink/v2/core/web/testutils" ) -func Test_EVMTelemetryReporter_NewHead(t *testing.T) { +func TestUnit_EVMTelemetryReporter_NewHead(t *testing.T) { head := evmtypes.Head{ Number: 42, EVMChainID: ubig.NewI(100), @@ -72,7 +72,7 @@ func Test_EVMTelemetryReporter_NewHead(t *testing.T) { assert.NoError(t, err) } -func Test_EVMTelemetryReporter_NewHeadMissingFinalized(t *testing.T) { +func TestUnit_EVMTelemetryReporter_NewHeadMissingFinalized(t *testing.T) { head := evmtypes.Head{ Number: 42, EVMChainID: ubig.NewI(100), @@ -102,7 +102,7 @@ func Test_EVMTelemetryReporter_NewHeadMissingFinalized(t *testing.T) { assert.NoError(t, err) } -func Test_EVMTelemetryReporter_NewHead_MissingEndpoint(t *testing.T) { +func TestUnit_EVMTelemetryReporter_NewHead_MissingEndpoint(t *testing.T) { monitoringEndpointGen := telemetry.NewMockMonitoringEndpointGenerator(t) monitoringEndpointGen. On("GenMonitoringEndpoint", "EVM", "100", "", synchronization.HeadReport). @@ -125,7 +125,7 @@ func (m mockRelayer) LatestHead(_ context.Context) (types.Head, error) { return m.latestHead, nil } -func Test_SolanaTelemetryReporter_ReportPeriodic(t *testing.T) { +func TestUnit_SolanaTelemetryReporter_ReportPeriodic(t *testing.T) { privKey, err := solana.NewRandomPrivateKey() require.NoError(t, err) blockHash := [32]byte(privKey.PublicKey()) @@ -165,7 +165,7 @@ func Test_SolanaTelemetryReporter_ReportPeriodic(t *testing.T) { assert.NoError(t, err) } -func Test_SolanaTelemetryReporter_ReportPeriodic_EmptyBlockHeight(t *testing.T) { +func TestUnit_SolanaTelemetryReporter_ReportPeriodic_EmptyBlockHeight(t *testing.T) { head := types.Head{ Height: "", Hash: nil, @@ -188,7 +188,7 @@ func Test_SolanaTelemetryReporter_ReportPeriodic_EmptyBlockHeight(t *testing.T) assert.ErrorContains(t, err, "latest block height returned by relayer is empty for {Solana testchain}") } -func Test_SolanaTelemetryReporter_ReportPeriodic_MissingEndpoint(t *testing.T) { +func TestUnit_SolanaTelemetryReporter_ReportPeriodic_MissingEndpoint(t *testing.T) { monitoringEndpoint := mocks2.NewMonitoringEndpoint(t) monitoringEndpointGen := telemetry.NewMockMonitoringEndpointGenerator(t) diff --git a/core/services/health_test.go b/core/services/health_test.go index d63ebbaddc2..69b7abfb3db 100644 --- a/core/services/health_test.go +++ b/core/services/health_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services" ) -func TestNewStartUpHealthReport(t *testing.T) { +func TestUnit_NewStartUpHealthReport(t *testing.T) { lggr, observed := logger.TestLoggerObserved(t, zapcore.InfoLevel) ibhr := services.NewStartUpHealthReport(1234, lggr) diff --git a/core/services/job/job_orm_test.go b/core/services/job/job_orm_test.go index 98405503c0b..9dcb46905df 100644 --- a/core/services/job/job_orm_test.go +++ b/core/services/job/job_orm_test.go @@ -88,7 +88,7 @@ serverURL = 'wss://localhost:8080' serverPubKey = '8fa807463ad73f9ee855cfd60ba406dcf98a2855b3dd8af613107b0f6890a707' ` -func TestORM(t *testing.T) { +func TestIntegration_Shared_ORM(t *testing.T) { t.Parallel() config := configtest.NewTestGeneralConfig(t) @@ -360,7 +360,7 @@ func TestORM(t *testing.T) { }) } -func TestORM_DeleteJob_DeletesAssociatedRecords(t *testing.T) { +func TestIntegration_Shared_ORM_DeleteJob_DeletesAssociatedRecords(t *testing.T) { t.Parallel() ctx := testutils.Context(t) config := configtest.NewGeneralConfig(t, nil) @@ -524,7 +524,7 @@ executorConfig = "Foo = 'Bar'" }) } -func TestORM_CreateJob_VRFV2(t *testing.T) { +func TestIntegration_Shared_ORM_CreateJob_VRFV2(t *testing.T) { ctx := testutils.Context(t) config := configtest.NewTestGeneralConfig(t) db := pgtest.NewSqlxDB(t) @@ -609,7 +609,7 @@ func TestORM_CreateJob_VRFV2(t *testing.T) { cltest.AssertCount(t, db, "jobs", 0) } -func TestORM_CreateJob_VRFV2Plus(t *testing.T) { +func TestIntegration_Shared_ORM_CreateJob_VRFV2Plus(t *testing.T) { ctx := testutils.Context(t) config := configtest.NewTestGeneralConfig(t) db := pgtest.NewSqlxDB(t) @@ -697,7 +697,7 @@ func TestORM_CreateJob_VRFV2Plus(t *testing.T) { cltest.AssertCount(t, db, "jobs", 0) } -func TestORM_CreateJob_OCRBootstrap(t *testing.T) { +func TestIntegration_Shared_ORM_CreateJob_OCRBootstrap(t *testing.T) { ctx := testutils.Context(t) config := configtest.NewTestGeneralConfig(t) db := pgtest.NewSqlxDB(t) @@ -725,7 +725,7 @@ func TestORM_CreateJob_OCRBootstrap(t *testing.T) { cltest.AssertCount(t, db, "jobs", 0) } -func TestORM_CreateJob_EVMChainID_Validation(t *testing.T) { +func TestUnit_ORM_CreateJob_EVMChainID_Validation(t *testing.T) { config := configtest.NewGeneralConfig(t, nil) db := pgtest.NewSqlxDB(t) keyStore := cltest.NewKeyStore(t, db) @@ -809,7 +809,7 @@ func TestORM_CreateJob_EVMChainID_Validation(t *testing.T) { }) } -func TestORM_CreateJob_OCR_DuplicatedContractAddress(t *testing.T) { +func TestUnit_ORM_CreateJob_OCR_DuplicatedContractAddress(t *testing.T) { ctx := testutils.Context(t) customChainID := big.New(testutils.NewRandomEVMChainID()) @@ -886,7 +886,7 @@ func TestORM_CreateJob_OCR_DuplicatedContractAddress(t *testing.T) { }) } -func TestORM_CreateJob_OCR2_DuplicatedContractAddress(t *testing.T) { +func TestUnit_ORM_CreateJob_OCR2_DuplicatedContractAddress(t *testing.T) { ctx := testutils.Context(t) customChainID := big.New(testutils.NewRandomEVMChainID()) @@ -948,7 +948,7 @@ func TestORM_CreateJob_OCR2_DuplicatedContractAddress(t *testing.T) { require.NoError(t, err) } -func TestORM_CreateJob_OCR2_Sending_Keys_Transmitter_Keys_Validations(t *testing.T) { +func TestUnit_ORM_CreateJob_OCR2_Sending_Keys_Transmitter_Keys_Validations(t *testing.T) { ctx := testutils.Context(t) customChainID := big.New(testutils.NewRandomEVMChainID()) @@ -1007,7 +1007,7 @@ func TestORM_CreateJob_OCR2_Sending_Keys_Transmitter_Keys_Validations(t *testing }) } -func TestORM_ValidateKeyStoreMatch(t *testing.T) { +func TestUnit_ORM_ValidateKeyStoreMatch(t *testing.T) { ctx := testutils.Context(t) config := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) {}) @@ -1118,7 +1118,7 @@ func TestORM_ValidateKeyStoreMatch(t *testing.T) { }) } -func Test_FindJobs(t *testing.T) { +func TestUnit_FindJobs(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -1193,7 +1193,7 @@ func Test_FindJobs(t *testing.T) { }) } -func Test_FindJob(t *testing.T) { +func TestUnit_FindJob(t *testing.T) { t.Parallel() ctx := testutils.Context(t) evmRelay := "evm" @@ -1438,7 +1438,7 @@ func Test_FindJob(t *testing.T) { }) } -func Test_FindJobsByPipelineSpecIDs(t *testing.T) { +func TestUnit_FindJobsByPipelineSpecIDs(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -1489,7 +1489,7 @@ func Test_FindJobsByPipelineSpecIDs(t *testing.T) { }) } -func Test_FindPipelineRuns(t *testing.T) { +func TestUnit_FindPipelineRuns(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -1558,7 +1558,7 @@ func Test_FindPipelineRuns(t *testing.T) { }) } -func Test_PipelineRunsByJobID(t *testing.T) { +func TestUnit_PipelineRunsByJobID(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -1627,7 +1627,7 @@ func Test_PipelineRunsByJobID(t *testing.T) { }) } -func Test_FindPipelineRunIDsByJobID(t *testing.T) { +func TestUnit_FindPipelineRunIDsByJobID(t *testing.T) { ctx := testutils.Context(t) var jb job.Job @@ -1748,7 +1748,7 @@ func Test_FindPipelineRunIDsByJobID(t *testing.T) { }) } -func Test_FindPipelineRunsByIDs(t *testing.T) { +func TestUnit_FindPipelineRunsByIDs(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -1815,7 +1815,7 @@ func Test_FindPipelineRunsByIDs(t *testing.T) { }) } -func Test_FindPipelineRunByID(t *testing.T) { +func TestUnit_FindPipelineRunByID(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -1861,7 +1861,7 @@ func Test_FindPipelineRunByID(t *testing.T) { }) } -func Test_FindJobWithoutSpecErrors(t *testing.T) { +func TestUnit_FindJobWithoutSpecErrors(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -1899,7 +1899,7 @@ func Test_FindJobWithoutSpecErrors(t *testing.T) { assert.Len(t, jbWithErrors.JobSpecErrors, 2) } -func Test_FindSpecErrorsByJobIDs(t *testing.T) { +func TestUnit_FindSpecErrorsByJobIDs(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -1934,7 +1934,7 @@ func Test_FindSpecErrorsByJobIDs(t *testing.T) { assert.Len(t, specErrs, 2) } -func Test_CountPipelineRunsByJobID(t *testing.T) { +func TestUnit_CountPipelineRunsByJobID(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -1992,7 +1992,7 @@ func Test_CountPipelineRunsByJobID(t *testing.T) { }) } -func Test_ORM_FindJobByWorkflow(t *testing.T) { +func TestUnit_ORM_FindJobByWorkflow(t *testing.T) { var addr1 = "0x0123456789012345678901234567890123456789" var addr2 = "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd" t.Parallel() @@ -2117,7 +2117,7 @@ func Test_ORM_FindJobByWorkflow(t *testing.T) { } } -func Test_ORM_FindJobByWorkflow_Multiple(t *testing.T) { +func TestUnit_ORM_FindJobByWorkflow_Multiple(t *testing.T) { var addr1 = "0x012345678901234567890123456789012345ffff" var addr2 = "0xabcdefabcdefabcdefabcdefabcdefabcdef0000" t.Parallel() @@ -2220,7 +2220,7 @@ func mustInsertPipelineRun(t *testing.T, orm pipeline.ORM, j job.Job) pipeline.R return run } -func TestORM_CreateJob_OCR2_With_DualTransmission(t *testing.T) { +func TestUnit_ORM_CreateJob_OCR2_With_DualTransmission(t *testing.T) { ctx := testutils.Context(t) customChainID := big.New(testutils.NewRandomEVMChainID()) @@ -2301,7 +2301,7 @@ func TestORM_CreateJob_OCR2_With_DualTransmission(t *testing.T) { require.NoError(t, jobORM.CreateJob(ctx, &jb)) } -func TestORM_CreateJob_KeyLocking(t *testing.T) { +func TestUnit_ORM_CreateJob_KeyLocking(t *testing.T) { ctx := testutils.Context(t) customChainID := big.New(testutils.NewRandomEVMChainID()) @@ -2402,7 +2402,7 @@ func TestORM_CreateJob_KeyLocking(t *testing.T) { }) } -func Test_FindGatewayJobID(t *testing.T) { +func TestUnit_FindGatewayJobID(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -2439,7 +2439,7 @@ func Test_FindGatewayJobID(t *testing.T) { require.Equal(t, jobSpec.ID, id, "mismatch job id") } -func Test_FindGatewayJobID_NoMatch(t *testing.T) { +func TestUnit_FindGatewayJobID_NoMatch(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -2476,7 +2476,7 @@ func Test_FindGatewayJobID_NoMatch(t *testing.T) { require.Equal(t, int32(0), id, "found non-zero job id") } -func Test_FindStandardCapabilityJobID(t *testing.T) { +func TestUnit_FindStandardCapabilityJobID(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -2509,7 +2509,7 @@ func Test_FindStandardCapabilityJobID(t *testing.T) { require.Equal(t, jobSpec.ID, id, "mismatch job id") } -func Test_FindStandardCapabilityJobID_NoMatch(t *testing.T) { +func TestUnit_FindStandardCapabilityJobID_NoMatch(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -2542,7 +2542,7 @@ func Test_FindStandardCapabilityJobID_NoMatch(t *testing.T) { require.Equal(t, int32(0), id, "found non-zero job id") } -func TestORM_CRESettings(t *testing.T) { +func TestUnit_ORM_CRESettings(t *testing.T) { config := configtest.NewGeneralConfig(t, nil) db := pgtest.NewSqlxDB(t) keyStore := cltest.NewKeyStore(t, db) diff --git a/core/services/job/job_pipeline_orm_integration_test.go b/core/services/job/job_pipeline_orm_integration_test.go index 2a2e17674ba..1461e4dfc9f 100644 --- a/core/services/job/job_pipeline_orm_integration_test.go +++ b/core/services/job/job_pipeline_orm_integration_test.go @@ -28,7 +28,7 @@ func clearJobsDb(t *testing.T, db *sqlx.DB) { cltest.ClearDBTables(t, db, "flux_monitor_round_stats_v2", "jobs", "pipeline_runs", "pipeline_specs", "pipeline_task_runs") } -func TestPipelineORM_Integration(t *testing.T) { +func TestUnit_PipelineORM_Integration(t *testing.T) { ctx := testutils.Context(t) const DotStr = ` // data source 1 diff --git a/core/services/job/kv_orm_test.go b/core/services/job/kv_orm_test.go index f355690093b..8bd97eab13f 100644 --- a/core/services/job/kv_orm_test.go +++ b/core/services/job/kv_orm_test.go @@ -21,7 +21,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/testdata/testspecs" ) -func TestJobKVStore(t *testing.T) { +func TestUnit_JobKVStore(t *testing.T) { ctx := t.Context() config := configtest.NewTestGeneralConfig(t) @@ -73,7 +73,7 @@ func TestJobKVStore(t *testing.T) { require.NoError(t, jobORM.DeleteJob(ctx, jobID, jb.Type)) } -func TestJobKVStore_PruneExpiredEntries(t *testing.T) { +func TestUnit_JobKVStore_PruneExpiredEntries(t *testing.T) { ctx, cancel := context.WithCancel(testutils.Context(t)) defer cancel() diff --git a/core/services/job/models_test.go b/core/services/job/models_test.go index a974a87cc81..9cbaedd624e 100644 --- a/core/services/job/models_test.go +++ b/core/services/job/models_test.go @@ -23,7 +23,7 @@ import ( "gopkg.in/guregu/null.v4" ) -func TestStandardCapabilitiesSpec_Deserialization(t *testing.T) { +func TestUnit_StandardCapabilitiesSpec_Deserialization(t *testing.T) { tomlData := ` type = "standardcapabilities" schemaVersion = 1 @@ -63,7 +63,7 @@ func TestStandardCapabilitiesSpec_Deserialization(t *testing.T) { assert.Equal(t, "5fbb7d5dc1e592142a979b7014552e07a78cb89b1a8626c6412f12f2adfcb240", spec.OracleFactory.OCRKeyBundleID) } -func TestOCR2OracleSpec_RelayIdentifier(t *testing.T) { +func TestUnit_OCR2OracleSpec_RelayIdentifier(t *testing.T) { type fields struct { Relay string ChainID string @@ -134,7 +134,7 @@ var ( pretty string ) -func TestOCR2OracleSpec(t *testing.T) { +func TestUnit_OCR2OracleSpec(t *testing.T) { val := job.OCR2OracleSpec{ Relay: relay.NetworkEVM, PluginType: types.Median, @@ -314,7 +314,7 @@ func TestOCR2OracleSpec(t *testing.T) { }) } -func TestWorkflowSpec_Validate(t *testing.T) { +func TestUnit_WorkflowSpec_Validate(t *testing.T) { type fields struct { Workflow string } diff --git a/core/services/job/orm_test.go b/core/services/job/orm_test.go index 9f3cd296c38..a1b0b0c89db 100644 --- a/core/services/job/orm_test.go +++ b/core/services/job/orm_test.go @@ -25,7 +25,7 @@ func NewTestORM(t *testing.T, ds sqlutil.DataSource, pipelineORM pipeline.ORM, b return o } -func TestLoadConfigVarsLocalOCR(t *testing.T) { +func TestUnit_LoadConfigVarsLocalOCR(t *testing.T) { t.Parallel() config := configtest.NewTestGeneralConfig(t) @@ -46,7 +46,7 @@ func TestLoadConfigVarsLocalOCR(t *testing.T) { require.Equal(t, sqlutil.Interval(chainConfig.EVM().OCR().ContractTransmitterTransmitTimeout()), *jobSpec.ContractTransmitterTransmitTimeout) } -func TestSetDRMinIncomingConfirmations(t *testing.T) { +func TestUnit_SetDRMinIncomingConfirmations(t *testing.T) { t.Parallel() config := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { diff --git a/core/services/job/runner_integration_test.go b/core/services/job/runner_integration_test.go index 45bc6d3ed61..c385e47cecd 100644 --- a/core/services/job/runner_integration_test.go +++ b/core/services/job/runner_integration_test.go @@ -53,7 +53,7 @@ import ( var monitoringEndpoint = telemetry.MonitoringEndpointGenerator(&telemetry.NoopAgent{}) -func TestRunner(t *testing.T) { +func TestUnit_Runner(t *testing.T) { ctx := testutils.Context(t) db := pgtest.NewSqlxDB(t) keyStore := cltest.NewKeyStore(t, db) @@ -778,7 +778,7 @@ answer1 [type=median index=0]; }) } -func TestRunner_Success_Callback_AsyncJob(t *testing.T) { +func TestUnit_Runner_Success_Callback_AsyncJob(t *testing.T) { t.Parallel() ethClient := cltest.NewEthMocksWithStartupAssertions(t) @@ -957,7 +957,7 @@ func TestRunner_Success_Callback_AsyncJob(t *testing.T) { } } -func TestRunner_Error_Callback_AsyncJob(t *testing.T) { +func TestUnit_Runner_Error_Callback_AsyncJob(t *testing.T) { t.Parallel() ethClient := cltest.NewEthMocksWithStartupAssertions(t) diff --git a/core/services/job/spawner_test.go b/core/services/job/spawner_test.go index bb685456086..54e74959550 100644 --- a/core/services/job/spawner_test.go +++ b/core/services/job/spawner_test.go @@ -76,7 +76,7 @@ func (g *relayGetter) GetIDToRelayerMap() map[types.RelayID]loop.Relayer { return map[types.RelayID]loop.Relayer{} } -func TestSpawner_CreateJobDeleteJob(t *testing.T) { +func TestUnit_Spawner_CreateJobDeleteJob(t *testing.T) { t.Parallel() ctx := testutils.Context(t) diff --git a/core/services/job/validate_test.go b/core/services/job/validate_test.go index ee5d710cc96..3a3045db898 100755 --- a/core/services/job/validate_test.go +++ b/core/services/job/validate_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestValidate(t *testing.T) { +func TestUnit_Validate(t *testing.T) { var tt = []struct { name string spec string diff --git a/core/services/job/wasm_file_spec_factory_test.go b/core/services/job/wasm_file_spec_factory_test.go index 8160998d093..153bf434a25 100644 --- a/core/services/job/wasm_file_spec_factory_test.go +++ b/core/services/job/wasm_file_spec_factory_test.go @@ -20,7 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/job" ) -func TestWasmFileSpecFactory(t *testing.T) { +func TestUnit_WasmFileSpecFactory(t *testing.T) { binaryLocation := createTestBinary(t) configLocation := "testdata/config.json" config, err := os.ReadFile(configLocation) diff --git a/core/services/job/yaml_spec_factory_test.go b/core/services/job/yaml_spec_factory_test.go index e309db97d1c..80da1787ac0 100644 --- a/core/services/job/yaml_spec_factory_test.go +++ b/core/services/job/yaml_spec_factory_test.go @@ -64,7 +64,7 @@ targets: abi: "receive(report bytes)" ` -func TestYamlSpecFactory_GetSpec(t *testing.T) { +func TestUnit_YamlSpecFactory_GetSpec(t *testing.T) { t.Parallel() actual, raw, actualSha, err := job.YAMLSpecFactory{}.Spec(testutils.Context(t), anyYamlSpec, "") @@ -78,7 +78,7 @@ func TestYamlSpecFactory_GetSpec(t *testing.T) { assert.YAMLEq(t, anyYamlSpec, string(raw)) } -func TestYamlSpecFactory_Config(t *testing.T) { +func TestUnit_YamlSpecFactory_Config(t *testing.T) { t.Parallel() config := "config" diff --git a/core/services/keeper/integration_test.go b/core/services/keeper/integration_test.go index 4dfb1a19edf..2afad27827f 100644 --- a/core/services/keeper/integration_test.go +++ b/core/services/keeper/integration_test.go @@ -153,7 +153,7 @@ func getUpkeepIDFromTx(t *testing.T, registryWrapper *keeper.RegistryWrapper, re return upkeepID } -func TestKeeperEthIntegration(t *testing.T) { +func TestUnit_KeeperEthIntegration(t *testing.T) { tests.SkipFlakey(t, "https://smartcontract-it.atlassian.net/browse/DX-400") t.Parallel() @@ -327,7 +327,7 @@ func TestKeeperEthIntegration(t *testing.T) { } } -func TestKeeperForwarderEthIntegration(t *testing.T) { +func TestIntegration_Shared_KeeperForwarderEthIntegration(t *testing.T) { quarantine.Flaky(t, "DX-2042") t.Parallel() t.Run("keeper_forwarder_flow", func(t *testing.T) { @@ -490,7 +490,7 @@ func TestKeeperForwarderEthIntegration(t *testing.T) { }) } -func TestMaxPerformDataSize(t *testing.T) { +func TestIntegration_Shared_MaxPerformDataSize(t *testing.T) { t.Parallel() t.Run("max_perform_data_size_test", func(t *testing.T) { ctx := testutils.Context(t) diff --git a/core/services/keeper/models_test.go b/core/services/keeper/models_test.go index 6cb2ed2b4e3..19a7b438e75 100644 --- a/core/services/keeper/models_test.go +++ b/core/services/keeper/models_test.go @@ -9,7 +9,7 @@ import ( ubig "github.com/smartcontractkit/chainlink-evm/pkg/utils/big" ) -func TestUpkeepIdentifer_String(t *testing.T) { +func TestUnit_UpkeepIdentifer_String(t *testing.T) { for _, test := range []struct { name string id string diff --git a/core/services/keeper/orm_test.go b/core/services/keeper/orm_test.go index e1a5b7e0588..43c99327f80 100644 --- a/core/services/keeper/orm_test.go +++ b/core/services/keeper/orm_test.go @@ -69,7 +69,7 @@ func assertLastRunHeight(t *testing.T, db *sqlx.DB, upkeep keeper.UpkeepRegistra require.Equal(t, lastKeeperIndex, upkeep.LastKeeperIndex.Int64) } -func TestKeeperDB_Registries(t *testing.T) { +func TestIntegration_Shared_KeeperDB_Registries(t *testing.T) { t.Parallel() ctx := testutils.Context(t) db, _, orm := setupKeeperDB(t) @@ -83,7 +83,7 @@ func TestKeeperDB_Registries(t *testing.T) { require.Len(t, existingRegistries, 2) } -func TestKeeperDB_RegistryByContractAddress(t *testing.T) { +func TestIntegration_Shared_KeeperDB_RegistryByContractAddress(t *testing.T) { t.Parallel() ctx := testutils.Context(t) db, _, orm := setupKeeperDB(t) @@ -97,7 +97,7 @@ func TestKeeperDB_RegistryByContractAddress(t *testing.T) { require.Equal(t, registry, registryByContractAddress) } -func TestKeeperDB_UpsertUpkeep(t *testing.T) { +func TestIntegration_Shared_KeeperDB_UpsertUpkeep(t *testing.T) { t.Parallel() ctx := testutils.Context(t) db, _, orm := setupKeeperDB(t) @@ -133,7 +133,7 @@ func TestKeeperDB_UpsertUpkeep(t *testing.T) { require.Equal(t, int64(1), upkeepFromDB.LastRunBlockHeight) // shouldn't change on upsert } -func TestKeeperDB_BatchDeleteUpkeepsForJob(t *testing.T) { +func TestIntegration_Shared_KeeperDB_BatchDeleteUpkeepsForJob(t *testing.T) { t.Parallel() ctx := testutils.Context(t) db, _, orm := setupKeeperDB(t) @@ -160,7 +160,7 @@ func TestKeeperDB_BatchDeleteUpkeepsForJob(t *testing.T) { require.Equal(t, expectedUpkeepID, remainingUpkeep.UpkeepID) } -func TestKeeperDB_EligibleUpkeeps_Shuffle(t *testing.T) { +func TestIntegration_Shared_KeeperDB_EligibleUpkeeps_Shuffle(t *testing.T) { t.Parallel() ctx := testutils.Context(t) db, _, orm := setupKeeperDB(t) @@ -191,7 +191,7 @@ func TestKeeperDB_EligibleUpkeeps_Shuffle(t *testing.T) { assert.NotEqualValues(t, ordered, shuffled) } -func TestKeeperDB_NewEligibleUpkeeps_GracePeriod(t *testing.T) { +func TestIntegration_Shared_KeeperDB_NewEligibleUpkeeps_GracePeriod(t *testing.T) { t.Parallel() ctx := testutils.Context(t) db, _, orm := setupKeeperDB(t) @@ -219,7 +219,7 @@ func TestKeeperDB_NewEligibleUpkeeps_GracePeriod(t *testing.T) { require.NotEmpty(t, list1, "should get some eligible upkeeps now that they are outside grace period") } -func TestKeeperDB_EligibleUpkeeps_TurnsRandom(t *testing.T) { +func TestIntegration_Shared_KeeperDB_EligibleUpkeeps_TurnsRandom(t *testing.T) { t.Parallel() ctx := testutils.Context(t) db, _, orm := setupKeeperDB(t) @@ -263,7 +263,7 @@ func TestKeeperDB_EligibleUpkeeps_TurnsRandom(t *testing.T) { assert.NotEqual(t, list1, list4, "list1 vs list4") } -func TestKeeperDB_NewEligibleUpkeeps_SkipIfLastPerformedByCurrentKeeper(t *testing.T) { +func TestIntegration_Shared_KeeperDB_NewEligibleUpkeeps_SkipIfLastPerformedByCurrentKeeper(t *testing.T) { t.Parallel() ctx := testutils.Context(t) db, _, orm := setupKeeperDB(t) @@ -286,7 +286,7 @@ func TestKeeperDB_NewEligibleUpkeeps_SkipIfLastPerformedByCurrentKeeper(t *testi require.Empty(t, list0, "should be 0 as all last perform was done by current node") } -func TestKeeperDB_NewEligibleUpkeeps_CoverBuddy(t *testing.T) { +func TestIntegration_Shared_KeeperDB_NewEligibleUpkeeps_CoverBuddy(t *testing.T) { t.Parallel() ctx := testutils.Context(t) db, _, orm := setupKeeperDB(t) @@ -311,7 +311,7 @@ func TestKeeperDB_NewEligibleUpkeeps_CoverBuddy(t *testing.T) { require.Greater(t, len(listAfter), len(listBefore), "after our buddy runs all the performs we should have more eligible then a normal turn") } -func TestKeeperDB_NewEligibleUpkeeps_FirstTurn(t *testing.T) { +func TestIntegration_Shared_KeeperDB_NewEligibleUpkeeps_FirstTurn(t *testing.T) { t.Parallel() ctx := testutils.Context(t) db, _, orm := setupKeeperDB(t) @@ -333,7 +333,7 @@ func TestKeeperDB_NewEligibleUpkeeps_FirstTurn(t *testing.T) { require.NotEmpty(t, listKpr0, "kpr0 should have some eligible as a normal turn") } -func TestKeeperDB_NewEligibleUpkeeps_FiltersByRegistry(t *testing.T) { +func TestIntegration_Shared_KeeperDB_NewEligibleUpkeeps_FiltersByRegistry(t *testing.T) { t.Parallel() ctx := testutils.Context(t) db, _, orm := setupKeeperDB(t) @@ -358,7 +358,7 @@ func TestKeeperDB_NewEligibleUpkeeps_FiltersByRegistry(t *testing.T) { assert.Len(t, list2, 1) } -func TestKeeperDB_AllUpkeepIDsForRegistry(t *testing.T) { +func TestIntegration_Shared_KeeperDB_AllUpkeepIDsForRegistry(t *testing.T) { t.Parallel() ctx := testutils.Context(t) db, _, orm := setupKeeperDB(t) @@ -387,7 +387,7 @@ func TestKeeperDB_AllUpkeepIDsForRegistry(t *testing.T) { require.Contains(t, upkeepIDs, *ubig.New(big.NewInt(8))) } -func TestKeeperDB_UpdateUpkeepLastKeeperIndex(t *testing.T) { +func TestIntegration_Shared_KeeperDB_UpdateUpkeepLastKeeperIndex(t *testing.T) { t.Parallel() ctx := testutils.Context(t) db, _, orm := setupKeeperDB(t) @@ -402,7 +402,7 @@ func TestKeeperDB_UpdateUpkeepLastKeeperIndex(t *testing.T) { require.Equal(t, int64(0), upkeep.LastKeeperIndex.Int64) } -func TestKeeperDB_NewSetLastRunInfoForUpkeepOnJob(t *testing.T) { +func TestIntegration_Shared_KeeperDB_NewSetLastRunInfoForUpkeepOnJob(t *testing.T) { t.Parallel() ctx := testutils.Context(t) db, _, orm := setupKeeperDB(t) @@ -440,7 +440,7 @@ func TestKeeperDB_NewSetLastRunInfoForUpkeepOnJob(t *testing.T) { assertLastRunHeight(t, db, upkeep, 101, 0) } -func TestKeeperDB_LeastSignificant(t *testing.T) { +func TestIntegration_Shared_KeeperDB_LeastSignificant(t *testing.T) { t.Parallel() db, _, _ := setupKeeperDB(t) sql := `SELECT least_significant($1, $2)` @@ -486,7 +486,7 @@ func TestKeeperDB_LeastSignificant(t *testing.T) { } } -func TestKeeperDB_Uint256ToBit(t *testing.T) { +func TestIntegration_Shared_KeeperDB_Uint256ToBit(t *testing.T) { t.Parallel() db, _, _ := setupKeeperDB(t) sql := `SELECT uint256_to_bit($1)` diff --git a/core/services/keeper/registry1_1_synchronizer_test.go b/core/services/keeper/registry1_1_synchronizer_test.go index 0ca4b0216eb..1807dcb854a 100644 --- a/core/services/keeper/registry1_1_synchronizer_test.go +++ b/core/services/keeper/registry1_1_synchronizer_test.go @@ -69,7 +69,7 @@ func mockRegistry1_1( } } -func Test_LogListenerOpts1_1(t *testing.T) { +func TestIntegration_Shared_LogListenerOpts1_1(t *testing.T) { db := pgtest.NewSqlxDB(t) korm := keeper.NewORM(db, logger.TestLogger(t)) ethClient := clienttest.NewClientWithDefaultChainID(t) @@ -92,7 +92,7 @@ func Test_LogListenerOpts1_1(t *testing.T) { require.Contains(t, logListenerOpts.LogsWithTopics, registry1_1.KeeperRegistryUpkeepPerformed{}.Topic(), "Registry should listen to KeeperRegistryUpkeepPerformed log") } -func Test_RegistrySynchronizer1_1_Start(t *testing.T) { +func TestIntegration_Shared_RegistrySynchronizer1_1_Start(t *testing.T) { db, synchronizer, ethMock, _, job := setupRegistrySync(t, keeper.RegistryVersion_1_1) contractAddress := job.KeeperSpec.ContractAddress.Address() @@ -118,7 +118,7 @@ func Test_RegistrySynchronizer1_1_Start(t *testing.T) { require.Error(t, err) } -func Test_RegistrySynchronizer_CalcPositioningConstant(t *testing.T) { +func TestIntegration_Shared_RegistrySynchronizer_CalcPositioningConstant(t *testing.T) { t.Parallel() for _, upkeepID := range []int64{0, 1, 100, 10_000} { _, err := keeper.CalcPositioningConstant(ubig.NewI(upkeepID), cltest.NewEIP55Address()) @@ -126,7 +126,7 @@ func Test_RegistrySynchronizer_CalcPositioningConstant(t *testing.T) { } } -func Test_RegistrySynchronizer1_1_FullSync(t *testing.T) { +func TestIntegration_Shared_RegistrySynchronizer1_1_FullSync(t *testing.T) { ctx := testutils.Context(t) g := gomega.NewWithT(t) db, synchronizer, ethMock, _, job := setupRegistrySync(t, keeper.RegistryVersion_1_1) @@ -200,7 +200,7 @@ func Test_RegistrySynchronizer1_1_FullSync(t *testing.T) { assertUpkeepIDs(t, db, []int64{2, 4}) } -func Test_RegistrySynchronizer1_1_ConfigSetLog(t *testing.T) { +func TestUnit_RegistrySynchronizer1_1_ConfigSetLog(t *testing.T) { ctx := testutils.Context(t) db, synchronizer, ethMock, lb, job := setupRegistrySync(t, keeper.RegistryVersion_1_1) @@ -248,7 +248,7 @@ func Test_RegistrySynchronizer1_1_ConfigSetLog(t *testing.T) { cltest.AssertCount(t, db, "keeper_registries", 1) } -func Test_RegistrySynchronizer1_1_KeepersUpdatedLog(t *testing.T) { +func TestUnit_RegistrySynchronizer1_1_KeepersUpdatedLog(t *testing.T) { ctx := testutils.Context(t) db, synchronizer, ethMock, lb, job := setupRegistrySync(t, keeper.RegistryVersion_1_1) @@ -294,7 +294,7 @@ func Test_RegistrySynchronizer1_1_KeepersUpdatedLog(t *testing.T) { }) cltest.AssertCount(t, db, "keeper_registries", 1) } -func Test_RegistrySynchronizer1_1_UpkeepCanceledLog(t *testing.T) { +func TestUnit_RegistrySynchronizer1_1_UpkeepCanceledLog(t *testing.T) { ctx := testutils.Context(t) db, synchronizer, ethMock, lb, job := setupRegistrySync(t, keeper.RegistryVersion_1_1) @@ -332,7 +332,7 @@ func Test_RegistrySynchronizer1_1_UpkeepCanceledLog(t *testing.T) { cltest.WaitForCount(t, db, "upkeep_registrations", 2) } -func Test_RegistrySynchronizer1_1_UpkeepRegisteredLog(t *testing.T) { +func TestUnit_RegistrySynchronizer1_1_UpkeepRegisteredLog(t *testing.T) { ctx := testutils.Context(t) db, synchronizer, ethMock, lb, job := setupRegistrySync(t, keeper.RegistryVersion_1_1) @@ -373,7 +373,7 @@ func Test_RegistrySynchronizer1_1_UpkeepRegisteredLog(t *testing.T) { cltest.WaitForCount(t, db, "upkeep_registrations", 2) } -func Test_RegistrySynchronizer1_1_UpkeepPerformedLog(t *testing.T) { +func TestUnit_RegistrySynchronizer1_1_UpkeepPerformedLog(t *testing.T) { ctx := testutils.Context(t) g := gomega.NewWithT(t) diff --git a/core/services/keeper/registry1_2_synchronizer_test.go b/core/services/keeper/registry1_2_synchronizer_test.go index cf2d3805f23..e4b29a77109 100644 --- a/core/services/keeper/registry1_2_synchronizer_test.go +++ b/core/services/keeper/registry1_2_synchronizer_test.go @@ -91,7 +91,7 @@ func mockRegistry1_2( } } -func Test_LogListenerOpts1_2(t *testing.T) { +func TestUnit_LogListenerOpts1_2(t *testing.T) { db := pgtest.NewSqlxDB(t) korm := keeper.NewORM(db, logger.TestLogger(t)) ethClient := clienttest.NewClientWithDefaultChainID(t) @@ -117,7 +117,7 @@ func Test_LogListenerOpts1_2(t *testing.T) { require.Contains(t, logListenerOpts.LogsWithTopics, registry1_2.KeeperRegistryUpkeepReceived{}.Topic(), "Registry should listen to KeeperRegistryUpkeepReceived log") } -func Test_RegistrySynchronizer1_2_Start(t *testing.T) { +func TestUnit_RegistrySynchronizer1_2_Start(t *testing.T) { db, synchronizer, ethMock, _, job := setupRegistrySync(t, keeper.RegistryVersion_1_2) contractAddress := job.KeeperSpec.ContractAddress.Address() @@ -144,7 +144,7 @@ func Test_RegistrySynchronizer1_2_Start(t *testing.T) { require.Error(t, err) } -func Test_RegistrySynchronizer1_2_FullSync(t *testing.T) { +func TestUnit_RegistrySynchronizer1_2_FullSync(t *testing.T) { ctx := testutils.Context(t) g := gomega.NewWithT(t) db, synchronizer, ethMock, _, job := setupRegistrySync(t, keeper.RegistryVersion_1_2) @@ -218,7 +218,7 @@ func Test_RegistrySynchronizer1_2_FullSync(t *testing.T) { assertUpkeepIDs(t, db, []int64{69, 420, 2022}) } -func Test_RegistrySynchronizer1_2_ConfigSetLog(t *testing.T) { +func TestUnit_RegistrySynchronizer1_2_ConfigSetLog(t *testing.T) { ctx := testutils.Context(t) db, synchronizer, ethMock, lb, job := setupRegistrySync(t, keeper.RegistryVersion_1_2) @@ -270,7 +270,7 @@ func Test_RegistrySynchronizer1_2_ConfigSetLog(t *testing.T) { cltest.AssertCount(t, db, "keeper_registries", 1) } -func Test_RegistrySynchronizer1_2_KeepersUpdatedLog(t *testing.T) { +func TestUnit_RegistrySynchronizer1_2_KeepersUpdatedLog(t *testing.T) { ctx := testutils.Context(t) db, synchronizer, ethMock, lb, job := setupRegistrySync(t, keeper.RegistryVersion_1_2) @@ -321,7 +321,7 @@ func Test_RegistrySynchronizer1_2_KeepersUpdatedLog(t *testing.T) { cltest.AssertCount(t, db, "keeper_registries", 1) } -func Test_RegistrySynchronizer1_2_UpkeepCanceledLog(t *testing.T) { +func TestUnit_RegistrySynchronizer1_2_UpkeepCanceledLog(t *testing.T) { ctx := testutils.Context(t) db, synchronizer, ethMock, lb, job := setupRegistrySync(t, keeper.RegistryVersion_1_2) @@ -360,7 +360,7 @@ func Test_RegistrySynchronizer1_2_UpkeepCanceledLog(t *testing.T) { cltest.WaitForCount(t, db, "upkeep_registrations", 2) } -func Test_RegistrySynchronizer1_2_UpkeepRegisteredLog(t *testing.T) { +func TestUnit_RegistrySynchronizer1_2_UpkeepRegisteredLog(t *testing.T) { ctx := testutils.Context(t) db, synchronizer, ethMock, lb, job := setupRegistrySync(t, keeper.RegistryVersion_1_2) @@ -402,7 +402,7 @@ func Test_RegistrySynchronizer1_2_UpkeepRegisteredLog(t *testing.T) { cltest.WaitForCount(t, db, "upkeep_registrations", 2) } -func Test_RegistrySynchronizer1_2_UpkeepPerformedLog(t *testing.T) { +func TestUnit_RegistrySynchronizer1_2_UpkeepPerformedLog(t *testing.T) { ctx := testutils.Context(t) g := gomega.NewWithT(t) @@ -457,7 +457,7 @@ func Test_RegistrySynchronizer1_2_UpkeepPerformedLog(t *testing.T) { }, testutils.WaitTimeout(t), cltest.DBPollingInterval).Should(gomega.Equal(int64(0))) } -func Test_RegistrySynchronizer1_2_UpkeepGasLimitSetLog(t *testing.T) { +func TestUnit_RegistrySynchronizer1_2_UpkeepGasLimitSetLog(t *testing.T) { ctx := testutils.Context(t) g := gomega.NewWithT(t) db, synchronizer, ethMock, lb, job := setupRegistrySync(t, keeper.RegistryVersion_1_2) @@ -510,7 +510,7 @@ func Test_RegistrySynchronizer1_2_UpkeepGasLimitSetLog(t *testing.T) { g.Eventually(getExecuteGas, testutils.WaitTimeout(t), cltest.DBPollingInterval).Should(gomega.Equal(uint32(4_000_000))) } -func Test_RegistrySynchronizer1_2_UpkeepReceivedLog(t *testing.T) { +func TestUnit_RegistrySynchronizer1_2_UpkeepReceivedLog(t *testing.T) { ctx := testutils.Context(t) db, synchronizer, ethMock, lb, job := setupRegistrySync(t, keeper.RegistryVersion_1_2) @@ -552,7 +552,7 @@ func Test_RegistrySynchronizer1_2_UpkeepReceivedLog(t *testing.T) { cltest.WaitForCount(t, db, "upkeep_registrations", 2) } -func Test_RegistrySynchronizer1_2_UpkeepMigratedLog(t *testing.T) { +func TestUnit_RegistrySynchronizer1_2_UpkeepMigratedLog(t *testing.T) { ctx := testutils.Context(t) db, synchronizer, ethMock, lb, job := setupRegistrySync(t, keeper.RegistryVersion_1_2) diff --git a/core/services/keeper/registry1_3_synchronizer_test.go b/core/services/keeper/registry1_3_synchronizer_test.go index 1537ca81b7f..e19e15b970e 100644 --- a/core/services/keeper/registry1_3_synchronizer_test.go +++ b/core/services/keeper/registry1_3_synchronizer_test.go @@ -93,7 +93,7 @@ func mockRegistry1_3( } } -func Test_LogListenerOpts1_3(t *testing.T) { +func TestUnit_LogListenerOpts1_3(t *testing.T) { db := pgtest.NewSqlxDB(t) korm := keeper.NewORM(db, logger.TestLogger(t)) ethClient := clienttest.NewClientWithDefaultChainID(t) @@ -122,7 +122,7 @@ func Test_LogListenerOpts1_3(t *testing.T) { require.Contains(t, logListenerOpts.LogsWithTopics, registry1_3.KeeperRegistryUpkeepCheckDataUpdated{}.Topic(), "Registry should listen to KeeperRegistryUpkeepCheckDataUpdated log") } -func Test_RegistrySynchronizer1_3_Start(t *testing.T) { +func TestUnit_RegistrySynchronizer1_3_Start(t *testing.T) { db, synchronizer, ethMock, _, job := setupRegistrySync(t, keeper.RegistryVersion_1_3) contractAddress := job.KeeperSpec.ContractAddress.Address() @@ -149,7 +149,7 @@ func Test_RegistrySynchronizer1_3_Start(t *testing.T) { require.Error(t, err) } -func Test_RegistrySynchronizer1_3_FullSync(t *testing.T) { +func TestUnit_RegistrySynchronizer1_3_FullSync(t *testing.T) { ctx := testutils.Context(t) g := gomega.NewWithT(t) db, synchronizer, ethMock, _, job := setupRegistrySync(t, keeper.RegistryVersion_1_3) @@ -223,7 +223,7 @@ func Test_RegistrySynchronizer1_3_FullSync(t *testing.T) { assertUpkeepIDs(t, db, []int64{69, 420, 2022}) } -func Test_RegistrySynchronizer1_3_ConfigSetLog(t *testing.T) { +func TestUnit_RegistrySynchronizer1_3_ConfigSetLog(t *testing.T) { ctx := testutils.Context(t) db, synchronizer, ethMock, lb, job := setupRegistrySync(t, keeper.RegistryVersion_1_3) @@ -275,7 +275,7 @@ func Test_RegistrySynchronizer1_3_ConfigSetLog(t *testing.T) { cltest.AssertCount(t, db, "keeper_registries", 1) } -func Test_RegistrySynchronizer1_3_KeepersUpdatedLog(t *testing.T) { +func TestUnit_RegistrySynchronizer1_3_KeepersUpdatedLog(t *testing.T) { ctx := testutils.Context(t) db, synchronizer, ethMock, lb, job := setupRegistrySync(t, keeper.RegistryVersion_1_3) @@ -326,7 +326,7 @@ func Test_RegistrySynchronizer1_3_KeepersUpdatedLog(t *testing.T) { cltest.AssertCount(t, db, "keeper_registries", 1) } -func Test_RegistrySynchronizer1_3_UpkeepCanceledLog(t *testing.T) { +func TestUnit_RegistrySynchronizer1_3_UpkeepCanceledLog(t *testing.T) { ctx := testutils.Context(t) db, synchronizer, ethMock, lb, job := setupRegistrySync(t, keeper.RegistryVersion_1_3) @@ -365,7 +365,7 @@ func Test_RegistrySynchronizer1_3_UpkeepCanceledLog(t *testing.T) { cltest.WaitForCount(t, db, "upkeep_registrations", 2) } -func Test_RegistrySynchronizer1_3_UpkeepRegisteredLog(t *testing.T) { +func TestUnit_RegistrySynchronizer1_3_UpkeepRegisteredLog(t *testing.T) { ctx := testutils.Context(t) db, synchronizer, ethMock, lb, job := setupRegistrySync(t, keeper.RegistryVersion_1_3) @@ -407,7 +407,7 @@ func Test_RegistrySynchronizer1_3_UpkeepRegisteredLog(t *testing.T) { cltest.WaitForCount(t, db, "upkeep_registrations", 2) } -func Test_RegistrySynchronizer1_3_UpkeepPerformedLog(t *testing.T) { +func TestUnit_RegistrySynchronizer1_3_UpkeepPerformedLog(t *testing.T) { ctx := testutils.Context(t) g := gomega.NewWithT(t) @@ -462,7 +462,7 @@ func Test_RegistrySynchronizer1_3_UpkeepPerformedLog(t *testing.T) { }, testutils.WaitTimeout(t), cltest.DBPollingInterval).Should(gomega.Equal(int64(0))) } -func Test_RegistrySynchronizer1_3_UpkeepGasLimitSetLog(t *testing.T) { +func TestUnit_RegistrySynchronizer1_3_UpkeepGasLimitSetLog(t *testing.T) { ctx := testutils.Context(t) g := gomega.NewWithT(t) db, synchronizer, ethMock, lb, job := setupRegistrySync(t, keeper.RegistryVersion_1_3) @@ -515,7 +515,7 @@ func Test_RegistrySynchronizer1_3_UpkeepGasLimitSetLog(t *testing.T) { g.Eventually(getExecuteGas, testutils.WaitTimeout(t), cltest.DBPollingInterval).Should(gomega.Equal(uint32(4_000_000))) } -func Test_RegistrySynchronizer1_3_UpkeepReceivedLog(t *testing.T) { +func TestUnit_RegistrySynchronizer1_3_UpkeepReceivedLog(t *testing.T) { ctx := testutils.Context(t) db, synchronizer, ethMock, lb, job := setupRegistrySync(t, keeper.RegistryVersion_1_3) @@ -557,7 +557,7 @@ func Test_RegistrySynchronizer1_3_UpkeepReceivedLog(t *testing.T) { cltest.WaitForCount(t, db, "upkeep_registrations", 2) } -func Test_RegistrySynchronizer1_3_UpkeepMigratedLog(t *testing.T) { +func TestUnit_RegistrySynchronizer1_3_UpkeepMigratedLog(t *testing.T) { ctx := testutils.Context(t) db, synchronizer, ethMock, lb, job := setupRegistrySync(t, keeper.RegistryVersion_1_3) @@ -597,7 +597,7 @@ func Test_RegistrySynchronizer1_3_UpkeepMigratedLog(t *testing.T) { cltest.WaitForCount(t, db, "upkeep_registrations", 2) } -func Test_RegistrySynchronizer1_3_UpkeepPausedLog_UpkeepUnpausedLog(t *testing.T) { +func TestUnit_RegistrySynchronizer1_3_UpkeepPausedLog_UpkeepUnpausedLog(t *testing.T) { ctx := testutils.Context(t) db, synchronizer, ethMock, lb, job := setupRegistrySync(t, keeper.RegistryVersion_1_3) @@ -664,7 +664,7 @@ func Test_RegistrySynchronizer1_3_UpkeepPausedLog_UpkeepUnpausedLog(t *testing.T require.Equal(t, registryId, upkeep.RegistryID) } -func Test_RegistrySynchronizer1_3_UpkeepCheckDataUpdatedLog(t *testing.T) { +func TestUnit_RegistrySynchronizer1_3_UpkeepCheckDataUpdatedLog(t *testing.T) { ctx := testutils.Context(t) g := gomega.NewWithT(t) db, synchronizer, ethMock, lb, job := setupRegistrySync(t, keeper.RegistryVersion_1_3) diff --git a/core/services/keeper/registry_synchronizer_sync_test.go b/core/services/keeper/registry_synchronizer_sync_test.go index f3676f8a964..e45357c97a1 100644 --- a/core/services/keeper/registry_synchronizer_sync_test.go +++ b/core/services/keeper/registry_synchronizer_sync_test.go @@ -26,7 +26,7 @@ func (g *GetUpkeepFailure) GetUpkeep(opts *bind.CallOpts, id *big.Int) (*UpkeepC return nil, fmt.Errorf("%w [%w]: getConfig v1.%d", ErrContractCallFailure, errGetUpkeep, RegistryVersion_1_2) } -func TestSyncUpkeepWithCallback_UpkeepNotFound(t *testing.T) { +func TestUnit_SyncUpkeepWithCallback_UpkeepNotFound(t *testing.T) { ctx := testutils.Context(t) log, logObserver := logger.TestLoggerObserved(t, zapcore.ErrorLevel) synchronizer := &RegistrySynchronizer{ diff --git a/core/services/keeper/upkeep_executer_test.go b/core/services/keeper/upkeep_executer_test.go index e645b0a1bd2..39b27a494ba 100644 --- a/core/services/keeper/upkeep_executer_test.go +++ b/core/services/keeper/upkeep_executer_test.go @@ -110,14 +110,14 @@ var checkPerformResponse = struct { Success: true, } -func Test_UpkeepExecuter_ErrorsIfStartedTwice(t *testing.T) { +func TestUnit_UpkeepExecuter_ErrorsIfStartedTwice(t *testing.T) { t.Parallel() _, _, _, executer, _, _, _, _, _, _, _, _ := setup(t, nil) err := executer.Start(testutils.Context(t)) // already started in setup() require.Error(t, err) } -func Test_UpkeepExecuter_PerformsUpkeep_Happy(t *testing.T) { +func TestUnit_UpkeepExecuter_PerformsUpkeep_Happy(t *testing.T) { taskRuns := 11 t.Parallel() @@ -312,7 +312,7 @@ func Test_UpkeepExecuter_PerformsUpkeep_Happy(t *testing.T) { }) } -func Test_UpkeepExecuter_PerformsUpkeep_Error(t *testing.T) { +func TestUnit_UpkeepExecuter_PerformsUpkeep_Error(t *testing.T) { t.Parallel() g := gomega.NewWithT(t) diff --git a/core/services/keeper/upkeep_executer_unit_test.go b/core/services/keeper/upkeep_executer_unit_test.go index 36e6d1e0b53..0d0013d7eab 100644 --- a/core/services/keeper/upkeep_executer_unit_test.go +++ b/core/services/keeper/upkeep_executer_unit_test.go @@ -23,7 +23,7 @@ func (r *registry) CheckGasOverhead() uint32 { return uint32(0) } func (r *registry) PerformGasOverhead() uint32 { return r.pgo } func (r *registry) MaxPerformDataSize() uint32 { return r.mpds } -func TestBuildJobSpec(t *testing.T) { +func TestUnit_BuildJobSpec(t *testing.T) { from := types.EIP55Address(testutils.NewAddress().Hex()) contract := types.EIP55Address(testutils.NewAddress().Hex()) chainID := "250" diff --git a/core/services/keeper/validate_test.go b/core/services/keeper/validate_test.go index cfa6a1520f5..5565358a928 100644 --- a/core/services/keeper/validate_test.go +++ b/core/services/keeper/validate_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestValidatedKeeperSpec(t *testing.T) { +func TestIntegration_Shared_ValidatedKeeperSpec(t *testing.T) { t.Parallel() type args struct { diff --git a/core/services/keystore/aptos_test.go b/core/services/keystore/aptos_test.go index 0fc89b7c9c4..80ccf47bb83 100644 --- a/core/services/keystore/aptos_test.go +++ b/core/services/keystore/aptos_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/aptoskey" ) -func Test_AptosKeyStore_E2E(t *testing.T) { +func TestIntegration_Shared_AptosKeyStore_E2E(t *testing.T) { db := pgtest.NewSqlxDB(t) keyStore := keystore.ExposedNewMaster(t, db) diff --git a/core/services/keystore/cosmos_test.go b/core/services/keystore/cosmos_test.go index 16133c85807..ec98e9272f3 100644 --- a/core/services/keystore/cosmos_test.go +++ b/core/services/keystore/cosmos_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/cosmoskey" ) -func Test_CosmosKeyStore_E2E(t *testing.T) { +func TestIntegration_Shared_CosmosKeyStore_E2E(t *testing.T) { db := pgtest.NewSqlxDB(t) keyStore := keystore.ExposedNewMaster(t, db) diff --git a/core/services/keystore/csa_test.go b/core/services/keystore/csa_test.go index 281cd0933c5..bca4d7647e6 100644 --- a/core/services/keystore/csa_test.go +++ b/core/services/keystore/csa_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" ) -func Test_CSAKeyStore_E2E(t *testing.T) { +func TestIntegration_Shared_CSAKeyStore_E2E(t *testing.T) { db := pgtest.NewSqlxDB(t) keyStore := keystore.ExposedNewMaster(t, db) require.NoError(t, keyStore.Unlock(testutils.Context(t), cltest.Password)) diff --git a/core/services/keystore/dkgrecipient_test.go b/core/services/keystore/dkgrecipient_test.go index 4a70735e384..285773e8b80 100644 --- a/core/services/keystore/dkgrecipient_test.go +++ b/core/services/keystore/dkgrecipient_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/dkgrecipientkey" ) -func Test_DKGRecipientKeyStore_E2E(t *testing.T) { +func TestUnit_DKGRecipientKeyStore_E2E(t *testing.T) { db := pgtest.NewSqlxDB(t) keyStore := keystore.ExposedNewMaster(t, db) require.NoError(t, keyStore.Unlock(testutils.Context(t), cltest.Password)) diff --git a/core/services/keystore/eth_test.go b/core/services/keystore/eth_test.go index dcc239d4e65..ef7137e645a 100644 --- a/core/services/keystore/eth_test.go +++ b/core/services/keystore/eth_test.go @@ -23,7 +23,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" ) -func Test_EthKeyStore(t *testing.T) { +func TestUnit_EthKeyStore(t *testing.T) { t.Parallel() db := pgtest.NewSqlxDB(t) @@ -215,7 +215,7 @@ func Test_EthKeyStore(t *testing.T) { }) } -func Test_EthKeyStore_GetRoundRobinAddress(t *testing.T) { +func TestUnit_EthKeyStore_GetRoundRobinAddress(t *testing.T) { ctx := testutils.Context(t) t.Parallel() @@ -336,7 +336,7 @@ func Test_EthKeyStore_GetRoundRobinAddress(t *testing.T) { }) } -func Test_EthKeyStore_E2E(t *testing.T) { +func TestUnit_EthKeyStore_E2E(t *testing.T) { t.Parallel() db := pgtest.NewSqlxDB(t) @@ -462,7 +462,7 @@ func Test_EthKeyStore_E2E(t *testing.T) { }) } -func Test_EthKeyStore_Enable(t *testing.T) { +func TestUnit_EthKeyStore_Enable(t *testing.T) { t.Parallel() db := pgtest.NewSqlxDB(t) @@ -510,7 +510,7 @@ func Test_EthKeyStore_Enable(t *testing.T) { }) } -func Test_EthKeyStore_EnsureKeys(t *testing.T) { +func TestUnit_EthKeyStore_EnsureKeys(t *testing.T) { t.Parallel() t.Run("creates one unique key per chain if none exist", func(t *testing.T) { @@ -582,7 +582,7 @@ func Test_EthKeyStore_EnsureKeys(t *testing.T) { }) } -func Test_EthKeyStore_Delete(t *testing.T) { +func TestUnit_EthKeyStore_Delete(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -629,7 +629,7 @@ func Test_EthKeyStore_Delete(t *testing.T) { require.NoError(t, err) } -func Test_EthKeyStore_CheckEnabled(t *testing.T) { +func TestUnit_EthKeyStore_CheckEnabled(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -716,7 +716,7 @@ func Test_EthKeyStore_CheckEnabled(t *testing.T) { }) } -func Test_EthKeyStore_Disable(t *testing.T) { +func TestUnit_EthKeyStore_Disable(t *testing.T) { t.Parallel() db := pgtest.NewSqlxDB(t) diff --git a/core/services/keystore/internal/raw_test.go b/core/services/keystore/internal/raw_test.go index dc5162a53e2..2c487535541 100644 --- a/core/services/keystore/internal/raw_test.go +++ b/core/services/keystore/internal/raw_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestRaw_nonprintable(t *testing.T) { +func TestUnit_Raw_nonprintable(t *testing.T) { bytes, err := hex.DecodeString("f0d07ab448018b2754475f9a3b580218b0675a1456aad96ad607c7bbd7d9237b") require.NoError(t, err) r := NewRaw(bytes) diff --git a/core/services/keystore/keys/aptoskey/export_test.go b/core/services/keystore/keys/aptoskey/export_test.go index a920e432298..dde47f65e5d 100644 --- a/core/services/keystore/keys/aptoskey/export_test.go +++ b/core/services/keystore/keys/aptoskey/export_test.go @@ -6,7 +6,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" ) -func TestAptosKeys_ExportImport(t *testing.T) { +func TestUnit_AptosKeys_ExportImport(t *testing.T) { keys.RunKeyExportImportTestcase(t, createKey, decryptKey) } diff --git a/core/services/keystore/keys/aptoskey/key_test.go b/core/services/keystore/keys/aptoskey/key_test.go index 955eb153bf5..3e8306f9c28 100644 --- a/core/services/keystore/keys/aptoskey/key_test.go +++ b/core/services/keystore/keys/aptoskey/key_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" ) -func TestAptosKey(t *testing.T) { +func TestUnit_AptosKey(t *testing.T) { bytes, err := hex.DecodeString("f0d07ab448018b2754475f9a3b580218b0675a1456aad96ad607c7bbd7d9237b") require.NoError(t, err) k := KeyFor(internal.NewRaw(bytes)) diff --git a/core/services/keystore/keys/cosmoskey/export_test.go b/core/services/keystore/keys/cosmoskey/export_test.go index 48b68c6b09b..4aac2e18d0a 100644 --- a/core/services/keystore/keys/cosmoskey/export_test.go +++ b/core/services/keystore/keys/cosmoskey/export_test.go @@ -6,7 +6,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" ) -func TestCosmosKeys_ExportImport(t *testing.T) { +func TestUnit_CosmosKeys_ExportImport(t *testing.T) { keys.RunKeyExportImportTestcase(t, createKey, decryptKey) } diff --git a/core/services/keystore/keys/csakey/export_test.go b/core/services/keystore/keys/csakey/export_test.go index bc1a475b17a..28ae130b85d 100644 --- a/core/services/keystore/keys/csakey/export_test.go +++ b/core/services/keystore/keys/csakey/export_test.go @@ -6,7 +6,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" ) -func TestCSAKeys_ExportImport(t *testing.T) { +func TestUnit_CSAKeys_ExportImport(t *testing.T) { keys.RunKeyExportImportTestcase(t, createKey, decryptKey) } diff --git a/core/services/keystore/keys/csakey/key_v2_test.go b/core/services/keystore/keys/csakey/key_v2_test.go index d4c237a100e..88c921afc2e 100644 --- a/core/services/keystore/keys/csakey/key_v2_test.go +++ b/core/services/keystore/keys/csakey/key_v2_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" ) -func TestCSAKeyV2_FromRawPrivateKey(t *testing.T) { +func TestUnit_CSAKeyV2_FromRawPrivateKey(t *testing.T) { pubKey, privKey, err := ed25519.GenerateKey(nil) require.NoError(t, err) @@ -22,7 +22,7 @@ func TestCSAKeyV2_FromRawPrivateKey(t *testing.T) { assert.Equal(t, hex.EncodeToString(pubKey), keyV2.PublicKeyString()) } -func TestCSAKeyV2_NewV2(t *testing.T) { +func TestUnit_CSAKeyV2_NewV2(t *testing.T) { keyV2, err := NewV2() require.NoError(t, err) diff --git a/core/services/keystore/keys/dkgrecipientkey/key_test.go b/core/services/keystore/keys/dkgrecipientkey/key_test.go index db9ca4da27d..6b2d58b33e2 100644 --- a/core/services/keystore/keys/dkgrecipientkey/key_test.go +++ b/core/services/keystore/keys/dkgrecipientkey/key_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" ) -func TestNew(t *testing.T) { +func TestUnit_New(t *testing.T) { key, err := New() require.NoError(t, err) @@ -18,7 +18,7 @@ func TestNew(t *testing.T) { assert.Equal(t, key.ID(), key.PublicKeyString()) } -func TestPublicKey(t *testing.T) { +func TestUnit_PublicKey(t *testing.T) { key, err := New() require.NoError(t, err) @@ -27,7 +27,7 @@ func TestPublicKey(t *testing.T) { assert.Len(t, pubKey, 33) } -func TestPublicKeyString(t *testing.T) { +func TestUnit_PublicKeyString(t *testing.T) { key, err := New() require.NoError(t, err) @@ -36,7 +36,7 @@ func TestPublicKeyString(t *testing.T) { assert.Len(t, pubKeyStr, 66) } -func TestECDH(t *testing.T) { +func TestUnit_ECDH(t *testing.T) { key1, err := New() require.NoError(t, err) @@ -53,7 +53,7 @@ func TestECDH(t *testing.T) { assert.NotEmpty(t, secret1) } -func TestRaw(t *testing.T) { +func TestUnit_Raw(t *testing.T) { key, err := New() require.NoError(t, err) @@ -67,7 +67,7 @@ func TestRaw(t *testing.T) { assert.Equal(t, key.PublicKeyString(), key2.PublicKeyString()) } -func TestKeyUniqueness(t *testing.T) { +func TestUnit_KeyUniqueness(t *testing.T) { key1, err := New() require.NoError(t, err) diff --git a/core/services/keystore/keys/ethkey/export_test.go b/core/services/keystore/keys/ethkey/export_test.go index 588fef050bc..95de772bb86 100644 --- a/core/services/keystore/keys/ethkey/export_test.go +++ b/core/services/keystore/keys/ethkey/export_test.go @@ -6,7 +6,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" ) -func TestEthKeys_ExportImport(t *testing.T) { +func TestUnit_EthKeys_ExportImport(t *testing.T) { keys.RunKeyExportImportTestcase(t, createKey, func(keyJSON []byte, password string) (kt keys.KeyType, err error) { t.SkipNow() return kt, err diff --git a/core/services/keystore/keys/ethkey/key_v2_test.go b/core/services/keystore/keys/ethkey/key_v2_test.go index 2541967bae2..ac4fe455da7 100644 --- a/core/services/keystore/keys/ethkey/key_v2_test.go +++ b/core/services/keystore/keys/ethkey/key_v2_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" ) -func TestEthKeyV2_ToKey(t *testing.T) { +func TestUnit_EthKeyV2_ToKey(t *testing.T) { privateKeyECDSA, err := ecdsa.GenerateKey(crypto.S256(), rand.Reader) require.NoError(t, err) @@ -26,7 +26,7 @@ func TestEthKeyV2_ToKey(t *testing.T) { assert.Equal(t, types.EIP55AddressFromAddress(crypto.PubkeyToAddress(privateKeyECDSA.PublicKey)).Hex(), k.ID()) } -func TestEthKeyV2_NewV2(t *testing.T) { +func TestUnit_EthKeyV2_NewV2(t *testing.T) { keyV2, err := NewV2() require.NoError(t, err) diff --git a/core/services/keystore/keys/ocr2key/cosmos_keyring_test.go b/core/services/keystore/keys/ocr2key/cosmos_keyring_test.go index 9a220be5db4..174d042bf9b 100644 --- a/core/services/keystore/keys/ocr2key/cosmos_keyring_test.go +++ b/core/services/keystore/keys/ocr2key/cosmos_keyring_test.go @@ -12,7 +12,7 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" ) -func TestCosmosKeyRing_Sign_Verify(t *testing.T) { +func TestUnit_CosmosKeyRing_Sign_Verify(t *testing.T) { kr1, err := newCosmosKeyring(cryptorand.Reader) require.NoError(t, err) kr2, err := newCosmosKeyring(cryptorand.Reader) @@ -43,7 +43,7 @@ func TestCosmosKeyRing_Sign_Verify(t *testing.T) { }) } -func TestCosmosKeyRing_Marshalling(t *testing.T) { +func TestUnit_CosmosKeyRing_Marshalling(t *testing.T) { kr1, err := newCosmosKeyring(cryptorand.Reader) require.NoError(t, err) m, err := kr1.Marshal() diff --git a/core/services/keystore/keys/ocr2key/ed25519_keyring_test.go b/core/services/keystore/keys/ocr2key/ed25519_keyring_test.go index 064a45abd19..2ed82832338 100644 --- a/core/services/keystore/keys/ocr2key/ed25519_keyring_test.go +++ b/core/services/keystore/keys/ocr2key/ed25519_keyring_test.go @@ -12,7 +12,7 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" ) -func TestAptosKeyRing_Sign_Verify(t *testing.T) { +func TestUnit_AptosKeyRing_Sign_Verify(t *testing.T) { kr1, err := newEd25519Keyring(cryptorand.Reader) require.NoError(t, err) kr2, err := newEd25519Keyring(cryptorand.Reader) @@ -43,7 +43,7 @@ func TestAptosKeyRing_Sign_Verify(t *testing.T) { }) } -func TestAptosKeyRing_Marshalling(t *testing.T) { +func TestUnit_AptosKeyRing_Marshalling(t *testing.T) { kr1, err := newEd25519Keyring(cryptorand.Reader) require.NoError(t, err) m, err := kr1.Marshal() diff --git a/core/services/keystore/keys/ocr2key/evm_keyring_test.go b/core/services/keystore/keys/ocr2key/evm_keyring_test.go index 38df8ac6725..4650b1f4b5e 100644 --- a/core/services/keystore/keys/ocr2key/evm_keyring_test.go +++ b/core/services/keystore/keys/ocr2key/evm_keyring_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" ) -func TestEVMKeyring_SignVerify(t *testing.T) { +func TestUnit_EVMKeyring_SignVerify(t *testing.T) { kr1, err := newEVMKeyring(cryptorand.Reader) require.NoError(t, err) kr2, err := newEVMKeyring(cryptorand.Reader) @@ -48,7 +48,7 @@ func TestEVMKeyring_SignVerify(t *testing.T) { }) } -func TestEVMKeyring_Sign3Verify3(t *testing.T) { +func TestUnit_EVMKeyring_Sign3Verify3(t *testing.T) { kr1, err := newEVMKeyring(cryptorand.Reader) require.NoError(t, err) kr2, err := newEVMKeyring(cryptorand.Reader) @@ -80,7 +80,7 @@ func TestEVMKeyring_Sign3Verify3(t *testing.T) { }) } -func TestEVMKeyring_Marshalling(t *testing.T) { +func TestUnit_EVMKeyring_Marshalling(t *testing.T) { kr1, err := newEVMKeyring(cryptorand.Reader) require.NoError(t, err) @@ -98,7 +98,7 @@ func TestEVMKeyring_Marshalling(t *testing.T) { assert.Error(t, kr2.Unmarshal([]byte{0x01})) } -func TestRawReportContext3(t *testing.T) { +func TestUnit_RawReportContext3(t *testing.T) { testCases := []struct { name string digest [32]byte diff --git a/core/services/keystore/keys/ocr2key/export_test.go b/core/services/keystore/keys/ocr2key/export_test.go index df16e6df179..f59f9ef0de3 100644 --- a/core/services/keystore/keys/ocr2key/export_test.go +++ b/core/services/keystore/keys/ocr2key/export_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils" ) -func TestExport(t *testing.T) { +func TestUnit_Export(t *testing.T) { var tt = []struct { chain chaintype.ChainType }{ diff --git a/core/services/keystore/keys/ocr2key/generic_key_bundle_test.go b/core/services/keystore/keys/ocr2key/generic_key_bundle_test.go index 06b7fdf8eec..ebd9d3eabc6 100644 --- a/core/services/keystore/keys/ocr2key/generic_key_bundle_test.go +++ b/core/services/keystore/keys/ocr2key/generic_key_bundle_test.go @@ -30,7 +30,7 @@ type ( } ) -func TestGenericKeyBundle_Migrate_UnmarshalMarshal(t *testing.T) { +func TestUnit_GenericKeyBundle_Migrate_UnmarshalMarshal(t *testing.T) { // offchain key offKey, err := newOffchainKeyring(cryptorand.Reader, cryptorand.Reader) require.NoError(t, err) diff --git a/core/services/keystore/keys/ocr2key/key_bundle_test.go b/core/services/keystore/keys/ocr2key/key_bundle_test.go index 8b23b0f064b..2ff9bbdf594 100644 --- a/core/services/keystore/keys/ocr2key/key_bundle_test.go +++ b/core/services/keystore/keys/ocr2key/key_bundle_test.go @@ -16,7 +16,7 @@ func assertKeyBundlesNotEqual(t *testing.T, pk1 ocr2key.KeyBundle, pk2 ocr2key.K assert.NotEqual(t, pk1.OnChainPublicKey(), pk2.OnChainPublicKey()) } -func TestOCR2Keys_New(t *testing.T) { +func TestUnit_OCR2Keys_New(t *testing.T) { t.Parallel() var keys []ocr2key.KeyBundle @@ -50,7 +50,7 @@ func TestOCR2Keys_New(t *testing.T) { } } -func TestOCR2KeyBundle_BundleBase(t *testing.T) { +func TestUnit_OCR2KeyBundle_BundleBase(t *testing.T) { t.Parallel() for _, chain := range chaintype.SupportedChainTypes { diff --git a/core/services/keystore/keys/ocr2key/offchain_keyring_test.go b/core/services/keystore/keys/ocr2key/offchain_keyring_test.go index a19050548af..2f92a517ae9 100644 --- a/core/services/keystore/keys/ocr2key/offchain_keyring_test.go +++ b/core/services/keystore/keys/ocr2key/offchain_keyring_test.go @@ -12,14 +12,14 @@ import ( "golang.org/x/crypto/nacl/box" ) -func TestOffchainKeyring(t *testing.T) { +func TestUnit_OffchainKeyring(t *testing.T) { kr, err := newOffchainKeyring(cryptorand.Reader, cryptorand.Reader) require.NoError(t, err) pubKey := kr.OffchainPublicKey() assert.True(t, bytes.Equal(kr.signingKey().Public().(ed25519.PublicKey), pubKey[:])) } -func TestOffchainKeyring_NaclBoxSealAnonymous(t *testing.T) { +func TestUnit_OffchainKeyring_NaclBoxSealAnonymous(t *testing.T) { kr, err := newOffchainKeyring(cryptorand.Reader, cryptorand.Reader) require.NoError(t, err) @@ -35,7 +35,7 @@ func TestOffchainKeyring_NaclBoxSealAnonymous(t *testing.T) { assert.Equal(t, originalMessage, decryptedMessage) } -func TestOffchainKeyring_NaclBoxSealAnonymous_ShortCiphertext(t *testing.T) { +func TestUnit_OffchainKeyring_NaclBoxSealAnonymous_ShortCiphertext(t *testing.T) { kr, err := newOffchainKeyring(cryptorand.Reader, cryptorand.Reader) require.NoError(t, err) @@ -45,7 +45,7 @@ func TestOffchainKeyring_NaclBoxSealAnonymous_ShortCiphertext(t *testing.T) { assert.Equal(t, "ciphertext too short", err.Error()) } -func TestOffchainKeyring_NaclBoxSealAnonymous_FailedDecryption(t *testing.T) { +func TestUnit_OffchainKeyring_NaclBoxSealAnonymous_FailedDecryption(t *testing.T) { kr, err := newOffchainKeyring(cryptorand.Reader, cryptorand.Reader) require.NoError(t, err) diff --git a/core/services/keystore/keys/ocr2key/solana_keyring_test.go b/core/services/keystore/keys/ocr2key/solana_keyring_test.go index e391848a4b9..4a6b035b683 100644 --- a/core/services/keystore/keys/ocr2key/solana_keyring_test.go +++ b/core/services/keystore/keys/ocr2key/solana_keyring_test.go @@ -11,7 +11,7 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" ) -func TestSolanaKeyring_Sign_Verify(t *testing.T) { +func TestUnit_SolanaKeyring_Sign_Verify(t *testing.T) { kr1, err := newSolanaKeyring(cryptorand.Reader) require.NoError(t, err) kr2, err := newSolanaKeyring(cryptorand.Reader) @@ -42,7 +42,7 @@ func TestSolanaKeyring_Sign_Verify(t *testing.T) { }) } -func TestSolanaKeyring_Marshalling(t *testing.T) { +func TestUnit_SolanaKeyring_Marshalling(t *testing.T) { kr1, err := newSolanaKeyring(cryptorand.Reader) require.NoError(t, err) m, err := kr1.Marshal() diff --git a/core/services/keystore/keys/ocr2key/ton_keyring_test.go b/core/services/keystore/keys/ocr2key/ton_keyring_test.go index 32890a979f6..46a69932df1 100644 --- a/core/services/keystore/keys/ocr2key/ton_keyring_test.go +++ b/core/services/keystore/keys/ocr2key/ton_keyring_test.go @@ -12,7 +12,7 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" ) -func TestTONKeyring_Sign_Verify(t *testing.T) { +func TestUnit_TONKeyring_Sign_Verify(t *testing.T) { kr1, err := newTONKeyring(cryptorand.Reader) require.NoError(t, err) kr2, err := newTONKeyring(cryptorand.Reader) @@ -43,7 +43,7 @@ func TestTONKeyring_Sign_Verify(t *testing.T) { }) } -func TestTONKeyring_Sign3_Verify3(t *testing.T) { +func TestUnit_TONKeyring_Sign3_Verify3(t *testing.T) { kr1, err := newTONKeyring(cryptorand.Reader) require.NoError(t, err) kr2, err := newTONKeyring(cryptorand.Reader) @@ -79,7 +79,7 @@ func TestTONKeyring_Sign3_Verify3(t *testing.T) { }) } -func TestTONKeyring_Marshalling(t *testing.T) { +func TestUnit_TONKeyring_Marshalling(t *testing.T) { kr1, err := newEd25519Keyring(cryptorand.Reader) require.NoError(t, err) m, err := kr1.Marshal() diff --git a/core/services/keystore/keys/ocrkey/config_public_key_test.go b/core/services/keystore/keys/ocrkey/config_public_key_test.go index f3d257bd1fc..88bbe606725 100644 --- a/core/services/keystore/keys/ocrkey/config_public_key_test.go +++ b/core/services/keystore/keys/ocrkey/config_public_key_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestOCRKey_ConfigPublicKey(t *testing.T) { +func TestUnit_OCRKey_ConfigPublicKey(t *testing.T) { k := MustNewV2XXXTestingOnly(big.NewInt(1)) t.Run("fails to unmarshal invalid JSON", func(t *testing.T) { diff --git a/core/services/keystore/keys/ocrkey/export_test.go b/core/services/keystore/keys/ocrkey/export_test.go index 347babb31cc..3273af33dc6 100644 --- a/core/services/keystore/keys/ocrkey/export_test.go +++ b/core/services/keystore/keys/ocrkey/export_test.go @@ -6,7 +6,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" ) -func TestOCRKeys_ExportImport(t *testing.T) { +func TestUnit_OCRKeys_ExportImport(t *testing.T) { keys.RunKeyExportImportTestcase(t, createKey, decryptKey) } diff --git a/core/services/keystore/keys/ocrkey/key_v2_test.go b/core/services/keystore/keys/ocrkey/key_v2_test.go index c7cda7e7bd8..83f0e868518 100644 --- a/core/services/keystore/keys/ocrkey/key_v2_test.go +++ b/core/services/keystore/keys/ocrkey/key_v2_test.go @@ -18,7 +18,7 @@ func assertKeyBundlesNotEqual(t *testing.T, pk1 ocrkey.KeyV2, pk2 ocrkey.KeyV2) assert.NotEqual(t, pk1.ExportedOffChainEncryption(), pk2.ExportedOffChainEncryption()) } -func TestOCRKeys_New(t *testing.T) { +func TestUnit_OCRKeys_New(t *testing.T) { t.Parallel() pk1, err := ocrkey.NewV2() require.NoError(t, err) @@ -30,7 +30,7 @@ func TestOCRKeys_New(t *testing.T) { assertKeyBundlesNotEqual(t, pk1, pk3) assertKeyBundlesNotEqual(t, pk2, pk3) } -func TestOCRKeys_Raw_Key(t *testing.T) { +func TestUnit_OCRKeys_Raw_Key(t *testing.T) { t.Parallel() key := ocrkey.MustNewV2XXXTestingOnly(big.NewInt(1)) require.Equal(t, key.ID(), ocrkey.KeyFor(key.Raw()).ID()) diff --git a/core/services/keystore/keys/ocrkey/off_chain_private_key_test.go b/core/services/keystore/keys/ocrkey/off_chain_private_key_test.go index a7eadc72860..a19dc60ecaa 100644 --- a/core/services/keystore/keys/ocrkey/off_chain_private_key_test.go +++ b/core/services/keystore/keys/ocrkey/off_chain_private_key_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestOCRKeys_OffChainPrivateKey(t *testing.T) { +func TestUnit_OCRKeys_OffChainPrivateKey(t *testing.T) { t.Parallel() k, err := NewV2() diff --git a/core/services/keystore/keys/ocrkey/off_chain_public_key_test.go b/core/services/keystore/keys/ocrkey/off_chain_public_key_test.go index 372ca8b273b..00a00b2a962 100644 --- a/core/services/keystore/keys/ocrkey/off_chain_public_key_test.go +++ b/core/services/keystore/keys/ocrkey/off_chain_public_key_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" ) -func TestOCR_OffchainPublicKey_MarshalJSON(t *testing.T) { +func TestUnit_OCR_OffchainPublicKey_MarshalJSON(t *testing.T) { t.Parallel() rawBytes := make([]byte, 32) rawBytes[31] = 1 @@ -24,7 +24,7 @@ func TestOCR_OffchainPublicKey_MarshalJSON(t *testing.T) { assert.JSONEq(t, pubKeyJSON, string(result)) } -func TestOCR_OffchainPublicKey_UnmarshalJSON_Happy(t *testing.T) { +func TestUnit_OCR_OffchainPublicKey_UnmarshalJSON_Happy(t *testing.T) { t.Parallel() pubKeyString := "918a65a518c005d6367309bec4b26805f8afabef72cbf9940d9a0fd04ec80b38" @@ -36,7 +36,7 @@ func TestOCR_OffchainPublicKey_UnmarshalJSON_Happy(t *testing.T) { assert.Equal(t, pubKeyString, pubKey.Raw()) } -func TestOCR_OffchainPublicKey_UnmarshalJSON_Error(t *testing.T) { +func TestUnit_OCR_OffchainPublicKey_UnmarshalJSON_Error(t *testing.T) { t.Parallel() pubKeyString := "hello world" diff --git a/core/services/keystore/keys/ocrkey/on_chain_private_key_test.go b/core/services/keystore/keys/ocrkey/on_chain_private_key_test.go index 8613eb1d405..ee1b0cb182a 100644 --- a/core/services/keystore/keys/ocrkey/on_chain_private_key_test.go +++ b/core/services/keystore/keys/ocrkey/on_chain_private_key_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestOCRKeys_OnChainPrivateKey(t *testing.T) { +func TestUnit_OCRKeys_OnChainPrivateKey(t *testing.T) { t.Parallel() pk, err := ecdsa.GenerateKey(crypto.S256(), rand.Reader) diff --git a/core/services/keystore/keys/ocrkey/on_chain_public_key_test.go b/core/services/keystore/keys/ocrkey/on_chain_public_key_test.go index 2828fd74db3..b313df43f77 100644 --- a/core/services/keystore/keys/ocrkey/on_chain_public_key_test.go +++ b/core/services/keystore/keys/ocrkey/on_chain_public_key_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestOCRKeys_OnChainPublicKey(t *testing.T) { +func TestUnit_OCRKeys_OnChainPublicKey(t *testing.T) { t.Parallel() pk, err := ecdsa.GenerateKey(crypto.S256(), rand.Reader) diff --git a/core/services/keystore/keys/ocrkey/on_chain_signing_address_test.go b/core/services/keystore/keys/ocrkey/on_chain_signing_address_test.go index e45da17f03a..bc762516d06 100644 --- a/core/services/keystore/keys/ocrkey/on_chain_signing_address_test.go +++ b/core/services/keystore/keys/ocrkey/on_chain_signing_address_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" ) -func TestOCR_OnChainSigningAddress_String(t *testing.T) { +func TestUnit_OCR_OnChainSigningAddress_String(t *testing.T) { t.Parallel() // should contain EIP55CapitalizedAddress diff --git a/core/services/keystore/keys/p2pkey/export_test.go b/core/services/keystore/keys/p2pkey/export_test.go index cd9ceb9064c..78be701f98c 100644 --- a/core/services/keystore/keys/p2pkey/export_test.go +++ b/core/services/keystore/keys/p2pkey/export_test.go @@ -6,7 +6,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" ) -func TestP2PKeys_ExportImport(t *testing.T) { +func TestUnit_P2PKeys_ExportImport(t *testing.T) { keys.RunKeyExportImportTestcase(t, createKey, decryptKey) } diff --git a/core/services/keystore/keys/p2pkey/key_v2_test.go b/core/services/keystore/keys/p2pkey/key_v2_test.go index 8aedb5674d9..e283176dc7d 100644 --- a/core/services/keystore/keys/p2pkey/key_v2_test.go +++ b/core/services/keystore/keys/p2pkey/key_v2_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestP2PKeys_KeyV2(t *testing.T) { +func TestUnit_P2PKeys_KeyV2(t *testing.T) { kv2, err := NewV2() require.NoError(t, err) diff --git a/core/services/keystore/keys/p2pkey/peer_id_test.go b/core/services/keystore/keys/p2pkey/peer_id_test.go index 3d4ad05d5f2..2b21b9ff7cc 100644 --- a/core/services/keystore/keys/p2pkey/peer_id_test.go +++ b/core/services/keystore/keys/p2pkey/peer_id_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestP2PKeys_PeerID(t *testing.T) { +func TestUnit_P2PKeys_PeerID(t *testing.T) { t.Run("make peer ID", func(t *testing.T) { id, err := MakePeerID("12D3KooWM1111111111111111111111111111111111111111111") require.NoError(t, err) @@ -45,7 +45,7 @@ func TestP2PKeys_PeerID(t *testing.T) { }) } -func TestPeerID_marshal(t *testing.T) { +func TestUnit_PeerID_marshal(t *testing.T) { id, err := MakePeerID("p2p_12D3KooWMoejJznyDuEk5aX6GvbjaG12UzeornPCBNzMRqdwrFJw") require.NoError(t, err) t.Run("json", func(t *testing.T) { diff --git a/core/services/keystore/keys/solkey/export_test.go b/core/services/keystore/keys/solkey/export_test.go index aeae61da475..7b0690d9d3e 100644 --- a/core/services/keystore/keys/solkey/export_test.go +++ b/core/services/keystore/keys/solkey/export_test.go @@ -6,7 +6,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" ) -func TestSolanaKeys_ExportImport(t *testing.T) { +func TestUnit_SolanaKeys_ExportImport(t *testing.T) { keys.RunKeyExportImportTestcase(t, createKey, decryptKey) } diff --git a/core/services/keystore/keys/starkkey/export_test.go b/core/services/keystore/keys/starkkey/export_test.go index 27caa1744b4..35ea46e5e52 100644 --- a/core/services/keystore/keys/starkkey/export_test.go +++ b/core/services/keystore/keys/starkkey/export_test.go @@ -7,7 +7,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils" ) -func TestStarkNetKeys_ExportImport(t *testing.T) { +func TestUnit_StarkNetKeys_ExportImport(t *testing.T) { keys.RunKeyExportImportTestcase(t, createKey, decryptKey) } diff --git a/core/services/keystore/keys/starkkey/ocr2key_test.go b/core/services/keystore/keys/starkkey/ocr2key_test.go index 02b1d9d4896..52daac015a0 100644 --- a/core/services/keystore/keys/starkkey/ocr2key_test.go +++ b/core/services/keystore/keys/starkkey/ocr2key_test.go @@ -36,7 +36,7 @@ import ( // --> privKey 2137244795266879235401249500471353867704187908407744160927664772020405449078 r 2898571078985034687500959842265381508927681132188252715370774777831313601543 s 1930849708769648077928186998643944706551011476358007177069185543644456022504 pubKey 1118148281956858477519852250235501663092798578871088714409528077622994994907 // privKey 3571531812827697194985986636869245829152430835021673171507607525908246940354 r 3242770073040892094735101607173275538752888766491356946211654602282309624331 s 2150742645846855766116236144967953798077492822890095121354692808525999221887 pubKey 2445157821578193538289426656074203099996547227497157254541771705133209838679 -func TestStarknetKeyring_TestVector(t *testing.T) { +func TestUnit_StarknetKeyring_TestVector(t *testing.T) { var kr1 OCR2Key bigKey, _ := new(big.Int).SetString("2137244795266879235401249500471353867704187908407744160927664772020405449078", 10) feltKey, err := new(felt.Felt).SetString(bigKey.String()) @@ -114,7 +114,7 @@ func TestStarknetKeyring_TestVector(t *testing.T) { assert.Equal(t, feltSExpected, s) } -func TestStarknetKeyring_Sign_Verify(t *testing.T) { +func TestUnit_StarknetKeyring_Sign_Verify(t *testing.T) { kr1, err := NewOCR2Key(cryptorand.Reader) require.NoError(t, err) kr2, err := NewOCR2Key(cryptorand.Reader) @@ -176,7 +176,7 @@ func TestStarknetKeyring_Sign_Verify(t *testing.T) { }) } -func TestStarknetKeyring_Marshal(t *testing.T) { +func TestUnit_StarknetKeyring_Marshal(t *testing.T) { testStarknetKeyringMarshal(t, cryptorand.Reader) } diff --git a/core/services/keystore/keys/suikey/export_test.go b/core/services/keystore/keys/suikey/export_test.go index 993629d0e57..cff288e7ac1 100644 --- a/core/services/keystore/keys/suikey/export_test.go +++ b/core/services/keystore/keys/suikey/export_test.go @@ -6,7 +6,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" ) -func TestSuiKeys_ExportImport(t *testing.T) { +func TestUnit_SuiKeys_ExportImport(t *testing.T) { keys.RunKeyExportImportTestcase(t, createKey, decryptKey) } diff --git a/core/services/keystore/keys/suikey/key_test.go b/core/services/keystore/keys/suikey/key_test.go index 4f43b0563be..5b9f967cd02 100644 --- a/core/services/keystore/keys/suikey/key_test.go +++ b/core/services/keystore/keys/suikey/key_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" ) -func TestSuiKey(t *testing.T) { +func TestUnit_SuiKey(t *testing.T) { bytes, err := hex.DecodeString("f0d07ab448018b2754475f9a3b580218b0675a1456aad96ad607c7bbd7d9237b") require.NoError(t, err) k := KeyFor(internal.NewRaw(bytes)) diff --git a/core/services/keystore/keys/tonkey/export_test.go b/core/services/keystore/keys/tonkey/export_test.go index 384ccc30af3..d60777b920b 100644 --- a/core/services/keystore/keys/tonkey/export_test.go +++ b/core/services/keystore/keys/tonkey/export_test.go @@ -6,7 +6,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" ) -func TestTONKeys_ExportImport(t *testing.T) { +func TestUnit_TONKeys_ExportImport(t *testing.T) { keys.RunKeyExportImportTestcase(t, createKey, decryptKey) } diff --git a/core/services/keystore/keys/tonkey/key_test.go b/core/services/keystore/keys/tonkey/key_test.go index e8e9ab20ec7..dd0bc41ee1f 100644 --- a/core/services/keystore/keys/tonkey/key_test.go +++ b/core/services/keystore/keys/tonkey/key_test.go @@ -13,7 +13,7 @@ import ( "github.com/xssnick/tonutils-go/ton/wallet" ) -func TestTONKey(t *testing.T) { +func TestUnit_TONKey(t *testing.T) { t.Run("Generate new key and verify its components", func(t *testing.T) { // Generate a new key key, err := New() diff --git a/core/services/keystore/keys/tronkey/account_test.go b/core/services/keystore/keys/tronkey/account_test.go index 9a92801bb13..5bd344eb3d0 100644 --- a/core/services/keystore/keys/tronkey/account_test.go +++ b/core/services/keystore/keys/tronkey/account_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/require" ) -func Test_DecodeBase58(t *testing.T) { +func TestUnit_DecodeBase58(t *testing.T) { invalidAddresses := []string{ "TronEnergyioE1Z3ukeRv38sYkv5Jn55bL", "TronEnergyioNijNo8g3LF2ABKUAae6D2Z", @@ -33,7 +33,7 @@ func Test_DecodeBase58(t *testing.T) { } } -func TestAddress(t *testing.T) { +func TestUnit_Address(t *testing.T) { t.Run("Valid Addresses", func(t *testing.T) { validAddresses := []string{ "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", @@ -103,7 +103,7 @@ func TestAddress(t *testing.T) { }) } -func TestHexToAddress(t *testing.T) { +func TestUnit_HexToAddress(t *testing.T) { t.Run("Valid Hex Addresses", func(t *testing.T) { validHexAddresses := []string{ "41a614f803b6fd780986a42c78ec9c7f77e6ded13c", diff --git a/core/services/keystore/keys/tronkey/export_test.go b/core/services/keystore/keys/tronkey/export_test.go index 5e3e605ed34..d6b6ef3aa2f 100644 --- a/core/services/keystore/keys/tronkey/export_test.go +++ b/core/services/keystore/keys/tronkey/export_test.go @@ -6,7 +6,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" ) -func TestTronKeys_ExportImport(t *testing.T) { +func TestUnit_TronKeys_ExportImport(t *testing.T) { keys.RunKeyExportImportTestcase(t, createKey, decryptKey) } diff --git a/core/services/keystore/keys/tronkey/key_test.go b/core/services/keystore/keys/tronkey/key_test.go index 9ec74946f90..7f900ea6452 100644 --- a/core/services/keystore/keys/tronkey/key_test.go +++ b/core/services/keystore/keys/tronkey/key_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestTronKeyNewKeyGeneration(t *testing.T) { +func TestUnit_TronKeyNewKeyGeneration(t *testing.T) { t.Run("Generate new key and verify its components", func(t *testing.T) { // Generate a new key key, err := New() @@ -32,7 +32,7 @@ func TestTronKeyNewKeyGeneration(t *testing.T) { }) } -func TestKeyAddress(t *testing.T) { +func TestUnit_KeyAddress(t *testing.T) { t.Run("Known private key and expected address", func(t *testing.T) { // Tests cases from https://developers.tron.network/docs/account privateKeyHex := "b406adb115b43e103c7b1dc8b5931f63279a5b6b2cf7328638814c43171a2908" diff --git a/core/services/keystore/keys/vrfkey/crypto_test.go b/core/services/keystore/keys/vrfkey/crypto_test.go index c81553c99ff..5d153dec96c 100644 --- a/core/services/keystore/keys/vrfkey/crypto_test.go +++ b/core/services/keystore/keys/vrfkey/crypto_test.go @@ -9,21 +9,21 @@ import ( bm "github.com/smartcontractkit/chainlink/v2/core/utils/big_math" ) -func TestVRF_IsSquare(t *testing.T) { +func TestUnit_VRF_IsSquare(t *testing.T) { assert.True(t, IsSquare(bm.Four)) minusOneModP := bm.I().Sub(FieldSize, bm.One) assert.False(t, IsSquare(minusOneModP)) } -func TestVRF_SquareRoot(t *testing.T) { +func TestUnit_VRF_SquareRoot(t *testing.T) { assert.Equal(t, bm.Two, SquareRoot(bm.Four)) } -func TestVRF_YSquared(t *testing.T) { +func TestUnit_VRF_YSquared(t *testing.T) { assert.Equal(t, bm.Add(bm.Mul(bm.Two, bm.Mul(bm.Two, bm.Two)), bm.Seven), YSquared(bm.Two)) // 2³+7 } -func TestVRF_IsCurveXOrdinate(t *testing.T) { +func TestUnit_VRF_IsCurveXOrdinate(t *testing.T) { assert.True(t, IsCurveXOrdinate(big.NewInt(1))) assert.False(t, IsCurveXOrdinate(big.NewInt(5))) } diff --git a/core/services/keystore/keys/vrfkey/export_test.go b/core/services/keystore/keys/vrfkey/export_test.go index c262853c584..3f92ce7d48a 100644 --- a/core/services/keystore/keys/vrfkey/export_test.go +++ b/core/services/keystore/keys/vrfkey/export_test.go @@ -6,7 +6,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" ) -func TestVRFKeys_ExportImport(t *testing.T) { +func TestUnit_VRFKeys_ExportImport(t *testing.T) { keys.RunKeyExportImportTestcase(t, createKey, decryptKey) } diff --git a/core/services/keystore/keys/vrfkey/key_v2_test.go b/core/services/keystore/keys/vrfkey/key_v2_test.go index 82754444f9d..2b2ef4135b5 100644 --- a/core/services/keystore/keys/vrfkey/key_v2_test.go +++ b/core/services/keystore/keys/vrfkey/key_v2_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" ) -func TestVRFKeys_KeyV2(t *testing.T) { +func TestUnit_VRFKeys_KeyV2(t *testing.T) { k, err := NewV2() require.NoError(t, err) diff --git a/core/services/keystore/keys/vrfkey/models_test.go b/core/services/keystore/keys/vrfkey/models_test.go index e603e6aadae..1d2ffb12a8f 100644 --- a/core/services/keystore/keys/vrfkey/models_test.go +++ b/core/services/keystore/keys/vrfkey/models_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestVRFKeys_Models(t *testing.T) { +func TestUnit_VRFKeys_Models(t *testing.T) { kv2, err := NewV2() require.NoError(t, err) k := EncryptedVRFKey{ diff --git a/core/services/keystore/keys/vrfkey/proof_test.go b/core/services/keystore/keys/vrfkey/proof_test.go index 0a6af4b088a..9189bbd805e 100644 --- a/core/services/keystore/keys/vrfkey/proof_test.go +++ b/core/services/keystore/keys/vrfkey/proof_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestVRF_VerifyProof(t *testing.T) { +func TestUnit_VRF_VerifyProof(t *testing.T) { sk, err := NewV2() require.NoError(t, err) seed, nonce := big.NewInt(2), big.NewInt(3) diff --git a/core/services/keystore/keys/workflowkey/key_test.go b/core/services/keystore/keys/workflowkey/key_test.go index 61789b97685..4c6969f975b 100644 --- a/core/services/keystore/keys/workflowkey/key_test.go +++ b/core/services/keystore/keys/workflowkey/key_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" ) -func TestNew(t *testing.T) { +func TestUnit_New(t *testing.T) { key, err := New() require.NoError(t, err) @@ -21,14 +21,14 @@ func TestNew(t *testing.T) { assert.NotNil(t, key.raw) } -func TestPublicKey(t *testing.T) { +func TestUnit_PublicKey(t *testing.T) { key, err := New() require.NoError(t, err) assert.Equal(t, *key.publicKey, key.PublicKey()) } -func TestEncryptKeyFromRawPrivateKey(t *testing.T) { +func TestUnit_EncryptKeyFromRawPrivateKey(t *testing.T) { boxPubKey, boxPrivKey, err := box.GenerateKey(cryptorand.Reader) require.NoError(t, err) @@ -45,7 +45,7 @@ func TestEncryptKeyFromRawPrivateKey(t *testing.T) { assert.Equal(t, hex.EncodeToString(byteBoxPubKey), key.PublicKeyString()) } -func TestPublicKeyStringAndID(t *testing.T) { +func TestUnit_PublicKeyStringAndID(t *testing.T) { key := "my-test-public-key" var pubkey [32]byte copy(pubkey[:], key) @@ -63,7 +63,7 @@ func TestPublicKeyStringAndID(t *testing.T) { assert.Equal(t, expected, k.ID()) } -func TestDecrypt(t *testing.T) { +func TestUnit_Decrypt(t *testing.T) { key, err := New() require.NoError(t, err) @@ -77,7 +77,7 @@ func TestDecrypt(t *testing.T) { assert.Equal(t, secret, plaintext) } -func TestMustNewXXXTestingOnly(t *testing.T) { +func TestUnit_MustNewXXXTestingOnly(t *testing.T) { tests := []struct { name string k *big.Int diff --git a/core/services/keystore/master_test.go b/core/services/keystore/master_test.go index 86d320f6eb3..41dc9a12ce3 100644 --- a/core/services/keystore/master_test.go +++ b/core/services/keystore/master_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" ) -func TestMasterKeystore_Unlock_Save(t *testing.T) { +func TestUnit_MasterKeystore_Unlock_Save(t *testing.T) { t.Parallel() db := pgtest.NewSqlxDB(t) diff --git a/core/services/keystore/models_test.go b/core/services/keystore/models_test.go index 658db7597da..f71f84bcf4c 100644 --- a/core/services/keystore/models_test.go +++ b/core/services/keystore/models_test.go @@ -24,7 +24,7 @@ import ( const password = "password" -func TestKeyRing_Encrypt_Decrypt(t *testing.T) { +func TestUnit_KeyRing_Encrypt_Decrypt(t *testing.T) { csa1, csa2 := csakey.MustNewV2XXXTestingOnly(big.NewInt(1)), csakey.MustNewV2XXXTestingOnly(big.NewInt(2)) eth1, eth2 := mustNewEthKey(t), mustNewEthKey(t) ocr := []ocrkey.KeyV2{ diff --git a/core/services/keystore/ocr2_test.go b/core/services/keystore/ocr2_test.go index 9cc96f3d24b..bc7c40bb80c 100644 --- a/core/services/keystore/ocr2_test.go +++ b/core/services/keystore/ocr2_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" ) -func Test_OCR2KeyStore_E2E(t *testing.T) { +func TestUnit_OCR2KeyStore_E2E(t *testing.T) { db := pgtest.NewSqlxDB(t) keyStore := keystore.ExposedNewMaster(t, db) require.NoError(t, keyStore.Unlock(testutils.Context(t), cltest.Password)) diff --git a/core/services/keystore/ocr_test.go b/core/services/keystore/ocr_test.go index f3ad841c8d0..f8f3fdfc32c 100644 --- a/core/services/keystore/ocr_test.go +++ b/core/services/keystore/ocr_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" ) -func Test_OCRKeyStore_E2E(t *testing.T) { +func TestUnit_OCRKeyStore_E2E(t *testing.T) { db := pgtest.NewSqlxDB(t) keyStore := keystore.ExposedNewMaster(t, db) require.NoError(t, keyStore.Unlock(testutils.Context(t), cltest.Password)) diff --git a/core/services/keystore/p2p_test.go b/core/services/keystore/p2p_test.go index 02745c5154d..b3efb1db7f4 100644 --- a/core/services/keystore/p2p_test.go +++ b/core/services/keystore/p2p_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) -func Test_P2PKeyStore_E2E(t *testing.T) { +func TestUnit_P2PKeyStore_E2E(t *testing.T) { db := pgtest.NewSqlxDB(t) keyStore := keystore.ExposedNewMaster(t, db) diff --git a/core/services/keystore/solana_test.go b/core/services/keystore/solana_test.go index 1a69cb692be..55d254183d7 100644 --- a/core/services/keystore/solana_test.go +++ b/core/services/keystore/solana_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/solkey" ) -func Test_SolanaKeyStore_E2E(t *testing.T) { +func TestUnit_SolanaKeyStore_E2E(t *testing.T) { db := pgtest.NewSqlxDB(t) keyStore := keystore.ExposedNewMaster(t, db) diff --git a/core/services/keystore/starknet_test.go b/core/services/keystore/starknet_test.go index 31d99f49c86..30b3d3b4996 100644 --- a/core/services/keystore/starknet_test.go +++ b/core/services/keystore/starknet_test.go @@ -19,7 +19,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/mocks" ) -func Test_StarkNetKeyStore_E2E(t *testing.T) { +func TestUnit_StarkNetKeyStore_E2E(t *testing.T) { db := pgtest.NewSqlxDB(t) keyStore := keystore.ExposedNewMaster(t, db) @@ -108,7 +108,7 @@ func Test_StarkNetKeyStore_E2E(t *testing.T) { }) } -func TestStarknetSigner(t *testing.T) { +func TestUnit_StarknetSigner(t *testing.T) { var ( starknetSenderAddr = "legit" ) diff --git a/core/services/keystore/sui_test.go b/core/services/keystore/sui_test.go index b5099ab37fc..c68b083bc24 100644 --- a/core/services/keystore/sui_test.go +++ b/core/services/keystore/sui_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/suikey" ) -func Test_SuiKeyStore_E2E(t *testing.T) { +func TestUnit_SuiKeyStore_E2E(t *testing.T) { db := pgtest.NewSqlxDB(t) keyStore := keystore.ExposedNewMaster(t, db) diff --git a/core/services/keystore/ton_test.go b/core/services/keystore/ton_test.go index 430b2010b4a..df37e038b34 100644 --- a/core/services/keystore/ton_test.go +++ b/core/services/keystore/ton_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tonkey" ) -func Test_TONKeyStore_E2E(t *testing.T) { +func TestUnit_TONKeyStore_E2E(t *testing.T) { db := pgtest.NewSqlxDB(t) keyStore := keystore.ExposedNewMaster(t, db) diff --git a/core/services/keystore/tron_test.go b/core/services/keystore/tron_test.go index e93f4860e52..27cd405ec0e 100644 --- a/core/services/keystore/tron_test.go +++ b/core/services/keystore/tron_test.go @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" ) -func Test_TronKeyStore_E2E(t *testing.T) { +func TestUnit_TronKeyStore_E2E(t *testing.T) { db := pgtest.NewSqlxDB(t) keyStore := keystore.ExposedNewMaster(t, db) diff --git a/core/services/keystore/vrf_test.go b/core/services/keystore/vrf_test.go index 3df9101492f..af97c34bf76 100644 --- a/core/services/keystore/vrf_test.go +++ b/core/services/keystore/vrf_test.go @@ -18,7 +18,7 @@ import ( "github.com/stretchr/testify/require" ) -func Test_VRFKeyStore_E2E(t *testing.T) { +func TestUnit_VRFKeyStore_E2E(t *testing.T) { db := pgtest.NewSqlxDB(t) keyStore := keystore.ExposedNewMaster(t, db) require.NoError(t, keyStore.Unlock(testutils.Context(t), cltest.Password)) diff --git a/core/services/keystore/workflow_test.go b/core/services/keystore/workflow_test.go index 6696818d90b..56c8ad925ff 100644 --- a/core/services/keystore/workflow_test.go +++ b/core/services/keystore/workflow_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" ) -func Test_EncryptionKeyStore_E2E(t *testing.T) { +func TestUnit_EncryptionKeyStore_E2E(t *testing.T) { db := pgtest.NewSqlxDB(t) keyStore := keystore.ExposedNewMaster(t, db) require.NoError(t, keyStore.Unlock(testutils.Context(t), cltest.Password)) diff --git a/core/services/llo/bm/dummy_transmitter_test.go b/core/services/llo/bm/dummy_transmitter_test.go index e6c59e2f9e9..3aac40b92e6 100644 --- a/core/services/llo/bm/dummy_transmitter_test.go +++ b/core/services/llo/bm/dummy_transmitter_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func Test_DummyTransmitter(t *testing.T) { +func TestUnit_DummyTransmitter(t *testing.T) { lggr, observedLogs := logger.TestLoggerObserved(t, zapcore.DebugLevel) tr := NewTransmitter(lggr, "dummy") diff --git a/core/services/llo/channeldefinitions/channel_definition_cache_factory_test.go b/core/services/llo/channeldefinitions/channel_definition_cache_factory_test.go index 024f2b1fff6..bbb5995b967 100644 --- a/core/services/llo/channeldefinitions/channel_definition_cache_factory_test.go +++ b/core/services/llo/channeldefinitions/channel_definition_cache_factory_test.go @@ -10,7 +10,7 @@ import ( lloconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/llo/config" ) -func Test_ChannelDefinitionCacheFactory(t *testing.T) { +func TestUnit_ChannelDefinitionCacheFactory(t *testing.T) { lggr := logger.TestLogger(t) cdcFactory := NewChannelDefinitionCacheFactory(lggr, nil, nil, nil) diff --git a/core/services/llo/channeldefinitions/onchain_channel_definition_cache_test.go b/core/services/llo/channeldefinitions/onchain_channel_definition_cache_test.go index 0cec6fd7cfa..6d956022e31 100644 --- a/core/services/llo/channeldefinitions/onchain_channel_definition_cache_test.go +++ b/core/services/llo/channeldefinitions/onchain_channel_definition_cache_test.go @@ -105,7 +105,7 @@ func makeDonIDTopic(donID uint32) []byte { return common.BigToHash(big.NewInt(int64(donID))).Bytes() } -func Test_ChannelDefinitionCache(t *testing.T) { +func TestUnit_ChannelDefinitionCache(t *testing.T) { donID := rand.Uint32() t.Run("Definitions", func(t *testing.T) { @@ -459,7 +459,7 @@ func Test_ChannelDefinitionCache(t *testing.T) { }) } -func Test_filterName(t *testing.T) { +func TestUnit_filterName(t *testing.T) { s := types.ChannelDefinitionCacheFilterName(common.Address{1, 2, 3}, 654) assert.Equal(t, "OCR3 LLO ChannelDefinitionCachePoller - 0x0102030000000000000000000000000000000000:654", s) } diff --git a/core/services/llo/cleanup_test.go b/core/services/llo/cleanup_test.go index f7ba8f50aa9..b1a1b3e86b5 100644 --- a/core/services/llo/cleanup_test.go +++ b/core/services/llo/cleanup_test.go @@ -53,7 +53,7 @@ func makeSampleTransmission(seqNr uint64, sURL string) *mercurytransmitter.Trans } } -func Test_Cleanup(t *testing.T) { +func TestUnit_Cleanup(t *testing.T) { ctx := testutils.Context(t) lp := &mockLogPoller{} @@ -121,7 +121,7 @@ func Test_Cleanup(t *testing.T) { }) } -func Test_StaleTransmissionReaper(t *testing.T) { +func TestUnit_StaleTransmissionReaper(t *testing.T) { ds := pgtest.NewSqlxDB(t) lggr := logger.TestLogger(t) tr := &transmissionReaper{ds: ds, lggr: lggr, maxAge: 24 * time.Hour} @@ -154,7 +154,7 @@ WHERE transmission_hash IN ( assert.Equal(t, int64(n-5), d) } -func Test_OrphanedTransmissionReaper(t *testing.T) { +func TestUnit_OrphanedTransmissionReaper(t *testing.T) { ds := pgtest.NewSqlxDB(t) lggr := logger.TestLogger(t) tr := &transmissionReaper{ds: ds, lggr: lggr, maxAge: 24 * time.Hour} diff --git a/core/services/llo/cre/report_codec_test.go b/core/services/llo/cre/report_codec_test.go index eb12d935fb5..6f6c18881b7 100644 --- a/core/services/llo/cre/report_codec_test.go +++ b/core/services/llo/cre/report_codec_test.go @@ -18,7 +18,7 @@ import ( "github.com/stretchr/testify/require" ) -func Test_ReportCodec(t *testing.T) { +func TestUnit_ReportCodec(t *testing.T) { t.Run("Encode: Without Opts SUCCESS", func(t *testing.T) { donID := uint32(1) c := NewReportCodecCapabilityTrigger(logger.Test(t), donID) diff --git a/core/services/llo/cre/transmitter_test.go b/core/services/llo/cre/transmitter_test.go index e11e840f54f..7547759cf39 100644 --- a/core/services/llo/cre/transmitter_test.go +++ b/core/services/llo/cre/transmitter_test.go @@ -22,7 +22,7 @@ const ( donID = 4 ) -func Test_Transmitter(t *testing.T) { +func TestUnit_Transmitter(t *testing.T) { digest := types.ConfigDigest{1, 2, 3} sigs := []types.AttributedOnchainSignature{ { diff --git a/core/services/llo/grpc/client_test.go b/core/services/llo/grpc/client_test.go index 6374c13abac..b6e1d36c182 100644 --- a/core/services/llo/grpc/client_test.go +++ b/core/services/llo/grpc/client_test.go @@ -19,7 +19,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func Test_Client(t *testing.T) { +func TestUnit_Client(t *testing.T) { clientPrivKey := ed25519.NewKeyFromSeed(randomBytes(t, 32)) serverPrivKey := ed25519.NewKeyFromSeed(randomBytes(t, 32)) diff --git a/core/services/llo/keyring_test.go b/core/services/llo/keyring_test.go index 92ff8f361a5..500d102140a 100644 --- a/core/services/llo/keyring_test.go +++ b/core/services/llo/keyring_test.go @@ -62,7 +62,7 @@ func (m *mockKey) reset(format llotypes.ReportFormat) { m.verify = false } -func Test_Keyring(t *testing.T) { +func TestUnit_Keyring(t *testing.T) { lggr := logger.TestLogger(t) ks := map[llotypes.ReportFormat]Key{ diff --git a/core/services/llo/mercurytransmitter/orm_test.go b/core/services/llo/mercurytransmitter/orm_test.go index f36b32d3af6..a343ea74382 100644 --- a/core/services/llo/mercurytransmitter/orm_test.go +++ b/core/services/llo/mercurytransmitter/orm_test.go @@ -17,7 +17,7 @@ var ( sURL3 = "wss://mercuryserver.example/foo" ) -func TestORM(t *testing.T) { +func TestIntegration_Shared_ORM(t *testing.T) { ctx := testutils.Context(t) db := pgtest.NewSqlxDB(t) diff --git a/core/services/llo/mercurytransmitter/persistence_manager_test.go b/core/services/llo/mercurytransmitter/persistence_manager_test.go index 8fecd30d3fa..e0bc0e8f7dc 100644 --- a/core/services/llo/mercurytransmitter/persistence_manager_test.go +++ b/core/services/llo/mercurytransmitter/persistence_manager_test.go @@ -26,7 +26,7 @@ func bootstrapPersistenceManager(t *testing.T, donID uint32, db *sqlx.DB, maxTra return NewPersistenceManager(lggr, orm, "wss://example.com/mercury", maxTransmitQueueSize, 5*time.Millisecond, 5*time.Millisecond, 30*24*time.Hour), observedLogs } -func TestPersistenceManager(t *testing.T) { +func TestIntegration_Shared_PersistenceManager(t *testing.T) { donID1 := uint32(1234) donID2 := uint32(2345) @@ -81,7 +81,7 @@ func TestPersistenceManager(t *testing.T) { }) } -func TestPersistenceManagerAsyncDelete(t *testing.T) { +func TestUnit_PersistenceManagerAsyncDelete(t *testing.T) { ctx := testutils.Context(t) donID := uint32(1234) db := pgtest.NewSqlxDB(t) @@ -105,7 +105,7 @@ func TestPersistenceManagerAsyncDelete(t *testing.T) { assert.ElementsMatch(t, transmissions[1:], result) } -func TestPersistenceManagerPrune(t *testing.T) { +func TestUnit_PersistenceManagerPrune(t *testing.T) { donID1 := uint32(123456) donID2 := uint32(654321) db := pgtest.NewSqlxDB(t) @@ -155,7 +155,7 @@ func TestPersistenceManagerPrune(t *testing.T) { }) } -func Test_PersistenceManager_deleteTransmissions(t *testing.T) { +func TestUnit_PersistenceManager_deleteTransmissions(t *testing.T) { donID1 := uint32(123456) db := pgtest.NewSqlxDB(t) diff --git a/core/services/llo/mercurytransmitter/queue_test.go b/core/services/llo/mercurytransmitter/queue_test.go index 1df1bed4421..9f7174b77ad 100644 --- a/core/services/llo/mercurytransmitter/queue_test.go +++ b/core/services/llo/mercurytransmitter/queue_test.go @@ -27,7 +27,7 @@ func (m *mockAsyncDeleter) DonID() uint32 { return m.donID } -func Test_Queue(t *testing.T) { +func TestUnit_Queue(t *testing.T) { t.Parallel() const maxSize = 7 diff --git a/core/services/llo/mercurytransmitter/transmitter_test.go b/core/services/llo/mercurytransmitter/transmitter_test.go index e73c183d626..2360aa6baf2 100644 --- a/core/services/llo/mercurytransmitter/transmitter_test.go +++ b/core/services/llo/mercurytransmitter/transmitter_test.go @@ -60,7 +60,7 @@ func (m *MockGRPCClient) Transmit(ctx context.Context, in *rpc.TransmitRequest) } func (m *MockGRPCClient) ServerURL() string { return "mock server url" } -func Test_Transmitter_Transmit(t *testing.T) { +func TestUnit_Transmitter_Transmit(t *testing.T) { lggr := logger.TestLogger(t) db := pgtest.NewSqlxDB(t) donID := uint32(123456) @@ -184,7 +184,7 @@ func (m *mockQ) Push(t *Transmission) (ok bool) { func (m *mockQ) Init(transmissions []*Transmission) error { return nil } func (m *mockQ) IsEmpty() bool { return false } -func Test_Transmitter_runQueueLoop(t *testing.T) { +func TestUnit_Transmitter_runQueueLoop(t *testing.T) { donIDStr := "555" lggr := logger.TestLogger(t) c := &MockGRPCClient{} diff --git a/core/services/llo/observation/cache_test.go b/core/services/llo/observation/cache_test.go index f4ec3da6dc9..b1cbc03444e 100644 --- a/core/services/llo/observation/cache_test.go +++ b/core/services/llo/observation/cache_test.go @@ -47,7 +47,7 @@ func (m *mockStreamValue) Type() llo.LLOStreamValue_Type { return llo.LLOStreamValue_TimestampedStreamValue } -func TestNewCache(t *testing.T) { +func TestUnit_NewCache(t *testing.T) { tests := []struct { name string cleanupInterval time.Duration @@ -76,7 +76,7 @@ func TestNewCache(t *testing.T) { } } -func TestCache_Add_Get(t *testing.T) { +func TestUnit_Cache_Add_Get(t *testing.T) { tests := []struct { name string streamID llotypes.StreamID @@ -128,7 +128,7 @@ func TestCache_Add_Get(t *testing.T) { } } -func TestCache_Cleanup(t *testing.T) { +func TestUnit_Cache_Cleanup(t *testing.T) { cache := NewCache(time.Millisecond) streamID := llotypes.StreamID(1) value := &mockStreamValue{value: []byte{42}} @@ -140,7 +140,7 @@ func TestCache_Cleanup(t *testing.T) { assert.Nil(t, gotValue) } -func TestCache_ConcurrentAccess(t *testing.T) { +func TestUnit_Cache_ConcurrentAccess(t *testing.T) { cache := NewCache(0) const numGoroutines = 10 const numOperations = uint32(1000) @@ -170,7 +170,7 @@ func TestCache_ConcurrentAccess(t *testing.T) { } } -func TestCache_ConcurrentReadWrite(t *testing.T) { +func TestUnit_Cache_ConcurrentReadWrite(t *testing.T) { cache := NewCache(0) const numGoroutines = 10 const numOperations = uint32(1000) @@ -203,7 +203,7 @@ func TestCache_ConcurrentReadWrite(t *testing.T) { wg.Wait() } -func TestCache_ConcurrentAddGet(t *testing.T) { +func TestUnit_Cache_ConcurrentAddGet(t *testing.T) { cache := NewCache(0) const numGoroutines = 10 const numOperations = uint32(1000) diff --git a/core/services/llo/observation/data_source_test.go b/core/services/llo/observation/data_source_test.go index 27bf1338b89..62cff1e10c7 100644 --- a/core/services/llo/observation/data_source_test.go +++ b/core/services/llo/observation/data_source_test.go @@ -174,7 +174,7 @@ func (m *mockTelemeter) CaptureObservationTelemetry() bool { var observationTimeout = 100 * time.Millisecond -func Test_DataSource(t *testing.T) { +func TestUnit_DataSource(t *testing.T) { lggr := logger.NullLogger mainCtx := testutils.Context(t) opts := &mockOpts{} diff --git a/core/services/llo/observation/observation_context_test.go b/core/services/llo/observation/observation_context_test.go index 6a0a0c5e017..280dd101baf 100644 --- a/core/services/llo/observation/observation_context_test.go +++ b/core/services/llo/observation/observation_context_test.go @@ -56,7 +56,7 @@ func makePipelineWithMultipleStreamResults(streamIDs []streams.StreamID, results } } -func TestObservationContext_Observe(t *testing.T) { +func TestUnit_ObservationContext_Observe(t *testing.T) { ctx := t.Context() r := &mockRegistry{} telem := &mockTelemeter{} @@ -141,7 +141,7 @@ func TestObservationContext_Observe(t *testing.T) { }) } -func TestObservationContext_Observe_concurrencyStressTest(t *testing.T) { +func TestUnit_ObservationContext_Observe_concurrencyStressTest(t *testing.T) { ctx := t.Context() r := &mockRegistry{} telem := &mockTelemeter{} @@ -216,7 +216,7 @@ func createBridge(t testing.TB, name string, val string, borm bridges.ORM, maxCa })) } -func TestObservationContext_Observe_integrationRealPipeline(t *testing.T) { +func TestIntegration_Shared_ObservationContext_Observe_integrationRealPipeline(t *testing.T) { ctx := t.Context() lggr := logger.TestLogger(t) db := pgtest.NewSqlxDB(t) diff --git a/core/services/llo/orm_test.go b/core/services/llo/orm_test.go index 3051c0f93b0..291764b2529 100644 --- a/core/services/llo/orm_test.go +++ b/core/services/llo/orm_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/llo/types" ) -func Test_ORM(t *testing.T) { +func TestUnit_ORM(t *testing.T) { const ETHMainnetChainSelector uint64 = 5009297550715157269 const OtherChainSelector uint64 = 1234567890 diff --git a/core/services/llo/report_codecs_test.go b/core/services/llo/report_codecs_test.go index ad7d732f7cc..b7e6a77f650 100644 --- a/core/services/llo/report_codecs_test.go +++ b/core/services/llo/report_codecs_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func Test_NewReportCodecs(t *testing.T) { +func TestUnit_NewReportCodecs(t *testing.T) { c := NewReportCodecs(logger.TestLogger(t), 1) assert.Contains(t, c, llotypes.ReportFormatJSON, "expected JSON to be supported") diff --git a/core/services/llo/retirement/plugin_scoped_retirement_report_cache_test.go b/core/services/llo/retirement/plugin_scoped_retirement_report_cache_test.go index c56d1bd9b21..7fee4776dd6 100644 --- a/core/services/llo/retirement/plugin_scoped_retirement_report_cache_test.go +++ b/core/services/llo/retirement/plugin_scoped_retirement_report_cache_test.go @@ -68,7 +68,7 @@ func (m *mockCodec) Decode(b []byte) (datastreamsllo.RetirementReport, error) { return m.decode(b) } -func Test_PluginScopedRetirementReportCache(t *testing.T) { +func TestUnit_PluginScopedRetirementReportCache(t *testing.T) { rrc := &mockRetirementReportCache{} v := &mockVerifier{} c := &mockCodec{} diff --git a/core/services/llo/retirement/retirement_report_cache_test.go b/core/services/llo/retirement/retirement_report_cache_test.go index 9d2a158e285..87f059d9c2c 100644 --- a/core/services/llo/retirement/retirement_report_cache_test.go +++ b/core/services/llo/retirement/retirement_report_cache_test.go @@ -39,7 +39,7 @@ func (m *mockORM) LoadConfigs(ctx context.Context) ([]Config, error) { return configs, m.err } -func Test_RetirementReportCache(t *testing.T) { +func TestIntegration_Shared_RetirementReportCache(t *testing.T) { t.Parallel() ctx := t.Context() diff --git a/core/services/llo/retirement/retirement_report_orm_test.go b/core/services/llo/retirement/retirement_report_orm_test.go index 943233587e6..a7e84a657a7 100644 --- a/core/services/llo/retirement/retirement_report_orm_test.go +++ b/core/services/llo/retirement/retirement_report_orm_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" ) -func Test_RetirementReportCache_ORM(t *testing.T) { +func TestIntegration_Shared_RetirementReportCache_ORM(t *testing.T) { db := pgtest.NewSqlxDB(t) orm := &retirementReportCacheORM{db} ctx := t.Context() diff --git a/core/services/llo/telem/sampling_test.go b/core/services/llo/telem/sampling_test.go index 804a87dda2c..6bc123dc6c0 100644 --- a/core/services/llo/telem/sampling_test.go +++ b/core/services/llo/telem/sampling_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/synchronization" ) -func TestFingerprint(t *testing.T) { +func TestUnit_Fingerprint(t *testing.T) { t.Parallel() ot := time.Now() @@ -111,7 +111,7 @@ func TestFingerprint(t *testing.T) { } // TestSample ensures Sample() correctly chooses which messages to send. -func TestSample(t *testing.T) { +func TestUnit_Sample(t *testing.T) { t.Parallel() lggr := logger.TestSugared(t) @@ -141,7 +141,7 @@ func TestSample(t *testing.T) { } // TestPruningLoop ensures the pruning loop works as expected. -func TestPruningLoop(t *testing.T) { +func TestUnit_PruningLoop(t *testing.T) { t.Parallel() lggr := logger.TestSugared(t) @@ -191,7 +191,7 @@ func TestPruningLoop(t *testing.T) { } // TestPruningLoop_Exits ensures the pruning loop exits when its context is cancelled and doesn't leak goroutines. -func TestPruningLoop_Exits(t *testing.T) { +func TestUnit_PruningLoop_Exits(t *testing.T) { t.Parallel() lggr := logger.TestSugared(t) diff --git a/core/services/llo/telem/telemetry_test.go b/core/services/llo/telem/telemetry_test.go index 836b7cc2dd2..694b2cb45d9 100644 --- a/core/services/llo/telem/telemetry_test.go +++ b/core/services/llo/telem/telemetry_test.go @@ -139,7 +139,7 @@ var trrs = pipeline.TaskRunResults{ }, } -func Test_Telemeter_v3PremiumLegacy(t *testing.T) { +func TestUnit_Telemeter_v3PremiumLegacy(t *testing.T) { lggr := logger.TestLogger(t) m := &mockMonitoringEndpoint{} @@ -269,7 +269,7 @@ func Test_Telemeter_v3PremiumLegacy(t *testing.T) { }) } -func Test_Telemeter_observationScopedTelemetry(t *testing.T) { +func TestUnit_Telemeter_observationScopedTelemetry(t *testing.T) { t.Parallel() lggr := logger.TestLogger(t) @@ -404,7 +404,7 @@ func Test_Telemeter_observationScopedTelemetry(t *testing.T) { }) } -func Test_Telemeter_outcomeTelemetry(t *testing.T) { +func TestUnit_Telemeter_outcomeTelemetry(t *testing.T) { t.Parallel() lggr := logger.TestLogger(t) @@ -531,7 +531,7 @@ func Test_Telemeter_outcomeTelemetry(t *testing.T) { }) } -func Test_Telemeter_reportTelemetry(t *testing.T) { +func TestUnit_Telemeter_reportTelemetry(t *testing.T) { t.Parallel() lggr := logger.TestLogger(t) diff --git a/core/services/nodestatusreporter/bridgestatus/bridge_status_reporter_test.go b/core/services/nodestatusreporter/bridgestatus/bridge_status_reporter_test.go index e330f7b3aa3..bd99a4e2e41 100644 --- a/core/services/nodestatusreporter/bridgestatus/bridge_status_reporter_test.go +++ b/core/services/nodestatusreporter/bridgestatus/bridge_status_reporter_test.go @@ -123,7 +123,7 @@ func setupTestServiceWithIgnoreFlags(t *testing.T, enabled bool, pollingInterval return service, bridgeORM, jobORM, emitter } -func TestNewBridgeStatusReporter(t *testing.T) { +func TestUnit_NewBridgeStatusReporter(t *testing.T) { httpClient := &http.Client{} service, _, _, _ := setupTestService(t, true, testPollingInterval, httpClient) @@ -131,7 +131,7 @@ func TestNewBridgeStatusReporter(t *testing.T) { assert.Equal(t, ServiceName, service.Name()) } -func TestService_Start_Disabled(t *testing.T) { +func TestUnit_Service_Start_Disabled(t *testing.T) { httpClient := &http.Client{} service, _, _, _ := setupTestService(t, false, testPollingInterval, httpClient) @@ -143,7 +143,7 @@ func TestService_Start_Disabled(t *testing.T) { require.NoError(t, err) } -func TestService_Start_Enabled(t *testing.T) { +func TestUnit_Service_Start_Enabled(t *testing.T) { httpClient := &http.Client{} service, bridgeORM, jobORM, emitter := setupTestService(t, true, 100*time.Millisecond, httpClient) @@ -160,7 +160,7 @@ func TestService_Start_Enabled(t *testing.T) { require.NoError(t, err) } -func TestService_HealthReport(t *testing.T) { +func TestUnit_Service_HealthReport(t *testing.T) { httpClient := &http.Client{} service, _, _, _ := setupTestService(t, true, testPollingInterval, httpClient) @@ -168,7 +168,7 @@ func TestService_HealthReport(t *testing.T) { assert.Contains(t, health, service.Name()) } -func TestService_pollAllBridges_NoBridges(t *testing.T) { +func TestUnit_Service_pollAllBridges_NoBridges(t *testing.T) { httpClient := &http.Client{} service, bridgeORM, _, _ := setupTestService(t, true, testPollingInterval, httpClient) @@ -184,7 +184,7 @@ func TestService_pollAllBridges_NoBridges(t *testing.T) { bridgeORM.AssertExpectations(t) } -func TestService_pollAllBridges_WithBridges(t *testing.T) { +func TestUnit_Service_pollAllBridges_WithBridges(t *testing.T) { httpClient := mocks.NewMockHTTPClient(loadFixture(t, "bridge_status_response.json"), http.StatusOK) service, bridgeORM, jobORM, emitter := setupTestService(t, true, testPollingInterval, httpClient) @@ -203,7 +203,7 @@ func TestService_pollAllBridges_WithBridges(t *testing.T) { emitter.AssertExpectations(t) } -func TestService_pollAllBridges_FetchError(t *testing.T) { +func TestUnit_Service_pollAllBridges_FetchError(t *testing.T) { httpClient := &http.Client{} service, bridgeORM, _, _ := setupTestService(t, true, testPollingInterval, httpClient) @@ -219,7 +219,7 @@ func TestService_pollAllBridges_FetchError(t *testing.T) { bridgeORM.AssertExpectations(t) } -func TestService_pollBridge_Success(t *testing.T) { +func TestUnit_Service_pollBridge_Success(t *testing.T) { httpClient := mocks.NewMockHTTPClient(loadFixture(t, "bridge_status_response.json"), http.StatusOK) service, _, jobORM, emitter := setupTestService(t, true, testPollingInterval, httpClient) @@ -235,7 +235,7 @@ func TestService_pollBridge_Success(t *testing.T) { emitter.AssertExpectations(t) } -func TestService_pollBridge_HTTPError(t *testing.T) { +func TestUnit_Service_pollBridge_HTTPError(t *testing.T) { httpClient := &http.Client{} service, _, jobORM, emitter := setupTestService(t, true, testPollingInterval, httpClient) @@ -254,7 +254,7 @@ func TestService_pollBridge_HTTPError(t *testing.T) { jobORM.AssertExpectations(t) } -func TestService_pollBridge_InvalidJSON(t *testing.T) { +func TestUnit_Service_pollBridge_InvalidJSON(t *testing.T) { httpClient := mocks.NewMockHTTPClient("invalid json", http.StatusOK) service, _, jobORM, emitter := setupTestService(t, true, testPollingInterval, httpClient) @@ -272,7 +272,7 @@ func TestService_pollBridge_InvalidJSON(t *testing.T) { jobORM.AssertExpectations(t) } -func TestService_pollBridge_InvalidURL(t *testing.T) { +func TestUnit_Service_pollBridge_InvalidURL(t *testing.T) { httpClient := &http.Client{} service, _, jobORM, emitter := setupTestService(t, true, testPollingInterval, httpClient) @@ -291,7 +291,7 @@ func TestService_pollBridge_InvalidURL(t *testing.T) { jobORM.AssertExpectations(t) } -func TestService_pollBridge_EmptyURL(t *testing.T) { +func TestUnit_Service_pollBridge_EmptyURL(t *testing.T) { httpClient := &http.Client{} service, _, jobORM, emitter := setupTestService(t, true, testPollingInterval, httpClient) @@ -310,7 +310,7 @@ func TestService_pollBridge_EmptyURL(t *testing.T) { jobORM.AssertExpectations(t) } -func TestService_pollBridge_URLPathPreservation(t *testing.T) { +func TestUnit_Service_pollBridge_URLPathPreservation(t *testing.T) { // Create mock that expects the exact URL with preserved path + status httpClient := mocks.NewMockHTTPClientWithExpectedURL( loadFixture(t, "bridge_status_response.json"), @@ -332,7 +332,7 @@ func TestService_pollBridge_URLPathPreservation(t *testing.T) { emitter.AssertExpectations(t) } -func TestService_pollBridge_Non200Status(t *testing.T) { +func TestUnit_Service_pollBridge_Non200Status(t *testing.T) { httpClient := mocks.NewMockHTTPClient("Not Found", http.StatusNotFound) service, _, jobORM, emitter := setupTestService(t, true, testPollingInterval, httpClient) @@ -350,7 +350,7 @@ func TestService_pollBridge_Non200Status(t *testing.T) { jobORM.AssertExpectations(t) } -func TestService_emitBridgeStatus_Success(t *testing.T) { +func TestUnit_Service_emitBridgeStatus_Success(t *testing.T) { httpClient := &http.Client{} service, _, _, emitter := setupTestService(t, true, testPollingInterval, httpClient) @@ -362,7 +362,7 @@ func TestService_emitBridgeStatus_Success(t *testing.T) { emitter.AssertExpectations(t) } -func TestService_pollAllBridges_RefreshError(t *testing.T) { +func TestUnit_Service_pollAllBridges_RefreshError(t *testing.T) { httpClient := &http.Client{} service, bridgeORM, _, _ := setupTestService(t, true, testPollingInterval, httpClient) @@ -379,7 +379,7 @@ func TestService_pollAllBridges_RefreshError(t *testing.T) { bridgeORM.AssertExpectations(t) } -func TestService_pollAllBridges_MultipleBridges(t *testing.T) { +func TestUnit_Service_pollAllBridges_MultipleBridges(t *testing.T) { httpClient := mocks.NewMockHTTPClient(loadFixture(t, "bridge_status_response.json"), http.StatusOK) service, bridgeORM, jobORM, emitter := setupTestService(t, true, testPollingInterval, httpClient) @@ -418,7 +418,7 @@ func TestService_pollAllBridges_MultipleBridges(t *testing.T) { emitter.AssertExpectations(t) } -func TestService_emitBridgeStatus_CaptureOutput(t *testing.T) { +func TestUnit_Service_emitBridgeStatus_CaptureOutput(t *testing.T) { emitter := mocks.NewBeholderEmitter() var capturedProtobufBytes []byte @@ -496,7 +496,7 @@ func TestService_emitBridgeStatus_CaptureOutput(t *testing.T) { emitter.AssertExpectations(t) } -func TestService_Start_AlreadyStarted(t *testing.T) { +func TestUnit_Service_Start_AlreadyStarted(t *testing.T) { httpClient := &http.Client{} service, bridgeORM, jobORM, emitter := setupTestService(t, true, testPollingInterval, httpClient) @@ -518,7 +518,7 @@ func TestService_Start_AlreadyStarted(t *testing.T) { require.NoError(t, err) } -func TestService_Close_AlreadyClosed(t *testing.T) { +func TestUnit_Service_Close_AlreadyClosed(t *testing.T) { httpClient := &http.Client{} service, bridgeORM, jobORM, emitter := setupTestService(t, true, testPollingInterval, httpClient) @@ -540,7 +540,7 @@ func TestService_Close_AlreadyClosed(t *testing.T) { require.Error(t, err) } -func TestService_PollAllBridges_3000Bridges(t *testing.T) { +func TestUnit_Service_PollAllBridges_3000Bridges(t *testing.T) { httpClient := mocks.NewMockHTTPClient(loadFixture(t, "bridge_status_response.json"), http.StatusOK) service, mockORM, jobORM, emitter := setupTestService(t, true, testPollingInterval, httpClient) @@ -584,7 +584,7 @@ func TestService_PollAllBridges_3000Bridges(t *testing.T) { emitter.AssertExpectations(t) } -func TestService_PollAllBridges_ContextTimeout(t *testing.T) { +func TestUnit_Service_PollAllBridges_ContextTimeout(t *testing.T) { httpClient := &http.Client{} service, mockORM, jobORM, _ := setupTestService(t, true, testPollingInterval, httpClient) @@ -624,7 +624,7 @@ func TestService_PollAllBridges_ContextTimeout(t *testing.T) { mockORM.AssertExpectations(t) } -func TestService_emitBridgeStatus_EmptyFields(t *testing.T) { +func TestUnit_Service_emitBridgeStatus_EmptyFields(t *testing.T) { emitter := mocks.NewBeholderEmitter() var capturedProtobufBytes []byte @@ -680,7 +680,7 @@ func TestService_emitBridgeStatus_EmptyFields(t *testing.T) { } // Test for external job IDs and job names functionality -func TestService_pollBridge_WithJobInfo(t *testing.T) { +func TestUnit_Service_pollBridge_WithJobInfo(t *testing.T) { httpClient := mocks.NewMockHTTPClient(loadFixture(t, "bridge_status_response.json"), http.StatusOK) service, _, jobORM, emitter := setupTestService(t, true, testPollingInterval, httpClient) @@ -729,7 +729,7 @@ func TestService_pollBridge_WithJobInfo(t *testing.T) { emitter.AssertExpectations(t) } -func TestService_pollBridge_JobORMError(t *testing.T) { +func TestUnit_Service_pollBridge_JobORMError(t *testing.T) { httpClient := mocks.NewMockHTTPClient(loadFixture(t, "bridge_status_response.json"), http.StatusOK) service, _, jobORM, emitter := setupTestService(t, true, testPollingInterval, httpClient) @@ -747,7 +747,7 @@ func TestService_pollBridge_JobORMError(t *testing.T) { } // Test ignoreJoblessBridges functionality -func TestService_pollBridge_IgnoreJoblessBridges_Enabled(t *testing.T) { +func TestUnit_Service_pollBridge_IgnoreJoblessBridges_Enabled(t *testing.T) { // Use a nil httpClient since no HTTP request should be made when bridge is skipped for having no jobs httpClient := &http.Client{} service, _, jobORM, emitter := setupTestServiceWithIgnoreFlags(t, true, testPollingInterval, httpClient, true, true) @@ -765,7 +765,7 @@ func TestService_pollBridge_IgnoreJoblessBridges_Enabled(t *testing.T) { emitter.AssertExpectations(t) } -func TestService_pollBridge_IgnoreJoblessBridges_Disabled(t *testing.T) { +func TestUnit_Service_pollBridge_IgnoreJoblessBridges_Disabled(t *testing.T) { // Use valid HTTP client with successful response since we want the full flow when ignoreJoblessBridges is false httpClient := mocks.NewMockHTTPClient(loadFixture(t, "bridge_status_response.json"), http.StatusOK) service, _, jobORM, emitter := setupTestServiceWithIgnoreFlags(t, true, testPollingInterval, httpClient, true, false) @@ -784,7 +784,7 @@ func TestService_pollBridge_IgnoreJoblessBridges_Disabled(t *testing.T) { } // Test ignoreInvalidBridges functionality - HTTP error -func TestService_pollBridge_IgnoreInvalidBridges_HTTPError_Enabled(t *testing.T) { +func TestUnit_Service_pollBridge_IgnoreInvalidBridges_HTTPError_Enabled(t *testing.T) { httpClient := &http.Client{} service, _, jobORM, emitter := setupTestServiceWithIgnoreFlags(t, true, testPollingInterval, httpClient, true, false) @@ -806,7 +806,7 @@ func TestService_pollBridge_IgnoreInvalidBridges_HTTPError_Enabled(t *testing.T) emitter.AssertExpectations(t) } -func TestService_pollBridge_IgnoreInvalidBridges_HTTPError_Disabled(t *testing.T) { +func TestUnit_Service_pollBridge_IgnoreInvalidBridges_HTTPError_Disabled(t *testing.T) { httpClient := &http.Client{} service, _, jobORM, emitter := setupTestServiceWithIgnoreFlags(t, true, testPollingInterval, httpClient, false, false) @@ -828,7 +828,7 @@ func TestService_pollBridge_IgnoreInvalidBridges_HTTPError_Disabled(t *testing.T } // Test ignoreInvalidBridges functionality - Non-200 status -func TestService_pollBridge_IgnoreInvalidBridges_Non200Status_Enabled(t *testing.T) { +func TestUnit_Service_pollBridge_IgnoreInvalidBridges_Non200Status_Enabled(t *testing.T) { httpClient := mocks.NewMockHTTPClient("Not Found", http.StatusNotFound) service, _, jobORM, emitter := setupTestServiceWithIgnoreFlags(t, true, testPollingInterval, httpClient, true, false) @@ -850,7 +850,7 @@ func TestService_pollBridge_IgnoreInvalidBridges_Non200Status_Enabled(t *testing emitter.AssertExpectations(t) } -func TestService_pollBridge_IgnoreInvalidBridges_Non200Status_Disabled(t *testing.T) { +func TestUnit_Service_pollBridge_IgnoreInvalidBridges_Non200Status_Disabled(t *testing.T) { httpClient := mocks.NewMockHTTPClient("Not Found", http.StatusNotFound) service, _, jobORM, emitter := setupTestServiceWithIgnoreFlags(t, true, testPollingInterval, httpClient, false, false) @@ -872,7 +872,7 @@ func TestService_pollBridge_IgnoreInvalidBridges_Non200Status_Disabled(t *testin } // Test ignoreInvalidBridges functionality - Invalid JSON -func TestService_pollBridge_IgnoreInvalidBridges_InvalidJSON_Enabled(t *testing.T) { +func TestUnit_Service_pollBridge_IgnoreInvalidBridges_InvalidJSON_Enabled(t *testing.T) { httpClient := mocks.NewMockHTTPClient("invalid json", http.StatusOK) service, _, jobORM, emitter := setupTestServiceWithIgnoreFlags(t, true, testPollingInterval, httpClient, true, false) @@ -894,7 +894,7 @@ func TestService_pollBridge_IgnoreInvalidBridges_InvalidJSON_Enabled(t *testing. emitter.AssertExpectations(t) } -func TestService_pollBridge_IgnoreInvalidBridges_InvalidJSON_Disabled(t *testing.T) { +func TestUnit_Service_pollBridge_IgnoreInvalidBridges_InvalidJSON_Disabled(t *testing.T) { httpClient := mocks.NewMockHTTPClient("invalid json", http.StatusOK) service, _, jobORM, emitter := setupTestServiceWithIgnoreFlags(t, true, testPollingInterval, httpClient, false, false) @@ -916,7 +916,7 @@ func TestService_pollBridge_IgnoreInvalidBridges_InvalidJSON_Disabled(t *testing } // Test combined functionality -func TestService_pollBridge_BothIgnoreFlags_Enabled(t *testing.T) { +func TestUnit_Service_pollBridge_BothIgnoreFlags_Enabled(t *testing.T) { httpClient := &http.Client{} service, _, jobORM, emitter := setupTestServiceWithIgnoreFlags(t, true, testPollingInterval, httpClient, true, true) @@ -934,7 +934,7 @@ func TestService_pollBridge_BothIgnoreFlags_Enabled(t *testing.T) { emitter.AssertExpectations(t) } -func TestService_pollBridge_BothIgnoreFlags_Disabled(t *testing.T) { +func TestUnit_Service_pollBridge_BothIgnoreFlags_Disabled(t *testing.T) { httpClient := &http.Client{} service, _, jobORM, emitter := setupTestServiceWithIgnoreFlags(t, true, testPollingInterval, httpClient, false, false) @@ -952,7 +952,7 @@ func TestService_pollBridge_BothIgnoreFlags_Disabled(t *testing.T) { } // TestService_pollBridge_EndToEnd_RealWebServer tests the complete flow with a real HTTP server -func TestService_pollBridge_EndToEnd_RealWebServer(t *testing.T) { +func TestUnit_Service_pollBridge_EndToEnd_RealWebServer(t *testing.T) { // Create a test HTTP server that serves fixture data fixtureData := loadFixture(t, "bridge_status_response.json") server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { diff --git a/core/services/nurse_test.go b/core/services/nurse_test.go index fe16e651982..51cf4095045 100644 --- a/core/services/nurse_test.go +++ b/core/services/nurse_test.go @@ -97,7 +97,7 @@ func (c mockConfig) GoroutineThreshold() int { return c.goroutineThreshold } -func TestNurse(t *testing.T) { +func TestUnit_Nurse(t *testing.T) { l := logger.TestLogger(t) nrse := NewNurse(newMockConfig(t), l) nrse.AddCheck("test", func() (bool, Meta) { return true, Meta{} }) diff --git a/core/services/ocr/config_overrider_test.go b/core/services/ocr/config_overrider_test.go index af0b7d5b44d..6010947697b 100644 --- a/core/services/ocr/config_overrider_test.go +++ b/core/services/ocr/config_overrider_test.go @@ -84,7 +84,7 @@ func TestIntegration_OCRConfigOverrider_EntersHibernation(t *testing.T) { g.Eventually(func() *ocrtypes.ConfigOverride { return uni.overrider.ConfigOverride() }, 10*time.Second, 450*time.Millisecond).Should(gomega.Equal(expectedOverride)) } -func Test_OCRConfigOverrider(t *testing.T) { +func TestIntegration_Shared_OCRConfigOverrider(t *testing.T) { t.Parallel() t.Run("Before first tick returns nil override, later does return a specific override when hibernating", func(t *testing.T) { diff --git a/core/services/ocr/contract_tracker_test.go b/core/services/ocr/contract_tracker_test.go index 45731290282..5f24e981163 100644 --- a/core/services/ocr/contract_tracker_test.go +++ b/core/services/ocr/contract_tracker_test.go @@ -100,7 +100,7 @@ func newContractTrackerUni(t *testing.T, opts ...any) (uni contractTrackerUni) { return uni } -func Test_OCRContractTracker_LatestBlockHeight(t *testing.T) { +func TestIntegration_Shared_OCRContractTracker_LatestBlockHeight(t *testing.T) { t.Parallel() t.Run("before first head incoming, looks up on-chain", func(t *testing.T) { @@ -153,7 +153,7 @@ func Test_OCRContractTracker_LatestBlockHeight(t *testing.T) { }) } -func Test_OCRContractTracker_HandleLog_OCRContractLatestRoundRequested(t *testing.T) { +func TestIntegration_Shared_OCRContractTracker_HandleLog_OCRContractLatestRoundRequested(t *testing.T) { t.Parallel() fixtureLogAddress := gethCommon.HexToAddress("0x03bd0d5d39629423979f8a0e53dbce78c1791ebf") @@ -345,7 +345,7 @@ func Test_OCRContractTracker_HandleLog_OCRContractLatestRoundRequested(t *testin }) } -func Test_OCRContractTracker_IsLaterThan(t *testing.T) { +func TestIntegration_Shared_OCRContractTracker_IsLaterThan(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/services/ocr/contract_transmitter_test.go b/core/services/ocr/contract_transmitter_test.go index fcf0060aa8a..5084c9f0ba0 100644 --- a/core/services/ocr/contract_transmitter_test.go +++ b/core/services/ocr/contract_transmitter_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr" ) -func Test_ContractTransmitter_ChainID(t *testing.T) { +func TestUnit_ContractTransmitter_ChainID(t *testing.T) { chainID := big.NewInt(42) contractABI, err := abi.JSON(strings.NewReader(offchainaggregator.OffchainAggregatorABI)) require.NoError(t, err) diff --git a/core/services/ocr/database_test.go b/core/services/ocr/database_test.go index 5e7641137d5..c03893c8a32 100644 --- a/core/services/ocr/database_test.go +++ b/core/services/ocr/database_test.go @@ -20,7 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr" ) -func Test_DB_ReadWriteState(t *testing.T) { +func TestIntegration_Shared_DB_ReadWriteState(t *testing.T) { db := pgtest.NewSqlxDB(t) configDigest := cltest.MakeConfigDigest(t) @@ -101,7 +101,7 @@ func Test_DB_ReadWriteState(t *testing.T) { }) } -func Test_DB_ReadWriteConfig(t *testing.T) { +func TestIntegration_Shared_DB_ReadWriteConfig(t *testing.T) { db := pgtest.NewSqlxDB(t) sqlDB := db @@ -182,7 +182,7 @@ func assertPendingTransmissionEqual(t *testing.T, pt1, pt2 ocrtypes.PendingTrans } } -func Test_DB_PendingTransmissions(t *testing.T) { +func TestIntegration_Shared_DB_PendingTransmissions(t *testing.T) { db := pgtest.NewSqlxDB(t) sqlDB := db ethKeyStore := cltest.NewKeyStore(t, db).Eth() @@ -386,7 +386,7 @@ func Test_DB_PendingTransmissions(t *testing.T) { }) } -func Test_DB_LatestRoundRequested(t *testing.T) { +func TestUnit_DB_LatestRoundRequested(t *testing.T) { db := pgtest.NewSqlxDB(t) sqlDB := db diff --git a/core/services/ocr/flags_test.go b/core/services/ocr/flags_test.go index a204bdde6be..eab7abd4ecb 100644 --- a/core/services/ocr/flags_test.go +++ b/core/services/ocr/flags_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/fluxmonitorv2" ) -func TestFlags_IsLowered(t *testing.T) { +func TestUnit_Flags_IsLowered(t *testing.T) { t.Parallel() testCases := []struct { diff --git a/core/services/ocr/validate_test.go b/core/services/ocr/validate_test.go index 68a863c5564..4877eb773a6 100644 --- a/core/services/ocr/validate_test.go +++ b/core/services/ocr/validate_test.go @@ -33,7 +33,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr" ) -func TestValidateOracleSpec(t *testing.T) { +func TestUnit_ValidateOracleSpec(t *testing.T) { var tt = []struct { name string toml string @@ -446,7 +446,7 @@ answer1 [type=median index=0]; } } -func TestOnChainContractAvailability(t *testing.T) { +func TestUnit_OnChainContractAvailability(t *testing.T) { // Because some RPCs prune logs we have scenarios in which a job spec update will lead to outages because of the inability to get the logs. We need to safeguard against these outages by checking if the node can access the OCR configuration // There are 4 possible scenarios: // 1. Contract is not deployed diff --git a/core/services/ocr2/database_test.go b/core/services/ocr2/database_test.go index acdc0cb48bf..0621eed04ec 100644 --- a/core/services/ocr2/database_test.go +++ b/core/services/ocr2/database_test.go @@ -62,7 +62,7 @@ func setupDB(t *testing.T) *sqlx.DB { return sqlx } -func Test_DB_ReadWriteState(t *testing.T) { +func TestUnit_DB_ReadWriteState(t *testing.T) { sqlDB := setupDB(t) configDigest := testhelpers.MakeConfigDigest(t) @@ -143,7 +143,7 @@ func Test_DB_ReadWriteState(t *testing.T) { }) } -func Test_DB_ReadWriteConfig(t *testing.T) { +func TestUnit_DB_ReadWriteConfig(t *testing.T) { sqlDB := setupDB(t) config := ocrtypes.ContractConfig{ @@ -239,7 +239,7 @@ func assertPendingTransmissionEqual(t *testing.T, pt1, pt2 ocrtypes.PendingTrans require.Equal(t, pt1.AttributedSignatures, pt2.AttributedSignatures) } -func Test_DB_PendingTransmissions(t *testing.T) { +func TestUnit_DB_PendingTransmissions(t *testing.T) { sqlDB := setupDB(t) ethKeyStore := cltest.NewKeyStore(t, sqlDB).Eth() @@ -446,7 +446,7 @@ func Test_DB_PendingTransmissions(t *testing.T) { }) } -func Test_DB_ReadWriteProtocolState(t *testing.T) { +func TestUnit_DB_ReadWriteProtocolState(t *testing.T) { sqlDB := setupDB(t) lggr := logger.TestLogger(t) @@ -516,7 +516,7 @@ func Test_DB_ReadWriteProtocolState(t *testing.T) { }) } -func Test_DB_ReadWriteBlock(t *testing.T) { +func TestUnit_DB_ReadWriteBlock(t *testing.T) { sqlDB := setupDB(t) lggr := logger.TestLogger(t) diff --git a/core/services/ocr2/delegate_test.go b/core/services/ocr2/delegate_test.go index 8ff6af26b45..7156444c54e 100644 --- a/core/services/ocr2/delegate_test.go +++ b/core/services/ocr2/delegate_test.go @@ -33,7 +33,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/testdata/testspecs" ) -func TestGetEVMEffectiveTransmitterID(t *testing.T) { +func TestUnit_GetEVMEffectiveTransmitterID(t *testing.T) { customChainID := big.New(testutils.NewRandomEVMChainID()) config := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { diff --git a/core/services/ocr2/plugins/ccip/abihelpers/abi_helpers_test.go b/core/services/ocr2/plugins/ccip/abihelpers/abi_helpers_test.go index ff1d0744ebc..60cdafc67b1 100644 --- a/core/services/ocr2/plugins/ccip/abihelpers/abi_helpers_test.go +++ b/core/services/ocr2/plugins/ccip/abihelpers/abi_helpers_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/utils" ) -func TestProofFlagToBits(t *testing.T) { +func TestUnit_ProofFlagToBits(t *testing.T) { genFlags := func(indexesSet []int, size int) []bool { bools := make([]bool, size) for _, indexSet := range indexesSet { @@ -56,7 +56,7 @@ func TestProofFlagToBits(t *testing.T) { } } -func TestEvmWord(t *testing.T) { +func TestUnit_EvmWord(t *testing.T) { testCases := []struct { inp uint64 exp common.Hash @@ -73,7 +73,7 @@ func TestEvmWord(t *testing.T) { } } -func TestABIEncodeDecode(t *testing.T) { +func TestUnit_ABIEncodeDecode(t *testing.T) { abiStr := `[{"components": [{"name":"int1","type":"int256"},{"name":"int2","type":"int256"}], "type":"tuple"}]` values := []any{struct { Int1 *big.Int `json:"int1"` diff --git a/core/services/ocr2/plugins/ccip/ccipcommit/factory_test.go b/core/services/ocr2/plugins/ccip/ccipcommit/factory_test.go index 59762c8a98b..2bc2dc1958f 100644 --- a/core/services/ocr2/plugins/ccip/ccipcommit/factory_test.go +++ b/core/services/ocr2/plugins/ccip/ccipcommit/factory_test.go @@ -25,7 +25,7 @@ import ( // NewReportingPlugin makes several calls (e.g. CommitStoreReader.ChangeConfig) that can fail. We use mocks to cause the // first call to each of these functions to fail, then all subsequent calls succeed. We assert that NewReportingPlugin // retries a sufficient number of times to get through the transient errors and eventually succeed. -func TestNewReportingPluginRetriesUntilSuccess(t *testing.T) { +func TestUnit_NewReportingPluginRetriesUntilSuccess(t *testing.T) { ctx := t.Context() commitConfig := CommitPluginStaticConfig{} commitConfig.lggr = logger.TestLogger(t) diff --git a/core/services/ocr2/plugins/ccip/ccipcommit/ocr2_test.go b/core/services/ocr2/plugins/ccip/ccipcommit/ocr2_test.go index 118c21cac62..0648c5736aa 100644 --- a/core/services/ocr2/plugins/ccip/ccipcommit/ocr2_test.go +++ b/core/services/ocr2/plugins/ccip/ccipcommit/ocr2_test.go @@ -44,7 +44,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/prices" ) -func TestCommitReportingPlugin_Observation(t *testing.T) { +func TestUnit_CommitReportingPlugin_Observation(t *testing.T) { sourceNativeTokenAddr := ccipcalc.HexToAddress("1000") destChainSelector := uint64(1) sourceChainSelector := uint64(2) @@ -223,7 +223,7 @@ func TestCommitReportingPlugin_Observation(t *testing.T) { } } -func TestCommitReportingPlugin_Report(t *testing.T) { +func TestUnit_CommitReportingPlugin_Report(t *testing.T) { ctx := testutils.Context(t) sourceChainSelector := uint64(rand.Int()) var gasPrice = big.NewInt(1) @@ -475,7 +475,7 @@ func TestCommitReportingPlugin_Report(t *testing.T) { } } -func TestCommitReportingPlugin_ShouldAcceptFinalizedReport(t *testing.T) { +func TestUnit_CommitReportingPlugin_ShouldAcceptFinalizedReport(t *testing.T) { ctx := testutils.Context(t) newPlugin := func() *CommitReportingPlugin { @@ -598,7 +598,7 @@ func TestCommitReportingPlugin_ShouldAcceptFinalizedReport(t *testing.T) { }) } -func TestCommitReportingPlugin_ShouldTransmitAcceptedReport(t *testing.T) { +func TestUnit_CommitReportingPlugin_ShouldTransmitAcceptedReport(t *testing.T) { report := cciptypes.CommitStoreReport{ TokenPrices: []cciptypes.TokenPrice{ {Token: cciptypes.Address(utils.RandomAddress().String()), Value: big.NewInt(9e18)}, @@ -656,7 +656,7 @@ func TestCommitReportingPlugin_ShouldTransmitAcceptedReport(t *testing.T) { }) } -func TestCommitReportingPlugin_observePriceUpdates(t *testing.T) { +func TestUnit_CommitReportingPlugin_observePriceUpdates(t *testing.T) { destChainSelector := uint64(12345) sourceChainSelector := uint64(67890) @@ -756,7 +756,7 @@ type CommitObservationLegacy struct { SourceGasPriceUSD *big.Int `json:"sourceGasPrice"` } -func TestCommitReportingPlugin_extractObservationData(t *testing.T) { +func TestUnit_CommitReportingPlugin_extractObservationData(t *testing.T) { token1 := ccipcalc.HexToAddress("0xa") token2 := ccipcalc.HexToAddress("0xb") token1Price := big.NewInt(1) @@ -1030,7 +1030,7 @@ func TestCommitReportingPlugin_extractObservationData(t *testing.T) { } } -func TestCommitReportingPlugin_calculatePriceUpdates(t *testing.T) { +func TestUnit_CommitReportingPlugin_calculatePriceUpdates(t *testing.T) { const defaultSourceChainSelector = 10 // we reuse this value across all test cases feeToken1 := ccipcalc.HexToAddress("0xa") feeToken2 := ccipcalc.HexToAddress("0xb") @@ -1566,7 +1566,7 @@ func TestCommitReportingPlugin_calculatePriceUpdates(t *testing.T) { } } -func TestCommitReportingPlugin_isStaleReport(t *testing.T) { +func TestUnit_CommitReportingPlugin_isStaleReport(t *testing.T) { ctx := context.Background() lggr := logger.TestLogger(t) merkleRoot1 := utils.Keccak256Fixed([]byte("some merkle root 1")) @@ -1620,7 +1620,7 @@ func TestCommitReportingPlugin_isStaleReport(t *testing.T) { }) } -func TestCommitReportingPlugin_calculateMinMaxSequenceNumbers(t *testing.T) { +func TestUnit_CommitReportingPlugin_calculateMinMaxSequenceNumbers(t *testing.T) { testCases := []struct { name string commitStoreSeqNum uint64 @@ -1708,7 +1708,7 @@ func TestCommitReportingPlugin_calculateMinMaxSequenceNumbers(t *testing.T) { } } -func TestCommitReportingPlugin_getLatestGasPriceUpdate(t *testing.T) { +func TestUnit_CommitReportingPlugin_getLatestGasPriceUpdate(t *testing.T) { now := time.Now() chainSelector1 := uint64(1234) chainSelector2 := uint64(5678) @@ -1794,7 +1794,7 @@ func TestCommitReportingPlugin_getLatestGasPriceUpdate(t *testing.T) { } } -func TestCommitReportingPlugin_getLatestTokenPriceUpdates(t *testing.T) { +func TestUnit_CommitReportingPlugin_getLatestTokenPriceUpdates(t *testing.T) { now := time.Now() tk1 := cciptypes.Address(utils.RandomAddress().String()) tk2 := cciptypes.Address(utils.RandomAddress().String()) @@ -1863,7 +1863,7 @@ func TestCommitReportingPlugin_getLatestTokenPriceUpdates(t *testing.T) { } } -func Test_commitReportSize(t *testing.T) { +func TestUnit_commitReportSize(t *testing.T) { testParams := gopter.DefaultTestParameters() testParams.MinSuccessfulTests = 100 p := gopter.NewProperties(testParams) @@ -1887,7 +1887,7 @@ func Test_commitReportSize(t *testing.T) { p.TestingRun(t) } -func Test_calculateIntervalConsensus(t *testing.T) { +func TestUnit_calculateIntervalConsensus(t *testing.T) { tests := []struct { name string intervals []cciptypes.CommitStoreInterval @@ -1929,7 +1929,7 @@ func Test_calculateIntervalConsensus(t *testing.T) { } } -func TestCommitReportToEthTxMeta(t *testing.T) { +func TestUnit_CommitReportToEthTxMeta(t *testing.T) { mctx := hashutil.NewKeccak() tree, err := merklemulti.NewTree(mctx, [][32]byte{mctx.Hash([]byte{0xaa})}) require.NoError(t, err) diff --git a/core/services/ocr2/plugins/ccip/ccipexec/batching_test.go b/core/services/ocr2/plugins/ccip/ccipexec/batching_test.go index b3c0511e727..a6028ace419 100644 --- a/core/services/ocr2/plugins/ccip/ccipexec/batching_test.go +++ b/core/services/ocr2/plugins/ccip/ccipexec/batching_test.go @@ -40,7 +40,7 @@ type testCase struct { msgCost int64 } -func Test_NewBatchingStrategy(t *testing.T) { +func TestUnit_NewBatchingStrategy(t *testing.T) { t.Parallel() mockStatusChecker := mockstatuschecker.NewCCIPTransactionStatusChecker(t) @@ -58,7 +58,7 @@ func Test_NewBatchingStrategy(t *testing.T) { } } -func Test_validateSendRequests(t *testing.T) { +func TestUnit_validateSendRequests(t *testing.T) { testCases := []struct { name string seqNums []uint64 @@ -125,7 +125,7 @@ func (m delayedTokenDataWorker) GetMsgTokenData(ctx context.Context, msg cciptyp return nil, ctx.Err() } -func TestExecutionReportingPlugin_getTokenDataWithCappedLatency(t *testing.T) { +func TestUnit_ExecutionReportingPlugin_getTokenDataWithCappedLatency(t *testing.T) { testCases := []struct { name string allowedWaitingTime time.Duration @@ -166,7 +166,7 @@ func TestExecutionReportingPlugin_getTokenDataWithCappedLatency(t *testing.T) { } } -func TestBatchingStrategies(t *testing.T) { +func TestUnit_BatchingStrategies(t *testing.T) { sender1 := ccipcalc.HexToAddress("0xa") destNative := ccipcalc.HexToAddress("0xb") srcNative := ccipcalc.HexToAddress("0xc") diff --git a/core/services/ocr2/plugins/ccip/ccipexec/factory_test.go b/core/services/ocr2/plugins/ccip/ccipexec/factory_test.go index d527a48e83d..3229262e918 100644 --- a/core/services/ocr2/plugins/ccip/ccipexec/factory_test.go +++ b/core/services/ocr2/plugins/ccip/ccipexec/factory_test.go @@ -23,7 +23,7 @@ import ( // NewReportingPlugin makes several calls (e.g. OffRampReader.ChangeConfig()) that can fail. We use mocks to cause the // first call to each of these functions to fail, then all subsequent calls succeed. We assert that NewReportingPlugin // retries a sufficient number of times to get through the transient errors and eventually succeed. -func TestNewReportingPluginRetriesUntilSuccess(t *testing.T) { +func TestUnit_NewReportingPluginRetriesUntilSuccess(t *testing.T) { ctx := t.Context() execConfig := ExecutionPluginStaticConfig{} execConfig.lggr = logger.TestLogger(t) diff --git a/core/services/ocr2/plugins/ccip/ccipexec/gashelpers_test.go b/core/services/ocr2/plugins/ccip/ccipexec/gashelpers_test.go index 42a62a1be99..b6792a5aaa6 100644 --- a/core/services/ocr2/plugins/ccip/ccipexec/gashelpers_test.go +++ b/core/services/ocr2/plugins/ccip/ccipexec/gashelpers_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestOverheadGas(t *testing.T) { +func TestUnit_OverheadGas(t *testing.T) { // Only Data and TokenAmounts are used from the messages // And only the length is used so the contents doesn't matter. tests := []struct { @@ -37,7 +37,7 @@ func TestOverheadGas(t *testing.T) { } } -func TestMaxGasOverHeadGas(t *testing.T) { +func TestUnit_MaxGasOverHeadGas(t *testing.T) { // Only Data and TokenAmounts are used from the messages // And only the length is used so the contents doesn't matter. tests := []struct { @@ -68,7 +68,7 @@ func TestMaxGasOverHeadGas(t *testing.T) { } } -func TestWaitBoostedFee(t *testing.T) { +func TestUnit_WaitBoostedFee(t *testing.T) { tests := []struct { name string sendTimeDiff time.Duration diff --git a/core/services/ocr2/plugins/ccip/ccipexec/helpers_test.go b/core/services/ocr2/plugins/ccip/ccipexec/helpers_test.go index ecc72b501b9..fd3bbe2d984 100644 --- a/core/services/ocr2/plugins/ccip/ccipexec/helpers_test.go +++ b/core/services/ocr2/plugins/ccip/ccipexec/helpers_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/utils" ) -func Test_CommitReportWithSendRequests_uniqueSenders(t *testing.T) { +func TestUnit_CommitReportWithSendRequests_uniqueSenders(t *testing.T) { messageFn := func(address cciptypes.Address) cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta { return cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta{EVM2EVMMessage: cciptypes.EVM2EVMMessage{Sender: address}} } diff --git a/core/services/ocr2/plugins/ccip/ccipexec/inflight_test.go b/core/services/ocr2/plugins/ccip/ccipexec/inflight_test.go index c08a49b43dd..8bb0de9b97c 100644 --- a/core/services/ocr2/plugins/ccip/ccipexec/inflight_test.go +++ b/core/services/ocr2/plugins/ccip/ccipexec/inflight_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func TestInflightReportsContainer_add(t *testing.T) { +func TestUnit_InflightReportsContainer_add(t *testing.T) { lggr := logger.TestLogger(t) container := newInflightExecReportsContainer(time.Second) @@ -26,7 +26,7 @@ func TestInflightReportsContainer_add(t *testing.T) { require.Len(t, container.getAll(), 1) } -func TestInflightReportsContainer_expire(t *testing.T) { +func TestUnit_InflightReportsContainer_expire(t *testing.T) { lggr := logger.TestLogger(t) container := newInflightExecReportsContainer(time.Second) diff --git a/core/services/ocr2/plugins/ccip/ccipexec/ocr2_test.go b/core/services/ocr2/plugins/ccip/ccipexec/ocr2_test.go index 6c3f467c87d..49274db10df 100644 --- a/core/services/ocr2/plugins/ccip/ccipexec/ocr2_test.go +++ b/core/services/ocr2/plugins/ccip/ccipexec/ocr2_test.go @@ -45,7 +45,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata" ) -func TestExecutionReportingPlugin_Observation(t *testing.T) { +func TestUnit_ExecutionReportingPlugin_Observation(t *testing.T) { testCases := []struct { name string commitStorePaused bool @@ -231,7 +231,7 @@ func TestExecutionReportingPlugin_Observation(t *testing.T) { } } -func TestExecutionReportingPlugin_Report(t *testing.T) { +func TestUnit_ExecutionReportingPlugin_Report(t *testing.T) { testCases := []struct { name string f int @@ -312,7 +312,7 @@ func TestExecutionReportingPlugin_Report(t *testing.T) { } } -func TestExecutionReportingPlugin_ShouldAcceptFinalizedReport(t *testing.T) { +func TestUnit_ExecutionReportingPlugin_ShouldAcceptFinalizedReport(t *testing.T) { msg := cciptypes.EVM2EVMMessage{ SequenceNumber: 12, FeeTokenAmount: big.NewInt(1e9), @@ -366,7 +366,7 @@ func TestExecutionReportingPlugin_ShouldAcceptFinalizedReport(t *testing.T) { assert.False(t, should) } -func TestExecutionReportingPlugin_ShouldTransmitAcceptedReport(t *testing.T) { +func TestUnit_ExecutionReportingPlugin_ShouldTransmitAcceptedReport(t *testing.T) { msg := cciptypes.EVM2EVMMessage{ SequenceNumber: 12, FeeTokenAmount: big.NewInt(1e9), @@ -414,7 +414,7 @@ func TestExecutionReportingPlugin_ShouldTransmitAcceptedReport(t *testing.T) { assert.False(t, should) } -func TestExecutionReportingPlugin_buildReport(t *testing.T) { +func TestUnit_ExecutionReportingPlugin_buildReport(t *testing.T) { ctx := testutils.Context(t) const numMessages = 100 @@ -488,7 +488,7 @@ func TestExecutionReportingPlugin_buildReport(t *testing.T) { assert.LessOrEqual(t, len(execReport), MaxExecutionReportLength, "built execution report length") } -func TestExecutionReportingPlugin_getReportsWithSendRequests(t *testing.T) { +func TestUnit_ExecutionReportingPlugin_getReportsWithSendRequests(t *testing.T) { testCases := []struct { name string reports []cciptypes.CommitStoreReport @@ -620,7 +620,7 @@ func TestExecutionReportingPlugin_getReportsWithSendRequests(t *testing.T) { } } -func Test_calculateObservedMessagesConsensus(t *testing.T) { +func TestUnit_calculateObservedMessagesConsensus(t *testing.T) { type args struct { observations []ccip.ExecutionObservation f int @@ -729,7 +729,7 @@ func Test_calculateObservedMessagesConsensus(t *testing.T) { } } -func Test_getTokensPrices(t *testing.T) { +func TestUnit_getTokensPrices(t *testing.T) { tk1 := ccipcalc.HexToAddress("1") tk2 := ccipcalc.HexToAddress("2") tk3 := ccipcalc.HexToAddress("3") @@ -819,7 +819,7 @@ func Test_getTokensPrices(t *testing.T) { } } -func Test_calculateMessageMaxGas(t *testing.T) { +func TestUnit_calculateMessageMaxGas(t *testing.T) { type args struct { gasLimit *big.Int numRequests int @@ -865,7 +865,7 @@ func Test_calculateMessageMaxGas(t *testing.T) { } } -func Test_inflightAggregates(t *testing.T) { +func TestUnit_inflightAggregates(t *testing.T) { const n = 10 addrs := make([]cciptypes.Address, n) tokenAddrs := make([]cciptypes.Address, n) @@ -988,7 +988,7 @@ func Test_inflightAggregates(t *testing.T) { } } -func Test_commitReportWithSendRequests_validate(t *testing.T) { +func TestUnit_commitReportWithSendRequests_validate(t *testing.T) { testCases := []struct { name string reportInterval cciptypes.CommitStoreInterval @@ -1036,7 +1036,7 @@ func Test_commitReportWithSendRequests_validate(t *testing.T) { } } -func Test_commitReportWithSendRequests_allRequestsAreExecutedAndFinalized(t *testing.T) { +func TestUnit_commitReportWithSendRequests_allRequestsAreExecutedAndFinalized(t *testing.T) { testCases := []struct { name string reqs []cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta @@ -1085,7 +1085,7 @@ func Test_commitReportWithSendRequests_allRequestsAreExecutedAndFinalized(t *tes } } -func Test_commitReportWithSendRequests_sendReqFits(t *testing.T) { +func TestUnit_commitReportWithSendRequests_sendReqFits(t *testing.T) { testCases := []struct { name string req cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta @@ -1187,7 +1187,7 @@ func generateExecutionReport(t *testing.T, numMsgs, tokensPerMsg, bytesPerMsg in } } -func Test_selectReportsToFillBatch(t *testing.T) { +func TestUnit_selectReportsToFillBatch(t *testing.T) { tests := []struct { name string messagesLimit uint64 // maximum number of messages that can be included in a batch. @@ -1267,7 +1267,7 @@ func Test_selectReportsToFillBatch(t *testing.T) { } } -func Test_prepareTokenExecData(t *testing.T) { +func TestUnit_prepareTokenExecData(t *testing.T) { ctx := testutils.Context(t) weth := cciptypes.Address(utils.RandomAddress().String()) @@ -1414,7 +1414,7 @@ func encodeExecutionReport(t *testing.T, report cciptypes.ExecReport) []byte { } // Verify the price registry update mechanism in case of configuration change on the source onRamp. -func TestExecutionReportingPlugin_ensurePriceRegistrySynchronization(t *testing.T) { +func TestUnit_ExecutionReportingPlugin_ensurePriceRegistrySynchronization(t *testing.T) { p := &ExecutionReportingPlugin{} p.lggr = logger.TestLogger(t) p.sourcePriceRegistryLock = sync.RWMutex{} @@ -1449,7 +1449,7 @@ func TestExecutionReportingPlugin_ensurePriceRegistrySynchronization(t *testing. require.Equal(t, mockPriceRegistryReader2, p.sourcePriceRegistry) } -func TestExecutionReportingPlugin_getConsensusThreshold(t *testing.T) { +func TestUnit_ExecutionReportingPlugin_getConsensusThreshold(t *testing.T) { tests := []struct { name string batchingStrategyID uint32 @@ -1482,7 +1482,7 @@ func TestExecutionReportingPlugin_getConsensusThreshold(t *testing.T) { } } -func TestExecutionReportingPlugin_SnoozeLogicWithTokenDataNotReady(t *testing.T) { +func TestUnit_ExecutionReportingPlugin_SnoozeLogicWithTokenDataNotReady(t *testing.T) { testCases := []struct { name string msgExecStates []messageExecStatus diff --git a/core/services/ocr2/plugins/ccip/clo_ccip_integration_test.go b/core/services/ocr2/plugins/ccip/clo_ccip_integration_test.go index 3dcec296ad8..8939dbdb3c5 100644 --- a/core/services/ocr2/plugins/ccip/clo_ccip_integration_test.go +++ b/core/services/ocr2/plugins/ccip/clo_ccip_integration_test.go @@ -24,7 +24,7 @@ import ( integrationtesthelpers "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers/integration" ) -func Test_CLOSpecApprovalFlow_pipeline(t *testing.T) { +func TestIntegration_Shared_CLOSpecApprovalFlow_pipeline(t *testing.T) { quarantine.Flaky(t, "DX-1807") t.Parallel() @@ -44,7 +44,7 @@ func Test_CLOSpecApprovalFlow_pipeline(t *testing.T) { test_CLOSpecApprovalFlow(t, ccipTH, tokenPricesUSDPipeline, "") } -func Test_CLOSpecApprovalFlow_dynamicPriceGetter(t *testing.T) { +func TestIntegration_Shared_CLOSpecApprovalFlow_dynamicPriceGetter(t *testing.T) { quarantine.Flaky(t, "DX-1805") t.Parallel() ccipTH := integrationtesthelpers.SetupCCIPIntegrationTH( diff --git a/core/services/ocr2/plugins/ccip/config/chain_config_test.go b/core/services/ocr2/plugins/ccip/config/chain_config_test.go index c9d566039ce..87917043f45 100644 --- a/core/services/ocr2/plugins/ccip/config/chain_config_test.go +++ b/core/services/ocr2/plugins/ccip/config/chain_config_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/job" ) -func TestGetChainFromSpec(t *testing.T) { +func TestUnit_GetChainFromSpec(t *testing.T) { testChainID := int64(1337) tests := []struct { @@ -60,7 +60,7 @@ func TestGetChainFromSpec(t *testing.T) { } } -func TestGetChainByChainSelector_success(t *testing.T) { +func TestUnit_GetChainByChainSelector_success(t *testing.T) { mockChain := mocks.NewChain(t) mockChain.On("ID").Return(big.NewInt(11155111)) @@ -74,14 +74,14 @@ func TestGetChainByChainSelector_success(t *testing.T) { require.Equal(t, int64(11155111), chainID) } -func TestGetChainByChainSelector_selectorNotFound(t *testing.T) { +func TestUnit_GetChainByChainSelector_selectorNotFound(t *testing.T) { mockChainSet := mocks.NewLegacyChainContainer(t) _, _, err := GetChainByChainSelector(mockChainSet, uint64(444000444)) require.Error(t, err) } -func TestGetChainById_notFound(t *testing.T) { +func TestUnit_GetChainById_notFound(t *testing.T) { mockChainSet := mocks.NewLegacyChainContainer(t) mockChainSet.On("Get", "444").Return(nil, errors.New("test")).Maybe() @@ -90,7 +90,7 @@ func TestGetChainById_notFound(t *testing.T) { require.Contains(t, err.Error(), "chain not found in chainset") } -func TestResolveChainNames(t *testing.T) { +func TestUnit_ResolveChainNames(t *testing.T) { tests := []struct { name string sourceChainId int64 diff --git a/core/services/ocr2/plugins/ccip/config/config_test.go b/core/services/ocr2/plugins/ccip/config/config_test.go index 8c16408303e..b9c08dad7fd 100644 --- a/core/services/ocr2/plugins/ccip/config/config_test.go +++ b/core/services/ocr2/plugins/ccip/config/config_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" ) -func TestCommitConfig(t *testing.T) { +func TestUnit_CommitConfig(t *testing.T) { tests := []struct { name string cfg CommitPluginJobSpecConfig @@ -130,7 +130,7 @@ func TestCommitConfig(t *testing.T) { } } -func TestExecutionConfig(t *testing.T) { +func TestUnit_ExecutionConfig(t *testing.T) { exampleConfig := ExecPluginJobSpecConfig{ SourceStartBlock: 222, DestStartBlock: 333, @@ -145,7 +145,7 @@ func TestExecutionConfig(t *testing.T) { require.Equal(t, exampleConfig, parsedConfig) } -func TestUSDCValidate(t *testing.T) { +func TestUnit_USDCValidate(t *testing.T) { testcases := []struct { config USDCConfig err string @@ -205,7 +205,7 @@ func TestUSDCValidate(t *testing.T) { } } -func TestDynamicPriceGetterConfig(t *testing.T) { +func TestUnit_DynamicPriceGetterConfig(t *testing.T) { // this test goes through unmarshal -> move deprecated -> validate -> assert equal to expected // for verifying e2e config loading and validation destChain := chainsel.TEST_1000 // 11787463284727550157 diff --git a/core/services/ocr2/plugins/ccip/config/type_and_version_test.go b/core/services/ocr2/plugins/ccip/config/type_and_version_test.go index 807bb59f3be..a61e3da8847 100644 --- a/core/services/ocr2/plugins/ccip/config/type_and_version_test.go +++ b/core/services/ocr2/plugins/ccip/config/type_and_version_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestParseTypeAndVersion(t *testing.T) { +func TestUnit_ParseTypeAndVersion(t *testing.T) { tests := []struct { name string input string diff --git a/core/services/ocr2/plugins/ccip/estimatorconfig/config_test.go b/core/services/ocr2/plugins/ccip/estimatorconfig/config_test.go index 3ecd88ae3bd..2e193c37d4a 100644 --- a/core/services/ocr2/plugins/ccip/estimatorconfig/config_test.go +++ b/core/services/ocr2/plugins/ccip/estimatorconfig/config_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" ) -func TestFeeEstimatorConfigService(t *testing.T) { +func TestUnit_FeeEstimatorConfigService(t *testing.T) { svc := estimatorconfig.NewFeeEstimatorConfigService() ctx := context.Background() @@ -50,7 +50,7 @@ func TestFeeEstimatorConfigService(t *testing.T) { require.Error(t, err) } -func TestModifyGasPriceComponents(t *testing.T) { +func TestUnit_ModifyGasPriceComponents(t *testing.T) { t.Run("success modification", func(t *testing.T) { svc := estimatorconfig.NewFeeEstimatorConfigService() ctx := context.Background() diff --git a/core/services/ocr2/plugins/ccip/integration_test.go b/core/services/ocr2/plugins/ccip/integration_test.go index d78d9b69382..0378c950986 100644 --- a/core/services/ocr2/plugins/ccip/integration_test.go +++ b/core/services/ocr2/plugins/ccip/integration_test.go @@ -655,7 +655,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) { +func TestIntegration_Shared_Reorg(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) diff --git a/core/services/ocr2/plugins/ccip/internal/cache/autosync_test.go b/core/services/ocr2/plugins/ccip/internal/cache/autosync_test.go index 4eab3163d18..4753cce4a1e 100644 --- a/core/services/ocr2/plugins/ccip/internal/cache/autosync_test.go +++ b/core/services/ocr2/plugins/ccip/internal/cache/autosync_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache" ) -func TestLogpollerEventsBased(t *testing.T) { +func TestUnit_LogpollerEventsBased(t *testing.T) { ctx := testutils.Context(t) lp := lpmocks.NewLogPoller(t) observedEvents := []common.Hash{ diff --git a/core/services/ocr2/plugins/ccip/internal/cache/chain_health_test.go b/core/services/ocr2/plugins/ccip/internal/cache/chain_health_test.go index b919776b3b0..38b295566be 100644 --- a/core/services/ocr2/plugins/ccip/internal/cache/chain_health_test.go +++ b/core/services/ocr2/plugins/ccip/internal/cache/chain_health_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" ) -func Test_RMNStateCaching(t *testing.T) { +func TestUnit_RMNStateCaching(t *testing.T) { ctx := t.Context() lggr := logger.TestLogger(t) mockCommitStore := mocks.NewCommitStoreReader(t) @@ -60,7 +60,7 @@ func Test_RMNStateCaching(t *testing.T) { assert.False(t, healthy) } -func Test_ChainStateIsCached(t *testing.T) { +func TestUnit_ChainStateIsCached(t *testing.T) { ctx := t.Context() lggr := logger.TestLogger(t) mockCommitStore := mocks.NewCommitStoreReader(t) @@ -103,7 +103,7 @@ func Test_ChainStateIsCached(t *testing.T) { assert.False(t, healthy) } -func Test_ChainStateIsHealthy(t *testing.T) { +func TestUnit_ChainStateIsHealthy(t *testing.T) { testCases := []struct { name string commitStoreDown bool @@ -189,7 +189,7 @@ func Test_ChainStateIsHealthy(t *testing.T) { } } -func Test_RefreshingInBackground(t *testing.T) { +func TestUnit_RefreshingInBackground(t *testing.T) { mockCommitStore := newCommitStoreWrapper(t, true, nil) mockCommitStore.CommitStoreReader.On("IsDestChainHealthy", mock.Anything).Return(true, nil).Maybe() diff --git a/core/services/ocr2/plugins/ccip/internal/cache/commit_roots_test.go b/core/services/ocr2/plugins/ccip/internal/cache/commit_roots_test.go index 7ba4dad981b..703d61c4eda 100644 --- a/core/services/ocr2/plugins/ccip/internal/cache/commit_roots_test.go +++ b/core/services/ocr2/plugins/ccip/internal/cache/commit_roots_test.go @@ -22,7 +22,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" ) -func Test_RootsEligibleForExecution(t *testing.T) { +func TestIntegration_Shared_RootsEligibleForExecution(t *testing.T) { ctx := testutils.Context(t) chainID := testutils.NewRandomEVMChainID() orm := logpoller.NewORM(chainID, pgtest.NewSqlxDB(t), logger.TestLogger(t)) @@ -138,7 +138,7 @@ func Test_RootsEligibleForExecution(t *testing.T) { assertRoots(t, roots) } -func Test_RootsEligibleForExecutionWithReorgs(t *testing.T) { +func TestIntegration_Shared_RootsEligibleForExecutionWithReorgs(t *testing.T) { ctx := testutils.Context(t) chainID := testutils.NewRandomEVMChainID() orm := logpoller.NewORM(chainID, pgtest.NewSqlxDB(t), logger.TestLogger(t)) @@ -212,7 +212,7 @@ func Test_RootsEligibleForExecutionWithReorgs(t *testing.T) { } // Not very likely, but let's be more defensive here and verify if cache works properly and can deal with duplicates -func Test_BlocksWithTheSameTimestamps(t *testing.T) { +func TestIntegration_Shared_BlocksWithTheSameTimestamps(t *testing.T) { ctx := testutils.Context(t) chainID := testutils.NewRandomEVMChainID() orm := logpoller.NewORM(chainID, pgtest.NewSqlxDB(t), logger.TestLogger(t)) diff --git a/core/services/ocr2/plugins/ccip/internal/cache/commit_roots_unit_test.go b/core/services/ocr2/plugins/ccip/internal/cache/commit_roots_unit_test.go index 37fcf363d45..80a4742ec3d 100644 --- a/core/services/ocr2/plugins/ccip/internal/cache/commit_roots_unit_test.go +++ b/core/services/ocr2/plugins/ccip/internal/cache/commit_roots_unit_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" ) -func Test_CacheIsInitializedWithFirstCall(t *testing.T) { +func TestUnit_CacheIsInitializedWithFirstCall(t *testing.T) { commitStoreReader := mocks.NewCommitStoreReader(t) cache := newCommitRootsCache(logger.TestLogger(t), commitStoreReader, time.Hour, time.Hour, time.Hour, time.Hour) commitStoreReader.On("GetAcceptedCommitReportsGteTimestamp", mock.Anything, mock.Anything, mock.Anything).Return([]ccip.CommitStoreReportWithTxMeta{}, nil) @@ -25,7 +25,7 @@ func Test_CacheIsInitializedWithFirstCall(t *testing.T) { assertRoots(t, roots) } -func Test_CacheExpiration(t *testing.T) { +func TestUnit_CacheExpiration(t *testing.T) { ts1 := time.Now().Add(-5 * time.Millisecond).Truncate(time.Millisecond) ts2 := time.Now().Add(-3 * time.Millisecond).Truncate(time.Millisecond) ts3 := time.Now().Add(-1 * time.Millisecond).Truncate(time.Millisecond) @@ -55,7 +55,7 @@ func Test_CacheExpiration(t *testing.T) { }, 5*time.Second, 1*time.Second) } -func Test_CacheFullEviction(t *testing.T) { +func TestUnit_CacheFullEviction(t *testing.T) { commitStoreReader := mocks.NewCommitStoreReader(t) cache := newCommitRootsCache(logger.TestLogger(t), commitStoreReader, 2*time.Second, 1*time.Second, time.Second, time.Second) @@ -93,7 +93,7 @@ func Test_CacheFullEviction(t *testing.T) { }, 10*time.Second, time.Second) } -func Test_CacheProgression_Internal(t *testing.T) { +func TestUnit_CacheProgression_Internal(t *testing.T) { ts1 := time.Now().Add(-5 * time.Hour).Truncate(time.Millisecond) ts2 := time.Now().Add(-3 * time.Hour).Truncate(time.Millisecond) ts3 := time.Now().Add(-1 * time.Hour).Truncate(time.Millisecond) diff --git a/core/services/ocr2/plugins/ccip/internal/cache/lazy_test.go b/core/services/ocr2/plugins/ccip/internal/cache/lazy_test.go index 9ed8f41ac3f..1e0d997288b 100644 --- a/core/services/ocr2/plugins/ccip/internal/cache/lazy_test.go +++ b/core/services/ocr2/plugins/ccip/internal/cache/lazy_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestLazyFetchPass(t *testing.T) { +func TestUnit_LazyFetchPass(t *testing.T) { counterFunction := createPassingCounter() counter, _ := counterFunction() @@ -22,7 +22,7 @@ func TestLazyFetchPass(t *testing.T) { require.Equal(t, 2, counter) } -func TestLazyFetchFail(t *testing.T) { +func TestUnit_LazyFetchFail(t *testing.T) { counterFunction := createFailingCounter() _, err := counterFunction() @@ -36,7 +36,7 @@ func TestLazyFetchFail(t *testing.T) { require.Equal(t, "counter 2 failed", err.Error()) } -func TestLazyFetchMultipleRoutines(t *testing.T) { +func TestUnit_LazyFetchMultipleRoutines(t *testing.T) { routines := 100 counterFunction := LazyFetch(createPassingCounter()) diff --git a/core/services/ocr2/plugins/ccip/internal/cache/observed_chain_health_test.go b/core/services/ocr2/plugins/ccip/internal/cache/observed_chain_health_test.go index 7e02dbd3c92..3df8e089401 100644 --- a/core/services/ocr2/plugins/ccip/internal/cache/observed_chain_health_test.go +++ b/core/services/ocr2/plugins/ccip/internal/cache/observed_chain_health_test.go @@ -16,7 +16,7 @@ import ( var address = cciptypes.Address(common.HexToAddress("0x1234567890123456789012345678901234567890").String()) -func Test_ObservedChainStateSkipErrors(t *testing.T) { +func TestUnit_ObservedChainStateSkipErrors(t *testing.T) { mockedHealthcheck := mocks.NewChainHealthcheck(t) mockedHealthcheck.On("IsHealthy", mock.Anything).Return(false, errors.New("error")) @@ -33,7 +33,7 @@ func Test_ObservedChainStateSkipErrors(t *testing.T) { assert.Equal(t, float64(0), testutil.ToFloat64(laneHealthStatus.WithLabelValues("plugin", "10", "20", "0x1234567890123456789012345678901234567890"))) } -func Test_ObservedChainStateReportsStatus(t *testing.T) { +func TestUnit_ObservedChainStateReportsStatus(t *testing.T) { mockedHealthcheck := mocks.NewChainHealthcheck(t) mockedHealthcheck.On("IsHealthy", mock.Anything).Return(true, nil).Once() diff --git a/core/services/ocr2/plugins/ccip/internal/cache/once_test.go b/core/services/ocr2/plugins/ccip/internal/cache/once_test.go index 203e56b122a..ab9436626f9 100644 --- a/core/services/ocr2/plugins/ccip/internal/cache/once_test.go +++ b/core/services/ocr2/plugins/ccip/internal/cache/once_test.go @@ -11,7 +11,7 @@ import ( ) // TestCallOnceOnNoErrorCachingSuccess tests caching behavior when the function succeeds. -func TestCallOnceOnNoErrorCachingSuccess(t *testing.T) { +func TestUnit_CallOnceOnNoErrorCachingSuccess(t *testing.T) { callCount := 0 testFunc := func(ctx context.Context) (string, error) { callCount++ @@ -31,7 +31,7 @@ func TestCallOnceOnNoErrorCachingSuccess(t *testing.T) { } // TestCallOnceOnNoErrorCachingError tests that the function is retried after an error. -func TestCallOnceOnNoErrorCachingError(t *testing.T) { +func TestUnit_CallOnceOnNoErrorCachingError(t *testing.T) { callCount := 0 testFunc := func(ctx context.Context) (string, error) { callCount++ @@ -55,7 +55,7 @@ func TestCallOnceOnNoErrorCachingError(t *testing.T) { } // TestCallOnceOnNoErrorCachingConcurrency tests that the function works correctly under concurrent access. -func TestCallOnceOnNoErrorCachingConcurrency(t *testing.T) { +func TestUnit_CallOnceOnNoErrorCachingConcurrency(t *testing.T) { var wg sync.WaitGroup callCount := 0 testFunc := func(ctx context.Context) (string, error) { diff --git a/core/services/ocr2/plugins/ccip/internal/ccipcalc/calc_test.go b/core/services/ocr2/plugins/ccip/internal/ccipcalc/calc_test.go index e6cb928fddb..5efc258b29d 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipcalc/calc_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipcalc/calc_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func TestMergeEpochAndRound(t *testing.T) { +func TestUnit_MergeEpochAndRound(t *testing.T) { type args struct { epoch uint32 round uint8 @@ -52,7 +52,7 @@ func TestMergeEpochAndRound(t *testing.T) { } } -func TestContiguousReqs(t *testing.T) { +func TestUnit_ContiguousReqs(t *testing.T) { testCases := []struct { min uint64 max uint64 @@ -73,7 +73,7 @@ func TestContiguousReqs(t *testing.T) { } } -func TestCalculateUsdPerUnitGas(t *testing.T) { +func TestUnit_CalculateUsdPerUnitGas(t *testing.T) { testCases := []struct { name string sourceGasPrice *big.Int @@ -102,7 +102,7 @@ func TestCalculateUsdPerUnitGas(t *testing.T) { } } -func TestBigIntSortedMiddle(t *testing.T) { +func TestUnit_BigIntSortedMiddle(t *testing.T) { tests := []struct { name string vals []*big.Int @@ -136,7 +136,7 @@ func TestBigIntSortedMiddle(t *testing.T) { } } -func TestDeviates(t *testing.T) { +func TestUnit_Deviates(t *testing.T) { type args struct { x1 *big.Int x2 *big.Int @@ -220,7 +220,7 @@ func TestDeviates(t *testing.T) { } } -func TestDeviatesOnCurve(t *testing.T) { +func TestUnit_DeviatesOnCurve(t *testing.T) { type args struct { xNew *big.Int xOld *big.Int @@ -292,7 +292,7 @@ func TestDeviatesOnCurve(t *testing.T) { } } -func TestCalculateCurveThresholdPPB(t *testing.T) { +func TestUnit_CalculateCurveThresholdPPB(t *testing.T) { tests := []struct { x float64 ppbLowerBound int64 diff --git a/core/services/ocr2/plugins/ccip/internal/ccipcommon/shortcuts_test.go b/core/services/ocr2/plugins/ccip/internal/ccipcommon/shortcuts_test.go index 55098b2aea6..60e7339405a 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipcommon/shortcuts_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipcommon/shortcuts_test.go @@ -14,7 +14,7 @@ import ( cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" ) -func TestGetMessageIDsAsHexString(t *testing.T) { +func TestUnit_GetMessageIDsAsHexString(t *testing.T) { t.Run("base", func(t *testing.T) { hashes := make([]cciptypes.Hash, 10) for i := range hashes { @@ -38,7 +38,7 @@ func TestGetMessageIDsAsHexString(t *testing.T) { }) } -func TestFlattenUniqueSlice(t *testing.T) { +func TestUnit_FlattenUniqueSlice(t *testing.T) { testCases := []struct { name string inputSlices [][]int @@ -63,7 +63,7 @@ func TestFlattenUniqueSlice(t *testing.T) { } } -func TestFlattenedAndSortedTokens(t *testing.T) { +func TestUnit_FlattenedAndSortedTokens(t *testing.T) { testCases := []struct { name string inputSlices [][]cciptypes.Address @@ -108,7 +108,7 @@ func TestFlattenedAndSortedTokens(t *testing.T) { } } -func TestIsTxRevertError(t *testing.T) { +func TestUnit_IsTxRevertError(t *testing.T) { testCases := []struct { name string inputError error @@ -127,7 +127,7 @@ func TestIsTxRevertError(t *testing.T) { } } -func TestRetryUntilSuccess(t *testing.T) { +func TestUnit_RetryUntilSuccess(t *testing.T) { // Set delays to 0 for tests initialDelay := 0 * time.Nanosecond maxDelay := 0 * time.Nanosecond diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/token_pool_batch_reader_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/token_pool_batch_reader_test.go index f5ace0d5872..7a3f967b603 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/token_pool_batch_reader_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/token_pool_batch_reader_test.go @@ -20,7 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib/rpclibmocks" ) -func TestTokenPoolFactory(t *testing.T) { +func TestUnit_TokenPoolFactory(t *testing.T) { lggr := logger.TestLogger(t) offRamp := utils.RandomAddress() ctx := context.Background() diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/commit_store_reader_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/commit_store_reader_test.go index 739264728d8..310f085cf93 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/commit_store_reader_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/commit_store_reader_test.go @@ -40,7 +40,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" ) -func TestCommitOffchainConfig_Encoding(t *testing.T) { +func TestUnit_CommitOffchainConfig_Encoding(t *testing.T) { tests := map[string]struct { want v1_2_0.JSONCommitOffchainConfig expectErr bool @@ -102,7 +102,7 @@ func TestCommitOffchainConfig_Encoding(t *testing.T) { } } -func TestCommitOnchainConfig(t *testing.T) { +func TestUnit_CommitOnchainConfig(t *testing.T) { tests := []struct { name string want ccipdata.CommitOnchainConfig @@ -137,7 +137,7 @@ func TestCommitOnchainConfig(t *testing.T) { } } -func TestCommitStoreReaders(t *testing.T) { +func TestIntegration_Shared_CommitStoreReaders(t *testing.T) { user, ec := newSim(t) ctx := testutils.Context(t) lggr := logger.Test(t) @@ -348,7 +348,7 @@ func TestCommitStoreReaders(t *testing.T) { } } -func TestNewCommitStoreReader(t *testing.T) { +func TestUnit_NewCommitStoreReader(t *testing.T) { var tt = []struct { typeAndVersion string expectedErr string diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/commit_store_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/commit_store_test.go index 551d5e1df50..f15313f3db9 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/commit_store_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/commit_store_test.go @@ -19,7 +19,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" ) -func TestCommitStore(t *testing.T) { +func TestUnit_CommitStore(t *testing.T) { ctx := t.Context() for _, versionStr := range []string{ccipdata.V1_2_0} { lggr := logger.Test(t) diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/offramp_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/offramp_test.go index 03bab9606d2..139ecd50e38 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/offramp_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/offramp_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" ) -func TestOffRamp(t *testing.T) { +func TestUnit_OffRamp(t *testing.T) { ctx := t.Context() for _, versionStr := range []string{ccipdata.V1_2_0} { lggr := logger.Test(t) diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/onramp_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/onramp_test.go index 25b062507dd..6f94927fde2 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/onramp_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/onramp_test.go @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" ) -func TestOnRamp(t *testing.T) { +func TestUnit_OnRamp(t *testing.T) { ctx := t.Context() for _, versionStr := range []string{ccipdata.V1_2_0, ccipdata.V1_5_0} { lggr := logger.Test(t) diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/price_registry_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/price_registry_test.go index edfb9c450d9..8207ebba1de 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/price_registry_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/price_registry_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" ) -func TestPriceRegistry(t *testing.T) { +func TestUnit_PriceRegistry(t *testing.T) { ctx := testutils.Context(t) for _, versionStr := range []string{ccipdata.V1_2_0} { diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/offramp_reader_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/offramp_reader_test.go index 69ab492b3e5..985dd5e24c6 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/offramp_reader_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/offramp_reader_test.go @@ -40,7 +40,7 @@ type offRampReaderTH struct { reader ccipdata.OffRampReader } -func TestExecOnchainConfig120(t *testing.T) { +func TestUnit_ExecOnchainConfig120(t *testing.T) { tests := []struct { name string want v1_2_0.ExecOnchainConfig @@ -82,7 +82,7 @@ func TestExecOnchainConfig120(t *testing.T) { } } -func TestOffRampReaderInit(t *testing.T) { +func TestIntegration_Shared_OffRampReaderInit(t *testing.T) { tests := []struct { name string version string @@ -285,7 +285,7 @@ func testOffRampReader(t *testing.T, th offRampReaderTH) { require.NoError(t, err) } -func TestNewOffRampReader(t *testing.T) { +func TestUnit_NewOffRampReader(t *testing.T) { var tt = []struct { typeAndVersion string expectedErr string diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/onramp_reader_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/onramp_reader_test.go index 78d346e9f29..09850ac0783 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/onramp_reader_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/onramp_reader_test.go @@ -36,7 +36,7 @@ type onRampReaderTH struct { reader ccipdata.OnRampReader } -func TestNewOnRampReader_noContractAtAddress(t *testing.T) { +func TestUnit_NewOnRampReader_noContractAtAddress(t *testing.T) { ctx := t.Context() _, bc := ccipdata.NewSimulation(t) addr := ccipcalc.EvmAddrToGeneric(utils.RandomAddress()) @@ -44,7 +44,7 @@ func TestNewOnRampReader_noContractAtAddress(t *testing.T) { assert.EqualError(t, err, fmt.Sprintf("unable to read type and version: error calling typeAndVersion on addr: %s no contract code at given address", addr)) } -func TestOnRampReaderInit(t *testing.T) { +func TestUnit_OnRampReaderInit(t *testing.T) { tests := []struct { name string version string @@ -287,7 +287,7 @@ func testOnRampReader(t *testing.T, th onRampReaderTH, expectedRouterAddress com require.Equal(t, ccipcalc.EvmAddrToGeneric(expectedRouterAddress), cfg.Router) } -func TestNewOnRampReader(t *testing.T) { +func TestUnit_NewOnRampReader(t *testing.T) { var tt = []struct { typeAndVersion string expectedErr string diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/price_registry_reader_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/price_registry_reader_test.go index 16abad78dd7..63f9c1dee3a 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/price_registry_reader_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/price_registry_reader_test.go @@ -237,7 +237,7 @@ func testPriceRegistryReader(t *testing.T, th priceRegReaderTH, pr ccipdata.Pric } } -func TestPriceRegistryReader(t *testing.T) { +func TestUnit_PriceRegistryReader(t *testing.T) { th := setupPriceRegistryReaderTH(t) // Assert all readers produce the same expected results. for version, pr := range th.readers { @@ -247,7 +247,7 @@ func TestPriceRegistryReader(t *testing.T) { } } -func TestNewPriceRegistryReader(t *testing.T) { +func TestUnit_NewPriceRegistryReader(t *testing.T) { var tt = []struct { typeAndVersion string expectedErr string diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/reader_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/reader_test.go index ad7d8637264..e0966902744 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/reader_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/reader_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func Test_parseLogs(t *testing.T) { +func TestUnit_parseLogs(t *testing.T) { // generate 100 logs logs := make([]logpoller.Log, 100) for i := range logs { @@ -39,7 +39,7 @@ func Test_parseLogs(t *testing.T) { } } -func Test_parseLogs_withErrors(t *testing.T) { +func TestUnit_parseLogs_withErrors(t *testing.T) { // generate 50 valid logs and 50 errors actualErrorCount := 50 logs := make([]logpoller.Log, actualErrorCount*2) diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/usdc_reader_internal_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/usdc_reader_internal_test.go index 1504f2d1f88..373055ddc5a 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/usdc_reader_internal_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/usdc_reader_internal_test.go @@ -24,7 +24,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" ) -func TestLogPollerClient_GetUSDCMessagePriorToLogIndexInTx(t *testing.T) { +func TestUnit_LogPollerClient_GetUSDCMessagePriorToLogIndexInTx(t *testing.T) { addr := utils.RandomAddress() txHash := common.BytesToHash(addr[:]) ccipLogIndex := int64(100) @@ -126,7 +126,7 @@ func TestLogPollerClient_GetUSDCMessagePriorToLogIndexInTx(t *testing.T) { }) } -func TestParse(t *testing.T) { +func TestUnit_Parse(t *testing.T) { expectedBody, err := hexutil.Decode("0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000f80000000000000001000000020000000000048d71000000000000000000000000eb08f243e5d3fcff26a9e38ae5520a669f4019d000000000000000000000000023a04d5935ed8bc8e3eb78db3541f0abfb001c6e0000000000000000000000006cb3ed9b441eb674b58495c8b3324b59faff5243000000000000000000000000000000005425890298aed601595a70ab815c96711a31bc65000000000000000000000000ab4f961939bfe6a93567cc57c59eed7084ce2131000000000000000000000000000000000000000000000000000000000000271000000000000000000000000035e08285cfed1ef159236728f843286c55fc08610000000000000000") require.NoError(t, err) @@ -138,7 +138,7 @@ func TestParse(t *testing.T) { require.Equal(t, expectedPostParse, hexutil.Encode(parsedBody)) } -func TestFilters(t *testing.T) { +func TestIntegration_Shared_Filters(t *testing.T) { t.Run("filters of different jobs should be distinct", func(t *testing.T) { ctx := t.Context() lggr := logger.Test(t) diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store_test.go index 756af19953f..f197adf695a 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store_test.go @@ -20,7 +20,7 @@ import ( ccipdatamocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" ) -func TestCommitReportEncoding(t *testing.T) { +func TestUnit_CommitReportEncoding(t *testing.T) { t.Parallel() ctx := testutils.Context(t) report := cciptypes.CommitStoreReport{ @@ -62,7 +62,7 @@ func TestCommitReportEncoding(t *testing.T) { require.Equal(t, report, decodedReport) } -func TestCommitStoreV120ffchainConfigEncoding(t *testing.T) { +func TestUnit_CommitStoreV120ffchainConfigEncoding(t *testing.T) { t.Parallel() validConfig := JSONCommitOffchainConfig{ SourceFinalityDepth: 3, @@ -152,7 +152,7 @@ func TestCommitStoreV120ffchainConfigEncoding(t *testing.T) { } } -func TestCommitStoreV120ffchainConfigDecodingCompatibility(t *testing.T) { +func TestUnit_CommitStoreV120ffchainConfigDecodingCompatibility(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/hasher_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/hasher_test.go index f93a9898f56..2a5e5e781d9 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/hasher_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/hasher_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" ) -func TestHasherV1_2_0(t *testing.T) { +func TestUnit_HasherV1_2_0(t *testing.T) { sourceChainSelector, destChainSelector := uint64(1), uint64(4) onRampAddress := common.HexToAddress("0x5550000000000000000000000000000000000001") onRampABI := abihelpers.MustParseABI(evm_2_evm_onramp_1_2_0.EVM2EVMOnRampABI) @@ -77,7 +77,7 @@ func TestHasherV1_2_0(t *testing.T) { require.Equal(t, "4362a13a42e52ff5ce4324e7184dc7aa41704c3146bc842d35d95b94b32a78b6", hex.EncodeToString(hash[:])) } -func TestMetaDataHash(t *testing.T) { +func TestUnit_MetaDataHash(t *testing.T) { sourceChainSelector, destChainSelector := uint64(1), uint64(4) onRampAddress := common.HexToAddress("0x5550000000000000000000000000000000000001") ctx := hashutil.NewKeccak() diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_reader_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_reader_test.go index 7ee3995094a..ac569f0f82b 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_reader_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_reader_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" ) -func TestExecutionReportEncodingV120(t *testing.T) { +func TestUnit_ExecutionReportEncodingV120(t *testing.T) { // Note could consider some fancier testing here (fuzz/property) // but I think that would essentially be testing geth's abi library // as our encode/decode is a thin wrapper around that. diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_reader_unit_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_reader_unit_test.go index 4ff2732cb51..0520cf6daf5 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_reader_unit_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_reader_unit_test.go @@ -31,7 +31,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib/rpclibmocks" ) -func TestOffRampGetDestinationTokensFromSourceTokens(t *testing.T) { +func TestUnit_OffRampGetDestinationTokensFromSourceTokens(t *testing.T) { ctx := testutils.Context(t) const numSrcTokens = 20 @@ -101,7 +101,7 @@ func TestOffRampGetDestinationTokensFromSourceTokens(t *testing.T) { } } -func TestCachedOffRampTokens(t *testing.T) { +func TestUnit_CachedOffRampTokens(t *testing.T) { // Test data. srcTks, dstTks, _ := generateTokensAndOutputs(3) @@ -156,7 +156,7 @@ func generateTokensAndOutputs(nbTokens uint) ([]common.Address, []common.Address return srcTks, dstTks, outputs } -func Test_LogsAreProperlyMarkedAsFinalized(t *testing.T) { +func TestUnit_LogsAreProperlyMarkedAsFinalized(t *testing.T) { minSeqNr := uint64(10) maxSeqNr := uint64(14) inputLogs := []logpoller.Log{ @@ -211,7 +211,7 @@ func Test_LogsAreProperlyMarkedAsFinalized(t *testing.T) { } } -func TestGetRouter(t *testing.T) { +func TestUnit_GetRouter(t *testing.T) { routerAddr := utils.RandomAddress() mockOffRamp := mock_contracts.NewEVM2EVMOffRampInterface(t) diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_test.go index d76ebc29b98..8c5eeaba9e8 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/offramp_test.go @@ -24,7 +24,7 @@ func modifyCopy[T any](c T, f func(c *T)) T { return c } -func TestExecOffchainConfig120_Encoding(t *testing.T) { +func TestUnit_ExecOffchainConfig120_Encoding(t *testing.T) { t.Parallel() validConfig := JSONExecOffchainConfig{ SourceFinalityDepth: 3, @@ -112,7 +112,7 @@ func TestExecOffchainConfig120_Encoding(t *testing.T) { } } -func TestExecOffchainConfig120_ParseRawJson(t *testing.T) { +func TestUnit_ExecOffchainConfig120_ParseRawJson(t *testing.T) { t.Parallel() tests := []struct { @@ -180,7 +180,7 @@ func TestExecOffchainConfig120_ParseRawJson(t *testing.T) { } } -func Test_GetSendersNonce(t *testing.T) { +func TestUnit_GetSendersNonce(t *testing.T) { sender1 := cciptypes.Address(utils.RandomAddress().String()) sender2 := cciptypes.Address(utils.RandomAddress().String()) diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/onramp_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/onramp_test.go index 8f2769d0386..3078e3a4ce2 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/onramp_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/onramp_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" ) -func TestLogPollerClient_GetSendRequestsBetweenSeqNumsV1_2_0(t *testing.T) { +func TestUnit_LogPollerClient_GetSendRequestsBetweenSeqNumsV1_2_0(t *testing.T) { onRampAddr := utils.RandomAddress() seqNum := uint64(100) limit := uint64(10) diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/token_pool_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/token_pool_test.go index 500a6f1b2f2..e703a994335 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/token_pool_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/token_pool_test.go @@ -8,7 +8,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/utils" ) -func TestTokenPool(t *testing.T) { +func TestUnit_TokenPool(t *testing.T) { addr := utils.RandomAddress() offRamp := utils.RandomAddress() poolType := "BurnMint" diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_4_0/token_pool_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_4_0/token_pool_test.go index bad8d923629..55293e8b9e8 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_4_0/token_pool_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_4_0/token_pool_test.go @@ -8,7 +8,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/utils" ) -func TestTokenPool(t *testing.T) { +func TestUnit_TokenPool(t *testing.T) { addr := utils.RandomAddress() chainSelector := uint64(2000) poolType := "BurnMint" diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/hasher_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/hasher_test.go index c5561759c8d..461b74e13e9 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/hasher_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/hasher_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" ) -func TestHasherV1_4_0(t *testing.T) { +func TestUnit_HasherV1_4_0(t *testing.T) { sourceChainSelector, destChainSelector := uint64(1), uint64(4) onRampAddress := common.HexToAddress("0x5550000000000000000000000000000000000001") onRampABI := abihelpers.MustParseABI(evm_2_evm_onramp.EVM2EVMOnRampABI) diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/onramp_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/onramp_test.go index ac6b55d9193..66b8a79207b 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/onramp_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/onramp_test.go @@ -26,7 +26,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" ) -func TestLogPollerClient_GetSendRequestsBetweenSeqNums1_4_0(t *testing.T) { +func TestUnit_LogPollerClient_GetSendRequestsBetweenSeqNums1_4_0(t *testing.T) { onRampAddr := utils.RandomAddress() seqNum := uint64(100) limit := uint64(10) @@ -66,7 +66,7 @@ func TestLogPollerClient_GetSendRequestsBetweenSeqNums1_4_0(t *testing.T) { } } -func Test_ProperlyRecognizesPerLaneCurses(t *testing.T) { +func TestUnit_ProperlyRecognizesPerLaneCurses(t *testing.T) { user, bc := ccipdata.NewSimulation(t) ctx := testutils.Context(t) destChainSelector := uint64(100) diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdb/price_service_test.go b/core/services/ocr2/plugins/ccip/internal/ccipdb/price_service_test.go index e7d0ef2ab6f..139217d0aff 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdb/price_service_test.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdb/price_service_test.go @@ -31,7 +31,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/prices" ) -func TestPriceService_writeGasPrices(t *testing.T) { +func TestUnit_PriceService_writeGasPrices(t *testing.T) { lggr := logger.TestLogger(t) jobId := int32(1) destChainSelector := uint64(12345) @@ -95,7 +95,7 @@ func TestPriceService_writeGasPrices(t *testing.T) { } } -func TestPriceService_writeTokenPrices(t *testing.T) { +func TestUnit_PriceService_writeTokenPrices(t *testing.T) { lggr := logger.TestLogger(t) jobId := int32(1) destChainSelector := uint64(12345) @@ -167,7 +167,7 @@ func TestPriceService_writeTokenPrices(t *testing.T) { } } -func TestPriceService_observeGasPriceUpdates(t *testing.T) { +func TestUnit_PriceService_observeGasPriceUpdates(t *testing.T) { lggr := logger.TestLogger(t) jobId := int32(1) destChain := chainselectors.TEST_1338 @@ -281,7 +281,7 @@ func TestPriceService_observeGasPriceUpdates(t *testing.T) { } } -func TestPriceService_observeTokenPriceUpdates(t *testing.T) { +func TestUnit_PriceService_observeTokenPriceUpdates(t *testing.T) { lggr := logger.TestLogger(t) jobId := int32(1) destChain := chainselectors.TEST_1338 @@ -502,7 +502,7 @@ func TestPriceService_observeTokenPriceUpdates(t *testing.T) { } } -func TestPriceService_calculateUsdPer1e18TokenAmount(t *testing.T) { +func TestUnit_PriceService_calculateUsdPer1e18TokenAmount(t *testing.T) { testCases := []struct { name string price *big.Int @@ -542,7 +542,7 @@ func TestPriceService_calculateUsdPer1e18TokenAmount(t *testing.T) { } } -func TestPriceService_GetGasAndTokenPrices(t *testing.T) { +func TestUnit_PriceService_GetGasAndTokenPrices(t *testing.T) { lggr := logger.TestLogger(t) jobId := int32(1) destChainSelector := uint64(12345) @@ -761,7 +761,7 @@ func checkResultLen(t *testing.T, priceService PriceService, destChainSelector u return nil } -func TestPriceService_priceWriteInBackground(t *testing.T) { +func TestIntegration_Shared_PriceService_priceWriteInBackground(t *testing.T) { lggr := logger.TestLogger(t) jobId := int32(1) destChain := chainselectors.TEST_1338 diff --git a/core/services/ocr2/plugins/ccip/internal/logpollerutil/filters_test.go b/core/services/ocr2/plugins/ccip/internal/logpollerutil/filters_test.go index 871e24bfb94..925648e0852 100644 --- a/core/services/ocr2/plugins/ccip/internal/logpollerutil/filters_test.go +++ b/core/services/ocr2/plugins/ccip/internal/logpollerutil/filters_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/logpoller" ) -func Test_FiltersDiff(t *testing.T) { +func TestUnit_FiltersDiff(t *testing.T) { type args struct { filtersBefore []logpoller.Filter filtersNow []logpoller.Filter @@ -67,7 +67,7 @@ func Test_FiltersDiff(t *testing.T) { } } -func Test_filterContainsZeroAddress(t *testing.T) { +func TestUnit_filterContainsZeroAddress(t *testing.T) { type args struct { addrs []common.Address } @@ -112,7 +112,7 @@ func Test_filterContainsZeroAddress(t *testing.T) { } } -func Test_containsFilter(t *testing.T) { +func TestUnit_containsFilter(t *testing.T) { type args struct { filters []logpoller.Filter f logpoller.Filter diff --git a/core/services/ocr2/plugins/ccip/internal/observability/metrics_test.go b/core/services/ocr2/plugins/ccip/internal/observability/metrics_test.go index ff345a5cf4c..de4b8907b38 100644 --- a/core/services/ocr2/plugins/ccip/internal/observability/metrics_test.go +++ b/core/services/ocr2/plugins/ccip/internal/observability/metrics_test.go @@ -14,7 +14,7 @@ import ( ccipdatamocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" ) -func TestProperLabelsArePassed(t *testing.T) { +func TestUnit_ProperLabelsArePassed(t *testing.T) { histogram := readerHistogram successCounter := 10 failedCounter := 5 @@ -39,7 +39,7 @@ func TestProperLabelsArePassed(t *testing.T) { assert.Equal(t, failedCounter, counterFromHistogramByLabels(t, histogram, "123", "reader", "failedFun")) } -func TestMetricsSendFromContractDirectly(t *testing.T) { +func TestUnit_MetricsSendFromContractDirectly(t *testing.T) { expectedCounter := 4 ctx := testutils.Context(t) chainId := int64(420) diff --git a/core/services/ocr2/plugins/ccip/internal/observability/onramp_observed_test.go b/core/services/ocr2/plugins/ccip/internal/observability/onramp_observed_test.go index 15651017de1..dbbedcfb637 100644 --- a/core/services/ocr2/plugins/ccip/internal/observability/onramp_observed_test.go +++ b/core/services/ocr2/plugins/ccip/internal/observability/onramp_observed_test.go @@ -30,7 +30,7 @@ const expectedWrapper = "core/services/ocr2/plugins/ccip/internal/observability. // TestOnRampObservedMethods tests that all methods of OnRampReader are observed by a wrapper. // It uses the runtime to detect if the call stack contains the wrapper class. -func TestOnRampObservedMethods(t *testing.T) { +func TestUnit_OnRampObservedMethods(t *testing.T) { // Methods not expected to be observed. // Add a method name here to exclude it from the test. excludedMethods := []string{ diff --git a/core/services/ocr2/plugins/ccip/internal/parseutil/bigint_test.go b/core/services/ocr2/plugins/ccip/internal/parseutil/bigint_test.go index cea2f8cc19c..179516377a4 100644 --- a/core/services/ocr2/plugins/ccip/internal/parseutil/bigint_test.go +++ b/core/services/ocr2/plugins/ccip/internal/parseutil/bigint_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestParseBigIntFromAny(t *testing.T) { +func TestUnit_ParseBigIntFromAny(t *testing.T) { decimalVal := decimal.New(123, 0) testCases := []struct { diff --git a/core/services/ocr2/plugins/ccip/internal/pricegetter/evm_test.go b/core/services/ocr2/plugins/ccip/internal/pricegetter/evm_test.go index aaa33d3bb27..1db9b5f7dd5 100644 --- a/core/services/ocr2/plugins/ccip/internal/pricegetter/evm_test.go +++ b/core/services/ocr2/plugins/ccip/internal/pricegetter/evm_test.go @@ -49,7 +49,7 @@ func init() { TK4 = utils.RandomAddress() } -func TestDynamicPriceGetterWithEmptyInput(t *testing.T) { +func TestUnit_DynamicPriceGetterWithEmptyInput(t *testing.T) { tests := []struct { name string param testParameters diff --git a/core/services/ocr2/plugins/ccip/internal/pricegetter/pipeline_test.go b/core/services/ocr2/plugins/ccip/internal/pricegetter/pipeline_test.go index 32dd7b949b2..b1922f56b1e 100644 --- a/core/services/ocr2/plugins/ccip/internal/pricegetter/pipeline_test.go +++ b/core/services/ocr2/plugins/ccip/internal/pricegetter/pipeline_test.go @@ -30,7 +30,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" ) -func TestParsingDifferentFormats(t *testing.T) { +func TestIntegration_Shared_ParsingDifferentFormats(t *testing.T) { tests := []struct { name string inputValue string diff --git a/core/services/ocr2/plugins/ccip/internal/rpclib/evm_test.go b/core/services/ocr2/plugins/ccip/internal/rpclib/evm_test.go index 788b8962f77..1fb6ebbc793 100644 --- a/core/services/ocr2/plugins/ccip/internal/rpclib/evm_test.go +++ b/core/services/ocr2/plugins/ccip/internal/rpclib/evm_test.go @@ -21,7 +21,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib" ) -func TestDefaultEvmBatchCaller_BatchCallDynamicLimit(t *testing.T) { +func TestUnit_DefaultEvmBatchCaller_BatchCallDynamicLimit(t *testing.T) { testCases := []struct { name string maxBatchSize uint @@ -103,7 +103,7 @@ func TestDefaultEvmBatchCaller_BatchCallDynamicLimit(t *testing.T) { } } -func TestDefaultEvmBatchCaller_batchCallLimit(t *testing.T) { +func TestUnit_DefaultEvmBatchCaller_batchCallLimit(t *testing.T) { ctx := testutils.Context(t) testCases := []struct { @@ -159,7 +159,7 @@ func TestDefaultEvmBatchCaller_batchCallLimit(t *testing.T) { } } -func TestParseOutput(t *testing.T) { +func TestUnit_ParseOutput(t *testing.T) { type testCase[T any] struct { name string dataAndErr rpclib.DataAndErr diff --git a/core/services/ocr2/plugins/ccip/metrics_test.go b/core/services/ocr2/plugins/ccip/metrics_test.go index a36ca27ef15..ef2d275a860 100644 --- a/core/services/ocr2/plugins/ccip/metrics_test.go +++ b/core/services/ocr2/plugins/ccip/metrics_test.go @@ -18,7 +18,7 @@ const ( destChainName = "destChain" ) -func Test_SequenceNumbers(t *testing.T) { +func TestUnit_SequenceNumbers(t *testing.T) { // setup t.Parallel() var b strings.Builder @@ -39,7 +39,7 @@ func Test_SequenceNumbers(t *testing.T) { assert.Contains(t, b.String(), "ccip_max_sequence_number") } -func Test_NumberOfMessages(t *testing.T) { +func TestUnit_NumberOfMessages(t *testing.T) { // setup t.Parallel() var b strings.Builder @@ -65,7 +65,7 @@ func Test_NumberOfMessages(t *testing.T) { assert.Contains(t, b.String(), "ccip_number_of_messages_processed") } -func Test_UnexpiredCommitRoots(t *testing.T) { +func TestUnit_UnexpiredCommitRoots(t *testing.T) { // setup t.Parallel() var b strings.Builder diff --git a/core/services/ocr2/plugins/ccip/observations_test.go b/core/services/ocr2/plugins/ccip/observations_test.go index dd27328b50c..004617e6cfc 100644 --- a/core/services/ocr2/plugins/ccip/observations_test.go +++ b/core/services/ocr2/plugins/ccip/observations_test.go @@ -21,7 +21,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers" ) -func TestObservationFilter(t *testing.T) { +func TestUnit_ObservationFilter(t *testing.T) { t.Parallel() lggr := logger.TestLogger(t) obs1 := CommitObservation{Interval: cciptypes.CommitStoreInterval{Min: 1, Max: 10}} @@ -39,7 +39,7 @@ type CommitObservationLegacy struct { SourceGasPriceUSD *big.Int `json:"sourceGasPrice"` } -func TestObservationCompat_MultiChainGas(t *testing.T) { +func TestUnit_ObservationCompat_MultiChainGas(t *testing.T) { t.Parallel() obsLegacy := CommitObservationLegacy{ Interval: cciptypes.CommitStoreInterval{ @@ -67,7 +67,7 @@ func TestObservationCompat_MultiChainGas(t *testing.T) { assert.Equal(t, observations[0], observations[1]) } -func TestCommitObservationJsonDeserialization(t *testing.T) { +func TestUnit_CommitObservationJsonDeserialization(t *testing.T) { t.Parallel() expectedObservation := CommitObservation{ Interval: cciptypes.CommitStoreInterval{ @@ -95,7 +95,7 @@ func TestCommitObservationJsonDeserialization(t *testing.T) { assert.Equal(t, expectedObservation, observations[0]) } -func TestCommitObservationMarshal(t *testing.T) { +func TestUnit_CommitObservationMarshal(t *testing.T) { t.Parallel() obs := CommitObservation{ Interval: cciptypes.CommitStoreInterval{ @@ -123,7 +123,7 @@ func TestCommitObservationMarshal(t *testing.T) { assert.True(t, exists) } -func TestExecutionObservationJsonDeserialization(t *testing.T) { +func TestUnit_ExecutionObservationJsonDeserialization(t *testing.T) { t.Parallel() expectedObservation := ExecutionObservation{Messages: map[uint64]MsgData{ 2: {TokenData: tokenData("c")}, @@ -146,7 +146,7 @@ func TestExecutionObservationJsonDeserialization(t *testing.T) { assert.Equal(t, expectedObservation, observations[0]) } -func TestObservationSize(t *testing.T) { +func TestUnit_ObservationSize(t *testing.T) { t.Parallel() testParams := gopter.DefaultTestParameters() testParams.MinSuccessfulTests = 100 @@ -171,7 +171,7 @@ func TestObservationSize(t *testing.T) { p.TestingRun(t) } -func TestNewExecutionObservation(t *testing.T) { +func TestUnit_NewExecutionObservation(t *testing.T) { t.Parallel() tests := []struct { name string @@ -228,7 +228,7 @@ func tokenData(value string) [][]byte { return [][]byte{[]byte(value)} } -func TestCommitObservationJsonSerializationDeserialization(t *testing.T) { +func TestUnit_CommitObservationJsonSerializationDeserialization(t *testing.T) { t.Parallel() jsonEncoded := `{ "interval": { @@ -283,7 +283,7 @@ func TestCommitObservationJsonSerializationDeserialization(t *testing.T) { assert.Equal(t, expectedObservation, observations[0]) } -func TestAddressEncodingBackwardsCompatibility(t *testing.T) { +func TestUnit_AddressEncodingBackwardsCompatibility(t *testing.T) { t.Parallel() // The intention of this test is to remind including proper formatting of addresses after config is updated. // diff --git a/core/services/ocr2/plugins/ccip/prices/da_price_estimator_test.go b/core/services/ocr2/plugins/ccip/prices/da_price_estimator_test.go index 3101d8e5729..c6a3a94d984 100644 --- a/core/services/ocr2/plugins/ccip/prices/da_price_estimator_test.go +++ b/core/services/ocr2/plugins/ccip/prices/da_price_estimator_test.go @@ -20,7 +20,7 @@ func encodeGasPrice(daPrice, execPrice *big.Int) *big.Int { return new(big.Int).Add(new(big.Int).Lsh(daPrice, daGasPriceEncodingLength), execPrice) } -func TestDAPriceEstimator_GetGasPrice(t *testing.T) { +func TestUnit_DAPriceEstimator_GetGasPrice(t *testing.T) { ctx := context.Background() testCases := []struct { @@ -151,7 +151,7 @@ func TestDAPriceEstimator_GetGasPrice(t *testing.T) { }) } -func TestDAPriceEstimator_DenoteInUSD(t *testing.T) { +func TestUnit_DAPriceEstimator_DenoteInUSD(t *testing.T) { val1e18 := func(val int64) *big.Int { return new(big.Int).Mul(big.NewInt(1e18), big.NewInt(val)) } testCases := []struct { @@ -194,7 +194,7 @@ func TestDAPriceEstimator_DenoteInUSD(t *testing.T) { } } -func TestDAPriceEstimator_Median(t *testing.T) { +func TestUnit_DAPriceEstimator_Median(t *testing.T) { val1e18 := func(val int64) *big.Int { return new(big.Int).Mul(big.NewInt(1e18), big.NewInt(val)) } testCases := []struct { @@ -280,7 +280,7 @@ func TestDAPriceEstimator_Median(t *testing.T) { } } -func TestDAPriceEstimator_Deviates(t *testing.T) { +func TestUnit_DAPriceEstimator_Deviates(t *testing.T) { testCases := []struct { name string gasPrice1 *big.Int @@ -369,7 +369,7 @@ func TestDAPriceEstimator_Deviates(t *testing.T) { } } -func TestDAPriceEstimator_EstimateMsgCostUSD(t *testing.T) { +func TestUnit_DAPriceEstimator_EstimateMsgCostUSD(t *testing.T) { execCostUSD := big.NewInt(100_000) testCases := []struct { diff --git a/core/services/ocr2/plugins/ccip/prices/exec_price_estimator_test.go b/core/services/ocr2/plugins/ccip/prices/exec_price_estimator_test.go index c500cd061d0..05d40bce90d 100644 --- a/core/services/ocr2/plugins/ccip/prices/exec_price_estimator_test.go +++ b/core/services/ocr2/plugins/ccip/prices/exec_price_estimator_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/gas/mocks" ) -func TestExecPriceEstimator_GetGasPrice(t *testing.T) { +func TestUnit_ExecPriceEstimator_GetGasPrice(t *testing.T) { ctx := context.Background() testCases := []struct { @@ -106,7 +106,7 @@ func TestExecPriceEstimator_GetGasPrice(t *testing.T) { } } -func TestExecPriceEstimator_DenoteInUSD(t *testing.T) { +func TestUnit_ExecPriceEstimator_DenoteInUSD(t *testing.T) { val1e18 := func(val int64) *big.Int { return new(big.Int).Mul(big.NewInt(1e18), big.NewInt(val)) } testCases := []struct { @@ -147,7 +147,7 @@ func TestExecPriceEstimator_DenoteInUSD(t *testing.T) { } } -func TestExecPriceEstimator_Median(t *testing.T) { +func TestUnit_ExecPriceEstimator_Median(t *testing.T) { val1e18 := func(val int64) *big.Int { return new(big.Int).Mul(big.NewInt(1e18), big.NewInt(val)) } testCases := []struct { @@ -199,7 +199,7 @@ func TestExecPriceEstimator_Median(t *testing.T) { } } -func TestExecPriceEstimator_Deviates(t *testing.T) { +func TestUnit_ExecPriceEstimator_Deviates(t *testing.T) { testCases := []struct { name string gasPrice1 *big.Int @@ -255,7 +255,7 @@ func TestExecPriceEstimator_Deviates(t *testing.T) { } } -func TestExecPriceEstimator_EstimateMsgCostUSD(t *testing.T) { +func TestUnit_ExecPriceEstimator_EstimateMsgCostUSD(t *testing.T) { testCases := []struct { name string gasPrice *big.Int diff --git a/core/services/ocr2/plugins/ccip/tokendata/bgworker_test.go b/core/services/ocr2/plugins/ccip/tokendata/bgworker_test.go index c018ebf1274..1b22aefde84 100644 --- a/core/services/ocr2/plugins/ccip/tokendata/bgworker_test.go +++ b/core/services/ocr2/plugins/ccip/tokendata/bgworker_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata" ) -func TestBackgroundWorker(t *testing.T) { +func TestUnit_BackgroundWorker(t *testing.T) { ctx := testutils.Context(t) const numTokens = 100 @@ -97,7 +97,7 @@ func TestBackgroundWorker(t *testing.T) { require.NoError(t, w.Close()) } -func TestBackgroundWorker_RetryOnErrors(t *testing.T) { +func TestUnit_BackgroundWorker_RetryOnErrors(t *testing.T) { ctx := testutils.Context(t) tk1 := cciptypes.Address(utils.RandomAddress().String()) @@ -165,7 +165,7 @@ func TestBackgroundWorker_RetryOnErrors(t *testing.T) { require.NoError(t, w.Close()) } -func TestBackgroundWorker_Timeout(t *testing.T) { +func TestUnit_BackgroundWorker_Timeout(t *testing.T) { ctx := testutils.Context(t) tk1 := cciptypes.Address(utils.RandomAddress().String()) diff --git a/core/services/ocr2/plugins/ccip/tokendata/lbtc/lbtc_test.go b/core/services/ocr2/plugins/ccip/tokendata/lbtc/lbtc_test.go index 47dd44c3291..e6f83d0e7b1 100644 --- a/core/services/ocr2/plugins/ccip/tokendata/lbtc/lbtc_test.go +++ b/core/services/ocr2/plugins/ccip/tokendata/lbtc/lbtc_test.go @@ -43,7 +43,7 @@ func getMockLBTCEndpoint(t *testing.T, response attestationResponse) *httptest.S })) } -func TestLBTCReader_callAttestationApi(t *testing.T) { +func TestUnit_LBTCReader_callAttestationApi(t *testing.T) { t.Skipf("Skipping test because it uses the real LBTC attestation API") attestationURI, err := url.ParseRequestURI("https://bridge-manager.staging.lombard.finance") require.NoError(t, err) @@ -58,7 +58,7 @@ func TestLBTCReader_callAttestationApi(t *testing.T) { require.Equal(t, lbtcMessageAttestation, attestation.Attestations[0].Attestation) } -func TestLBTCReader_callAttestationApiMock(t *testing.T) { +func TestUnit_LBTCReader_callAttestationApiMock(t *testing.T) { response := attestationResponse{ Attestations: []messageAttestationResponse{ { @@ -83,7 +83,7 @@ func TestLBTCReader_callAttestationApiMock(t *testing.T) { require.Equal(t, response.Attestations[0].Attestation, attestation.Attestations[0].Attestation) } -func TestLBTCReader_callAttestationApiMockError(t *testing.T) { +func TestUnit_LBTCReader_callAttestationApiMockError(t *testing.T) { t.Parallel() sessionApprovedResponse := attestationResponse{ @@ -190,7 +190,7 @@ func TestLBTCReader_callAttestationApiMockError(t *testing.T) { } } -func TestLBTCReader_rateLimiting(t *testing.T) { +func TestUnit_LBTCReader_rateLimiting(t *testing.T) { sessionApprovedResponse := attestationResponse{ Attestations: []messageAttestationResponse{ { @@ -320,7 +320,7 @@ func TestLBTCReader_rateLimiting(t *testing.T) { } } -func TestLBTCReader_skipApiOnFullPayload(t *testing.T) { +func TestUnit_LBTCReader_skipApiOnFullPayload(t *testing.T) { sessionApprovedResponse := attestationResponse{ Attestations: []messageAttestationResponse{ { @@ -361,7 +361,7 @@ func TestLBTCReader_skipApiOnFullPayload(t *testing.T) { require.Contains(t, logs.All()[0].Message, "SourceTokenData.extraData size is not 32. This is deposit payload, not sha256(payload). Attestation is disabled onchain") } -func TestLBTCReader_expectedOutput(t *testing.T) { +func TestUnit_LBTCReader_expectedOutput(t *testing.T) { t.Parallel() tests := []struct { @@ -480,7 +480,7 @@ func TestLBTCReader_expectedOutput(t *testing.T) { } } -func Test_DecodeSourceTokenData(t *testing.T) { +func TestUnit_DecodeSourceTokenData(t *testing.T) { input, err := hexutil.Decode("0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000249f00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000267d40f64ecc4d95f3e8b2237df5f37b10812c250000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c47e4b3124597fdf8dd07843d4a7052f2ee80c3000000000000000000000000000000000000000000000000000000000000000e45c70a5050000000000000000000000000000000000000000000000000000000000aa36a7000000000000000000000000845f8e3c214d8d0e4d83fc094f302aa26a12a0bc0000000000000000000000000000000000000000000000000000000000014a34000000000000000000000000845f8e3c214d8d0e4d83fc094f302aa26a12a0bc00000000000000000000000062f10ce5b727edf787ea45776bd050308a61150800000000000000000000000000000000000000000000000000000000000003e6000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000") require.NoError(t, err) decoded, err := abihelpers.DecodeAbiStruct[sourceTokenData](input) diff --git a/core/services/ocr2/plugins/ccip/tokendata/observability/usdc_client_test.go b/core/services/ocr2/plugins/ccip/tokendata/observability/usdc_client_test.go index 9108064f3d2..a8736f00eb6 100644 --- a/core/services/ocr2/plugins/ccip/tokendata/observability/usdc_client_test.go +++ b/core/services/ocr2/plugins/ccip/tokendata/observability/usdc_client_test.go @@ -33,7 +33,7 @@ type expected struct { count int } -func TestUSDCClientMonitoring(t *testing.T) { +func TestUnit_USDCClientMonitoring(t *testing.T) { tests := []struct { name string server *httptest.Server diff --git a/core/services/ocr2/plugins/ccip/tokendata/usdc/usdc_blackbox_test.go b/core/services/ocr2/plugins/ccip/tokendata/usdc/usdc_blackbox_test.go index 2768c3f99d0..5c16b4a6744 100644 --- a/core/services/ocr2/plugins/ccip/tokendata/usdc/usdc_blackbox_test.go +++ b/core/services/ocr2/plugins/ccip/tokendata/usdc/usdc_blackbox_test.go @@ -28,7 +28,7 @@ type attestationResponse struct { Attestation string `json:"attestation"` } -func TestUSDCReader_ReadTokenData(t *testing.T) { +func TestUnit_USDCReader_ReadTokenData(t *testing.T) { t.Parallel() tests := []struct { name string diff --git a/core/services/ocr2/plugins/ccip/tokendata/usdc/usdc_test.go b/core/services/ocr2/plugins/ccip/tokendata/usdc/usdc_test.go index 1964532e7a1..6816ee3f0c9 100644 --- a/core/services/ocr2/plugins/ccip/tokendata/usdc/usdc_test.go +++ b/core/services/ocr2/plugins/ccip/tokendata/usdc/usdc_test.go @@ -34,7 +34,7 @@ var ( mockMsgTransmitter = utils.RandomAddress() ) -func TestUSDCReader_callAttestationApi(t *testing.T) { +func TestUnit_USDCReader_callAttestationApi(t *testing.T) { t.Skip("uses the real USDC attestation API") ctx := t.Context() usdcMessageHash := "912f22a13e9ccb979b621500f6952b2afd6e75be7eadaed93fc2625fe11c52a2" @@ -52,7 +52,7 @@ func TestUSDCReader_callAttestationApi(t *testing.T) { require.Equal(t, "PENDING", attestation.Attestation) } -func TestUSDCReader_callAttestationApiMock(t *testing.T) { +func TestUnit_USDCReader_callAttestationApiMock(t *testing.T) { t.Parallel() ctx := t.Context() response := attestationResponse{ @@ -76,7 +76,7 @@ func TestUSDCReader_callAttestationApiMock(t *testing.T) { require.Equal(t, response.Attestation, attestation.Attestation) } -func TestUSDCReader_callAttestationApiMockError(t *testing.T) { +func TestUnit_USDCReader_callAttestationApiMockError(t *testing.T) { t.Parallel() tests := []struct { @@ -230,7 +230,7 @@ func getMockUSDCEndpoint(t *testing.T, response attestationResponse) *httptest.S })) } -func TestGetUSDCMessageBody(t *testing.T) { +func TestUnit_GetUSDCMessageBody(t *testing.T) { t.Parallel() ctx := testutils.Context(t) expectedBody := []byte("0x0000000000000001000000020000000000048d71000000000000000000000000eb08f243e5d3fcff26a9e38ae5520a669f4019d000000000000000000000000023a04d5935ed8bc8e3eb78db3541f0abfb001c6e0000000000000000000000006cb3ed9b441eb674b58495c8b3324b59faff5243000000000000000000000000000000005425890298aed601595a70ab815c96711a31bc65000000000000000000000000ab4f961939bfe6a93567cc57c59eed7084ce2131000000000000000000000000000000000000000000000000000000000000271000000000000000000000000035e08285cfed1ef159236728f843286c55fc0861") @@ -258,7 +258,7 @@ func TestGetUSDCMessageBody(t *testing.T) { usdcReader.AssertNumberOfCalls(t, "GetUSDCMessagePriorToLogIndexInTx", 1) } -func TestTokenDataReader_getUsdcTokenEndOffset(t *testing.T) { +func TestUnit_TokenDataReader_getUsdcTokenEndOffset(t *testing.T) { t.Parallel() usdcToken := utils.RandomAddress() nonUsdcToken := utils.RandomAddress() @@ -311,7 +311,7 @@ func TestTokenDataReader_getUsdcTokenEndOffset(t *testing.T) { } } -func TestUSDCReader_rateLimiting(t *testing.T) { +func TestUnit_USDCReader_rateLimiting(t *testing.T) { t.Parallel() testCases := []struct { name string diff --git a/core/services/ocr2/plugins/functions/aggregation_test.go b/core/services/ocr2/plugins/functions/aggregation_test.go index 8a39a9b6561..d1c102f30fe 100644 --- a/core/services/ocr2/plugins/functions/aggregation_test.go +++ b/core/services/ocr2/plugins/functions/aggregation_test.go @@ -37,7 +37,7 @@ func reqMeta(id int, result []byte, err []byte, callbackGas uint32, coordinatorC } } -func TestCanAggregate(t *testing.T) { +func TestUnit_CanAggregate(t *testing.T) { t.Parallel() obs := make([]*encoding.ProcessedRequest, 10) @@ -51,7 +51,7 @@ func TestCanAggregate(t *testing.T) { require.False(t, functions.CanAggregate(0, 0, obs[:0])) } -func TestAggregate_Successful(t *testing.T) { +func TestUnit_Aggregate_Successful(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/services/ocr2/plugins/functions/config/config_test.go b/core/services/ocr2/plugins/functions/config/config_test.go index ee23a2fc1e9..f604f5ae487 100644 --- a/core/services/ocr2/plugins/functions/config/config_test.go +++ b/core/services/ocr2/plugins/functions/config/config_test.go @@ -10,7 +10,7 @@ import ( "google.golang.org/protobuf/proto" ) -func TestS4ConfigDecoder(t *testing.T) { +func TestUnit_S4ConfigDecoder(t *testing.T) { t.Parallel() configProto := &config.ReportingPluginConfig{ diff --git a/core/services/ocr2/plugins/functions/encoding/abi_codec_test.go b/core/services/ocr2/plugins/functions/encoding/abi_codec_test.go index 8cb44fac81c..391940ff239 100644 --- a/core/services/ocr2/plugins/functions/encoding/abi_codec_test.go +++ b/core/services/ocr2/plugins/functions/encoding/abi_codec_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/functions/encoding" ) -func TestABICodec_EncodeDecodeV1Success(t *testing.T) { +func TestUnit_ABICodec_EncodeDecodeV1Success(t *testing.T) { t.Parallel() codec, err := encoding.NewReportCodec(1) require.NoError(t, err) @@ -46,7 +46,7 @@ func TestABICodec_EncodeDecodeV1Success(t *testing.T) { } } -func TestABICodec_SliceToByte32(t *testing.T) { +func TestUnit_ABICodec_SliceToByte32(t *testing.T) { t.Parallel() _, err := encoding.SliceToByte32([]byte("abcd")) diff --git a/core/services/ocr2/plugins/functions/plugin_test.go b/core/services/ocr2/plugins/functions/plugin_test.go index 6916ea4aa2e..914900cc3a3 100644 --- a/core/services/ocr2/plugins/functions/plugin_test.go +++ b/core/services/ocr2/plugins/functions/plugin_test.go @@ -20,7 +20,7 @@ import ( s4mocks "github.com/smartcontractkit/chainlink/v2/core/services/s4/mocks" ) -func TestNewConnector_Success(t *testing.T) { +func TestUnit_NewConnector_Success(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -50,7 +50,7 @@ func TestNewConnector_Success(t *testing.T) { require.NoError(t, err) } -func TestNewConnector_NoKeyForConfiguredAddress(t *testing.T) { +func TestUnit_NewConnector_NoKeyForConfiguredAddress(t *testing.T) { t.Parallel() ctx := testutils.Context(t) diff --git a/core/services/ocr2/plugins/functions/reporting_test.go b/core/services/ocr2/plugins/functions/reporting_test.go index 25e3f5073ca..aa44e691df0 100644 --- a/core/services/ocr2/plugins/functions/reporting_test.go +++ b/core/services/ocr2/plugins/functions/reporting_test.go @@ -128,7 +128,7 @@ func newObservation(t *testing.T, observerId uint8, requests ...*encoding.Proces } } -func TestFunctionsReporting_Query(t *testing.T) { +func TestUnit_FunctionsReporting_Query(t *testing.T) { t.Parallel() const batchSize = 10 plugin, orm, _, _ := preparePlugin(t, batchSize, 0) @@ -146,7 +146,7 @@ func TestFunctionsReporting_Query(t *testing.T) { require.Equal(t, reqs[1].RequestID[:], queryProto.RequestIDs[1]) } -func TestFunctionsReporting_Query_HandleCoordinatorMismatch(t *testing.T) { +func TestUnit_FunctionsReporting_Query_HandleCoordinatorMismatch(t *testing.T) { t.Parallel() const batchSize = 10 plugin, orm, _, _ := preparePlugin(t, batchSize, 1000000) @@ -166,7 +166,7 @@ func TestFunctionsReporting_Query_HandleCoordinatorMismatch(t *testing.T) { // reqs[1] should be excluded from this query because it has a different coordinator address } -func TestFunctionsReporting_Observation(t *testing.T) { +func TestUnit_FunctionsReporting_Observation(t *testing.T) { t.Parallel() plugin, orm, _, _ := preparePlugin(t, 10, 0) @@ -201,7 +201,7 @@ func TestFunctionsReporting_Observation(t *testing.T) { require.Equal(t, observationProto.ProcessedRequests[1].Result, []byte("def")) } -func TestFunctionsReporting_Observation_IncorrectQuery(t *testing.T) { +func TestUnit_FunctionsReporting_Observation_IncorrectQuery(t *testing.T) { t.Parallel() plugin, orm, _, _ := preparePlugin(t, 10, 0) @@ -228,7 +228,7 @@ func TestFunctionsReporting_Observation_IncorrectQuery(t *testing.T) { require.Equal(t, observationProto.ProcessedRequests[0].Result, []byte("abc")) } -func TestFunctionsReporting_Report(t *testing.T) { +func TestUnit_FunctionsReporting_Report(t *testing.T) { t.Parallel() plugin, _, codec, _ := preparePlugin(t, 10, 1000000) reqId1, reqId2, reqId3 := newRequestID(), newRequestID(), newRequestID() @@ -265,7 +265,7 @@ func TestFunctionsReporting_Report(t *testing.T) { require.Equal(t, []byte{}, decoded[1].Error) } -func TestFunctionsReporting_Report_WithGasLimitAndMetadata(t *testing.T) { +func TestUnit_FunctionsReporting_Report_WithGasLimitAndMetadata(t *testing.T) { t.Parallel() plugin, _, codec, _ := preparePlugin(t, 10, 300000) reqId1, reqId2, reqId3 := newRequestID(), newRequestID(), newRequestID() @@ -306,7 +306,7 @@ func TestFunctionsReporting_Report_WithGasLimitAndMetadata(t *testing.T) { // CallbackGasLimit is not ABI-encoded } -func TestFunctionsReporting_Report_HandleCoordinatorMismatch(t *testing.T) { +func TestUnit_FunctionsReporting_Report_HandleCoordinatorMismatch(t *testing.T) { t.Parallel() plugin, _, codec, _ := preparePlugin(t, 10, 300000) reqId1, reqId2, reqId3 := newRequestID(), newRequestID(), newRequestID() @@ -336,7 +336,7 @@ func TestFunctionsReporting_Report_HandleCoordinatorMismatch(t *testing.T) { // reqId2 should be excluded from this report because it has a different coordinator address } -func TestFunctionsReporting_Report_CallbackGasLimitExceeded(t *testing.T) { +func TestUnit_FunctionsReporting_Report_CallbackGasLimitExceeded(t *testing.T) { t.Parallel() plugin, _, codec, _ := preparePlugin(t, 10, 200000) reqId1, reqId2 := newRequestID(), newRequestID() @@ -367,7 +367,7 @@ func TestFunctionsReporting_Report_CallbackGasLimitExceeded(t *testing.T) { require.Equal(t, coordinatorContract1[:], decoded[0].CoordinatorContract) } -func TestFunctionsReporting_Report_DeterministicOrderOfRequests(t *testing.T) { +func TestUnit_FunctionsReporting_Report_DeterministicOrderOfRequests(t *testing.T) { t.Parallel() plugin, _, codec, _ := preparePlugin(t, 10, 0) reqId1, reqId2, reqId3 := newRequestID(), newRequestID(), newRequestID() @@ -396,7 +396,7 @@ func TestFunctionsReporting_Report_DeterministicOrderOfRequests(t *testing.T) { require.Len(t, decoded, 3) } -func TestFunctionsReporting_Report_IncorrectObservation(t *testing.T) { +func TestUnit_FunctionsReporting_Report_IncorrectObservation(t *testing.T) { t.Parallel() plugin, _, _, _ := preparePlugin(t, 10, 0) reqId1 := newRequestID() @@ -430,7 +430,7 @@ func getReportBytes(t *testing.T, codec encoding.ReportCodec, reqs ...functions_ return reportBytes } -func TestFunctionsReporting_ShouldAcceptFinalizedReport(t *testing.T) { +func TestUnit_FunctionsReporting_ShouldAcceptFinalizedReport(t *testing.T) { t.Parallel() plugin, orm, codec, _ := preparePlugin(t, 10, 0) @@ -469,7 +469,7 @@ func TestFunctionsReporting_ShouldAcceptFinalizedReport(t *testing.T) { require.True(t, should) } -func TestFunctionsReporting_ShouldAcceptFinalizedReport_OffchainTransmission(t *testing.T) { +func TestUnit_FunctionsReporting_ShouldAcceptFinalizedReport_OffchainTransmission(t *testing.T) { t.Parallel() plugin, orm, codec, offchainTransmitter := preparePlugin(t, 10, 0) req1 := newRequestWithResult([]byte("abc")) @@ -484,7 +484,7 @@ func TestFunctionsReporting_ShouldAcceptFinalizedReport_OffchainTransmission(t * require.False(t, should) } -func TestFunctionsReporting_ShouldTransmitAcceptedReport(t *testing.T) { +func TestUnit_FunctionsReporting_ShouldTransmitAcceptedReport(t *testing.T) { t.Parallel() plugin, orm, codec, _ := preparePlugin(t, 10, 0) @@ -522,7 +522,7 @@ func TestFunctionsReporting_ShouldTransmitAcceptedReport(t *testing.T) { require.True(t, should) } -func TestFunctionsReporting_ShouldIncludeCoordinator(t *testing.T) { +func TestUnit_FunctionsReporting_ShouldIncludeCoordinator(t *testing.T) { t.Parallel() zeroAddr, coord1, coord2 := &common.Address{}, &common.Address{1}, &common.Address{2} diff --git a/core/services/ocr2/plugins/generic/merge_test.go b/core/services/ocr2/plugins/generic/merge_test.go index 01734020a1a..e2493d1d7b7 100644 --- a/core/services/ocr2/plugins/generic/merge_test.go +++ b/core/services/ocr2/plugins/generic/merge_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestMerge(t *testing.T) { +func TestUnit_Merge(t *testing.T) { vars := map[string]any{ "jb": map[string]any{ "databaseID": "some-job-id", 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 10fcb1b66e6..6c893b4f10d 100644 --- a/core/services/ocr2/plugins/generic/pipeline_runner_adapter_test.go +++ b/core/services/ocr2/plugins/generic/pipeline_runner_adapter_test.go @@ -35,7 +35,7 @@ answer [type=sum values=<[ $(val), 2 ]>] answer; ` -func TestAdapter_Integration(t *testing.T) { +func TestIntegration_Shared_Adapter_Integration(t *testing.T) { testutils.SkipShortDB(t) ctx := testutils.Context(t) logger := logger.TestLogger(t) @@ -104,7 +104,7 @@ func (m *mockPipelineRunner) ExecuteAndInsertFinishedRun(ctx context.Context, sp return 0, m.results, m.err } -func TestAdapter_AddsDefaultVars(t *testing.T) { +func TestUnit_Adapter_AddsDefaultVars(t *testing.T) { logger := logger.TestLogger(t) mpr := newMockPipelineRunner() jobID, externalJobID, name := int32(100), uuid.New(), null.StringFrom("job-name") @@ -126,7 +126,7 @@ func TestAdapter_AddsDefaultVars(t *testing.T) { assert.Equal(t, externalJobID, gotExternalID) } -func TestPipelineRunnerAdapter_SetsVarsOnSpec(t *testing.T) { +func TestUnit_PipelineRunnerAdapter_SetsVarsOnSpec(t *testing.T) { logger := logger.TestLogger(t) mpr := newMockPipelineRunner() jobID, externalJobID, name, jobType := int32(100), uuid.New(), null.StringFrom("job-name"), job.Type("generic") diff --git a/core/services/ocr2/plugins/generic/relayerset_test.go b/core/services/ocr2/plugins/generic/relayerset_test.go index 5a74f091f5a..b6a28f9af9c 100644 --- a/core/services/ocr2/plugins/generic/relayerset_test.go +++ b/core/services/ocr2/plugins/generic/relayerset_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/types/core" ) -func TestRelayerSet_List(t *testing.T) { +func TestUnit_RelayerSet_List(t *testing.T) { testRelayersMap := map[types.RelayID]loop.Relayer{} testRelayersMap[types.RelayID{Network: "N1", ChainID: "C1"}] = &TestRelayer{} testRelayersMap[types.RelayID{Network: "N2", ChainID: "C2"}] = &TestRelayer{} @@ -41,7 +41,7 @@ func TestRelayerSet_List(t *testing.T) { assert.True(t, ok) } -func TestRelayerSet_Get(t *testing.T) { +func TestUnit_RelayerSet_Get(t *testing.T) { testRelayersMap := map[types.RelayID]loop.Relayer{} testRelayersMap[types.RelayID{Network: "N1", ChainID: "C1"}] = &TestRelayer{} testRelayersMap[types.RelayID{Network: "N2", ChainID: "C2"}] = &TestRelayer{} @@ -59,7 +59,7 @@ func TestRelayerSet_Get(t *testing.T) { assert.Error(t, err) } -func TestRelayerSet_NewPluginProvider(t *testing.T) { +func TestUnit_RelayerSet_NewPluginProvider(t *testing.T) { testRelayersMap := map[types.RelayID]loop.Relayer{} testRelayer := &TestRelayer{} testRelayersMap[types.RelayID{Network: "N1", ChainID: "C1"}] = testRelayer diff --git a/core/services/ocr2/plugins/generic/telemetry_adapter_test.go b/core/services/ocr2/plugins/generic/telemetry_adapter_test.go index 6a281209540..b76432988dd 100644 --- a/core/services/ocr2/plugins/generic/telemetry_adapter_test.go +++ b/core/services/ocr2/plugins/generic/telemetry_adapter_test.go @@ -39,7 +39,7 @@ func (m *mockGenerator) GenMultitypeMonitoringEndpoint(network string, chainID s return nil } -func TestTelemetryAdapter(t *testing.T) { +func TestUnit_TelemetryAdapter(t *testing.T) { ta := generic.NewTelemetryAdapter(&mockGenerator{}) tests := []struct { diff --git a/core/services/ocr2/plugins/llo/config/config_test.go b/core/services/ocr2/plugins/llo/config/config_test.go index 0522a7f4a9f..a4924c93ab5 100644 --- a/core/services/ocr2/plugins/llo/config/config_test.go +++ b/core/services/ocr2/plugins/llo/config/config_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils" ) -func Test_Config(t *testing.T) { +func TestUnit_Config(t *testing.T) { t.Run("unmarshals from toml", func(t *testing.T) { cdjson := `{ "42": { @@ -144,7 +144,7 @@ func Test_Config(t *testing.T) { }) } -func Test_PluginConfig_Validate(t *testing.T) { +func TestUnit_PluginConfig_Validate(t *testing.T) { t.Run("with invalid URLs or keys", func(t *testing.T) { servers := map[string]utils.PlainHexBytes{ "not a valid url": utils.PlainHexBytes([]byte{1, 2, 3}), @@ -158,7 +158,7 @@ func Test_PluginConfig_Validate(t *testing.T) { }) } -func Test_PluginConfig_GetServers(t *testing.T) { +func TestUnit_PluginConfig_GetServers(t *testing.T) { t.Run("with multiple servers", func(t *testing.T) { servers := map[string]utils.PlainHexBytes{ "example.com:80": utils.PlainHexBytes([]byte{1, 2, 3}), diff --git a/core/services/ocr2/plugins/llo/onchain_channel_definition_cache_integration_test.go b/core/services/ocr2/plugins/llo/onchain_channel_definition_cache_integration_test.go index dc410f58d5f..830f0c43940 100644 --- a/core/services/ocr2/plugins/llo/onchain_channel_definition_cache_integration_test.go +++ b/core/services/ocr2/plugins/llo/onchain_channel_definition_cache_integration_test.go @@ -86,7 +86,7 @@ func (m *MockReadCloser) Close() error { return err } -func Test_ChannelDefinitionCache_Integration(t *testing.T) { +func TestUnit_ChannelDefinitionCache_Integration(t *testing.T) { var ( invalidDefinitions = []byte(`{{{`) invalidDefinitionsSHA = sha3.Sum256(invalidDefinitions) diff --git a/core/services/ocr2/plugins/median/config/config_test.go b/core/services/ocr2/plugins/median/config/config_test.go index e4e29d0b7fa..c82891f15a5 100644 --- a/core/services/ocr2/plugins/median/config/config_test.go +++ b/core/services/ocr2/plugins/median/config/config_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" ) -func TestValidatePluginConfig(t *testing.T) { +func TestUnit_ValidatePluginConfig(t *testing.T) { type testCase struct { name string pipeline string diff --git a/core/services/ocr2/plugins/mercury/config/config_test.go b/core/services/ocr2/plugins/mercury/config/config_test.go index c00d1a3f478..0aeea70f904 100644 --- a/core/services/ocr2/plugins/mercury/config/config_test.go +++ b/core/services/ocr2/plugins/mercury/config/config_test.go @@ -13,7 +13,7 @@ import ( var v1FeedId = [32]uint8{00, 01, 107, 74, 167, 229, 124, 167, 182, 138, 225, 191, 69, 101, 63, 86, 182, 86, 253, 58, 163, 53, 239, 127, 174, 105, 107, 102, 63, 27, 132, 114} var v2FeedId = [32]uint8{00, 02, 107, 74, 167, 229, 124, 167, 182, 138, 225, 191, 69, 101, 63, 86, 182, 86, 253, 58, 163, 53, 239, 127, 174, 105, 107, 102, 63, 27, 132, 114} -func Test_PluginConfig(t *testing.T) { +func TestUnit_PluginConfig(t *testing.T) { t.Run("Mercury v1", func(t *testing.T) { t.Run("with valid values", func(t *testing.T) { rawToml := ` @@ -180,7 +180,7 @@ func Test_PluginConfig(t *testing.T) { }) } -func Test_PluginConfig_GetServers(t *testing.T) { +func TestUnit_PluginConfig_GetServers(t *testing.T) { t.Run("with single server", func(t *testing.T) { pubKey := utils.PlainHexBytes([]byte{1, 2, 3}) pc := PluginConfig{RawServerURL: "example.com", ServerPubKey: pubKey} diff --git a/core/services/ocr2/plugins/mercury/plugin_test.go b/core/services/ocr2/plugins/mercury/plugin_test.go index 0b833eaee3b..cb6091f074e 100644 --- a/core/services/ocr2/plugins/mercury/plugin_test.go +++ b/core/services/ocr2/plugins/mercury/plugin_test.go @@ -90,7 +90,7 @@ var ( expectedLoopServiceCnt = expectedEmbeddedServiceCnt + 2 // factory server and loop unregisterer ) -func TestNewServices(t *testing.T) { +func TestUnit_NewServices(t *testing.T) { type args struct { pluginConfig job.JSONConfig feedID utils.FeedID diff --git a/core/services/ocr2/plugins/ocr2keeper/config_test.go b/core/services/ocr2/plugins/ocr2keeper/config_test.go index 82b0a448e4b..c0c121412f7 100644 --- a/core/services/ocr2/plugins/ocr2keeper/config_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/config_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestUnmarshalDuration(t *testing.T) { +func TestUnit_UnmarshalDuration(t *testing.T) { raw := `"2s"` var value Duration @@ -18,7 +18,7 @@ func TestUnmarshalDuration(t *testing.T) { assert.Equal(t, 2*time.Second, value.Value()) } -func TestUnmarshalConfig(t *testing.T) { +func TestUnit_UnmarshalConfig(t *testing.T) { raw := `{"cacheExpiration":"2s","maxServiceWorkers":42}` var config PluginConfig diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20/abi_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20/abi_test.go index a23a490a188..9767ab54731 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20/abi_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20/abi_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/keeper_registry_wrapper2_0" ) -func TestUnpackTransmitTxInput(t *testing.T) { +func TestUnit_UnpackTransmitTxInput(t *testing.T) { registryABI, err := abi.JSON(strings.NewReader(keeper_registry_wrapper2_0.KeeperRegistryABI)) assert.NoError(t, err) @@ -36,7 +36,7 @@ func TestUnpackTransmitTxInput(t *testing.T) { assert.Equal(t, rpt.ID.String(), expectedID.String()) } -func TestUnpackTransmitTxInputErrors(t *testing.T) { +func TestUnit_UnpackTransmitTxInputErrors(t *testing.T) { tests := []struct { Name string RawData string @@ -62,7 +62,7 @@ func TestUnpackTransmitTxInputErrors(t *testing.T) { } } -func TestUnpackCheckResults(t *testing.T) { +func TestUnit_UnpackCheckResults(t *testing.T) { registryABI, err := abi.JSON(strings.NewReader(keeper_registry_wrapper2_0.KeeperRegistryABI)) if err != nil { assert.NoError(t, err) @@ -123,7 +123,7 @@ func TestUnpackCheckResults(t *testing.T) { } } -func TestUnpackPerformResult(t *testing.T) { +func TestUnit_UnpackPerformResult(t *testing.T) { registryABI, err := abi.JSON(strings.NewReader(keeper_registry_wrapper2_0.KeeperRegistryABI)) if err != nil { assert.NoError(t, err) diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20/encoder_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20/encoder_test.go index b8f26aeb15c..60c3aa6a1ed 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20/encoder_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20/encoder_test.go @@ -10,7 +10,7 @@ import ( ocr2keepers "github.com/smartcontractkit/chainlink-automation/pkg/v2" ) -func TestEVMAutomationEncoder20(t *testing.T) { +func TestUnit_EVMAutomationEncoder20(t *testing.T) { encoder := EVMAutomationEncoder20{} t.Run("encoding an empty list of upkeep results returns a nil byte array", func(t *testing.T) { diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20/registry_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20/registry_test.go index cdea4ccb396..c72841745d5 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20/registry_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20/registry_test.go @@ -21,7 +21,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" ) -func TestGetActiveUpkeepKeys(t *testing.T) { +func TestUnit_GetActiveUpkeepKeys(t *testing.T) { tests := []struct { Name string LatestHead int64 @@ -75,7 +75,7 @@ func TestGetActiveUpkeepKeys(t *testing.T) { } } -func TestPollLogs(t *testing.T) { +func TestUnit_PollLogs(t *testing.T) { tests := []struct { Name string LastPoll int64 diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/active_list_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/active_list_test.go index 658451cafab..08e5e0cda52 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/active_list_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/active_list_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core" ) -func TestActiveUpkeepList(t *testing.T) { +func TestUnit_ActiveUpkeepList(t *testing.T) { logIDs := []ocr2keepers.UpkeepIdentifier{ core.GenUpkeepID(types.LogTrigger, "0"), core.GenUpkeepID(types.LogTrigger, "1"), @@ -92,7 +92,7 @@ func TestActiveUpkeepList(t *testing.T) { } } -func TestActiveUpkeepList_error(t *testing.T) { +func TestUnit_ActiveUpkeepList_error(t *testing.T) { t.Run("if invalid or negative numbers are in the store, they are excluded from the view operation", func(t *testing.T) { al := &activeList{} al.items = make(map[string]bool) diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/autotelemetry21/custom_telemetry_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/autotelemetry21/custom_telemetry_test.go index e561d076ef2..90444640fcf 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/autotelemetry21/custom_telemetry_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/autotelemetry21/custom_telemetry_test.go @@ -18,7 +18,7 @@ import ( // const blockSize = int64(4) const finality = uint32(4) -func TestNewAutomationCustomTelemetryService(t *testing.T) { +func TestUnit_NewAutomationCustomTelemetryService(t *testing.T) { me := &MockMonitoringEndpoint{} lggr := logger.TestLogger(t) var hb heads.Broadcaster diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/block_subscriber_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/block_subscriber_test.go index c550bc43700..a7a999667bd 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/block_subscriber_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/block_subscriber_test.go @@ -25,7 +25,7 @@ const historySize = 4 const blockSize = int64(4) const finality = uint32(4) -func TestBlockSubscriber_Subscribe(t *testing.T) { +func TestUnit_BlockSubscriber_Subscribe(t *testing.T) { lggr := logger.TestLogger(t) var hb heads.Broadcaster var lp logpoller.LogPoller @@ -44,7 +44,7 @@ func TestBlockSubscriber_Subscribe(t *testing.T) { assert.Equal(t, 3, subId) } -func TestBlockSubscriber_Unsubscribe(t *testing.T) { +func TestUnit_BlockSubscriber_Unsubscribe(t *testing.T) { lggr := logger.TestLogger(t) var hb heads.Broadcaster var lp logpoller.LogPoller @@ -62,7 +62,7 @@ func TestBlockSubscriber_Unsubscribe(t *testing.T) { assert.NoError(t, err) } -func TestBlockSubscriber_Unsubscribe_Failure(t *testing.T) { +func TestUnit_BlockSubscriber_Unsubscribe_Failure(t *testing.T) { lggr := logger.TestLogger(t) var hb heads.Broadcaster var lp logpoller.LogPoller @@ -74,7 +74,7 @@ func TestBlockSubscriber_Unsubscribe_Failure(t *testing.T) { assert.Equal(t, "subscriber 2 does not exist", err.Error()) } -func TestBlockSubscriber_GetBlockRange(t *testing.T) { +func TestUnit_BlockSubscriber_GetBlockRange(t *testing.T) { lggr := logger.TestLogger(t) var hb heads.Broadcaster @@ -113,7 +113,7 @@ func TestBlockSubscriber_GetBlockRange(t *testing.T) { } } -func TestBlockSubscriber_InitializeBlocks(t *testing.T) { +func TestUnit_BlockSubscriber_InitializeBlocks(t *testing.T) { lggr := logger.TestLogger(t) var hb heads.Broadcaster @@ -176,7 +176,7 @@ func TestBlockSubscriber_InitializeBlocks(t *testing.T) { } } -func TestBlockSubscriber_BuildHistory(t *testing.T) { +func TestUnit_BlockSubscriber_BuildHistory(t *testing.T) { lggr := logger.TestLogger(t) var hb heads.Broadcaster lp := new(mocks.LogPoller) @@ -226,7 +226,7 @@ func TestBlockSubscriber_BuildHistory(t *testing.T) { } } -func TestBlockSubscriber_Cleanup(t *testing.T) { +func TestUnit_BlockSubscriber_Cleanup(t *testing.T) { lggr := logger.TestLogger(t) var hb heads.Broadcaster lp := new(mocks.LogPoller) @@ -274,7 +274,7 @@ func TestBlockSubscriber_Cleanup(t *testing.T) { } } -func TestBlockSubscriber_Start(t *testing.T) { +func TestUnit_BlockSubscriber_Start(t *testing.T) { lggr := logger.TestLogger(t) hb := headstest.NewBroadcaster[*evmtypes.Head, common.Hash](t) hb.On("Subscribe", mock.Anything).Return(&evmtypes.Head{Number: 42}, func() {}) diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/payload_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/payload_test.go index 63de1f25ec4..295c24c9499 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/payload_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/payload_test.go @@ -12,7 +12,7 @@ import ( ocr2keepers "github.com/smartcontractkit/chainlink-common/pkg/types/automation" ) -func TestWorkID(t *testing.T) { +func TestUnit_WorkID(t *testing.T) { tests := []struct { name string upkeepID string @@ -94,7 +94,7 @@ func TestWorkID(t *testing.T) { } } -func TestNewUpkeepPayload(t *testing.T) { +func TestUnit_NewUpkeepPayload(t *testing.T) { tests := []struct { name string upkeepID *big.Int diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/trigger_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/trigger_test.go index 0a5d3fba4a0..32f99f8fa10 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/trigger_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/trigger_test.go @@ -12,7 +12,7 @@ import ( ocr2keepers "github.com/smartcontractkit/chainlink-common/pkg/types/automation" ) -func TestPackUnpackTrigger(t *testing.T) { +func TestUnit_PackUnpackTrigger(t *testing.T) { tests := []struct { name string id []byte diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/type_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/type_test.go index 1e4ec201b47..e052ab0edb2 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/type_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/type_test.go @@ -11,7 +11,7 @@ import ( ocr2keepers "github.com/smartcontractkit/chainlink-common/pkg/types/automation" ) -func TestGetUpkeepType(t *testing.T) { +func TestUnit_GetUpkeepType(t *testing.T) { tests := []struct { name string upkeepID []byte diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/utils_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/utils_test.go index 49b3cad7d92..152c7a6dd9c 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/utils_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/utils_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" ) -func TestUtils_GetTxBlock(t *testing.T) { +func TestUnit_Utils_GetTxBlock(t *testing.T) { tests := []struct { name string txHash common.Hash diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/encoding/encoder_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/encoding/encoder_test.go index 08ce0805bb0..ec5bd824001 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/encoding/encoder_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/encoding/encoder_test.go @@ -30,7 +30,7 @@ func init() { } } -func TestReportEncoder_EncodeExtract(t *testing.T) { +func TestUnit_ReportEncoder_EncodeExtract(t *testing.T) { encoder := reportEncoder{ packer: NewAbiPacker(), } @@ -111,7 +111,7 @@ func TestReportEncoder_EncodeExtract(t *testing.T) { } } -func TestReportEncoder_BackwardsCompatibility(t *testing.T) { +func TestUnit_ReportEncoder_BackwardsCompatibility(t *testing.T) { encoder := reportEncoder{ packer: NewAbiPacker(), } diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/encoding/packer_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/encoding/packer_test.go index 92bec6003ec..8ed3d532ddc 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/encoding/packer_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/encoding/packer_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core" ) -func TestPacker_PackReport(t *testing.T) { +func TestUnit_Packer_PackReport(t *testing.T) { for _, tc := range []struct { name string report ac.IAutomationV21PlusCommonReport @@ -115,7 +115,7 @@ func TestPacker_PackReport(t *testing.T) { } } -func TestPacker_UnpackCheckResults(t *testing.T) { +func TestUnit_Packer_UnpackCheckResults(t *testing.T) { uid, _ := new(big.Int).SetString("1843548457736589226156809205796175506139185429616502850435279853710366065936", 10) upkeepId := ocr2keepers.UpkeepIdentifier{} upkeepId.FromBigInt(uid) @@ -204,7 +204,7 @@ func TestPacker_UnpackCheckResults(t *testing.T) { } } -func TestPacker_UnpackPerformResult(t *testing.T) { +func TestUnit_Packer_UnpackPerformResult(t *testing.T) { tests := []struct { Name string RawData string @@ -227,7 +227,7 @@ func TestPacker_UnpackPerformResult(t *testing.T) { } } -func TestPacker_UnpackLogTriggerConfig(t *testing.T) { +func TestUnit_Packer_UnpackLogTriggerConfig(t *testing.T) { tests := []struct { name string raw []byte @@ -271,7 +271,7 @@ func TestPacker_UnpackLogTriggerConfig(t *testing.T) { } } -func TestPacker_PackReport_UnpackReport(t *testing.T) { +func TestUnit_Packer_PackReport_UnpackReport(t *testing.T) { report := ac.IAutomationV21PlusCommonReport{ FastGasWei: big.NewInt(1), LinkNative: big.NewInt(1), diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/gasprice/gasprice_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/gasprice/gasprice_test.go index 7bd106326b5..c213d507d08 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/gasprice/gasprice_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/gasprice/gasprice_test.go @@ -21,7 +21,7 @@ type WrongOffchainConfig struct { MaxGasPrice1 []int `json:"maxGasPrice1" cbor:"maxGasPrice1"` } -func TestGasPrice_Check(t *testing.T) { +func TestUnit_GasPrice_Check(t *testing.T) { lggr := logger.TestLogger(t) uid, _ := new(big.Int).SetString("1843548457736589226156809205796175506139185429616502850435279853710366065936", 10) diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/keyring_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/keyring_test.go index 92a05c2d760..3c7cb14a00c 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/keyring_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/keyring_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink-automation/pkg/v3/plugin" ) -func TestNewOnchainKeyringV3Wrapper(t *testing.T) { +func TestUnit_NewOnchainKeyringV3Wrapper(t *testing.T) { t.Run("the on chain keyring wrapper gets the public key and max signature length from the wrapped keyring", func(t *testing.T) { onchainKeyring := &mockOnchainKeyring{ MaxSignatureLengthFn: func() int { diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/block_time_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/block_time_test.go index 60c207b4031..7347c9bc616 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/block_time_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/block_time_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" ) -func TestBlockTimeResolver_BlockTime(t *testing.T) { +func TestUnit_BlockTimeResolver_BlockTime(t *testing.T) { now := time.Now() tests := []struct { diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer_v1_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer_v1_test.go index 3239cd1b270..e8d2003b486 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer_v1_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer_v1_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func TestLogEventBufferV1(t *testing.T) { +func TestUnit_LogEventBufferV1(t *testing.T) { buf := NewLogBuffer(logger.TestLogger(t), 10, 20, 1) buf.Enqueue(big.NewInt(1), @@ -32,7 +32,7 @@ func TestLogEventBufferV1(t *testing.T) { require.Equal(t, 0, remaining) } -func TestLogEventBufferV1_SyncFilters(t *testing.T) { +func TestUnit_LogEventBufferV1_SyncFilters(t *testing.T) { buf := NewLogBuffer(logger.TestLogger(t), 10, 20, 1) buf.Enqueue(big.NewInt(1), @@ -68,7 +68,7 @@ func (l *readableLogger) With(args ...any) logger.Logger { return l } -func TestLogEventBufferV1_EnqueueViolations(t *testing.T) { +func TestUnit_LogEventBufferV1_EnqueueViolations(t *testing.T) { t.Run("enqueuing logs for a block older than latest seen logs a message", func(t *testing.T) { logReceived := false readableLogger := &readableLogger{ @@ -136,7 +136,7 @@ func TestLogEventBufferV1_EnqueueViolations(t *testing.T) { }) } -func TestLogEventBufferV1_Dequeue(t *testing.T) { +func TestUnit_LogEventBufferV1_Dequeue(t *testing.T) { tests := []struct { name string logsInBuffer map[*big.Int][]logpoller.Log @@ -224,7 +224,7 @@ func TestLogEventBufferV1_Dequeue(t *testing.T) { } } -func TestLogEventBufferV1_Enqueue(t *testing.T) { +func TestUnit_LogEventBufferV1_Enqueue(t *testing.T) { tests := []struct { name string logsToAdd map[*big.Int][]logpoller.Log @@ -346,7 +346,7 @@ func TestLogEventBufferV1_Enqueue(t *testing.T) { } } -func TestLogEventBufferV1_UpkeepQueue(t *testing.T) { +func TestUnit_LogEventBufferV1_UpkeepQueue(t *testing.T) { t.Run("enqueue dequeue", func(t *testing.T) { q := newUpkeepLogQueue(logger.TestLogger(t), big.NewInt(1), newLogBufferOptions(10, 1, 1)) @@ -386,7 +386,7 @@ func TestLogEventBufferV1_UpkeepQueue(t *testing.T) { }) } -func TestLogEventBufferV1_UpkeepQueue_sizeOfRange(t *testing.T) { +func TestUnit_LogEventBufferV1_UpkeepQueue_sizeOfRange(t *testing.T) { t.Run("empty", func(t *testing.T) { q := newUpkeepLogQueue(logger.TestLogger(t), big.NewInt(1), newLogBufferOptions(10, 1, 1)) @@ -404,7 +404,7 @@ func TestLogEventBufferV1_UpkeepQueue_sizeOfRange(t *testing.T) { }) } -func TestLogEventBufferV1_UpkeepQueue_clean(t *testing.T) { +func TestUnit_LogEventBufferV1_UpkeepQueue_clean(t *testing.T) { t.Run("empty", func(t *testing.T) { q := newUpkeepLogQueue(logger.TestLogger(t), big.NewInt(1), newLogBufferOptions(10, 1, 1)) @@ -441,7 +441,7 @@ func TestLogEventBufferV1_UpkeepQueue_clean(t *testing.T) { }) } -func TestLogEventBufferV1_BlockWindow(t *testing.T) { +func TestUnit_LogEventBufferV1_BlockWindow(t *testing.T) { tests := []struct { name string block int64 diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/filter_store_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/filter_store_test.go index 955a5e3d863..7a7c421c963 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/filter_store_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/filter_store_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestFilterStore_CRUD(t *testing.T) { +func TestUnit_FilterStore_CRUD(t *testing.T) { tests := []struct { name string initial []upkeepFilter @@ -67,7 +67,7 @@ func TestFilterStore_CRUD(t *testing.T) { } } -func TestFilterStore_Concurrency(t *testing.T) { +func TestUnit_FilterStore_Concurrency(t *testing.T) { s := NewUpkeepFilterStore() var wg sync.WaitGroup diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/filter_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/filter_test.go index 53c3bf3b399..ccc59464ad1 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/filter_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/filter_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/logpoller" ) -func TestUpkeepFilter_Select(t *testing.T) { +func TestUnit_UpkeepFilter_Select(t *testing.T) { var zeroBytes [32]byte emptyTopic := common.BytesToHash(zeroBytes[:]) contractAddress := common.HexToAddress("0xB9F3af0c2CbfE108efd0E23F7b0a151Ea42f764E") diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/log_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/log_test.go index 919457de749..33aebc246e9 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/log_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/log_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/logpoller" ) -func TestLogComparatorSorter(t *testing.T) { +func TestUnit_LogComparatorSorter(t *testing.T) { tests := []struct { name string a logpoller.Log diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/provider_life_cycle_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/provider_life_cycle_test.go index 5da9b1b6f59..0c4803a4688 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/provider_life_cycle_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/provider_life_cycle_test.go @@ -19,7 +19,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core" ) -func TestLogEventProvider_LifeCycle(t *testing.T) { +func TestUnit_LogEventProvider_LifeCycle(t *testing.T) { tests := []struct { name string errored bool @@ -143,7 +143,7 @@ func TestLogEventProvider_LifeCycle(t *testing.T) { } } -func TestEventLogProvider_RefreshActiveUpkeeps(t *testing.T) { +func TestUnit_EventLogProvider_RefreshActiveUpkeeps(t *testing.T) { ctx := testutils.Context(t) mp := new(mocks.LogPoller) mp.On("RegisterFilter", mock.Anything, mock.Anything).Return(nil) @@ -186,7 +186,7 @@ func TestEventLogProvider_RefreshActiveUpkeeps(t *testing.T) { require.Equal(t, 1, p.filterStore.Size()) } -func TestLogEventProvider_ValidateLogTriggerConfig(t *testing.T) { +func TestUnit_LogEventProvider_ValidateLogTriggerConfig(t *testing.T) { contractAddress := common.HexToAddress("0xB9F3af0c2CbfE108efd0E23F7b0a151Ea42f764E") eventSig := common.HexToHash("0x3bdab8bffae631cfee411525ebae27f3fb61b10c662c09ec2a7dbb5854c87e8c") tests := []struct { diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/provider_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/provider_test.go index f3be7a3a4e4..d3b60df1371 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/provider_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/provider_test.go @@ -22,7 +22,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func TestLogEventProvider_GetFilters(t *testing.T) { +func TestUnit_LogEventProvider_GetFilters(t *testing.T) { p := NewLogProvider(logger.TestLogger(t), nil, big.NewInt(1), &mockedPacker{}, NewUpkeepFilterStore(), NewOptions(200, big.NewInt(1))) _, f := newEntry(p, 1) @@ -64,7 +64,7 @@ func TestLogEventProvider_GetFilters(t *testing.T) { }) } -func TestLogEventProvider_UpdateEntriesLastPoll(t *testing.T) { +func TestUnit_LogEventProvider_UpdateEntriesLastPoll(t *testing.T) { p := NewLogProvider(logger.TestLogger(t), nil, big.NewInt(1), &mockedPacker{}, NewUpkeepFilterStore(), NewOptions(200, big.NewInt(1))) n := 10 @@ -108,7 +108,7 @@ func TestLogEventProvider_UpdateEntriesLastPoll(t *testing.T) { }) } -func TestLogEventProvider_ScheduleReadJobs(t *testing.T) { +func TestUnit_LogEventProvider_ScheduleReadJobs(t *testing.T) { mp := new(mocks.LogPoller) tests := []struct { @@ -238,7 +238,7 @@ func TestLogEventProvider_ScheduleReadJobs(t *testing.T) { } } -func TestLogEventProvider_ReadLogs(t *testing.T) { +func TestUnit_LogEventProvider_ReadLogs(t *testing.T) { ctx := testutils.Context(t) mp := new(mocks.LogPoller) @@ -316,7 +316,7 @@ func remainingBlockWindowCounts(queues map[string]*upkeepLogQueue, blockRate int return blockWindowCounts } -func TestLogEventProvider_GetLatestPayloads(t *testing.T) { +func TestUnit_LogEventProvider_GetLatestPayloads(t *testing.T) { t.Run("dequeuing from an empty buffer returns 0 logs", func(t *testing.T) { opts := NewOptions(200, big.NewInt(42161)) diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/recoverer_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/recoverer_test.go index dadea53d7db..25024ecb5c9 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/recoverer_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/recoverer_test.go @@ -28,7 +28,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core/mocks" ) -func TestLogRecoverer_GetRecoverables(t *testing.T) { +func TestUnit_LogRecoverer_GetRecoverables(t *testing.T) { ctx := testutils.Context(t) lp := &lpmocks.LogPoller{} lp.On("LatestBlock", mock.Anything).Return(logpoller.Block{BlockNumber: 100}, nil) @@ -98,7 +98,7 @@ func TestLogRecoverer_GetRecoverables(t *testing.T) { } } -func TestLogRecoverer_Clean(t *testing.T) { +func TestUnit_LogRecoverer_Clean(t *testing.T) { oldLogsOffset := int64(20) tests := []struct { @@ -211,7 +211,7 @@ func TestLogRecoverer_Clean(t *testing.T) { } } -func TestLogRecoverer_Recover(t *testing.T) { +func TestUnit_LogRecoverer_Recover(t *testing.T) { ctx := testutils.Context(t) tests := []struct { @@ -454,7 +454,7 @@ func TestLogRecoverer_Recover(t *testing.T) { } } -func TestLogRecoverer_SelectFilterBatch(t *testing.T) { +func TestUnit_LogRecoverer_SelectFilterBatch(t *testing.T) { n := recoveryBatchSize*2 + 2 filters := []upkeepFilter{} for i := range n { @@ -471,7 +471,7 @@ func TestLogRecoverer_SelectFilterBatch(t *testing.T) { require.Len(t, batch, recoveryBatchSize/2) } -func TestLogRecoverer_getFilterBatch(t *testing.T) { +func TestUnit_LogRecoverer_getFilterBatch(t *testing.T) { tests := []struct { name string offsetBlock int64 @@ -519,7 +519,7 @@ func TestLogRecoverer_getFilterBatch(t *testing.T) { } } -func TestLogRecoverer_FilterFinalizedStates(t *testing.T) { +func TestUnit_LogRecoverer_FilterFinalizedStates(t *testing.T) { tests := []struct { name string logs []logpoller.Log @@ -560,7 +560,7 @@ func TestLogRecoverer_FilterFinalizedStates(t *testing.T) { } } -func TestLogRecoverer_GetProposalData(t *testing.T) { +func TestUnit_LogRecoverer_GetProposalData(t *testing.T) { for _, tc := range []struct { name string proposal ocr2keepers.CoordinatedBlockProposal @@ -1089,7 +1089,7 @@ func TestLogRecoverer_GetProposalData(t *testing.T) { } } -func TestLogRecoverer_pending(t *testing.T) { +func TestUnit_LogRecoverer_pending(t *testing.T) { tests := []struct { name string maxPerUpkeep int diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/mercury_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/mercury_test.go index 08cfe3d8c66..0718e78a22f 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/mercury_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/mercury_test.go @@ -19,7 +19,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/encoding" ) -func TestGenerateHMACFn(t *testing.T) { +func TestUnit_GenerateHMACFn(t *testing.T) { testCases := []struct { name string method string @@ -63,7 +63,7 @@ func TestGenerateHMACFn(t *testing.T) { } } -func TestPacker_DecodeStreamsLookupRequest(t *testing.T) { +func TestUnit_Packer_DecodeStreamsLookupRequest(t *testing.T) { tests := []struct { name string data []byte @@ -101,7 +101,7 @@ func TestPacker_DecodeStreamsLookupRequest(t *testing.T) { } } -func TestPacker_UnpackGetUpkeepPrivilegeConfig(t *testing.T) { +func TestUnit_Packer_UnpackGetUpkeepPrivilegeConfig(t *testing.T) { tests := []struct { name string raw []byte @@ -150,7 +150,7 @@ func TestPacker_UnpackGetUpkeepPrivilegeConfig(t *testing.T) { } } -func TestPacker_PackGetUpkeepPrivilegeConfig(t *testing.T) { +func TestUnit_Packer_PackGetUpkeepPrivilegeConfig(t *testing.T) { tests := []struct { name string upkeepId *big.Int @@ -190,7 +190,7 @@ func TestPacker_PackGetUpkeepPrivilegeConfig(t *testing.T) { } } -func TestPacker_UnpackCheckCallbackResult(t *testing.T) { +func TestUnit_Packer_UnpackCheckCallbackResult(t *testing.T) { tests := []struct { Name string CallbackResp []byte @@ -246,7 +246,7 @@ func TestPacker_UnpackCheckCallbackResult(t *testing.T) { } } -func TestPacker_PackUserCheckErrorHandler(t *testing.T) { +func TestUnit_Packer_PackUserCheckErrorHandler(t *testing.T) { tests := []struct { name string errCode encoding.ErrCode @@ -284,7 +284,7 @@ func TestPacker_PackUserCheckErrorHandler(t *testing.T) { } } -func Test_CalculateRetryConfigFn(t *testing.T) { +func TestUnit_CalculateRetryConfigFn(t *testing.T) { tests := []struct { name string times int diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/streams/streams_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/streams/streams_test.go index 594da9691a2..7ee4beb1e4d 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/streams/streams_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/streams/streams_test.go @@ -119,7 +119,7 @@ func setupStreams(t *testing.T) *streams { return streams } -func TestStreams_CheckErrorHandler(t *testing.T) { +func TestUnit_Streams_CheckErrorHandler(t *testing.T) { upkeepId := big.NewInt(123456789) blockNumber := uint64(999) tests := []struct { @@ -265,7 +265,7 @@ func TestStreams_CheckErrorHandler(t *testing.T) { } } -func TestStreams_CheckCallback(t *testing.T) { +func TestUnit_Streams_CheckCallback(t *testing.T) { upkeepId := big.NewInt(123456789) bn := uint64(999) bs := []byte{183, 114, 215, 10, 0, 0, 0, 0, 0, 0} @@ -419,7 +419,7 @@ func TestStreams_CheckCallback(t *testing.T) { } } -func TestStreams_AllowedToUseMercury(t *testing.T) { +func TestUnit_Streams_AllowedToUseMercury(t *testing.T) { upkeepId, ok := new(big.Int).SetString("71022726777042968814359024671382968091267501884371696415772139504780367423725", 10) assert.True(t, ok, t.Name()) tests := []struct { @@ -604,7 +604,7 @@ func TestStreams_AllowedToUseMercury(t *testing.T) { } } -func TestStreams_StreamsLookup(t *testing.T) { +func TestUnit_Streams_StreamsLookup(t *testing.T) { upkeepId, ok := new(big.Int).SetString("71022726777042968814359024671382968091267501884371696415772139504780367423725", 10) var upkeepIdentifier [32]byte copy(upkeepIdentifier[:], upkeepId.Bytes()) 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 e971102afea..f96844b3f7b 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 @@ -100,7 +100,7 @@ func setupClient(t *testing.T) *client { return client } -func TestV02_SingleFeedRequest(t *testing.T) { +func TestUnit_V02_SingleFeedRequest(t *testing.T) { t.Parallel() upkeepId := big.NewInt(123456789) tests := []struct { @@ -383,7 +383,7 @@ func TestV02_SingleFeedRequest(t *testing.T) { } } -func TestV02_DoMercuryRequestV02(t *testing.T) { +func TestUnit_V02_DoMercuryRequestV02(t *testing.T) { t.Parallel() upkeepId, _ := new(big.Int).SetString("88786950015966611018675766524283132478093844178961698330929478019253453382042", 10) pluginRetryKey := "88786950015966611018675766524283132478093844178961698330929478019253453382042|34" @@ -627,7 +627,7 @@ func TestV02_DoMercuryRequestV02(t *testing.T) { } } -func TestV02_DoMercuryRequestV02_MultipleFeedsSuccess(t *testing.T) { +func TestUnit_V02_DoMercuryRequestV02_MultipleFeedsSuccess(t *testing.T) { t.Parallel() upkeepId, _ := new(big.Int).SetString("88786950015966611018675766524283132478093844178961698330929478019253453382042", 10) pluginRetryKey := "88786950015966611018675766524283132478093844178961698330929478019253453382042|34" @@ -669,7 +669,7 @@ func TestV02_DoMercuryRequestV02_MultipleFeedsSuccess(t *testing.T) { assert.Equal(t, encoding.NoPipelineError, state) } -func TestV02_DoMercuryRequestV02_Timeout(t *testing.T) { +func TestUnit_V02_DoMercuryRequestV02_Timeout(t *testing.T) { t.Parallel() upkeepId, _ := new(big.Int).SetString("88786950015966611018675766524283132478093844178961698330929478019253453382042", 10) pluginRetryKey := "88786950015966611018675766524283132478093844178961698330929478019253453382042|34" @@ -724,7 +724,7 @@ func TestV02_DoMercuryRequestV02_Timeout(t *testing.T) { assert.Equal(t, [][]byte(nil), values) } -func TestV02_DoMercuryRequestV02_OneFeedSuccessOneFeedPipelineError(t *testing.T) { +func TestUnit_V02_DoMercuryRequestV02_OneFeedSuccessOneFeedPipelineError(t *testing.T) { t.Parallel() upkeepId, _ := new(big.Int).SetString("88786950015966611018675766524283132478093844178961698330929478019253453382042", 10) pluginRetryKey := "88786950015966611018675766524283132478093844178961698330929478019253453382042|34" @@ -772,7 +772,7 @@ func TestV02_DoMercuryRequestV02_OneFeedSuccessOneFeedPipelineError(t *testing.T assert.Equal(t, [][]byte(nil), values) } -func TestV02_DoMercuryRequestV02_OneFeedSuccessOneFeedErrCode(t *testing.T) { +func TestUnit_V02_DoMercuryRequestV02_OneFeedSuccessOneFeedErrCode(t *testing.T) { t.Parallel() upkeepId, _ := new(big.Int).SetString("88786950015966611018675766524283132478093844178961698330929478019253453382042", 10) pluginRetryKey := "88786950015966611018675766524283132478093844178961698330929478019253453382042|34" @@ -820,7 +820,7 @@ func TestV02_DoMercuryRequestV02_OneFeedSuccessOneFeedErrCode(t *testing.T) { assert.Equal(t, encoding.NoPipelineError, state) } -func TestV02_DoMercuryRequestV02_OneFeedSuccessOneFeedPipelineErrorConvertedError(t *testing.T) { +func TestUnit_V02_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 f68fbdc66fd..ce5be33d01c 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 @@ -98,7 +98,7 @@ func setupClient(t *testing.T) *client { return client } -func TestV03_DoMercuryRequestV03(t *testing.T) { +func TestUnit_V03_DoMercuryRequestV03(t *testing.T) { t.Parallel() upkeepId, _ := new(big.Int).SetString("88786950015966611018675766524283132478093844178961698330929478019253453382042", 10) @@ -179,7 +179,7 @@ func TestV03_DoMercuryRequestV03(t *testing.T) { } } -func TestV03_DoMercuryRequestV03_MultipleFeedsSuccess(t *testing.T) { +func TestUnit_V03_DoMercuryRequestV03_MultipleFeedsSuccess(t *testing.T) { t.Parallel() upkeepId, _ := new(big.Int).SetString("88786950015966611018675766524283132478093844178961698330929478019253453382042", 10) pluginRetryKey := "88786950015966611018675766524283132478093844178961698330929478019253453382042|34" @@ -231,7 +231,7 @@ func TestV03_DoMercuryRequestV03_MultipleFeedsSuccess(t *testing.T) { assert.Equal(t, encoding.NoPipelineError, state) } -func TestV03_DoMercuryRequestV03_Timeout(t *testing.T) { +func TestUnit_V03_DoMercuryRequestV03_Timeout(t *testing.T) { t.Skip("TODO: MERC-5965") t.Parallel() upkeepId, _ := new(big.Int).SetString("88786950015966611018675766524283132478093844178961698330929478019253453382042", 10) @@ -289,7 +289,7 @@ func TestV03_DoMercuryRequestV03_Timeout(t *testing.T) { assert.Equal(t, [][]byte(nil), values) } -func TestV03_DoMercuryRequestV03_OneFeedSuccessOneFeedPipelineError(t *testing.T) { +func TestUnit_V03_DoMercuryRequestV03_OneFeedSuccessOneFeedPipelineError(t *testing.T) { t.Parallel() upkeepId, _ := new(big.Int).SetString("88786950015966611018675766524283132478093844178961698330929478019253453382042", 10) pluginRetryKey := "88786950015966611018675766524283132478093844178961698330929478019253453382042|34" @@ -346,7 +346,7 @@ func TestV03_DoMercuryRequestV03_OneFeedSuccessOneFeedPipelineError(t *testing.T assert.Equal(t, [][]byte(nil), values) } -func TestV03_DoMercuryRequestV03_OneFeedSuccessOneFeedErrCode(t *testing.T) { +func TestUnit_V03_DoMercuryRequestV03_OneFeedSuccessOneFeedErrCode(t *testing.T) { t.Parallel() upkeepId, _ := new(big.Int).SetString("88786950015966611018675766524283132478093844178961698330929478019253453382042", 10) pluginRetryKey := "88786950015966611018675766524283132478093844178961698330929478019253453382042|34" @@ -417,7 +417,7 @@ func TestV03_DoMercuryRequestV03_OneFeedSuccessOneFeedErrCode(t *testing.T) { assert.Equal(t, encoding.NoPipelineError, state) } -func TestV03_MultiFeedRequest(t *testing.T) { +func TestUnit_V03_MultiFeedRequest(t *testing.T) { t.Parallel() upkeepId := big.NewInt(123456789) tests := []struct { diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/payload_builder_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/payload_builder_test.go index d5837488ff4..4faaedcd2d0 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/payload_builder_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/payload_builder_test.go @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider" ) -func TestNewPayloadBuilder(t *testing.T) { +func TestUnit_NewPayloadBuilder(t *testing.T) { for _, tc := range []struct { name string activeList ActiveUpkeepList diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/registry_check_pipeline_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/registry_check_pipeline_test.go index ac3b2a73203..71f3cc32a4d 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/registry_check_pipeline_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/registry_check_pipeline_test.go @@ -33,7 +33,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mocks" ) -func TestRegistry_GetBlockAndUpkeepId(t *testing.T) { +func TestUnit_Registry_GetBlockAndUpkeepId(t *testing.T) { r := &EvmRegistry{} tests := []struct { name string @@ -78,7 +78,7 @@ func TestRegistry_GetBlockAndUpkeepId(t *testing.T) { } } -func TestRegistry_VerifyCheckBlock(t *testing.T) { +func TestUnit_Registry_VerifyCheckBlock(t *testing.T) { lggr := logger.Test(t) upkeepId := ocr2keepers.UpkeepIdentifier{} upkeepId.FromBigInt(big.NewInt(12345)) @@ -225,7 +225,7 @@ func (p *mockLogPoller) IndexedLogs(ctx context.Context, eventSig common.Hash, a return p.IndexedLogsFn(ctx, eventSig, address, topicIndex, topicValues, confs) } -func TestRegistry_VerifyLogExists(t *testing.T) { +func TestUnit_Registry_VerifyLogExists(t *testing.T) { lggr := logger.Test(t) upkeepId := ocr2keepers.UpkeepIdentifier{} upkeepId.FromBigInt(big.NewInt(12345)) @@ -375,7 +375,7 @@ func TestRegistry_VerifyLogExists(t *testing.T) { } } -func TestRegistry_CheckUpkeeps(t *testing.T) { +func TestUnit_Registry_CheckUpkeeps(t *testing.T) { lggr := logger.Test(t) uid0 := core.GenUpkeepID(autotypes.UpkeepType(0), "p0") uid1 := core.GenUpkeepID(autotypes.UpkeepType(1), "p1") @@ -536,7 +536,7 @@ func TestRegistry_CheckUpkeeps(t *testing.T) { } } -func TestRegistry_SimulatePerformUpkeeps(t *testing.T) { +func TestUnit_Registry_SimulatePerformUpkeeps(t *testing.T) { uid0 := core.GenUpkeepID(autotypes.UpkeepType(0), "p0") uid1 := core.GenUpkeepID(autotypes.UpkeepType(1), "p1") uid2 := core.GenUpkeepID(autotypes.UpkeepType(1), "p2") diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/registry_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/registry_test.go index 8867ed7dbf1..865c06ed091 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/registry_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/registry_test.go @@ -33,7 +33,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider" ) -func TestMercuryConfig_RemoveTrailingSlash(t *testing.T) { +func TestUnit_MercuryConfig_RemoveTrailingSlash(t *testing.T) { tests := []struct { Name string URL string @@ -76,7 +76,7 @@ func TestMercuryConfig_RemoveTrailingSlash(t *testing.T) { } } -func TestPollLogs(t *testing.T) { +func TestUnit_PollLogs(t *testing.T) { tests := []struct { Name string LastPoll int64 @@ -244,7 +244,7 @@ func TestPollLogs(t *testing.T) { } } -func TestRegistry_refreshLogTriggerUpkeeps(t *testing.T) { +func TestUnit_Registry_refreshLogTriggerUpkeeps(t *testing.T) { for _, tc := range []struct { name string ids []*big.Int diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/transmit/cache_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/transmit/cache_test.go index 687dbfdbfec..1a0fe00a817 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/transmit/cache_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/transmit/cache_test.go @@ -8,7 +8,7 @@ import ( ocr2keepers "github.com/smartcontractkit/chainlink-common/pkg/types/automation" ) -func TestTransmitEventCache_Sanity(t *testing.T) { +func TestUnit_TransmitEventCache_Sanity(t *testing.T) { tests := []struct { name string cap int64 diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/transmit/encoding_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/transmit/encoding_test.go index f08f6a44edf..ac20545709c 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/transmit/encoding_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/transmit/encoding_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core" ) -func TestTransmitEventLog(t *testing.T) { +func TestUnit_TransmitEventLog(t *testing.T) { uid := core.GenUpkeepID(types.ConditionTrigger, "111") tests := []struct { diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/transmit/event_provider_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/transmit/event_provider_test.go index fb25ad2dda2..43190141f28 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/transmit/event_provider_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/transmit/event_provider_test.go @@ -23,7 +23,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core" ) -func TestTransmitEventProvider_Sanity(t *testing.T) { +func TestUnit_TransmitEventProvider_Sanity(t *testing.T) { ctx := testutils.Context(t) lp := new(mocks.LogPoller) @@ -100,7 +100,7 @@ func TestTransmitEventProvider_Sanity(t *testing.T) { } } -func TestTransmitEventProvider_ProcessLogs(t *testing.T) { +func TestUnit_TransmitEventProvider_ProcessLogs(t *testing.T) { lp := new(mocks.LogPoller) lp.On("RegisterFilter", mock.Anything, mock.Anything).Return(nil) client := clienttest.NewClient(t) diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/upkeep_provider_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/upkeep_provider_test.go index dbe47967740..e9d6f5472ba 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/upkeep_provider_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/upkeep_provider_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core" ) -func TestUpkeepProvider_GetActiveUpkeeps(t *testing.T) { +func TestUnit_UpkeepProvider_GetActiveUpkeeps(t *testing.T) { ctx := testutils.Context(t) var lp logpoller.LogPoller diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/upkeepstate/orm_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/upkeepstate/orm_test.go index ea494bd517d..a0e773f9f33 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/upkeepstate/orm_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/upkeepstate/orm_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" ) -func TestInsertSelectDelete(t *testing.T) { +func TestUnit_InsertSelectDelete(t *testing.T) { ctx := testutils.Context(t) chainID := testutils.FixtureChainID db := pgtest.NewSqlxDB(t) diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/upkeepstate/scanner_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/upkeepstate/scanner_test.go index 6c78e019717..e6524e3eb21 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/upkeepstate/scanner_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/upkeepstate/scanner_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func TestPerformedEventsScanner(t *testing.T) { +func TestUnit_PerformedEventsScanner(t *testing.T) { ctx := testutils.Context(t) registryAddr := common.HexToAddress("0x12345") lggr := logger.TestLogger(t) @@ -111,7 +111,7 @@ func TestPerformedEventsScanner(t *testing.T) { } } -func TestPerformedEventsScanner_Batch(t *testing.T) { +func TestUnit_PerformedEventsScanner_Batch(t *testing.T) { ctx := testutils.Context(t) registryAddr := common.HexToAddress("0x12345") lggr := logger.TestLogger(t) diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/upkeepstate/store_test.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/upkeepstate/store_test.go index def0a44a2a4..2960f68eed1 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/upkeepstate/store_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/upkeepstate/store_test.go @@ -20,7 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func TestUpkeepStateStore(t *testing.T) { +func TestUnit_UpkeepStateStore(t *testing.T) { tests := []struct { name string inserts []ocr2keepers.CheckResult @@ -196,7 +196,7 @@ func TestUpkeepStateStore(t *testing.T) { } } -func TestUpkeepStateStore_SetSelectIntegration(t *testing.T) { +func TestUnit_UpkeepStateStore_SetSelectIntegration(t *testing.T) { if testing.Short() { t.Skip("database required for upkeep state store integration test") } @@ -379,7 +379,7 @@ func TestUpkeepStateStore_SetSelectIntegration(t *testing.T) { } } -func TestUpkeepStateStore_emptyDB(t *testing.T) { +func TestUnit_UpkeepStateStore_emptyDB(t *testing.T) { t.Run("querying non-stored workIDs on empty db returns unknown state results", func(t *testing.T) { lggr, observedLogs := logger.TestLoggerObserved(t, zapcore.ErrorLevel) chainID := testutils.FixtureChainID @@ -413,7 +413,7 @@ func TestUpkeepStateStore_emptyDB(t *testing.T) { }) } -func TestUpkeepStateStore_Upsert(t *testing.T) { +func TestUnit_UpkeepStateStore_Upsert(t *testing.T) { db := pgtest.NewSqlxDB(t) ctx := testutils.Context(t) lggr := logger.TestLogger(t) @@ -443,7 +443,7 @@ func TestUpkeepStateStore_Upsert(t *testing.T) { require.True(t, now.After(addedAt)) } -func TestUpkeepStateStore_Service(t *testing.T) { +func TestUnit_UpkeepStateStore_Service(t *testing.T) { ctx := testutils.Context(t) orm := &mockORM{ onDelete: func(tm time.Time) { diff --git a/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go b/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go index 05b5d1d13aa..b4c240b6da1 100644 --- a/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go @@ -63,7 +63,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" ) -func TestFilterNamesFromSpec21(t *testing.T) { +func TestUnit_FilterNamesFromSpec21(t *testing.T) { b := make([]byte, 20) _, err := crand.Read(b) require.NoError(t, err) diff --git a/core/services/ocr2/plugins/ocr2keeper/integration_test.go b/core/services/ocr2/plugins/ocr2keeper/integration_test.go index 3a3711dd18b..915bfc63cd3 100644 --- a/core/services/ocr2/plugins/ocr2keeper/integration_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/integration_test.go @@ -708,7 +708,7 @@ func TestIntegration_KeeperPluginForwarderEnabled(t *testing.T) { func ptr[T any](v T) *T { return &v } -func TestFilterNamesFromSpec20(t *testing.T) { +func TestUnit_FilterNamesFromSpec20(t *testing.T) { b := make([]byte, 20) _, err := rand.Read(b) require.NoError(t, err) diff --git a/core/services/ocr2/plugins/promwrapper/plugin_test.go b/core/services/ocr2/plugins/promwrapper/plugin_test.go index 371c03e78df..3880b0791cb 100644 --- a/core/services/ocr2/plugins/promwrapper/plugin_test.go +++ b/core/services/ocr2/plugins/promwrapper/plugin_test.go @@ -65,7 +65,7 @@ func (fakeReportingPlugin) Close() error { var _ types.ReportingPlugin = &fakeReportingPlugin{} -func TestPlugin_MustInstantiate(t *testing.T) { +func TestUnit_Plugin_MustInstantiate(t *testing.T) { // Ensure instantiation without panic for no override backend. var reportingPlugin = &fakeReportingPlugin{} promPlugin := New(reportingPlugin, "test", "EVM", big.NewInt(1), types.ReportingPluginConfig{}, nil) @@ -77,7 +77,7 @@ func TestPlugin_MustInstantiate(t *testing.T) { require.NotNil(t, promPlugin) } -func TestPlugin_GetLatencies(t *testing.T) { +func TestUnit_Plugin_GetLatencies(t *testing.T) { // Use arbitrary report timestamp and label values. configDigest := common.BytesToHash(crypto.Keccak256([]byte("foobar"))) reportTimestamp := types.ReportTimestamp{ diff --git a/core/services/ocr2/plugins/s4/factory_test.go b/core/services/ocr2/plugins/s4/factory_test.go index 856caa99692..0bb872ac567 100644 --- a/core/services/ocr2/plugins/s4/factory_test.go +++ b/core/services/ocr2/plugins/s4/factory_test.go @@ -15,7 +15,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestS4ReportingPluginFactory_NewReportingPlugin(t *testing.T) { +func TestIntegration_Shared_S4ReportingPluginFactory_NewReportingPlugin(t *testing.T) { t.Parallel() logger := commonlogger.NewOCRWrapper(logger.TestLogger(t), true, func(msg string) {}) diff --git a/core/services/ocr2/plugins/s4/integration_test.go b/core/services/ocr2/plugins/s4/integration_test.go index 47ed51b690d..d17b9998d7c 100644 --- a/core/services/ocr2/plugins/s4/integration_test.go +++ b/core/services/ocr2/plugins/s4/integration_test.go @@ -153,7 +153,7 @@ func checkNoUnconfirmedRows(ctx context.Context, t *testing.T, orm s4_svc.ORM, l assert.Empty(t, rows) } -func TestS4Integration_HappyDON(t *testing.T) { +func TestIntegration_Shared_S4Integration_HappyDON(t *testing.T) { don := newDON(t, 4, createPluginConfig(100)) ctx := testutils.Context(t) @@ -179,7 +179,7 @@ func TestS4Integration_HappyDON(t *testing.T) { } } -func TestS4Integration_HappyDON_4X(t *testing.T) { +func TestUnit_S4Integration_HappyDON_4X(t *testing.T) { don := newDON(t, 4, createPluginConfig(100)) ctx := testutils.Context(t) @@ -208,7 +208,7 @@ func TestS4Integration_HappyDON_4X(t *testing.T) { } } -func TestS4Integration_WrongSignature(t *testing.T) { +func TestUnit_S4Integration_WrongSignature(t *testing.T) { don := newDON(t, 4, createPluginConfig(100)) ctx := testutils.Context(t) @@ -243,7 +243,7 @@ func TestS4Integration_WrongSignature(t *testing.T) { require.Len(t, ur, 1) } -func TestS4Integration_MaxObservations(t *testing.T) { +func TestUnit_S4Integration_MaxObservations(t *testing.T) { config := createPluginConfig(100) config.MaxObservationEntries = 5 don := newDON(t, 4, config) @@ -270,7 +270,7 @@ func TestS4Integration_MaxObservations(t *testing.T) { } } -func TestS4Integration_Expired(t *testing.T) { +func TestUnit_S4Integration_Expired(t *testing.T) { config := createPluginConfig(100) config.MaxObservationEntries = 5 don := newDON(t, 4, config) @@ -295,7 +295,7 @@ func TestS4Integration_Expired(t *testing.T) { } } -func TestS4Integration_NSnapshotShards(t *testing.T) { +func TestUnit_S4Integration_NSnapshotShards(t *testing.T) { config := createPluginConfig(10000) config.NSnapshotShards = 4 don := newDON(t, 4, config) @@ -323,7 +323,7 @@ func TestS4Integration_NSnapshotShards(t *testing.T) { } } -func TestS4Integration_OneNodeOutOfSync(t *testing.T) { +func TestUnit_S4Integration_OneNodeOutOfSync(t *testing.T) { don := newDON(t, 4, createPluginConfig(100)) ctx := testutils.Context(t) @@ -350,7 +350,7 @@ func TestS4Integration_OneNodeOutOfSync(t *testing.T) { checkNoUnconfirmedRows(ctx, t, don.orms[don.size-1], 10) } -func TestS4Integration_RandomState(t *testing.T) { +func TestUnit_S4Integration_RandomState(t *testing.T) { don := newDON(t, 4, createPluginConfig(1000)) ctx := testutils.Context(t) diff --git a/core/services/ocr2/plugins/s4/messages_test.go b/core/services/ocr2/plugins/s4/messages_test.go index 55c65eec8df..7d6f684e233 100644 --- a/core/services/ocr2/plugins/s4/messages_test.go +++ b/core/services/ocr2/plugins/s4/messages_test.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/require" ) -func Test_MarshalUnmarshalRows(t *testing.T) { +func TestUnit_MarshalUnmarshalRows(t *testing.T) { t.Parallel() const n = 1000 @@ -32,7 +32,7 @@ func Test_MarshalUnmarshalRows(t *testing.T) { require.Equal(t, data, data2) } -func Test_MarshalUnmarshalQuery(t *testing.T) { +func TestUnit_MarshalUnmarshalQuery(t *testing.T) { t.Parallel() const n = 100 @@ -83,7 +83,7 @@ func marshalUnmarshal(t *testing.T, row *s4.Row) *s4.Row { return rows[0] } -func Test_VerifySignature(t *testing.T) { +func TestUnit_VerifySignature(t *testing.T) { t.Parallel() rows := generateTestRows(t, 2, time.Minute) diff --git a/core/services/ocr2/plugins/s4/plugin_test.go b/core/services/ocr2/plugins/s4/plugin_test.go index 236b54fd5ef..9379ee83488 100644 --- a/core/services/ocr2/plugins/s4/plugin_test.go +++ b/core/services/ocr2/plugins/s4/plugin_test.go @@ -119,7 +119,7 @@ func rowsToShapshotRows(rows []*s4_svc.Row) []*s4_svc.SnapshotRow { return versions } -func TestPlugin_NewReportingPlugin(t *testing.T) { +func TestUnit_Plugin_NewReportingPlugin(t *testing.T) { t.Parallel() logger := commonlogger.NewOCRWrapper(logger.TestLogger(t), true, func(msg string) {}) @@ -165,7 +165,7 @@ func TestPlugin_NewReportingPlugin(t *testing.T) { }) } -func TestPlugin_Close(t *testing.T) { +func TestUnit_Plugin_Close(t *testing.T) { t.Parallel() logger := commonlogger.NewOCRWrapper(logger.TestLogger(t), true, func(msg string) {}) @@ -178,7 +178,7 @@ func TestPlugin_Close(t *testing.T) { assert.NoError(t, err) } -func TestPlugin_ShouldTransmitAcceptedReport(t *testing.T) { +func TestUnit_Plugin_ShouldTransmitAcceptedReport(t *testing.T) { t.Parallel() logger := commonlogger.NewOCRWrapper(logger.TestLogger(t), true, func(msg string) {}) @@ -192,7 +192,7 @@ func TestPlugin_ShouldTransmitAcceptedReport(t *testing.T) { assert.False(t, should) } -func TestPlugin_ShouldAcceptFinalizedReport(t *testing.T) { +func TestUnit_Plugin_ShouldAcceptFinalizedReport(t *testing.T) { t.Parallel() logger := commonlogger.NewOCRWrapper(logger.TestLogger(t), true, func(msg string) {}) @@ -252,7 +252,7 @@ func TestPlugin_ShouldAcceptFinalizedReport(t *testing.T) { }) } -func TestPlugin_Query(t *testing.T) { +func TestUnit_Plugin_Query(t *testing.T) { t.Parallel() logger := commonlogger.NewOCRWrapper(logger.TestLogger(t), true, func(msg string) {}) @@ -329,7 +329,7 @@ func TestPlugin_Query(t *testing.T) { }) } -func TestPlugin_Observation(t *testing.T) { +func TestUnit_Plugin_Observation(t *testing.T) { t.Parallel() logger := commonlogger.NewOCRWrapper(logger.TestLogger(t), true, func(msg string) {}) @@ -462,7 +462,7 @@ func TestPlugin_Observation(t *testing.T) { }) } -func TestPlugin_Report(t *testing.T) { +func TestUnit_Plugin_Report(t *testing.T) { t.Parallel() logger := commonlogger.NewOCRWrapper(logger.TestLogger(t), true, func(msg string) {}) diff --git a/core/services/ocr2/plugins/threshold/decryption_queue_test.go b/core/services/ocr2/plugins/threshold/decryption_queue_test.go index afa2f2b706b..f9ba5ea9c07 100644 --- a/core/services/ocr2/plugins/threshold/decryption_queue_test.go +++ b/core/services/ocr2/plugins/threshold/decryption_queue_test.go @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" ) -func Test_decryptionQueue_NewThresholdDecryptor(t *testing.T) { +func TestUnit_decryptionQueue_NewThresholdDecryptor(t *testing.T) { lggr := logger.TestLogger(t) dq := NewDecryptionQueue(5, 1001, 64, 1002, lggr) @@ -26,7 +26,7 @@ func Test_decryptionQueue_NewThresholdDecryptor(t *testing.T) { assert.Equal(t, time.Duration(1002), dq.completedRequestsCacheTimeout) } -func Test_decryptionQueue_Decrypt_ReturnResultAfterCallingDecrypt(t *testing.T) { +func TestUnit_decryptionQueue_Decrypt_ReturnResultAfterCallingDecrypt(t *testing.T) { lggr := logger.TestLogger(t) dq := NewDecryptionQueue(5, 1000, 64, testutils.WaitTimeout(t), lggr) @@ -44,7 +44,7 @@ func Test_decryptionQueue_Decrypt_ReturnResultAfterCallingDecrypt(t *testing.T) } } -func Test_decryptionQueue_Decrypt_CiphertextIdTooLarge(t *testing.T) { +func TestUnit_decryptionQueue_Decrypt_CiphertextIdTooLarge(t *testing.T) { lggr := logger.TestLogger(t) dq := NewDecryptionQueue(1, 1000, 16, testutils.WaitTimeout(t), lggr) @@ -54,7 +54,7 @@ func Test_decryptionQueue_Decrypt_CiphertextIdTooLarge(t *testing.T) { assert.Equal(t, "ciphertextId too large", err.Error()) } -func Test_decryptionQueue_Decrypt_EmptyCiphertextId(t *testing.T) { +func TestUnit_decryptionQueue_Decrypt_EmptyCiphertextId(t *testing.T) { lggr := logger.TestLogger(t) dq := NewDecryptionQueue(1, 1000, 64, testutils.WaitTimeout(t), lggr) @@ -64,7 +64,7 @@ func Test_decryptionQueue_Decrypt_EmptyCiphertextId(t *testing.T) { assert.Equal(t, "ciphertextId is empty", err.Error()) } -func Test_decryptionQueue_Decrypt_CiphertextTooLarge(t *testing.T) { +func TestUnit_decryptionQueue_Decrypt_CiphertextTooLarge(t *testing.T) { lggr := logger.TestLogger(t) dq := NewDecryptionQueue(1, 10, 64, testutils.WaitTimeout(t), lggr) @@ -74,7 +74,7 @@ func Test_decryptionQueue_Decrypt_CiphertextTooLarge(t *testing.T) { assert.Equal(t, "ciphertext too large", err.Error()) } -func Test_decryptionQueue_Decrypt_EmptyCiphertext(t *testing.T) { +func TestUnit_decryptionQueue_Decrypt_EmptyCiphertext(t *testing.T) { lggr := logger.TestLogger(t) dq := NewDecryptionQueue(1, 1000, 64, testutils.WaitTimeout(t), lggr) @@ -84,7 +84,7 @@ func Test_decryptionQueue_Decrypt_EmptyCiphertext(t *testing.T) { assert.Equal(t, "ciphertext is empty", err.Error()) } -func Test_decryptionQueue_Decrypt_DuplicateCiphertextId(t *testing.T) { +func TestUnit_decryptionQueue_Decrypt_DuplicateCiphertextId(t *testing.T) { lggr := logger.TestLogger(t) dq := NewDecryptionQueue(1, 1000, 64, testutils.WaitTimeout(t), lggr) @@ -101,7 +101,7 @@ func Test_decryptionQueue_Decrypt_DuplicateCiphertextId(t *testing.T) { assert.Equal(t, "ciphertextId must be unique", err.Error()) } -func Test_decryptionQueue_Decrypt_ContextCancelled(t *testing.T) { +func TestUnit_decryptionQueue_Decrypt_ContextCancelled(t *testing.T) { lggr := logger.TestLogger(t) dq := NewDecryptionQueue(1, 1000, 64, 100, lggr) @@ -112,7 +112,7 @@ func Test_decryptionQueue_Decrypt_ContextCancelled(t *testing.T) { assert.Equal(t, "context provided by caller was cancelled", err.Error()) } -func Test_decryptionQueue_Decrypt_QueueFull(t *testing.T) { +func TestUnit_decryptionQueue_Decrypt_QueueFull(t *testing.T) { lggr := logger.TestLogger(t) dq := NewDecryptionQueue(1, 1000, 64, testutils.WaitTimeout(t), lggr) @@ -133,7 +133,7 @@ func Test_decryptionQueue_Decrypt_QueueFull(t *testing.T) { assert.Equal(t, "queue is full", err.Error()) } -func Test_decryptionQueue_GetRequests(t *testing.T) { +func TestUnit_decryptionQueue_GetRequests(t *testing.T) { lggr := logger.TestLogger(t) dq := NewDecryptionQueue(3, 1000, 64, testutils.WaitTimeout(t), lggr) @@ -168,7 +168,7 @@ func Test_decryptionQueue_GetRequests(t *testing.T) { } } -func Test_decryptionQueue_GetCiphertext(t *testing.T) { +func TestUnit_decryptionQueue_GetCiphertext(t *testing.T) { lggr := logger.TestLogger(t) dq := NewDecryptionQueue(3, 1000, 64, testutils.WaitTimeout(t), lggr) @@ -188,7 +188,7 @@ func Test_decryptionQueue_GetCiphertext(t *testing.T) { } } -func Test_decryptionQueue_GetCiphertext_CiphertextNotFound(t *testing.T) { +func TestUnit_decryptionQueue_GetCiphertext_CiphertextNotFound(t *testing.T) { lggr := logger.TestLogger(t) dq := NewDecryptionQueue(3, 1000, 64, testutils.WaitTimeout(t), lggr) @@ -196,7 +196,7 @@ func Test_decryptionQueue_GetCiphertext_CiphertextNotFound(t *testing.T) { assert.ErrorIs(t, err, decryptionPlugin.ErrNotFound) } -func Test_decryptionQueue_Decrypt_DecryptCalledAfterReadyResult(t *testing.T) { +func TestUnit_decryptionQueue_Decrypt_DecryptCalledAfterReadyResult(t *testing.T) { lggr := logger.TestLogger(t) dq := NewDecryptionQueue(2, 1000, 64, testutils.WaitTimeout(t), lggr) @@ -211,7 +211,7 @@ func Test_decryptionQueue_Decrypt_DecryptCalledAfterReadyResult(t *testing.T) { } } -func Test_decryptionQueue_ReadyResult_ExpireRequest(t *testing.T) { +func TestUnit_decryptionQueue_ReadyResult_ExpireRequest(t *testing.T) { lggr := logger.TestLogger(t) dq := NewDecryptionQueue(2, 1000, 64, 100, lggr) @@ -226,7 +226,7 @@ func Test_decryptionQueue_ReadyResult_ExpireRequest(t *testing.T) { assert.Equal(t, "context provided by caller was cancelled", err.Error()) } -func Test_decryptionQueue_Decrypt_CleanupSuccessfulRequest(t *testing.T) { +func TestUnit_decryptionQueue_Decrypt_CleanupSuccessfulRequest(t *testing.T) { lggr := logger.TestLogger(t) dq := NewDecryptionQueue(2, 1000, 64, testutils.WaitTimeout(t), lggr) @@ -245,7 +245,7 @@ func Test_decryptionQueue_Decrypt_CleanupSuccessfulRequest(t *testing.T) { assert.Equal(t, "context provided by caller was cancelled", err2.Error()) } -func Test_decryptionQueue_Decrypt_UserErrorDuringDecryption(t *testing.T) { +func TestUnit_decryptionQueue_Decrypt_UserErrorDuringDecryption(t *testing.T) { lggr := logger.TestLogger(t) dq := NewDecryptionQueue(5, 1000, 64, testutils.WaitTimeout(t), lggr) ciphertextId := []byte{0x12, 0x0f} @@ -261,7 +261,7 @@ func Test_decryptionQueue_Decrypt_UserErrorDuringDecryption(t *testing.T) { assert.Equal(t, "pending decryption request for ciphertextId 0x120f was closed without a response", err.Error()) } -func Test_decryptionQueue_Decrypt_HandleClosedChannelWithoutPlaintextResponse(t *testing.T) { +func TestUnit_decryptionQueue_Decrypt_HandleClosedChannelWithoutPlaintextResponse(t *testing.T) { lggr := logger.TestLogger(t) dq := NewDecryptionQueue(5, 1000, 64, testutils.WaitTimeout(t), lggr) ciphertextId := []byte{0x00, 0xff} @@ -277,7 +277,7 @@ func Test_decryptionQueue_Decrypt_HandleClosedChannelWithoutPlaintextResponse(t assert.Equal(t, "pending decryption request for ciphertextId 0x00ff was closed without a response", err.Error()) } -func Test_decryptionQueue_GetRequests_RequestsCountLimit(t *testing.T) { +func TestUnit_decryptionQueue_GetRequests_RequestsCountLimit(t *testing.T) { lggr := logger.TestLogger(t) dq := NewDecryptionQueue(4, 1000, 64, testutils.WaitTimeout(t), lggr) @@ -321,7 +321,7 @@ func Test_decryptionQueue_GetRequests_RequestsCountLimit(t *testing.T) { } } -func Test_decryptionQueue_GetRequests_TotalBytesLimit(t *testing.T) { +func TestUnit_decryptionQueue_GetRequests_TotalBytesLimit(t *testing.T) { lggr := logger.TestLogger(t) dq := NewDecryptionQueue(4, 10, 64, testutils.WaitTimeout(t), lggr) @@ -365,7 +365,7 @@ func Test_decryptionQueue_GetRequests_TotalBytesLimit(t *testing.T) { } } -func Test_decryptionQueue_GetRequests_PendingRequestQueueShorterThanRequestCountLimit(t *testing.T) { +func TestUnit_decryptionQueue_GetRequests_PendingRequestQueueShorterThanRequestCountLimit(t *testing.T) { lggr := logger.TestLogger(t) dq := NewDecryptionQueue(4, 1000, 64, testutils.WaitTimeout(t), lggr) @@ -387,7 +387,7 @@ func Test_decryptionQueue_GetRequests_PendingRequestQueueShorterThanRequestCount } } -func Test_decryptionQueue_GetRequests_ExpiredRequest(t *testing.T) { +func TestUnit_decryptionQueue_GetRequests_ExpiredRequest(t *testing.T) { lggr := logger.TestLogger(t) dq := NewDecryptionQueue(4, 1000, 64, testutils.WaitTimeout(t), lggr) @@ -409,7 +409,7 @@ func Test_decryptionQueue_GetRequests_ExpiredRequest(t *testing.T) { } } -func Test_decryptionQueue_Start(t *testing.T) { +func TestUnit_decryptionQueue_Start(t *testing.T) { lggr := logger.TestLogger(t) dq := NewDecryptionQueue(4, 1000, 64, testutils.WaitTimeout(t), lggr) @@ -420,7 +420,7 @@ func Test_decryptionQueue_Start(t *testing.T) { require.NoError(t, err) } -func Test_decryptionQueue_Close(t *testing.T) { +func TestUnit_decryptionQueue_Close(t *testing.T) { lggr := logger.TestLogger(t) dq := NewDecryptionQueue(4, 1000, 64, testutils.WaitTimeout(t), lggr) diff --git a/core/services/ocr2/plugins/vault/disk_monitor_test.go b/core/services/ocr2/plugins/vault/disk_monitor_test.go index 31a84b6c9e8..008b59e9cf2 100644 --- a/core/services/ocr2/plugins/vault/disk_monitor_test.go +++ b/core/services/ocr2/plugins/vault/disk_monitor_test.go @@ -20,7 +20,7 @@ func (m *mockGauge) Record(ctx context.Context, value int64, options ...metric.R m.gotValue = value } -func TestDiskMonitor_emitDirSizeMetric(t *testing.T) { +func TestUnit_DiskMonitor_emitDirSizeMetric(t *testing.T) { lggr, observed := logger.TestLoggerObserved(t, zapcore.DebugLevel) dm := &DiskMonitor{ @@ -37,7 +37,7 @@ func TestDiskMonitor_emitDirSizeMetric(t *testing.T) { assert.Len(t, observed.FilterMessage("Emitting vault directory size metric").All(), 1) } -func TestDiskMonitor_emitDirSizeMetric_error(t *testing.T) { +func TestUnit_DiskMonitor_emitDirSizeMetric_error(t *testing.T) { lggr, observed := logger.TestLoggerObserved(t, zapcore.DebugLevel) dm := &DiskMonitor{ diff --git a/core/services/ocr2/plugins/vault/kvstore_test.go b/core/services/ocr2/plugins/vault/kvstore_test.go index 15be9aa0dbd..d90a51790be 100644 --- a/core/services/ocr2/plugins/vault/kvstore_test.go +++ b/core/services/ocr2/plugins/vault/kvstore_test.go @@ -40,7 +40,7 @@ func (k *kv) Write(key []byte, data []byte) error { var _ (ocr3_1types.KeyValueReadWriter) = (*kv)(nil) -func TestKVStore_Secrets(t *testing.T) { +func TestUnit_KVStore_Secrets(t *testing.T) { kv := &kv{ m: make(map[string]response), } @@ -93,7 +93,7 @@ func TestKVStore_Secrets(t *testing.T) { assert.Equal(t, newData, s.EncryptedSecret) } -func TestKVStore_DeleteSecrets(t *testing.T) { +func TestUnit_KVStore_DeleteSecrets(t *testing.T) { kv := &kv{ m: make(map[string]response), } @@ -118,7 +118,7 @@ func TestKVStore_DeleteSecrets(t *testing.T) { assert.Empty(t, md.SecretIdentifiers) } -func TestKVStore_Metadata(t *testing.T) { +func TestUnit_KVStore_Metadata(t *testing.T) { owner := "owner" kv := &kv{ m: make(map[string]response), @@ -187,7 +187,7 @@ func TestKVStore_Metadata(t *testing.T) { assert.Len(t, gotM.SecretIdentifiers, 2) } -func TestKVStore_Metadata_Delete(t *testing.T) { +func TestUnit_KVStore_Metadata_Delete(t *testing.T) { owner := "owner" kv := &kv{ m: make(map[string]response), @@ -224,7 +224,7 @@ func TestKVStore_Metadata_Delete(t *testing.T) { require.ErrorContains(t, err, "no metadata found for owner owner") } -func TestKVStore_InconsistentWrites(t *testing.T) { +func TestUnit_KVStore_InconsistentWrites(t *testing.T) { kv := &kv{ m: make(map[string]response), } diff --git a/core/services/ocr2/plugins/vault/orm_test.go b/core/services/ocr2/plugins/vault/orm_test.go index 35891da5a6b..d861ff1f181 100644 --- a/core/services/ocr2/plugins/vault/orm_test.go +++ b/core/services/ocr2/plugins/vault/orm_test.go @@ -56,7 +56,7 @@ func createTestInstanceID() dkgocrtypes.InstanceID { return dkgocrtypes.MakeInstanceID(configContract, configDigest) } -func TestORM_WriteAndReadResultPackage(t *testing.T) { +func TestIntegration_Shared_ORM_WriteAndReadResultPackage(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -82,7 +82,7 @@ func TestORM_WriteAndReadResultPackage(t *testing.T) { } } -func TestORM_ReadResultPackage_NotFound(t *testing.T) { +func TestIntegration_Shared_ORM_ReadResultPackage_NotFound(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -94,7 +94,7 @@ func TestORM_ReadResultPackage_NotFound(t *testing.T) { assert.Nil(t, readValue) } -func TestORM_WriteResultPackage_Upsert(t *testing.T) { +func TestIntegration_Shared_ORM_WriteResultPackage_Upsert(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -138,7 +138,7 @@ func TestORM_WriteResultPackage_Upsert(t *testing.T) { assert.Equal(t, commontypes.OracleID(3), readValue.Signatures[0].Signer) } -func TestORM_WriteResultPackage_MultipleSignatures(t *testing.T) { +func TestIntegration_Shared_ORM_WriteResultPackage_MultipleSignatures(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -168,7 +168,7 @@ func TestORM_WriteResultPackage_MultipleSignatures(t *testing.T) { } } -func TestORM_WriteResultPackage_DifferentInstanceIDs(t *testing.T) { +func TestIntegration_Shared_ORM_WriteResultPackage_DifferentInstanceIDs(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -203,7 +203,7 @@ func TestORM_WriteResultPackage_DifferentInstanceIDs(t *testing.T) { assert.Equal(t, uint64(2), readValue2.SeqNr) } -func TestORM_WriteResultPackage_TimestampsUpdated(t *testing.T) { +func TestIntegration_Shared_ORM_WriteResultPackage_TimestampsUpdated(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -239,7 +239,7 @@ func TestORM_WriteResultPackage_TimestampsUpdated(t *testing.T) { "updated_at should be >= initial timestamp") } -func TestORM_ConfigDigestHandling(t *testing.T) { +func TestIntegration_Shared_ORM_ConfigDigestHandling(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -267,7 +267,7 @@ func TestORM_ConfigDigestHandling(t *testing.T) { assert.Equal(t, testDigest, readValue.ConfigDigest) } -func TestORM_WriteResultPackage_ValidationErrors(t *testing.T) { +func TestIntegration_Shared_ORM_WriteResultPackage_ValidationErrors(t *testing.T) { t.Parallel() ctx := testutils.Context(t) diff --git a/core/services/ocr2/plugins/vault/plugin_test.go b/core/services/ocr2/plugins/vault/plugin_test.go index 862d5e96973..b781c38f1c2 100644 --- a/core/services/ocr2/plugins/vault/plugin_test.go +++ b/core/services/ocr2/plugins/vault/plugin_test.go @@ -68,7 +68,7 @@ func assertLimit[N limits.Number](t *testing.T, expected int, limiter limits.Bou assert.Equal(t, expected, int(l)) } -func TestPlugin_ReportingPluginFactory_UsesDefaultsIfNotProvidedInOffchainConfig(t *testing.T) { +func TestIntegration_Shared_Plugin_ReportingPluginFactory_UsesDefaultsIfNotProvidedInOffchainConfig(t *testing.T) { lggr := logger.TestLogger(t) store := requests.NewStore[*vaulttypes.Request]() @@ -154,7 +154,7 @@ func TestPlugin_ReportingPluginFactory_UsesDefaultsIfNotProvidedInOffchainConfig assert.Equal(t, 2, infoObject.Limits.MaxBlobPayloadBytes) } -func TestPlugin_ReportingPluginFactory_UseDKGResult(t *testing.T) { +func TestIntegration_Shared_Plugin_ReportingPluginFactory_UseDKGResult(t *testing.T) { lggr := logger.TestLogger(t) store := requests.NewStore[*vaulttypes.Request]() @@ -210,7 +210,7 @@ func TestPlugin_ReportingPluginFactory_UseDKGResult(t *testing.T) { assert.Equal(t, pkBytes, key) } -func TestPlugin_ReportingPluginFactory_InvalidParams(t *testing.T) { +func TestIntegration_Shared_Plugin_ReportingPluginFactory_InvalidParams(t *testing.T) { lggr := logger.TestLogger(t) store := requests.NewStore[*vaulttypes.Request]() @@ -264,7 +264,7 @@ func makeReportingPluginConfig( } } -func TestPlugin_Observation_NothingInBatch(t *testing.T) { +func TestUnit_Plugin_Observation_NothingInBatch(t *testing.T) { lggr := logger.TestLogger(t) store := requests.NewStore[*vaulttypes.Request]() r := &ReportingPlugin{ @@ -297,7 +297,7 @@ func TestPlugin_Observation_NothingInBatch(t *testing.T) { assert.Empty(t, obs.Observations) } -func TestPlugin_Observation_GetSecretsRequest_SecretIdentifierInvalid(t *testing.T) { +func TestUnit_Plugin_Observation_GetSecretsRequest_SecretIdentifierInvalid(t *testing.T) { tcs := []struct { name string id *vaultcommon.SecretIdentifier @@ -393,7 +393,7 @@ func TestPlugin_Observation_GetSecretsRequest_SecretIdentifierInvalid(t *testing } } -func TestPlugin_Observation_GetSecretsRequest_FillsInNamespace(t *testing.T) { +func TestUnit_Plugin_Observation_GetSecretsRequest_FillsInNamespace(t *testing.T) { lggr, _ := logger.TestLoggerObserved(t, zapcore.DebugLevel) store := requests.NewStore[*vaulttypes.Request]() _, pk, shares, err := tdh2easy.GenerateKeys(1, 3) @@ -474,7 +474,7 @@ func TestPlugin_Observation_GetSecretsRequest_FillsInNamespace(t *testing.T) { assert.True(t, proto.Equal(batchResp.Responses[0].Id, createdID)) } -func TestPlugin_Observation_GetSecretsRequest_SecretDoesNotExist(t *testing.T) { +func TestUnit_Plugin_Observation_GetSecretsRequest_SecretDoesNotExist(t *testing.T) { lggr := logger.TestLogger(t) store := requests.NewStore[*vaulttypes.Request]() r := &ReportingPlugin{ @@ -534,7 +534,7 @@ func TestPlugin_Observation_GetSecretsRequest_SecretDoesNotExist(t *testing.T) { assert.Contains(t, resp.GetError(), "key does not exist") } -func TestPlugin_Observation_GetSecretsRequest_SecretExistsButIsIncorrect(t *testing.T) { +func TestUnit_Plugin_Observation_GetSecretsRequest_SecretExistsButIsIncorrect(t *testing.T) { lggr, observed := logger.TestLoggerObserved(t, zapcore.DebugLevel) store := requests.NewStore[*vaulttypes.Request]() _, pk, shares, err := tdh2easy.GenerateKeys(1, 3) @@ -611,7 +611,7 @@ func TestPlugin_Observation_GetSecretsRequest_SecretExistsButIsIncorrect(t *test assert.Contains(t, errString, "failed to unmarshal ciphertext") } -func TestPlugin_Observation_GetSecretsRequest_PublicKeyIsInvalid(t *testing.T) { +func TestUnit_Plugin_Observation_GetSecretsRequest_PublicKeyIsInvalid(t *testing.T) { lggr, _ := logger.TestLoggerObserved(t, zapcore.DebugLevel) store := requests.NewStore[*vaulttypes.Request]() _, pk, shares, err := tdh2easy.GenerateKeys(1, 3) @@ -686,7 +686,7 @@ func TestPlugin_Observation_GetSecretsRequest_PublicKeyIsInvalid(t *testing.T) { assert.Contains(t, resp.GetError(), "failed to convert public key to bytes") } -func TestPlugin_Observation_GetSecretsRequest_SecretLabelIsInvalid(t *testing.T) { +func TestUnit_Plugin_Observation_GetSecretsRequest_SecretLabelIsInvalid(t *testing.T) { lggr, _ := logger.TestLoggerObserved(t, zapcore.DebugLevel) store := requests.NewStore[*vaulttypes.Request]() _, pk, shares, err := tdh2easy.GenerateKeys(1, 3) @@ -769,7 +769,7 @@ func TestPlugin_Observation_GetSecretsRequest_SecretLabelIsInvalid(t *testing.T) assert.Contains(t, resp.GetError(), "failed to handle get secret request") } -func TestPlugin_Observation_GetSecretsRequest_Success(t *testing.T) { +func TestUnit_Plugin_Observation_GetSecretsRequest_Success(t *testing.T) { lggr, _ := logger.TestLoggerObserved(t, zapcore.DebugLevel) store := requests.NewStore[*vaulttypes.Request]() _, pk, shares, err := tdh2easy.GenerateKeys(1, 3) @@ -878,7 +878,7 @@ func TestPlugin_Observation_GetSecretsRequest_Success(t *testing.T) { assert.Equal(t, plaintext, gotSecret) } -func TestPlugin_Observation_CreateSecretsRequest_SecretIdentifierInvalid(t *testing.T) { +func TestUnit_Plugin_Observation_CreateSecretsRequest_SecretIdentifierInvalid(t *testing.T) { tcs := []struct { name string id *vaultcommon.SecretIdentifier @@ -975,7 +975,7 @@ func TestPlugin_Observation_CreateSecretsRequest_SecretIdentifierInvalid(t *test } } -func TestPlugin_Observation_CreateSecretsRequest_DisallowsDuplicateRequests(t *testing.T) { +func TestUnit_Plugin_Observation_CreateSecretsRequest_DisallowsDuplicateRequests(t *testing.T) { lggr := logger.TestLogger(t) store := requests.NewStore[*vaulttypes.Request]() r := &ReportingPlugin{ @@ -1043,7 +1043,7 @@ func TestPlugin_Observation_CreateSecretsRequest_DisallowsDuplicateRequests(t *t assert.Contains(t, resp.GetError(), "duplicate request for secret identifier") } -func TestPlugin_StateTransition_CreateSecretsRequest_CorrectlyTracksLimits(t *testing.T) { +func TestUnit_Plugin_StateTransition_CreateSecretsRequest_CorrectlyTracksLimits(t *testing.T) { lggr := logger.TestLogger(t) store := requests.NewStore[*vaulttypes.Request]() _, pk, shares, err := tdh2easy.GenerateKeys(1, 3) @@ -1157,7 +1157,7 @@ func TestPlugin_StateTransition_CreateSecretsRequest_CorrectlyTracksLimits(t *te assert.Contains(t, r2.GetError(), "owner has reached maximum number of secrets") } -func TestPlugin_Observation_CreateSecretsRequest_InvalidCiphertext(t *testing.T) { +func TestUnit_Plugin_Observation_CreateSecretsRequest_InvalidCiphertext(t *testing.T) { lggr := logger.TestLogger(t) store := requests.NewStore[*vaulttypes.Request]() r := &ReportingPlugin{ @@ -1218,7 +1218,7 @@ func TestPlugin_Observation_CreateSecretsRequest_InvalidCiphertext(t *testing.T) assert.Contains(t, resp.GetError(), "invalid hex encoding for ciphertext") } -func TestPlugin_Observation_CreateSecretsRequest_InvalidCiphertext_TooLong(t *testing.T) { +func TestUnit_Plugin_Observation_CreateSecretsRequest_InvalidCiphertext_TooLong(t *testing.T) { lggr := logger.TestLogger(t) store := requests.NewStore[*vaulttypes.Request]() r := &ReportingPlugin{ @@ -1280,7 +1280,7 @@ func TestPlugin_Observation_CreateSecretsRequest_InvalidCiphertext_TooLong(t *te assert.Contains(t, resp.GetError(), "ciphertext size exceeds maximum allowed size: 10b") } -func TestPlugin_Observation_CreateSecretsRequest_InvalidCiphertext_EncryptedWithWrongPublicKey(t *testing.T) { +func TestUnit_Plugin_Observation_CreateSecretsRequest_InvalidCiphertext_EncryptedWithWrongPublicKey(t *testing.T) { lggr := logger.TestLogger(t) store := requests.NewStore[*vaulttypes.Request]() // Wrong key @@ -1353,7 +1353,7 @@ func TestPlugin_Observation_CreateSecretsRequest_InvalidCiphertext_EncryptedWith assert.Contains(t, resp.GetError(), "failed to verify ciphertext") } -func TestPlugin_StateTransition_CreateSecretsRequest_TooManySecretsForOwner(t *testing.T) { +func TestUnit_Plugin_StateTransition_CreateSecretsRequest_TooManySecretsForOwner(t *testing.T) { lggr := logger.TestLogger(t) store := requests.NewStore[*vaulttypes.Request]() _, pk, shares, err := tdh2easy.GenerateKeys(1, 3) @@ -1442,7 +1442,7 @@ func TestPlugin_StateTransition_CreateSecretsRequest_TooManySecretsForOwner(t *t assert.Contains(t, o.GetCreateSecretsResponse().Responses[0].Error, "owner has reached maximum number of secrets") } -func TestPlugin_StateTransition_CreateSecretsRequest_SecretExistsForKey(t *testing.T) { +func TestUnit_Plugin_StateTransition_CreateSecretsRequest_SecretExistsForKey(t *testing.T) { lggr := logger.TestLogger(t) store := requests.NewStore[*vaulttypes.Request]() _, pk, shares, err := tdh2easy.GenerateKeys(1, 3) @@ -1525,7 +1525,7 @@ func TestPlugin_StateTransition_CreateSecretsRequest_SecretExistsForKey(t *testi assert.Contains(t, o.GetCreateSecretsResponse().Responses[0].Error, "key already exists") } -func TestPlugin_Observation_CreateSecretsRequest_Success(t *testing.T) { +func TestUnit_Plugin_Observation_CreateSecretsRequest_Success(t *testing.T) { lggr := logger.TestLogger(t) store := requests.NewStore[*vaulttypes.Request]() _, pk, shares, err := tdh2easy.GenerateKeys(1, 3) @@ -1668,7 +1668,7 @@ func marshalObservations(t *testing.T, observations ...observation) []byte { return b } -func TestPlugin_StateTransition_InsufficientObservations(t *testing.T) { +func TestUnit_Plugin_StateTransition_InsufficientObservations(t *testing.T) { lggr, observed := logger.TestLoggerObserved(t, zapcore.DebugLevel) store := requests.NewStore[*vaulttypes.Request]() _, pk, shares, err := tdh2easy.GenerateKeys(1, 3) @@ -1741,7 +1741,7 @@ func TestPlugin_StateTransition_InsufficientObservations(t *testing.T) { assert.Equal(t, 1, observed.FilterMessage("insufficient observations found for id").Len()) } -func TestPlugin_ValidateObservations_InvalidObservations(t *testing.T) { +func TestUnit_Plugin_ValidateObservations_InvalidObservations(t *testing.T) { lggr, _ := logger.TestLoggerObserved(t, zapcore.DebugLevel) store := requests.NewStore[*vaulttypes.Request]() _, pk, shares, err := tdh2easy.GenerateKeys(1, 3) @@ -1829,7 +1829,7 @@ func TestPlugin_ValidateObservations_InvalidObservations(t *testing.T) { assert.ErrorContains(t, err, "invalid observation: a single observation cannot contain duplicate observations for the same request id") } -func TestPlugin_StateTransition_ShasDontMatch(t *testing.T) { +func TestUnit_Plugin_StateTransition_ShasDontMatch(t *testing.T) { lggr, observed := logger.TestLoggerObserved(t, zapcore.DebugLevel) store := requests.NewStore[*vaulttypes.Request]() _, pk, shares, err := tdh2easy.GenerateKeys(1, 3) @@ -1911,7 +1911,7 @@ func TestPlugin_StateTransition_ShasDontMatch(t *testing.T) { assert.Equal(t, 1, observed.FilterMessage("insufficient observations found for id").Len()) } -func TestPlugin_StateTransition_AggregatesValidationErrors(t *testing.T) { +func TestUnit_Plugin_StateTransition_AggregatesValidationErrors(t *testing.T) { lggr, observed := logger.TestLoggerObserved(t, zapcore.DebugLevel) store := requests.NewStore[*vaulttypes.Request]() _, pk, shares, err := tdh2easy.GenerateKeys(1, 3) @@ -1989,7 +1989,7 @@ func TestPlugin_StateTransition_AggregatesValidationErrors(t *testing.T) { assert.Equal(t, 1, observed.FilterMessage("sufficient observations for sha").Len()) } -func TestPlugin_StateTransition_GetSecretsRequest_CombinesShares(t *testing.T) { +func TestUnit_Plugin_StateTransition_GetSecretsRequest_CombinesShares(t *testing.T) { lggr, observed := logger.TestLoggerObserved(t, zapcore.DebugLevel) store := requests.NewStore[*vaulttypes.Request]() _, pk, shares, err := tdh2easy.GenerateKeys(1, 3) @@ -2132,7 +2132,7 @@ func TestPlugin_StateTransition_GetSecretsRequest_CombinesShares(t *testing.T) { assert.Equal(t, 1, observed.FilterMessage("sufficient observations for sha").Len()) } -func TestPlugin_StateTransition_CreateSecretsRequest_WritesSecrets(t *testing.T) { +func TestUnit_Plugin_StateTransition_CreateSecretsRequest_WritesSecrets(t *testing.T) { lggr, observed := logger.TestLoggerObserved(t, zapcore.DebugLevel) store := requests.NewStore[*vaulttypes.Request]() _, pk, shares, err := tdh2easy.GenerateKeys(1, 3) @@ -2228,7 +2228,7 @@ func TestPlugin_StateTransition_CreateSecretsRequest_WritesSecrets(t *testing.T) assert.Equal(t, 1, observed.FilterMessage("sufficient observations for sha").Len()) } -func TestPlugin_Reports(t *testing.T) { +func TestUnit_Plugin_Reports(t *testing.T) { value := "encrypted-value" id := &vaultcommon.SecretIdentifier{ Owner: "owner", @@ -2361,7 +2361,7 @@ func TestPlugin_Reports(t *testing.T) { assert.True(t, proto.Equal(resp2, o2r)) } -func TestPlugin_Observation_UpdateSecretsRequest_SecretIdentifierInvalid(t *testing.T) { +func TestUnit_Plugin_Observation_UpdateSecretsRequest_SecretIdentifierInvalid(t *testing.T) { tcs := []struct { name string id *vaultcommon.SecretIdentifier @@ -2458,7 +2458,7 @@ func TestPlugin_Observation_UpdateSecretsRequest_SecretIdentifierInvalid(t *test } } -func TestPlugin_Observation_UpdateSecretsRequest_DisallowsDuplicateRequests(t *testing.T) { +func TestUnit_Plugin_Observation_UpdateSecretsRequest_DisallowsDuplicateRequests(t *testing.T) { lggr := logger.TestLogger(t) store := requests.NewStore[*vaulttypes.Request]() r := &ReportingPlugin{ @@ -2526,7 +2526,7 @@ func TestPlugin_Observation_UpdateSecretsRequest_DisallowsDuplicateRequests(t *t assert.Contains(t, resp.GetError(), "duplicate request for secret identifier") } -func TestPlugin_Observation_UpdateSecretsRequest_InvalidCiphertext(t *testing.T) { +func TestUnit_Plugin_Observation_UpdateSecretsRequest_InvalidCiphertext(t *testing.T) { lggr := logger.TestLogger(t) store := requests.NewStore[*vaulttypes.Request]() r := &ReportingPlugin{ @@ -2587,7 +2587,7 @@ func TestPlugin_Observation_UpdateSecretsRequest_InvalidCiphertext(t *testing.T) assert.Contains(t, resp.GetError(), "invalid hex encoding for ciphertext") } -func TestPlugin_Observation_UpdateSecretsRequest_InvalidCiphertext_TooLong(t *testing.T) { +func TestUnit_Plugin_Observation_UpdateSecretsRequest_InvalidCiphertext_TooLong(t *testing.T) { lggr := logger.TestLogger(t) store := requests.NewStore[*vaulttypes.Request]() r := &ReportingPlugin{ @@ -2649,7 +2649,7 @@ func TestPlugin_Observation_UpdateSecretsRequest_InvalidCiphertext_TooLong(t *te assert.Contains(t, resp.GetError(), "ciphertext size exceeds maximum allowed size: 10b") } -func TestPlugin_Observation_UpdateSecretsRequest_InvalidCiphertext_EncryptedWithWrongPublicKey(t *testing.T) { +func TestUnit_Plugin_Observation_UpdateSecretsRequest_InvalidCiphertext_EncryptedWithWrongPublicKey(t *testing.T) { lggr := logger.TestLogger(t) store := requests.NewStore[*vaulttypes.Request]() // Wrong key @@ -2722,7 +2722,7 @@ func TestPlugin_Observation_UpdateSecretsRequest_InvalidCiphertext_EncryptedWith assert.Contains(t, resp.GetError(), "failed to verify ciphertext") } -func TestPlugin_StateTransition_UpdateSecretsRequest_SecretDoesntExist(t *testing.T) { +func TestUnit_Plugin_StateTransition_UpdateSecretsRequest_SecretDoesntExist(t *testing.T) { lggr, observed := logger.TestLoggerObserved(t, zapcore.DebugLevel) store := requests.NewStore[*vaulttypes.Request]() _, pk, shares, err := tdh2easy.GenerateKeys(1, 3) @@ -2817,7 +2817,7 @@ func TestPlugin_StateTransition_UpdateSecretsRequest_SecretDoesntExist(t *testin assert.Equal(t, 1, observed.FilterMessage("sufficient observations for sha").Len()) } -func TestPlugin_StateTransition_UpdateSecretsRequest_WritesSecrets(t *testing.T) { +func TestUnit_Plugin_StateTransition_UpdateSecretsRequest_WritesSecrets(t *testing.T) { lggr, observed := logger.TestLoggerObserved(t, zapcore.DebugLevel) store := requests.NewStore[*vaulttypes.Request]() _, pk, shares, err := tdh2easy.GenerateKeys(1, 3) @@ -2929,7 +2929,7 @@ func TestPlugin_StateTransition_UpdateSecretsRequest_WritesSecrets(t *testing.T) assert.Equal(t, 1, observed.FilterMessage("sufficient observations for sha").Len()) } -func TestPlugin_Reports_UpdateSecretsRequest(t *testing.T) { +func TestUnit_Plugin_Reports_UpdateSecretsRequest(t *testing.T) { value := "encrypted-value" id := &vaultcommon.SecretIdentifier{ Owner: "owner", @@ -3017,7 +3017,7 @@ func TestPlugin_Reports_UpdateSecretsRequest(t *testing.T) { assert.Equal(t, expectedBytes, []byte(o.ReportWithInfo.Report)) } -func TestPlugin_Observation_DeleteSecrets(t *testing.T) { +func TestUnit_Plugin_Observation_DeleteSecrets(t *testing.T) { lggr := logger.TestLogger(t) store := requests.NewStore[*vaulttypes.Request]() r := &ReportingPlugin{ @@ -3094,7 +3094,7 @@ func TestPlugin_Observation_DeleteSecrets(t *testing.T) { assert.Empty(t, resp.Responses[0].GetError()) } -func TestPlugin_Observation_DeleteSecrets_IdDoesntExist(t *testing.T) { +func TestUnit_Plugin_Observation_DeleteSecrets_IdDoesntExist(t *testing.T) { lggr := logger.TestLogger(t) store := requests.NewStore[*vaulttypes.Request]() r := &ReportingPlugin{ @@ -3150,7 +3150,7 @@ func TestPlugin_Observation_DeleteSecrets_IdDoesntExist(t *testing.T) { assert.Contains(t, resp.Responses[0].GetError(), "key does not exist") } -func TestPlugin_Observation_DeleteSecrets_InvalidRequestDuplicateIds(t *testing.T) { +func TestUnit_Plugin_Observation_DeleteSecrets_InvalidRequestDuplicateIds(t *testing.T) { lggr := logger.TestLogger(t) store := requests.NewStore[*vaulttypes.Request]() r := &ReportingPlugin{ @@ -3211,7 +3211,7 @@ func TestPlugin_Observation_DeleteSecrets_InvalidRequestDuplicateIds(t *testing. assert.Contains(t, resp.Responses[1].GetError(), "duplicate request for secret identifier") } -func TestPlugin_StateTransition_DeleteSecretsRequest(t *testing.T) { +func TestUnit_Plugin_StateTransition_DeleteSecretsRequest(t *testing.T) { lggr, observed := logger.TestLoggerObserved(t, zapcore.DebugLevel) store := requests.NewStore[*vaulttypes.Request]() _, pk, shares, err := tdh2easy.GenerateKeys(1, 3) @@ -3320,7 +3320,7 @@ func TestPlugin_StateTransition_DeleteSecretsRequest(t *testing.T) { assert.Equal(t, 1, observed.FilterMessage("sufficient observations for sha").Len()) } -func TestPlugin_StateTransition_DeleteSecretsRequest_SecretDoesNotExist(t *testing.T) { +func TestUnit_Plugin_StateTransition_DeleteSecretsRequest_SecretDoesNotExist(t *testing.T) { lggr, observed := logger.TestLoggerObserved(t, zapcore.DebugLevel) store := requests.NewStore[*vaulttypes.Request]() _, pk, shares, err := tdh2easy.GenerateKeys(1, 3) @@ -3418,7 +3418,7 @@ func TestPlugin_StateTransition_DeleteSecretsRequest_SecretDoesNotExist(t *testi assert.Equal(t, 1, observed.FilterMessage("sufficient observations for sha").Len()) } -func TestPlugin_Reports_DeleteSecretsRequest(t *testing.T) { +func TestUnit_Plugin_Reports_DeleteSecretsRequest(t *testing.T) { id := &vaultcommon.SecretIdentifier{ Owner: "owner", Namespace: "main", @@ -3501,7 +3501,7 @@ func TestPlugin_Reports_DeleteSecretsRequest(t *testing.T) { assert.Equal(t, expectedBytes, []byte(o.ReportWithInfo.Report)) } -func TestPlugin_Observation_ListSecretIdentifiers_OwnerRequired(t *testing.T) { +func TestUnit_Plugin_Observation_ListSecretIdentifiers_OwnerRequired(t *testing.T) { lggr := logger.TestLogger(t) store := requests.NewStore[*vaulttypes.Request]() r := &ReportingPlugin{ @@ -3549,7 +3549,7 @@ func TestPlugin_Observation_ListSecretIdentifiers_OwnerRequired(t *testing.T) { assert.Contains(t, resp.GetError(), "owner cannot be empty") } -func TestPlugin_Observation_ListSecretIdentifiers_NoNamespaceProvided(t *testing.T) { +func TestUnit_Plugin_Observation_ListSecretIdentifiers_NoNamespaceProvided(t *testing.T) { lggr := logger.TestLogger(t) store := requests.NewStore[*vaulttypes.Request]() r := &ReportingPlugin{ @@ -3643,7 +3643,7 @@ func TestPlugin_Observation_ListSecretIdentifiers_NoNamespaceProvided(t *testing assert.Empty(t, resp.GetError()) } -func TestPlugin_Observation_ListSecretIdentifiers_FilterByNamespace(t *testing.T) { +func TestUnit_Plugin_Observation_ListSecretIdentifiers_FilterByNamespace(t *testing.T) { lggr := logger.TestLogger(t) store := requests.NewStore[*vaulttypes.Request]() r := &ReportingPlugin{ @@ -3733,7 +3733,7 @@ func TestPlugin_Observation_ListSecretIdentifiers_FilterByNamespace(t *testing.T assert.Empty(t, resp.GetError()) } -func TestPlugin_Reports_ListSecretIdentifiersRequest(t *testing.T) { +func TestUnit_Plugin_Reports_ListSecretIdentifiersRequest(t *testing.T) { id := &vaultcommon.SecretIdentifier{ Owner: "owner", Namespace: "main", @@ -3812,7 +3812,7 @@ func TestPlugin_Reports_ListSecretIdentifiersRequest(t *testing.T) { assert.Equal(t, expectedBytes, []byte(o.ReportWithInfo.Report)) } -func TestPlugin_StateTransition_ListSecretIdentifiers(t *testing.T) { +func TestUnit_Plugin_StateTransition_ListSecretIdentifiers(t *testing.T) { lggr, observed := logger.TestLoggerObserved(t, zapcore.DebugLevel) store := requests.NewStore[*vaulttypes.Request]() _, pk, shares, err := tdh2easy.GenerateKeys(1, 3) diff --git a/core/services/ocr2/plugins/vault/transmitter_test.go b/core/services/ocr2/plugins/vault/transmitter_test.go index 129de09d672..843f578a308 100644 --- a/core/services/ocr2/plugins/vault/transmitter_test.go +++ b/core/services/ocr2/plugins/vault/transmitter_test.go @@ -19,7 +19,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func TestTransmitter(t *testing.T) { +func TestUnit_Transmitter(t *testing.T) { lggr, _ := logger.TestLoggerObserved(t, zapcore.DebugLevel) store := requests.NewStore[*vaulttypes.Request]() handler := requests.NewHandler[*vaulttypes.Request, *vaulttypes.Response](lggr, store, clockwork.NewFakeClock(), time.Hour) diff --git a/core/services/ocr2/validate/validate_test.go b/core/services/ocr2/validate/validate_test.go index 1356e0db628..e5e8f71d034 100644 --- a/core/services/ocr2/validate/validate_test.go +++ b/core/services/ocr2/validate/validate_test.go @@ -21,7 +21,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/validate" ) -func TestValidateOracleSpec(t *testing.T) { +func TestUnit_ValidateOracleSpec(t *testing.T) { var tt = []struct { name string toml string @@ -611,7 +611,7 @@ type envelope struct { PluginConfig *validate.OCR2GenericPluginConfig } -func TestOCR2GenericPluginConfig_Unmarshal(t *testing.T) { +func TestUnit_OCR2GenericPluginConfig_Unmarshal(t *testing.T) { payload := ` [pluginConfig] pluginName = "median" @@ -650,7 +650,7 @@ type envelope2 struct { OnchainSigningStrategy *validate.OCR2OnchainSigningStrategy } -func TestOCR2OnchainSigningStrategy_Unmarshal(t *testing.T) { +func TestUnit_OCR2OnchainSigningStrategy_Unmarshal(t *testing.T) { payload := ` [onchainSigningStrategy] strategyName = "single-chain" diff --git a/core/services/ocr3/promwrapper/factory_test.go b/core/services/ocr3/promwrapper/factory_test.go index 2aaa389c201..4126ff1416a 100644 --- a/core/services/ocr3/promwrapper/factory_test.go +++ b/core/services/ocr3/promwrapper/factory_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func Test_WrapperFactory(t *testing.T) { +func TestUnit_WrapperFactory(t *testing.T) { validFactory := NewReportingPluginFactory( fakeFactory[uint]{}, logger.TestLogger(t), diff --git a/core/services/ocr3/promwrapper/plugin_test.go b/core/services/ocr3/promwrapper/plugin_test.go index ac6aae037ac..3f0b50fbcb1 100644 --- a/core/services/ocr3/promwrapper/plugin_test.go +++ b/core/services/ocr3/promwrapper/plugin_test.go @@ -14,7 +14,7 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" ) -func Test_ReportsGeneratedGauge(t *testing.T) { +func TestUnit_ReportsGeneratedGauge(t *testing.T) { pluginObservationSize := 5 pluginOutcomeSize := 3 @@ -117,7 +117,7 @@ func Test_ReportsGeneratedGauge(t *testing.T) { require.Equal(t, pluginObservationSize, int(observationLen)) } -func Test_DurationHistograms(t *testing.T) { +func TestUnit_DurationHistograms(t *testing.T) { plugin1 := newReportingPlugin( fakePlugin[uint]{}, "evm", "1", "empty", "abc", promOCR3ReportsGenerated, promOCR3Durations, promOCR3Sizes, promOCR3PluginStatus, diff --git a/core/services/ocrbootstrap/database_test.go b/core/services/ocrbootstrap/database_test.go index eaad863c88b..fffa10b06da 100644 --- a/core/services/ocrbootstrap/database_test.go +++ b/core/services/ocrbootstrap/database_test.go @@ -35,7 +35,7 @@ func setupDB(t *testing.T) *sqlx.DB { return pgtest.NewSqlxDB(t) } -func Test_DB_ReadWriteConfig(t *testing.T) { +func TestIntegration_Shared_DB_ReadWriteConfig(t *testing.T) { sqlDB := setupDB(t) config := ocrtypes.ContractConfig{ diff --git a/core/services/ocrbootstrap/validate_test.go b/core/services/ocrbootstrap/validate_test.go index fed62fc03a0..a7165dd56b4 100644 --- a/core/services/ocrbootstrap/validate_test.go +++ b/core/services/ocrbootstrap/validate_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/job" ) -func TestValidateBootstrapSpec(t *testing.T) { +func TestUnit_ValidateBootstrapSpec(t *testing.T) { var tt = []struct { name string toml string diff --git a/core/services/ocrcommon/adapters_test.go b/core/services/ocrcommon/adapters_test.go index af50dc0d810..b23e625a36a 100644 --- a/core/services/ocrcommon/adapters_test.go +++ b/core/services/ocrcommon/adapters_test.go @@ -103,7 +103,7 @@ func (f fakeOnchainKeyring) MaxSignatureLength() int { return maxSignatureLength } -func TestOCR3OnchainKeyringAdapter(t *testing.T) { +func TestUnit_OCR3OnchainKeyringAdapter(t *testing.T) { kr := ocrcommon.NewOCR3OnchainKeyringAdapter(fakeOnchainKeyring{}) _, err := kr.Sign(configDigest, seqNr, rwi) @@ -114,7 +114,7 @@ func TestOCR3OnchainKeyringAdapter(t *testing.T) { require.Equal(t, maxSignatureLength, kr.MaxSignatureLength()) } -func TestNewOCR3OnchainKeyringMultiChainAdapter(t *testing.T) { +func TestUnit_NewOCR3OnchainKeyringMultiChainAdapter(t *testing.T) { evmBundle, err := ocr2key.New(chaintype.EVM) require.NoError(t, err) @@ -187,7 +187,7 @@ func newMultichainAdapter(t *testing.T) *ocrcommon.OCR3OnchainKeyringMultiChainA return adapter } -func TestNewOCR3OnchainKeyringMultiChainAdapter_VerifyFromDifferentNodesPublicKeys(t *testing.T) { +func TestUnit_NewOCR3OnchainKeyringMultiChainAdapter_VerifyFromDifferentNodesPublicKeys(t *testing.T) { firstNodeAdapter := newMultichainAdapter(t) secondNodeAdapter := newMultichainAdapter(t) @@ -263,7 +263,7 @@ func (f fakeContractTransmitter) FromAccount(context.Context) (ocrtypes.Account, return account, nil } -func TestContractTransmitter(t *testing.T) { +func TestUnit_ContractTransmitter(t *testing.T) { ctx := testutils.Context(t) ct := ocrcommon.NewOCR3ContractTransmitterAdapter(fakeContractTransmitter{}) diff --git a/core/services/ocrcommon/data_source_test.go b/core/services/ocrcommon/data_source_test.go index ce120bee694..fb0237bf8c0 100644 --- a/core/services/ocrcommon/data_source_test.go +++ b/core/services/ocrcommon/data_source_test.go @@ -33,7 +33,7 @@ var ( jsonParseTaskValue = "1234" ) -func Test_InMemoryDataSource(t *testing.T) { +func TestUnit_InMemoryDataSource(t *testing.T) { runner := pipelinemocks.NewRunner(t) runner.On("ExecuteRun", mock.Anything, mock.AnythingOfType("pipeline.Spec"), mock.Anything, mock.Anything). Return(&pipeline.Run{}, pipeline.TaskRunResults{ @@ -52,7 +52,7 @@ func Test_InMemoryDataSource(t *testing.T) { assert.Equal(t, mockValue, val.String()) // returns expected value after pipeline run } -func Test_CachedInMemoryDataSourceErrHandling(t *testing.T) { +func TestUnit_CachedInMemoryDataSourceErrHandling(t *testing.T) { changeResultValue := func(runner *pipelinemocks.Runner, value string, returnErr, once bool) { result := pipeline.Result{ Value: value, @@ -144,7 +144,7 @@ func Test_CachedInMemoryDataSourceErrHandling(t *testing.T) { }) } -func Test_InMemoryDataSourceWithProm(t *testing.T) { +func TestUnit_InMemoryDataSourceWithProm(t *testing.T) { runner := pipelinemocks.NewRunner(t) jsonParseTask := pipeline.JSONParseTask{ @@ -200,7 +200,7 @@ func (ms *mockSaver) Save(r *pipeline.Run) { ms.r = r } -func Test_NewDataSourceV2(t *testing.T) { +func TestUnit_NewDataSourceV2(t *testing.T) { runner := pipelinemocks.NewRunner(t) ms := &mockSaver{} runner.On("ExecuteRun", mock.Anything, mock.AnythingOfType("pipeline.Spec"), mock.Anything, mock.Anything). @@ -221,7 +221,7 @@ func Test_NewDataSourceV2(t *testing.T) { assert.Equal(t, &pipeline.Run{}, ms.r) // expected data properly passed to channel } -func Test_NewDataSourceV1(t *testing.T) { +func TestUnit_NewDataSourceV1(t *testing.T) { runner := pipelinemocks.NewRunner(t) ms := &mockSaver{} runner.On("ExecuteRun", mock.Anything, mock.AnythingOfType("pipeline.Spec"), mock.Anything, mock.Anything). diff --git a/core/services/ocrcommon/discoverer_database_test.go b/core/services/ocrcommon/discoverer_database_test.go index 2448be29d67..3102f6ab574 100644 --- a/core/services/ocrcommon/discoverer_database_test.go +++ b/core/services/ocrcommon/discoverer_database_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" ) -func Test_DiscovererDatabase(t *testing.T) { +func TestIntegration_Shared_DiscovererDatabase(t *testing.T) { db := pgtest.NewSqlxDB(t) localPeerID1 := mustRandomP2PPeerID(t) diff --git a/core/services/ocrcommon/peer_wrapper_test.go b/core/services/ocrcommon/peer_wrapper_test.go index dfc41b55ef1..6f3b1e4e228 100644 --- a/core/services/ocrcommon/peer_wrapper_test.go +++ b/core/services/ocrcommon/peer_wrapper_test.go @@ -22,7 +22,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" ) -func Test_SingletonPeerWrapper_Start(t *testing.T) { +func TestIntegration_Shared_SingletonPeerWrapper_Start(t *testing.T) { t.Parallel() db := pgtest.NewSqlxDB(t) @@ -108,7 +108,7 @@ func Test_SingletonPeerWrapper_Start(t *testing.T) { }) } -func Test_SingletonPeerWrapper_Close(t *testing.T) { +func TestIntegration_Shared_SingletonPeerWrapper_Close(t *testing.T) { t.Parallel() ctx := testutils.Context(t) diff --git a/core/services/ocrcommon/run_saver_test.go b/core/services/ocrcommon/run_saver_test.go index bc051a9a424..aa56b17fad8 100644 --- a/core/services/ocrcommon/run_saver_test.go +++ b/core/services/ocrcommon/run_saver_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline/mocks" ) -func TestRunSaver(t *testing.T) { +func TestUnit_RunSaver(t *testing.T) { pipelineRunner := mocks.NewRunner(t) rs := NewResultRunSaver( pipelineRunner, diff --git a/core/services/ocrcommon/telemetry_test.go b/core/services/ocrcommon/telemetry_test.go index a014fb35702..f296a1e184d 100644 --- a/core/services/ocrcommon/telemetry_test.go +++ b/core/services/ocrcommon/telemetry_test.go @@ -98,7 +98,7 @@ var trrs = pipeline.TaskRunResults{ }, } -func TestShouldCollectTelemetry(t *testing.T) { +func TestUnit_ShouldCollectTelemetry(t *testing.T) { j := job.Job{ OCROracleSpec: &job.OCROracleSpec{CaptureEATelemetry: true}, OCR2OracleSpec: &job.OCR2OracleSpec{CaptureEATelemetry: true}, @@ -118,7 +118,7 @@ func TestShouldCollectTelemetry(t *testing.T) { assert.False(t, ShouldCollectEnhancedTelemetry(&j)) } -func TestGetContract(t *testing.T) { +func TestUnit_GetContract(t *testing.T) { j := job.Job{ OCROracleSpec: &job.OCROracleSpec{CaptureEATelemetry: true}, OCR2OracleSpec: &job.OCR2OracleSpec{CaptureEATelemetry: true}, @@ -141,7 +141,7 @@ func TestGetContract(t *testing.T) { assert.Empty(t, e.getContract()) } -func TestGetChainID(t *testing.T) { +func TestUnit_GetChainID(t *testing.T) { j := job.Job{ OCROracleSpec: &job.OCROracleSpec{CaptureEATelemetry: true}, OCR2OracleSpec: &job.OCR2OracleSpec{CaptureEATelemetry: true}, @@ -164,7 +164,7 @@ func TestGetChainID(t *testing.T) { assert.Empty(t, e.getChainID()) } -func TestParseEATelemetry(t *testing.T) { +func TestUnit_ParseEATelemetry(t *testing.T) { ea, err := parseEATelemetry([]byte(bridgeResponse)) assert.NoError(t, err) assert.Equal(t, "data-source-name", ea.DataSource) @@ -177,7 +177,7 @@ func TestParseEATelemetry(t *testing.T) { assert.Error(t, err) } -func TestGetJsonParsedValue(t *testing.T) { +func TestUnit_GetJsonParsedValue(t *testing.T) { resp := getJsonParsedValue(trrs[0], &trrs) assert.Equal(t, 123456.123456789, *resp) @@ -189,7 +189,7 @@ func TestGetJsonParsedValue(t *testing.T) { assert.Nil(t, resp) } -func TestGetJsonParsedValueHexValues(t *testing.T) { +func TestUnit_GetJsonParsedValueHexValues(t *testing.T) { trrsHexData := pipeline.TaskRunResults{ pipeline.TaskRunResult{ Task: &pipeline.BridgeTask{ @@ -283,7 +283,7 @@ func TestGetJsonParsedValueHexValues(t *testing.T) { assert.Nil(t, resp) } -func TestSendEATelemetry(t *testing.T) { +func TestUnit_SendEATelemetry(t *testing.T) { wg := sync.WaitGroup{} ingressClient := mocks.NewTelemetryService(t) ingressAgent := telemetry.NewIngressAgentWrapper(ingressClient) @@ -371,7 +371,7 @@ func TestSendEATelemetry(t *testing.T) { doneCh <- struct{}{} } -func TestGetObservation(t *testing.T) { +func TestUnit_GetObservation(t *testing.T) { j := job.Job{ OCROracleSpec: &job.OCROracleSpec{CaptureEATelemetry: true}, OCR2OracleSpec: &job.OCR2OracleSpec{CaptureEATelemetry: true}, @@ -396,7 +396,7 @@ func TestGetObservation(t *testing.T) { assert.Equal(t, int64(123456), obs) } -func TestCollectAndSend(t *testing.T) { +func TestUnit_CollectAndSend(t *testing.T) { wg := sync.WaitGroup{} ingressClient := mocks.NewTelemetryService(t) ingressAgent := telemetry.NewIngressAgentWrapper(ingressClient) @@ -574,7 +574,7 @@ var trrsMercuryV4 = pipeline.TaskRunResults{ }, } -func TestGetPricesFromBridgeByTelemetryField(t *testing.T) { +func TestUnit_GetPricesFromBridgeByTelemetryField(t *testing.T) { lggr, _ := logger.TestLoggerObserved(t, zap.WarnLevel) // These are intentionally out of order from the "legacy" method which expects order of `benchmark, bid, ask` jsonParseTaskBid := pipeline.JSONParseTask{ @@ -643,7 +643,7 @@ func TestGetPricesFromBridgeByTelemetryField(t *testing.T) { require.Equal(t, 123456.123456, wrongAskPrice) } -func TestGetPricesFromBridgeTaskByOrder(t *testing.T) { +func TestUnit_GetPricesFromBridgeTaskByOrder(t *testing.T) { lggr, logs := logger.TestLoggerObserved(t, zap.WarnLevel) benchmarkPrice, bid, ask := getPricesFromBridgeTask(lggr, trrsMercuryV1[0], trrsMercuryV1, 1) @@ -711,7 +711,7 @@ func TestGetPricesFromBridgeTaskByOrder(t *testing.T) { require.Equal(t, float64(0), ask) } -func TestShouldCollectEnhancedTelemetryMercury(t *testing.T) { +func TestUnit_ShouldCollectEnhancedTelemetryMercury(t *testing.T) { j := job.Job{ Type: job.Type(pipeline.OffchainReporting2JobType), OCR2OracleSpec: &job.OCR2OracleSpec{ @@ -727,7 +727,7 @@ func TestShouldCollectEnhancedTelemetryMercury(t *testing.T) { require.False(t, ShouldCollectEnhancedTelemetryMercury(j)) } -func TestParseBridgeRequestData(t *testing.T) { +func TestUnit_ParseBridgeRequestData(t *testing.T) { require.Equal(t, bridgeRequestData{}, parseBridgeRequestData("", 2)) reqData := `{"data":{"to":"LINK","from":"USD"}}` @@ -816,7 +816,7 @@ func getViewFunctionTaskRunResults() pipeline.TaskRunResults { } } -func TestCollectMercuryEnhancedTelemetryV1ViewFunction(t *testing.T) { +func TestUnit_CollectMercuryEnhancedTelemetryV1ViewFunction(t *testing.T) { wg := sync.WaitGroup{} ingressClient := mocks.NewTelemetryService(t) ingressAgent := telemetry.NewIngressAgentWrapper(ingressClient) @@ -903,7 +903,7 @@ func TestCollectMercuryEnhancedTelemetryV1ViewFunction(t *testing.T) { chDone <- struct{}{} } -func TestCollectMercuryEnhancedTelemetryV1(t *testing.T) { +func TestUnit_CollectMercuryEnhancedTelemetryV1(t *testing.T) { wg := sync.WaitGroup{} ingressClient := mocks.NewTelemetryService(t) ingressAgent := telemetry.NewIngressAgentWrapper(ingressClient) @@ -1020,7 +1020,7 @@ func TestCollectMercuryEnhancedTelemetryV1(t *testing.T) { chDone <- struct{}{} } -func TestCollectMercuryEnhancedTelemetryV2(t *testing.T) { +func TestUnit_CollectMercuryEnhancedTelemetryV2(t *testing.T) { wg := sync.WaitGroup{} ingressClient := mocks.NewTelemetryService(t) ingressAgent := telemetry.NewIngressAgentWrapper(ingressClient) @@ -1136,7 +1136,7 @@ func TestCollectMercuryEnhancedTelemetryV2(t *testing.T) { chDone <- struct{}{} } -func TestCollectMercuryEnhancedTelemetryV4(t *testing.T) { +func TestUnit_CollectMercuryEnhancedTelemetryV4(t *testing.T) { ingressClient := mocks.NewTelemetryService(t) ingressAgent := telemetry.NewIngressAgentWrapper(ingressClient) monitoringEndpoint := ingressAgent.GenMonitoringEndpoint("test-network", "test-chainID", "0xa", synchronization.EnhancedEAMercury) diff --git a/core/services/p2p/counter_test.go b/core/services/p2p/counter_test.go index 7d11503ccaa..f5bbc9a6ed9 100644 --- a/core/services/p2p/counter_test.go +++ b/core/services/p2p/counter_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" ) -func Test_groupID(t *testing.T) { +func TestUnit_groupID(t *testing.T) { g := &counter{} assert.Equal(t, [32]byte{}, g.Bytes()) g.Inc() diff --git a/core/services/p2p/peer_test.go b/core/services/p2p/peer_test.go index 3914e95ac68..1446c8dd203 100644 --- a/core/services/p2p/peer_test.go +++ b/core/services/p2p/peer_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/p2p" ) -func TestPeer_CleanStartClose(t *testing.T) { +func TestUnit_Peer_CleanStartClose(t *testing.T) { lggr := logger.TestLogger(t) port := freeport.GetOne(t) privKey, _ := newKeyPair(t) diff --git a/core/services/p2p/shared_peer_test.go b/core/services/p2p/shared_peer_test.go index 4701db3df40..6b2e2ac889c 100644 --- a/core/services/p2p/shared_peer_test.go +++ b/core/services/p2p/shared_peer_test.go @@ -25,7 +25,7 @@ import ( p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" ) -func TestDon2DonSharedPeer_WithRealSingletonPeerWrapper(t *testing.T) { +func TestIntegration_Shared_Don2DonSharedPeer_WithRealSingletonPeerWrapper(t *testing.T) { db := pgtest.NewSqlxDB(t) keyStore := cltest.NewKeyStore(t, db) k, err := keyStore.P2P().Create(testutils.Context(t)) @@ -55,12 +55,12 @@ func TestDon2DonSharedPeer_WithRealSingletonPeerWrapper(t *testing.T) { require.NoError(t, sp.Close()) } -func TestDon2DonSharedPeer_ErrorOnNilSingletonPeerWrapper(t *testing.T) { +func TestUnit_Don2DonSharedPeer_ErrorOnNilSingletonPeerWrapper(t *testing.T) { sp := p2p.NewDon2DonSharedPeer(nil, nil, logger.TestLogger(t)) require.Error(t, sp.Start(t.Context())) } -func TestDon2DonSharedPeer_UpdateConnectionsByDONs(t *testing.T) { +func TestUnit_Don2DonSharedPeer_UpdateConnectionsByDONs(t *testing.T) { pw := ocrcommon.NewSingletonPeerWrapper(nil, nil, nil, nil, logger.TestLogger(t)) // nils are ok, we won't Start() it _, myPeerID := newKeyPair(t) _, peerID2 := newKeyPair(t) diff --git a/core/services/p2p/signer_test.go b/core/services/p2p/signer_test.go index 4c91375c8e7..64d2e43458c 100644 --- a/core/services/p2p/signer_test.go +++ b/core/services/p2p/signer_test.go @@ -10,7 +10,7 @@ import ( ksmocks "github.com/smartcontractkit/chainlink/v2/core/services/keystore/mocks" ) -func TestSigner_InitializeAndSign(t *testing.T) { +func TestUnit_Signer_InitializeAndSign(t *testing.T) { keystoreP2P := ksmocks.NewP2P(t) key, err := p2pkey.NewV2() require.NoError(t, err) diff --git a/core/services/p2p/utils_test.go b/core/services/p2p/utils_test.go index 968633cca1a..838254bc847 100644 --- a/core/services/p2p/utils_test.go +++ b/core/services/p2p/utils_test.go @@ -16,7 +16,7 @@ const ( ann2 = "announcement2" ) -func TestInMemoryDiscovererDatabase(t *testing.T) { +func TestUnit_InMemoryDiscovererDatabase(t *testing.T) { db := p2p.NewInMemoryDiscovererDatabase() require.NoError(t, db.StoreAnnouncement(testutils.Context(t), peerID1, []byte(ann1))) require.NoError(t, db.StoreAnnouncement(testutils.Context(t), peerID2, []byte(ann2))) diff --git a/core/services/p2p/wrapper/wrapper_test.go b/core/services/p2p/wrapper/wrapper_test.go index 53231b48417..b93a6278d9c 100644 --- a/core/services/p2p/wrapper/wrapper_test.go +++ b/core/services/p2p/wrapper/wrapper_test.go @@ -19,7 +19,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/p2p/wrapper" ) -func TestPeerWrapper_CleanStartClose(t *testing.T) { +func TestUnit_PeerWrapper_CleanStartClose(t *testing.T) { db := pgtest.NewSqlxDB(t) lggr := logger.TestLogger(t) diff --git a/core/services/periodicbackup/backup_test.go b/core/services/periodicbackup/backup_test.go index 6e7f93d1857..ca320218b54 100644 --- a/core/services/periodicbackup/backup_test.go +++ b/core/services/periodicbackup/backup_test.go @@ -30,7 +30,7 @@ func must(t testing.TB, s string) *url.URL { return v } -func TestPeriodicBackup_RunBackup(t *testing.T) { +func TestIntegration_Shared_PeriodicBackup_RunBackup(t *testing.T) { backupConfig := newTestConfig(time.Minute, nil, "", config.DatabaseBackupModeFull) periodicBackup := mustNewDatabaseBackup(t, *(must(t, string(env.DatabaseURL.Get()))), os.TempDir(), backupConfig) assert.False(t, periodicBackup.frequencyIsTooSmall()) @@ -49,7 +49,7 @@ func TestPeriodicBackup_RunBackup(t *testing.T) { assert.NotContains(t, result.pgDumpArguments, "--exclude-table-data=pipeline_task_runs") } -func TestPeriodicBackup_RunBackupInLiteMode(t *testing.T) { +func TestIntegration_Shared_PeriodicBackup_RunBackupInLiteMode(t *testing.T) { backupConfig := newTestConfig(time.Minute, nil, "", config.DatabaseBackupModeLite) periodicBackup := mustNewDatabaseBackup(t, *(must(t, string(env.DatabaseURL.Get()))), os.TempDir(), backupConfig) assert.False(t, periodicBackup.frequencyIsTooSmall()) @@ -68,7 +68,7 @@ func TestPeriodicBackup_RunBackupInLiteMode(t *testing.T) { assert.Contains(t, result.pgDumpArguments, "--exclude-table-data=pipeline_task_runs") } -func TestPeriodicBackup_RunBackupWithoutVersion(t *testing.T) { +func TestIntegration_Shared_PeriodicBackup_RunBackupWithoutVersion(t *testing.T) { backupConfig := newTestConfig(time.Minute, nil, "", config.DatabaseBackupModeFull) periodicBackup := mustNewDatabaseBackup(t, *(must(t, string(env.DatabaseURL.Get()))), os.TempDir(), backupConfig) assert.False(t, periodicBackup.frequencyIsTooSmall()) @@ -86,7 +86,7 @@ func TestPeriodicBackup_RunBackupWithoutVersion(t *testing.T) { assert.Contains(t, result.path, "backup/cl_backup_unset") } -func TestPeriodicBackup_RunBackupViaAltUrlAndMaskPassword(t *testing.T) { +func TestUnit_PeriodicBackup_RunBackupViaAltUrlAndMaskPassword(t *testing.T) { altUrl, _ := url.Parse("postgresql://invalid:some-pass@invalid") backupConfig := newTestConfig(time.Minute, altUrl, "", config.DatabaseBackupModeFull) periodicBackup := mustNewDatabaseBackup(t, *(must(t, string(env.DatabaseURL.Get()))), os.TempDir(), backupConfig) @@ -97,13 +97,13 @@ func TestPeriodicBackup_RunBackupViaAltUrlAndMaskPassword(t *testing.T) { assert.Contains(t, partialResult.maskedArguments, "postgresql://invalid:xxxxx@invalid") } -func TestPeriodicBackup_FrequencyTooSmall(t *testing.T) { +func TestUnit_PeriodicBackup_FrequencyTooSmall(t *testing.T) { backupConfig := newTestConfig(time.Second, nil, "", config.DatabaseBackupModeFull) periodicBackup := mustNewDatabaseBackup(t, *(must(t, string(env.DatabaseURL.Get()))), os.TempDir(), backupConfig) assert.True(t, periodicBackup.frequencyIsTooSmall()) } -func TestPeriodicBackup_AlternativeOutputDir(t *testing.T) { +func TestIntegration_Shared_PeriodicBackup_AlternativeOutputDir(t *testing.T) { backupDir := filepath.Join(os.TempDir(), "alternative") backupConfig := newTestConfig(time.Second, nil, backupDir, config.DatabaseBackupModeFull) periodicBackup := mustNewDatabaseBackup(t, *(must(t, string(env.DatabaseURL.Get()))), os.TempDir(), backupConfig) diff --git a/core/services/pg/connection_test.go b/core/services/pg/connection_test.go index d21fb109b32..e639d7e62d6 100644 --- a/core/services/pg/connection_test.go +++ b/core/services/pg/connection_test.go @@ -25,7 +25,7 @@ func (m *mockGetter) Get(dest any, query string, args ...any) error { return nil } -func Test_checkVersion(t *testing.T) { +func TestUnit_checkVersion(t *testing.T) { if time.Now().Year() > 2027 { t.Fatal("Postgres version numbers only registered until 2028, please update the postgres version check using: https://www.postgresql.org/support/versioning/ then fix this test") } diff --git a/core/services/pg/lease_lock_test.go b/core/services/pg/lease_lock_test.go index 65bbe3b8610..ea23bb5bd24 100644 --- a/core/services/pg/lease_lock_test.go +++ b/core/services/pg/lease_lock_test.go @@ -23,7 +23,7 @@ func newLeaseLock(t *testing.T, db *sqlx.DB, cfg pg.LeaseLockConfig) pg.LeaseLoc return pg.NewLeaseLock(db, uuid.New(), logger.TestLogger(t), cfg) } -func Test_LeaseLock(t *testing.T) { +func TestIntegration_Shared_LeaseLock(t *testing.T) { cfg, db := heavyweight.FullTestDBNoFixturesV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { t := true c.Database.Lock.Enabled = &t diff --git a/core/services/pg/locked_db_test.go b/core/services/pg/locked_db_test.go index ef5c9cfe45a..6ac2b48e468 100644 --- a/core/services/pg/locked_db_test.go +++ b/core/services/pg/locked_db_test.go @@ -22,7 +22,7 @@ func lease(c *chainlink.Config, s *chainlink.Secrets) { c.Database.Lock.LeaseRefreshInterval = commonconfig.MustNewDuration(time.Second) } -func TestLockedDB_HappyPath(t *testing.T) { +func TestIntegration_Shared_LockedDB_HappyPath(t *testing.T) { testutils.SkipShortDB(t) config := configtest.NewGeneralConfig(t, lease) lggr := logger.TestLogger(t) @@ -37,7 +37,7 @@ func TestLockedDB_HappyPath(t *testing.T) { require.Nil(t, ldb.DB()) } -func TestLockedDB_ContextCancelled(t *testing.T) { +func TestUnit_LockedDB_ContextCancelled(t *testing.T) { testutils.SkipShortDB(t) config := configtest.NewGeneralConfig(t, lease) lggr := logger.TestLogger(t) @@ -50,7 +50,7 @@ func TestLockedDB_ContextCancelled(t *testing.T) { require.Nil(t, ldb.DB()) } -func TestLockedDB_OpenTwice(t *testing.T) { +func TestIntegration_Shared_LockedDB_OpenTwice(t *testing.T) { testutils.SkipShortDB(t) config := configtest.NewGeneralConfig(t, lease) lggr := logger.TestLogger(t) @@ -63,7 +63,7 @@ func TestLockedDB_OpenTwice(t *testing.T) { _ = ldb.Close() } -func TestLockedDB_TwoInstances(t *testing.T) { +func TestIntegration_Shared_LockedDB_TwoInstances(t *testing.T) { testutils.SkipShortDB(t) config := configtest.NewGeneralConfig(t, lease) lggr := logger.TestLogger(t) @@ -84,7 +84,7 @@ func TestLockedDB_TwoInstances(t *testing.T) { require.Error(t, err) } -func TestOpenUnlockedDB(t *testing.T) { +func TestIntegration_Shared_OpenUnlockedDB(t *testing.T) { testutils.SkipShortDB(t) ctx := testutils.Context(t) config := configtest.NewGeneralConfig(t, nil) diff --git a/core/services/pipeline/common_eth_test.go b/core/services/pipeline/common_eth_test.go index e34dc8ca035..b57528254a1 100644 --- a/core/services/pipeline/common_eth_test.go +++ b/core/services/pipeline/common_eth_test.go @@ -19,7 +19,7 @@ func mustABIType(t *testing.T, ty string) abi.Type { return typ } -func Test_convertToETHABIType(t *testing.T) { +func TestIntegration_Shared_convertToETHABIType(t *testing.T) { t.Parallel() emptyHash := common.Hash{} @@ -107,7 +107,7 @@ func Test_convertToETHABIType(t *testing.T) { } } -func Test_convertToETHABIType_Errors(t *testing.T) { +func TestIntegration_Shared_convertToETHABIType_Errors(t *testing.T) { t.Parallel() for _, tt := range []struct { @@ -125,7 +125,7 @@ func Test_convertToETHABIType_Errors(t *testing.T) { } } -func Test_convertToETHABIBytes_Errors(t *testing.T) { +func TestIntegration_Shared_convertToETHABIBytes_Errors(t *testing.T) { t.Parallel() for _, tt := range []struct { diff --git a/core/services/pipeline/common_test.go b/core/services/pipeline/common_test.go index 94b1d1a2f49..65e33f954c1 100644 --- a/core/services/pipeline/common_test.go +++ b/core/services/pipeline/common_test.go @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestAtrributesAttribute(t *testing.T) { +func TestUnit_AtrributesAttribute(t *testing.T) { a := `ds1 [type=http method=GET tags=<{"attribute1":"value1", "attribute2":42}>];` p, err := pipeline.Parse(a) require.NoError(t, err) @@ -25,7 +25,7 @@ func TestAtrributesAttribute(t *testing.T) { assert.JSONEq(t, "{\"attribute1\":\"value1\", \"attribute2\":42}", task.TaskTags()) } -func TestTimeoutAttribute(t *testing.T) { +func TestIntegration_Shared_TimeoutAttribute(t *testing.T) { t.Parallel() a := `ds1 [type=http method=GET url="https://chain.link/voter_turnout/USA-2020" requestData=<{"hi": "hello"}> timeout="10s"];` @@ -43,7 +43,7 @@ func TestTimeoutAttribute(t *testing.T) { assert.False(t, set) } -func TestTaskHTTPUnmarshal(t *testing.T) { +func TestIntegration_Shared_TaskHTTPUnmarshal(t *testing.T) { t.Parallel() a := `ds1 [type=http allowunrestrictednetworkaccess=true method=GET url="https://chain.link/voter_turnout/USA-2020" requestData=<{"hi": "hello"}> timeout="10s"];` @@ -55,7 +55,7 @@ func TestTaskHTTPUnmarshal(t *testing.T) { require.Equal(t, "true", task.AllowUnrestrictedNetworkAccess) } -func TestTaskAnyUnmarshal(t *testing.T) { +func TestIntegration_Shared_TaskAnyUnmarshal(t *testing.T) { t.Parallel() a := `ds1 [type=any failEarly=true];` @@ -67,7 +67,7 @@ func TestTaskAnyUnmarshal(t *testing.T) { require.True(t, p.Tasks[0].Base().FailEarly) } -func TestRetryUnmarshal(t *testing.T) { +func TestIntegration_Shared_RetryUnmarshal(t *testing.T) { t.Parallel() tests := []struct { @@ -114,7 +114,7 @@ func TestRetryUnmarshal(t *testing.T) { } } -func TestUnmarshalTaskFromMap(t *testing.T) { +func TestIntegration_Shared_UnmarshalTaskFromMap(t *testing.T) { t.Parallel() t.Run("returns error if task is not the right type", func(t *testing.T) { @@ -182,7 +182,7 @@ func TestUnmarshalTaskFromMap(t *testing.T) { } } -func TestCheckInputs(t *testing.T) { +func TestIntegration_Shared_CheckInputs(t *testing.T) { t.Parallel() emptyPR := []pipeline.Result{} @@ -223,7 +223,7 @@ func TestCheckInputs(t *testing.T) { } } -func TestTaskRunResult_IsPending(t *testing.T) { +func TestIntegration_Shared_TaskRunResult_IsPending(t *testing.T) { t.Parallel() trr := &pipeline.TaskRunResult{} @@ -236,7 +236,7 @@ func TestTaskRunResult_IsPending(t *testing.T) { assert.False(t, trrWithFinishedAt.IsPending()) } -func TestSelectGasLimit(t *testing.T) { +func TestIntegration_Shared_SelectGasLimit(t *testing.T) { t.Parallel() gcfg := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { @@ -293,7 +293,7 @@ func TestSelectGasLimit(t *testing.T) { assert.Equal(t, uint64(999), gasLimit) }) } -func TestGetNextTaskOf(t *testing.T) { +func TestUnit_GetNextTaskOf(t *testing.T) { trrs := pipeline.TaskRunResults{ { Task: &pipeline.BridgeTask{ @@ -331,7 +331,7 @@ func TestGetNextTaskOf(t *testing.T) { assert.Empty(t, nextTask) } -func TestGetDescendantTasks(t *testing.T) { +func TestIntegration_Shared_GetDescendantTasks(t *testing.T) { t.Parallel() t.Run("GetDescendantTasks with multiple levels of tasks", func(t *testing.T) { diff --git a/core/services/pipeline/eautils/eautils_test.go b/core/services/pipeline/eautils/eautils_test.go index 80183b80d2b..83394fc7c21 100644 --- a/core/services/pipeline/eautils/eautils_test.go +++ b/core/services/pipeline/eautils/eautils_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestBestEffortExtractEAStatus(t *testing.T) { +func TestUnit_BestEffortExtractEAStatus(t *testing.T) { tests := []struct { name string arg []byte diff --git a/core/services/pipeline/getters_test.go b/core/services/pipeline/getters_test.go index 11a8a92c720..a4b9579dd9a 100644 --- a/core/services/pipeline/getters_test.go +++ b/core/services/pipeline/getters_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestGetters_VarExpr(t *testing.T) { +func TestIntegration_Shared_Getters_VarExpr(t *testing.T) { t.Parallel() vars := createTestVars() @@ -57,7 +57,7 @@ func TestGetters_VarExpr(t *testing.T) { } } -func TestGetters_JSONWithVarExprs(t *testing.T) { +func TestIntegration_Shared_Getters_JSONWithVarExprs(t *testing.T) { t.Parallel() vars := createTestVars() @@ -115,7 +115,7 @@ func TestGetters_JSONWithVarExprs(t *testing.T) { } } -func TestGetters_Input(t *testing.T) { +func TestIntegration_Shared_Getters_Input(t *testing.T) { t.Parallel() t.Run("returns the requested input's Value and Error if they exist", func(t *testing.T) { @@ -134,7 +134,7 @@ func TestGetters_Input(t *testing.T) { }) } -func TestGetters_Inputs(t *testing.T) { +func TestIntegration_Shared_Getters_Inputs(t *testing.T) { t.Parallel() theErr := errors.New("some issue") @@ -172,7 +172,7 @@ func TestGetters_Inputs(t *testing.T) { } } -func TestGetters_NonemptyString(t *testing.T) { +func TestIntegration_Shared_Getters_NonemptyString(t *testing.T) { t.Parallel() t.Run("returns any non-empty string", func(t *testing.T) { @@ -189,7 +189,7 @@ func TestGetters_NonemptyString(t *testing.T) { }) } -func TestGetters_ValidDurationInSeconds(t *testing.T) { +func TestIntegration_Shared_Getters_ValidDurationInSeconds(t *testing.T) { t.Parallel() t.Run("returns duration in seconds", func(t *testing.T) { @@ -223,7 +223,7 @@ func TestGetters_ValidDurationInSeconds(t *testing.T) { }) } -func TestGetters_From(t *testing.T) { +func TestIntegration_Shared_Getters_From(t *testing.T) { t.Parallel() t.Run("no inputs", func(t *testing.T) { diff --git a/core/services/pipeline/graph_test.go b/core/services/pipeline/graph_test.go index c6248a38e24..09a04d627b9 100644 --- a/core/services/pipeline/graph_test.go +++ b/core/services/pipeline/graph_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestGraph_Decode(t *testing.T) { +func TestIntegration_Shared_Graph_Decode(t *testing.T) { t.Parallel() expected := map[string]map[string]bool{ @@ -117,7 +117,7 @@ func TestGraph_Decode(t *testing.T) { } } -func TestGraph_TasksInDependencyOrder(t *testing.T) { +func TestIntegration_Shared_Graph_TasksInDependencyOrder(t *testing.T) { t.Parallel() p, err := pipeline.Parse(pipeline.DotStr) @@ -209,7 +209,7 @@ func TestGraph_TasksInDependencyOrder(t *testing.T) { require.Equal(t, expected, p.Tasks) } -func TestGraph_HasCycles(t *testing.T) { +func TestIntegration_Shared_Graph_HasCycles(t *testing.T) { t.Parallel() _, err := pipeline.Parse(pipeline.DotStr) @@ -224,7 +224,7 @@ func TestGraph_HasCycles(t *testing.T) { require.Contains(t, err.Error(), "cycle detected") } -func TestGraph_ImplicitDependencies(t *testing.T) { +func TestIntegration_Shared_Graph_ImplicitDependencies(t *testing.T) { t.Parallel() g := pipeline.NewGraph() @@ -251,7 +251,7 @@ func TestGraph_ImplicitDependencies(t *testing.T) { require.True(t, g.HasEdgeFromTo(nodes["c"], nodes["d"])) } -func TestParse(t *testing.T) { +func TestUnit_Parse(t *testing.T) { for _, s := range []struct { name string pipeline string diff --git a/core/services/pipeline/keypath_test.go b/core/services/pipeline/keypath_test.go index daac61a25ee..16b8131d6fb 100644 --- a/core/services/pipeline/keypath_test.go +++ b/core/services/pipeline/keypath_test.go @@ -8,7 +8,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestKeypath(t *testing.T) { +func TestIntegration_Shared_Keypath(t *testing.T) { t.Parallel() t.Run("can be constructed from a period-delimited string", func(t *testing.T) { diff --git a/core/services/pipeline/models_test.go b/core/services/pipeline/models_test.go index 26c438ea309..4afcbddcd7f 100644 --- a/core/services/pipeline/models_test.go +++ b/core/services/pipeline/models_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestRun_Status(t *testing.T) { +func TestIntegration_Shared_Run_Status(t *testing.T) { t.Parallel() assert.False(t, pipeline.RunStatusUnknown.Finished()) @@ -73,7 +73,7 @@ func TestRun_Status(t *testing.T) { } } -func TestRunErrors_ToError(t *testing.T) { +func TestUnit_RunErrors_ToError(t *testing.T) { runErrors := pipeline.RunErrors{} runErrors = append(runErrors, null.NewString("bad thing happened", true)) runErrors = append(runErrors, null.NewString("pretty bad thing happened", true)) @@ -81,7 +81,7 @@ func TestRunErrors_ToError(t *testing.T) { require.ErrorContains(t, runErrors.ToError(), "bad thing happened\npretty bad thing happened") } -func TestRun_StringOutputs(t *testing.T) { +func TestIntegration_Shared_Run_StringOutputs(t *testing.T) { t.Parallel() t.Run("invalid outputs", func(t *testing.T) { diff --git a/core/services/pipeline/orm_test.go b/core/services/pipeline/orm_test.go index b720feab977..04cbf50d979 100644 --- a/core/services/pipeline/orm_test.go +++ b/core/services/pipeline/orm_test.go @@ -83,7 +83,7 @@ func setupLiteORM(t *testing.T) (db *sqlx.DB, orm pipeline.ORM, jorm job.ORM) { return setupORM(t, false) } -func Test_PipelineORM_CreateSpec(t *testing.T) { +func TestIntegration_Shared_PipelineORM_CreateSpec(t *testing.T) { ctx := testutils.Context(t) db, orm, _ := setupLiteORM(t) @@ -106,7 +106,7 @@ func Test_PipelineORM_CreateSpec(t *testing.T) { assert.Equal(t, maxTaskDuration, actual.MaxTaskDuration) } -func Test_PipelineORM_FindRun(t *testing.T) { +func TestIntegration_Shared_PipelineORM_FindRun(t *testing.T) { db, orm, _ := setupLiteORM(t) _, err := db.Exec(`SET CONSTRAINTS fk_pipeline_runs_pruning_key DEFERRED`) @@ -180,7 +180,7 @@ answer2 [type=bridge name=election_winner index=1]; return run } -func TestInsertFinishedRuns(t *testing.T) { +func TestIntegration_Shared_InsertFinishedRuns(t *testing.T) { ctx := testutils.Context(t) db, orm, _ := setupLiteORM(t) @@ -240,7 +240,7 @@ func TestInsertFinishedRuns(t *testing.T) { require.NoError(t, err) } -func Test_PipelineORM_InsertFinishedRunWithSpec(t *testing.T) { +func TestUnit_PipelineORM_InsertFinishedRunWithSpec(t *testing.T) { ctx := testutils.Context(t) db, orm, jorm := setupLiteORM(t) @@ -327,7 +327,7 @@ answer2 [type=bridge name=election_winner index=1]; } // Tests that inserting run results, then later updating the run results via upsert will work correctly. -func Test_PipelineORM_StoreRun_ShouldUpsert(t *testing.T) { +func TestUnit_PipelineORM_StoreRun_ShouldUpsert(t *testing.T) { ctx := testutils.Context(t) _, orm, jorm := setupLiteORM(t) @@ -407,7 +407,7 @@ func Test_PipelineORM_StoreRun_ShouldUpsert(t *testing.T) { // Tests that trying to persist a partial run while new data became available (i.e. via /v2/restart) // will detect a restart and update the result data on the Run. -func Test_PipelineORM_StoreRun_DetectsRestarts(t *testing.T) { +func TestUnit_PipelineORM_StoreRun_DetectsRestarts(t *testing.T) { ctx := testutils.Context(t) db, orm, jorm := setupLiteORM(t) @@ -472,7 +472,7 @@ func Test_PipelineORM_StoreRun_DetectsRestarts(t *testing.T) { require.True(t, ds1.FinishedAt.Valid) } -func Test_PipelineORM_StoreRun_UpdateTaskRunResult(t *testing.T) { +func TestUnit_PipelineORM_StoreRun_UpdateTaskRunResult(t *testing.T) { ctx := testutils.Context(t) _, orm, jorm := setupLiteORM(t) @@ -554,7 +554,7 @@ func Test_PipelineORM_StoreRun_UpdateTaskRunResult(t *testing.T) { require.Equal(t, jsonserializable.JSONSerializable{Val: cborOutput, Valid: true}, task2.Output) } -func Test_PipelineORM_DeleteRun(t *testing.T) { +func TestUnit_PipelineORM_DeleteRun(t *testing.T) { ctx := testutils.Context(t) _, orm, jorm := setupLiteORM(t) @@ -597,7 +597,7 @@ func Test_PipelineORM_DeleteRun(t *testing.T) { require.Error(t, err, "not found") } -func Test_PipelineORM_DeleteRunsOlderThan(t *testing.T) { +func TestUnit_PipelineORM_DeleteRunsOlderThan(t *testing.T) { ctx := testutils.Context(t) _, orm, jorm := setupHeavyORM(t) @@ -642,7 +642,7 @@ func Test_PipelineORM_DeleteRunsOlderThan(t *testing.T) { } } -func Test_GetUnfinishedRuns_Keepers(t *testing.T) { +func TestUnit_GetUnfinishedRuns_Keepers(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -745,7 +745,7 @@ func Test_GetUnfinishedRuns_Keepers(t *testing.T) { require.Equal(t, 2, counter) } -func Test_GetUnfinishedRuns_DirectRequest(t *testing.T) { +func TestUnit_GetUnfinishedRuns_DirectRequest(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -840,7 +840,7 @@ func Test_GetUnfinishedRuns_DirectRequest(t *testing.T) { require.Equal(t, 1, counter) } -func Test_Prune(t *testing.T) { +func TestUnit_Prune(t *testing.T) { t.Parallel() n := uint64(2) diff --git a/core/services/pipeline/runner_test.go b/core/services/pipeline/runner_test.go index 59b99198a8e..c3d91704be6 100644 --- a/core/services/pipeline/runner_test.go +++ b/core/services/pipeline/runner_test.go @@ -53,7 +53,7 @@ func newRunner(t testing.TB, db *sqlx.DB, bridgeORM bridges.ORM, cfg chainlink.G return r, orm } -func Test_PipelineRunner_ExecuteTaskRuns(t *testing.T) { +func TestUnit_PipelineRunner_ExecuteTaskRuns(t *testing.T) { db := pgtest.NewSqlxDB(t) cfg := configtest.NewTestGeneralConfig(t) @@ -134,7 +134,7 @@ ds5 [type=http method="GET" url="%s" index=2] require.Len(t, errorResults, 3) } -func Test_PipelineRunner_ExecuteEthAbiDecode(t *testing.T) { +func TestUnit_PipelineRunner_ExecuteEthAbiDecode(t *testing.T) { db := pgtest.NewSqlxDB(t) cfg := configtest.NewTestGeneralConfig(t) @@ -219,7 +219,7 @@ func (t taskRunWithVars) String() string { `, t.bridgeName, t.ds2URL, t.ds4URL, t.submitBridgeName, t.includeInputAtKey) } -func Test_PipelineRunner_ExecuteTaskRunsWithVars(t *testing.T) { +func TestUnit_PipelineRunner_ExecuteTaskRunsWithVars(t *testing.T) { t.Parallel() tests := []struct { @@ -390,7 +390,7 @@ decode_log -> decode_cbor; ` ) -func Test_PipelineRunner_CBORParse(t *testing.T) { +func TestUnit_PipelineRunner_CBORParse(t *testing.T) { db := pgtest.NewSqlxDB(t) cfg := configtest.NewTestGeneralConfig(t) btORM := bridgesMocks.NewORM(t) @@ -451,7 +451,7 @@ func Test_PipelineRunner_CBORParse(t *testing.T) { }) } -func Test_PipelineRunner_HandleFaults(t *testing.T) { +func TestUnit_PipelineRunner_HandleFaults(t *testing.T) { // We want to test the scenario where one or multiple APIs time out, // but a sufficient number of them still complete within the desired time frame // and so we can still obtain a median. @@ -502,7 +502,7 @@ answer1 [type=median index=0]; } } -func Test_PipelineRunner_HandleFaultsPersistRun(t *testing.T) { +func TestUnit_PipelineRunner_HandleFaultsPersistRun(t *testing.T) { db := pgtest.NewSqlxDB(t) orm := mocks.NewORM(t) btORM := bridgesMocks.NewORM(t) @@ -548,7 +548,7 @@ succeed2 -> final; assert.Equal(t, "10.5", finalResult.Values[0].(decimal.Decimal).String()) } -func Test_PipelineRunner_ExecuteAndInsertFinishedRun_SavingTheSpec(t *testing.T) { +func TestUnit_PipelineRunner_ExecuteAndInsertFinishedRun_SavingTheSpec(t *testing.T) { db := pgtest.NewSqlxDB(t) orm := mocks.NewORM(t) btORM := bridgesMocks.NewORM(t) @@ -593,7 +593,7 @@ succeed2 -> final; assert.Equal(t, "10.5", finalResult.Values[0].(decimal.Decimal).String()) } -func Test_PipelineRunner_MultipleOutputs(t *testing.T) { +func TestUnit_PipelineRunner_MultipleOutputs(t *testing.T) { db := pgtest.NewSqlxDB(t) cfg := configtest.NewTestGeneralConfig(t) btORM := bridgesMocks.NewORM(t) @@ -621,7 +621,7 @@ a->b2->c;`, assert.Equal(t, mustDecimal(t, "10").String(), result.Value.(decimal.Decimal).String()) } -func Test_PipelineRunner_MultipleTerminatingOutputs(t *testing.T) { +func TestUnit_PipelineRunner_MultipleTerminatingOutputs(t *testing.T) { cfg := configtest.NewTestGeneralConfig(t) btORM := bridgesMocks.NewORM(t) r, _ := newRunner(t, pgtest.NewSqlxDB(t), btORM, cfg) @@ -643,7 +643,7 @@ a->b2;`, assert.Equal(t, mustDecimal(t, "12").String(), result.Values[1].(decimal.Decimal).String()) } -func Test_PipelineRunner_AsyncJob_Basic(t *testing.T) { +func TestUnit_PipelineRunner_AsyncJob_Basic(t *testing.T) { db := pgtest.NewSqlxDB(t) btcUSDPairing := utils.MustUnmarshalToMap(`{"data":{"coin":"BTC","market":"USD"}}`) @@ -773,7 +773,7 @@ ds5 [type=http method="GET" url="%s" index=2] require.Len(t, errorResults, 3) } -func Test_PipelineRunner_AsyncJob_InstantRestart(t *testing.T) { +func TestUnit_PipelineRunner_AsyncJob_InstantRestart(t *testing.T) { db := pgtest.NewSqlxDB(t) btcUSDPairing := utils.MustUnmarshalToMap(`{"data":{"coin":"BTC","market":"USD"}}`) @@ -892,7 +892,7 @@ ds5 [type=http method="GET" url="%s" index=2] require.Len(t, errorResults, 3) } -func Test_PipelineRunner_LowercaseOutputs(t *testing.T) { +func TestUnit_PipelineRunner_LowercaseOutputs(t *testing.T) { db := pgtest.NewSqlxDB(t) cfg := configtest.NewTestGeneralConfig(t) btORM := bridgesMocks.NewORM(t) @@ -915,7 +915,7 @@ a [type=lowercase input="$(first)"] assert.Equal(t, "camelcase", result.Value.(string)) } -func Test_PipelineRunner_UppercaseOutputs(t *testing.T) { +func TestUnit_PipelineRunner_UppercaseOutputs(t *testing.T) { db := pgtest.NewSqlxDB(t) cfg := configtest.NewTestGeneralConfig(t) btORM := bridgesMocks.NewORM(t) @@ -937,7 +937,7 @@ a [type=uppercase input="$(first)"] assert.Equal(t, "SOMERANDOMTEST", result.Value.(string)) } -func Test_PipelineRunner_HexDecodeOutputs(t *testing.T) { +func TestUnit_PipelineRunner_HexDecodeOutputs(t *testing.T) { db := pgtest.NewSqlxDB(t) cfg := configtest.NewTestGeneralConfig(t) btORM := bridgesMocks.NewORM(t) @@ -959,7 +959,7 @@ a [type=hexdecode input="$(astring)"] assert.Equal(t, []byte{0x12, 0x34, 0x56, 0x78}, result.Value) } -func Test_PipelineRunner_HexEncodeAndDecode(t *testing.T) { +func TestUnit_PipelineRunner_HexEncodeAndDecode(t *testing.T) { db := pgtest.NewSqlxDB(t) cfg := configtest.NewTestGeneralConfig(t) btORM := bridgesMocks.NewORM(t) @@ -984,7 +984,7 @@ en->de assert.Equal(t, inputBytes, result.Value) } -func Test_PipelineRunner_Base64DecodeOutputs(t *testing.T) { +func TestUnit_PipelineRunner_Base64DecodeOutputs(t *testing.T) { db := pgtest.NewSqlxDB(t) cfg := configtest.NewTestGeneralConfig(t) btORM := bridgesMocks.NewORM(t) @@ -1006,7 +1006,7 @@ a [type=base64decode input="$(astring)"] assert.Equal(t, []byte("Hello, playground"), result.Value) } -func Test_PipelineRunner_Base64EncodeAndDecode(t *testing.T) { +func TestUnit_PipelineRunner_Base64EncodeAndDecode(t *testing.T) { db := pgtest.NewSqlxDB(t) cfg := configtest.NewTestGeneralConfig(t) btORM := bridgesMocks.NewORM(t) @@ -1031,7 +1031,7 @@ en->de assert.Equal(t, inputBytes, result.Value) } -func Test_PipelineRunner_ExecuteRun(t *testing.T) { +func TestUnit_PipelineRunner_ExecuteRun(t *testing.T) { t.Run("uses cached *Pipeline if available", func(t *testing.T) { db := pgtest.NewSqlxDB(t) cfg := configtest.NewTestGeneralConfig(t) diff --git a/core/services/pipeline/scheduler_test.go b/core/services/pipeline/scheduler_test.go index e81236d50ff..155a97cfa5e 100644 --- a/core/services/pipeline/scheduler_test.go +++ b/core/services/pipeline/scheduler_test.go @@ -17,7 +17,7 @@ type event struct { result Result } -func TestScheduler(t *testing.T) { +func TestUnit_Scheduler(t *testing.T) { // NOTE: task type does not matter in the test cases, it's just there so it's parsed successfully tests := []struct { name string diff --git a/core/services/pipeline/task.any_test.go b/core/services/pipeline/task.any_test.go index 2827d0d15b2..3b065d3a11b 100644 --- a/core/services/pipeline/task.any_test.go +++ b/core/services/pipeline/task.any_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestAnyTask(t *testing.T) { +func TestUnit_AnyTask(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/services/pipeline/task.base64decode_test.go b/core/services/pipeline/task.base64decode_test.go index 4ca80669bda..84cda30424b 100644 --- a/core/services/pipeline/task.base64decode_test.go +++ b/core/services/pipeline/task.base64decode_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestBase64DecodeTask(t *testing.T) { +func TestUnit_Base64DecodeTask(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/services/pipeline/task.base64encode_test.go b/core/services/pipeline/task.base64encode_test.go index 44a26f390cb..6c11a9af26a 100644 --- a/core/services/pipeline/task.base64encode_test.go +++ b/core/services/pipeline/task.base64encode_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestBase64EncodeTask(t *testing.T) { +func TestUnit_Base64EncodeTask(t *testing.T) { t.Parallel() tests := []struct { @@ -66,7 +66,7 @@ func TestBase64EncodeTask(t *testing.T) { } } -func TestBase64EncodeTaskInputParamLiteral(t *testing.T) { +func TestUnit_Base64EncodeTaskInputParamLiteral(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/services/pipeline/task.bridge_test.go b/core/services/pipeline/task.bridge_test.go index 9d65f1bde40..14c493b120f 100644 --- a/core/services/pipeline/task.bridge_test.go +++ b/core/services/pipeline/task.bridge_test.go @@ -210,7 +210,7 @@ func fakeStringResponder(t *testing.T, s string) http.Handler { }) } -func TestBridgeTask_Happy(t *testing.T) { +func TestUnit_BridgeTask_Happy(t *testing.T) { t.Parallel() db := pgtest.NewSqlxDB(t) @@ -269,7 +269,7 @@ func TestBridgeTask_Happy(t *testing.T) { assert.NotEqual(t, uuid.Nil, btelem.DotID) } -func TestBridgeTask_HandlesIntermittentFailure(t *testing.T) { +func TestUnit_BridgeTask_HandlesIntermittentFailure(t *testing.T) { t.Parallel() db := pgtest.NewSqlxDB(t) @@ -330,7 +330,7 @@ func TestBridgeTask_HandlesIntermittentFailure(t *testing.T) { require.Equal(t, runInfo.IsRetryable, runInfo2.IsRetryable) } -func TestBridgeTask_DoesNotReturnStaleResults(t *testing.T) { +func TestUnit_BridgeTask_DoesNotReturnStaleResults(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -424,7 +424,7 @@ func TestBridgeTask_DoesNotReturnStaleResults(t *testing.T) { require.Nil(t, result2.Value) } -func TestBridgeTask_AsyncJobPendingState(t *testing.T) { +func TestUnit_BridgeTask_AsyncJobPendingState(t *testing.T) { t.Parallel() db := pgtest.NewSqlxDB(t) @@ -475,7 +475,7 @@ func TestBridgeTask_AsyncJobPendingState(t *testing.T) { require.Nil(t, result.Value) } -func TestBridgeTask_Variables(t *testing.T) { +func TestUnit_BridgeTask_Variables(t *testing.T) { t.Parallel() validMeta := map[string]any{"theMeta": "yes"} @@ -667,7 +667,7 @@ func TestBridgeTask_Variables(t *testing.T) { } } -func TestBridgeTask_Meta(t *testing.T) { +func TestUnit_BridgeTask_Meta(t *testing.T) { t.Parallel() db := pgtest.NewSqlxDB(t) @@ -718,7 +718,7 @@ func TestBridgeTask_Meta(t *testing.T) { assert.True(t, httpCalled.Load()) } -func TestBridgeTask_IncludeInputAtKey(t *testing.T) { +func TestUnit_BridgeTask_IncludeInputAtKey(t *testing.T) { t.Parallel() theErr := errors.New("foo") @@ -785,7 +785,7 @@ func TestBridgeTask_IncludeInputAtKey(t *testing.T) { } } -func TestBridgeTask_ErrorMessage(t *testing.T) { +func TestUnit_BridgeTask_ErrorMessage(t *testing.T) { t.Parallel() db := pgtest.NewSqlxDB(t) @@ -827,7 +827,7 @@ func TestBridgeTask_ErrorMessage(t *testing.T) { require.Nil(t, result.Value) } -func TestBridgeTask_OnlyErrorMessage(t *testing.T) { +func TestUnit_BridgeTask_OnlyErrorMessage(t *testing.T) { t.Parallel() db := pgtest.NewSqlxDB(t) @@ -866,7 +866,7 @@ func TestBridgeTask_OnlyErrorMessage(t *testing.T) { require.Nil(t, result.Value) } -func TestBridgeTask_ErrorIfBridgeMissing(t *testing.T) { +func TestUnit_BridgeTask_ErrorIfBridgeMissing(t *testing.T) { t.Parallel() db := pgtest.NewSqlxDB(t) @@ -893,7 +893,7 @@ func TestBridgeTask_ErrorIfBridgeMissing(t *testing.T) { // Sample input taken from // https://github.com/smartcontractkit/price-adapters#chainlink-price-request-adapters -func TestAdapterResponse_UnmarshalJSON_Happy(t *testing.T) { +func TestUnit_AdapterResponse_UnmarshalJSON_Happy(t *testing.T) { t.Parallel() tests := []struct { @@ -917,7 +917,7 @@ func TestAdapterResponse_UnmarshalJSON_Happy(t *testing.T) { } } -func TestBridgeTask_Headers(t *testing.T) { +func TestUnit_BridgeTask_Headers(t *testing.T) { db := pgtest.NewSqlxDB(t) cfg := configtest.NewTestGeneralConfig(t) @@ -1023,7 +1023,7 @@ func TestBridgeTask_Headers(t *testing.T) { }) } -func TestBridgeTask_AdapterResponseStatusFailure(t *testing.T) { +func TestUnit_BridgeTask_AdapterResponseStatusFailure(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -1129,7 +1129,7 @@ func TestBridgeTask_AdapterResponseStatusFailure(t *testing.T) { require.False(t, runInfo.IsPending) } -func TestBridgeTask_AdapterTimeout(t *testing.T) { +func TestUnit_BridgeTask_AdapterTimeout(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -1200,7 +1200,7 @@ func TestBridgeTask_AdapterTimeout(t *testing.T) { }) } -func TestBridgeTask_PipelineAdapterLWBAError(t *testing.T) { +func TestUnit_BridgeTask_PipelineAdapterLWBAError(t *testing.T) { t.Parallel() dag := ` diff --git a/core/services/pipeline/task.cborparse_test.go b/core/services/pipeline/task.cborparse_test.go index 108d8f79f1f..151a6219fea 100644 --- a/core/services/pipeline/task.cborparse_test.go +++ b/core/services/pipeline/task.cborparse_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestCBORParseTask(t *testing.T) { +func TestUnit_CBORParseTask(t *testing.T) { tests := []struct { name string data string diff --git a/core/services/pipeline/task.coalesce_test.go b/core/services/pipeline/task.coalesce_test.go index 6884adfe2be..98b59f89c68 100644 --- a/core/services/pipeline/task.coalesce_test.go +++ b/core/services/pipeline/task.coalesce_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestCoalesceTask(t *testing.T) { +func TestUnit_CoalesceTask(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/services/pipeline/task.conditional_test.go b/core/services/pipeline/task.conditional_test.go index 162fadfa736..94e1c67eeab 100644 --- a/core/services/pipeline/task.conditional_test.go +++ b/core/services/pipeline/task.conditional_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestConditionalTask(t *testing.T) { +func TestUnit_ConditionalTask(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/services/pipeline/task.divide_test.go b/core/services/pipeline/task.divide_test.go index 648f2c84b70..3eb8d1108f1 100644 --- a/core/services/pipeline/task.divide_test.go +++ b/core/services/pipeline/task.divide_test.go @@ -20,7 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestDivideTask_Happy(t *testing.T) { +func TestUnit_DivideTask_Happy(t *testing.T) { t.Parallel() tests := []struct { @@ -132,7 +132,7 @@ func TestDivideTask_Happy(t *testing.T) { } } -func TestDivideTask_Unhappy(t *testing.T) { +func TestUnit_DivideTask_Unhappy(t *testing.T) { t.Parallel() tests := []struct { @@ -173,7 +173,7 @@ func TestDivideTask_Unhappy(t *testing.T) { } } -func TestDivideTask_Overflow(t *testing.T) { +func TestUnit_DivideTask_Overflow(t *testing.T) { t.Parallel() d1, err := decimal.NewFromString("6.34e-01") @@ -199,7 +199,7 @@ func TestDivideTask_Overflow(t *testing.T) { require.Equal(t, pipeline.ErrDivisionOverlow, errors.Cause(result.Error)) } -func TestDivide_Example(t *testing.T) { +func TestUnit_Divide_Example(t *testing.T) { t.Parallel() dag := ` diff --git a/core/services/pipeline/task.eth_abi_decode_log_test.go b/core/services/pipeline/task.eth_abi_decode_log_test.go index a20125550db..d9eff39c353 100644 --- a/core/services/pipeline/task.eth_abi_decode_log_test.go +++ b/core/services/pipeline/task.eth_abi_decode_log_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestETHABIDecodeLogTask(t *testing.T) { +func TestUnit_ETHABIDecodeLogTask(t *testing.T) { tests := []struct { name string abi string diff --git a/core/services/pipeline/task.eth_abi_decode_test.go b/core/services/pipeline/task.eth_abi_decode_test.go index a47875a103c..3c13c17c3e8 100644 --- a/core/services/pipeline/task.eth_abi_decode_test.go +++ b/core/services/pipeline/task.eth_abi_decode_test.go @@ -120,7 +120,7 @@ var testsABIDecode = []struct { }, } -func TestETHABIDecodeTask(t *testing.T) { +func TestUnit_ETHABIDecodeTask(t *testing.T) { for _, test := range testsABIDecode { t.Run(test.name, func(t *testing.T) { task := ETHABIDecodeTask{ diff --git a/core/services/pipeline/task.eth_abi_encode_2_test.go b/core/services/pipeline/task.eth_abi_encode_2_test.go index c831e05f7eb..414229680ca 100644 --- a/core/services/pipeline/task.eth_abi_encode_2_test.go +++ b/core/services/pipeline/task.eth_abi_encode_2_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestETHABIEncodeTask2(t *testing.T) { +func TestUnit_ETHABIEncodeTask2(t *testing.T) { var bytes32 [32]byte copy(bytes32[:], []byte("chainlink chainlink chainlink")) diff --git a/core/services/pipeline/task.eth_abi_encode_test.go b/core/services/pipeline/task.eth_abi_encode_test.go index a24c3d251b8..bc83ade497d 100644 --- a/core/services/pipeline/task.eth_abi_encode_test.go +++ b/core/services/pipeline/task.eth_abi_encode_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils" ) -func TestETHABIEncodeTask(t *testing.T) { +func TestUnit_ETHABIEncodeTask(t *testing.T) { var bytes32 [32]byte copy(bytes32[:], []byte("chainlink chainlink chainlink")) @@ -240,7 +240,7 @@ func TestETHABIEncodeTask(t *testing.T) { } } -func TestETHABIEncode_EncodeIntegers(t *testing.T) { +func TestUnit_ETHABIEncode_EncodeIntegers(t *testing.T) { testCases := []struct { name string abi string @@ -530,7 +530,7 @@ func TestETHABIEncode_EncodeIntegers(t *testing.T) { } } -func TestETHABIEncode_EncodeIntegers_Overflow(t *testing.T) { +func TestUnit_ETHABIEncode_EncodeIntegers_Overflow(t *testing.T) { testCases := []struct { name string abi string diff --git a/core/services/pipeline/task.eth_call_test.go b/core/services/pipeline/task.eth_call_test.go index e7d42a7ef1b..3c2b34f072c 100644 --- a/core/services/pipeline/task.eth_call_test.go +++ b/core/services/pipeline/task.eth_call_test.go @@ -27,7 +27,7 @@ import ( pipelinemocks "github.com/smartcontractkit/chainlink/v2/core/services/pipeline/mocks" ) -func TestETHCallTask(t *testing.T) { +func TestUnit_ETHCallTask(t *testing.T) { t.Parallel() testutils.SkipShortDB(t) diff --git a/core/services/pipeline/task.eth_tx_test.go b/core/services/pipeline/task.eth_tx_test.go index ad7093436db..714659711a0 100644 --- a/core/services/pipeline/task.eth_tx_test.go +++ b/core/services/pipeline/task.eth_tx_test.go @@ -26,7 +26,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestETHTxTask(t *testing.T) { +func TestUnit_ETHTxTask(t *testing.T) { jid := int32(321) reqID := common.HexToHash("0x5198616554d738d9485d1a7cf53b2f33e09c3bbc8fe9ac0020bd672cd2bc15d2") reqTxHash := common.HexToHash("0xc524fafafcaec40652b1f84fca09c231185437d008d195fccf2f51e64b7062f8") diff --git a/core/services/pipeline/task.hexdecode_test.go b/core/services/pipeline/task.hexdecode_test.go index 258d86364d0..3c0b867984d 100644 --- a/core/services/pipeline/task.hexdecode_test.go +++ b/core/services/pipeline/task.hexdecode_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestHexDecodeTask(t *testing.T) { +func TestUnit_HexDecodeTask(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/services/pipeline/task.hexencode_test.go b/core/services/pipeline/task.hexencode_test.go index baeff02e304..8e52af12373 100644 --- a/core/services/pipeline/task.hexencode_test.go +++ b/core/services/pipeline/task.hexencode_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestHexEncodeTask(t *testing.T) { +func TestUnit_HexEncodeTask(t *testing.T) { t.Parallel() bigTwo, bigThree := big.NewInt(2), big.NewInt(3) @@ -91,7 +91,7 @@ func TestHexEncodeTask(t *testing.T) { } } -func TestHexEncodeTaskInputParamLiteral(t *testing.T) { +func TestUnit_HexEncodeTaskInputParamLiteral(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/services/pipeline/task.http_test.go b/core/services/pipeline/task.http_test.go index 5de29184da5..e8ff6898dec 100644 --- a/core/services/pipeline/task.http_test.go +++ b/core/services/pipeline/task.http_test.go @@ -33,7 +33,7 @@ import ( // external adapters. // https://github.com/smartcontractkit/price-adapters -func TestHTTPTask_Happy(t *testing.T) { +func TestUnit_HTTPTask_Happy(t *testing.T) { t.Parallel() config := configtest.NewTestGeneralConfig(t) @@ -64,7 +64,7 @@ func TestHTTPTask_Happy(t *testing.T) { require.Equal(t, decimal.NewFromInt(9700), x.Data.Result) } -func TestHTTPTask_Variables(t *testing.T) { +func TestUnit_HTTPTask_Variables(t *testing.T) { t.Parallel() validMeta := map[string]any{"theMeta": "yes"} @@ -205,7 +205,7 @@ func TestHTTPTask_Variables(t *testing.T) { } } -func TestHTTPTask_OverrideURLSafe(t *testing.T) { +func TestUnit_HTTPTask_OverrideURLSafe(t *testing.T) { t.Parallel() config := configtest.NewTestGeneralConfig(t) @@ -252,7 +252,7 @@ func TestHTTPTask_OverrideURLSafe(t *testing.T) { require.NoError(t, result.Error) } -func TestHTTPTask_ErrorMessage(t *testing.T) { +func TestUnit_HTTPTask_ErrorMessage(t *testing.T) { t.Parallel() config := configtest.NewTestGeneralConfig(t) @@ -285,7 +285,7 @@ func TestHTTPTask_ErrorMessage(t *testing.T) { require.Nil(t, result.Value) } -func TestHTTPTask_OnlyErrorMessage(t *testing.T) { +func TestUnit_HTTPTask_OnlyErrorMessage(t *testing.T) { t.Parallel() config := configtest.NewTestGeneralConfig(t) @@ -315,7 +315,7 @@ func TestHTTPTask_OnlyErrorMessage(t *testing.T) { require.Nil(t, result.Value) } -func TestHTTPTask_Headers(t *testing.T) { +func TestUnit_HTTPTask_Headers(t *testing.T) { allHeaders := func(headers http.Header) (s []string) { var keys []string for k := range headers { diff --git a/core/services/pipeline/task.jsonparse_test.go b/core/services/pipeline/task.jsonparse_test.go index 7be1506e2b2..052c822cc5f 100644 --- a/core/services/pipeline/task.jsonparse_test.go +++ b/core/services/pipeline/task.jsonparse_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestJSONParseTask(t *testing.T) { +func TestUnit_JSONParseTask(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/services/pipeline/task.length_test.go b/core/services/pipeline/task.length_test.go index ac5b2665bcf..887e9f90612 100644 --- a/core/services/pipeline/task.length_test.go +++ b/core/services/pipeline/task.length_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestLengthTask(t *testing.T) { +func TestUnit_LengthTask(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/services/pipeline/task.lessthan_test.go b/core/services/pipeline/task.lessthan_test.go index a6b5ad94868..a2272cea8f2 100644 --- a/core/services/pipeline/task.lessthan_test.go +++ b/core/services/pipeline/task.lessthan_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestLessThanTask_Happy(t *testing.T) { +func TestUnit_LessThanTask_Happy(t *testing.T) { t.Parallel() tests := []struct { @@ -102,7 +102,7 @@ func TestLessThanTask_Happy(t *testing.T) { } } -func TestLessThanTask_Unhappy(t *testing.T) { +func TestUnit_LessThanTask_Unhappy(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/services/pipeline/task.lookup_test.go b/core/services/pipeline/task.lookup_test.go index c7f39b9726d..1db16b769a7 100644 --- a/core/services/pipeline/task.lookup_test.go +++ b/core/services/pipeline/task.lookup_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func Test_LookupTask(t *testing.T) { +func TestUnit_LookupTask(t *testing.T) { task := pipeline.LookupTask{} m := map[string]any{ "foo": 42, diff --git a/core/services/pipeline/task.lowercase_test.go b/core/services/pipeline/task.lowercase_test.go index 64bfd81489e..505db491a82 100644 --- a/core/services/pipeline/task.lowercase_test.go +++ b/core/services/pipeline/task.lowercase_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestLowercaseTask(t *testing.T) { +func TestUnit_LowercaseTask(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/services/pipeline/task.max_test.go b/core/services/pipeline/task.max_test.go index fd25eaab705..b27b0ee46a3 100644 --- a/core/services/pipeline/task.max_test.go +++ b/core/services/pipeline/task.max_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestMaxTask(t *testing.T) { +func TestUnit_MaxTask(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/services/pipeline/task.mean_test.go b/core/services/pipeline/task.mean_test.go index e1444c8a24c..ac1298fd588 100644 --- a/core/services/pipeline/task.mean_test.go +++ b/core/services/pipeline/task.mean_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestMeanTask(t *testing.T) { +func TestUnit_MeanTask(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/services/pipeline/task.median_test.go b/core/services/pipeline/task.median_test.go index 4c6cd37e2ad..64bac61f4a8 100644 --- a/core/services/pipeline/task.median_test.go +++ b/core/services/pipeline/task.median_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestMedianTask(t *testing.T) { +func TestUnit_MedianTask(t *testing.T) { t.Parallel() tests := []struct { @@ -251,7 +251,7 @@ func TestMedianTask(t *testing.T) { } } -func TestMedianTask_AllowedFaultsAndLax_Unmarshal(t *testing.T) { +func TestUnit_MedianTask_AllowedFaultsAndLax_Unmarshal(t *testing.T) { t.Parallel() p, err := pipeline.Parse(` diff --git a/core/services/pipeline/task.memo_test.go b/core/services/pipeline/task.memo_test.go index 303e4261179..80ed050ed6b 100644 --- a/core/services/pipeline/task.memo_test.go +++ b/core/services/pipeline/task.memo_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestMemoTask(t *testing.T) { +func TestUnit_MemoTask(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/services/pipeline/task.merge_test.go b/core/services/pipeline/task.merge_test.go index 22a465757e8..66fb58b5718 100644 --- a/core/services/pipeline/task.merge_test.go +++ b/core/services/pipeline/task.merge_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestMergeTask(t *testing.T) { +func TestUnit_MergeTask(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/services/pipeline/task.min_test.go b/core/services/pipeline/task.min_test.go index 227e5bcd3a7..bf9bbcd156c 100644 --- a/core/services/pipeline/task.min_test.go +++ b/core/services/pipeline/task.min_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestMinTask(t *testing.T) { +func TestUnit_MinTask(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/services/pipeline/task.mode_test.go b/core/services/pipeline/task.mode_test.go index 2241738bcaa..5f5bc4b7127 100644 --- a/core/services/pipeline/task.mode_test.go +++ b/core/services/pipeline/task.mode_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestModeTask(t *testing.T) { +func TestUnit_ModeTask(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/services/pipeline/task.multiply_test.go b/core/services/pipeline/task.multiply_test.go index 604771fdbb1..6dc7ff70312 100644 --- a/core/services/pipeline/task.multiply_test.go +++ b/core/services/pipeline/task.multiply_test.go @@ -20,7 +20,7 @@ func mustDecimal(t *testing.T, arg string) *decimal.Decimal { return &ret } -func TestMultiplyTask_Happy(t *testing.T) { +func TestUnit_MultiplyTask_Happy(t *testing.T) { t.Parallel() tests := []struct { @@ -146,7 +146,7 @@ func TestMultiplyTask_Happy(t *testing.T) { } } -func TestMultiplyTask_Unhappy(t *testing.T) { +func TestUnit_MultiplyTask_Unhappy(t *testing.T) { t.Parallel() tests := []struct { @@ -184,7 +184,7 @@ func TestMultiplyTask_Unhappy(t *testing.T) { } } -func TestMultiplyTask_Overflow(t *testing.T) { +func TestUnit_MultiplyTask_Overflow(t *testing.T) { t.Parallel() d1, err := decimal.NewFromString("6.34e-1147483647") diff --git a/core/services/pipeline/task.sum_test.go b/core/services/pipeline/task.sum_test.go index 043894cccff..f272261fe32 100644 --- a/core/services/pipeline/task.sum_test.go +++ b/core/services/pipeline/task.sum_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestSumTask(t *testing.T) { +func TestUnit_SumTask(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/services/pipeline/task.uppercase_test.go b/core/services/pipeline/task.uppercase_test.go index ddba922d8a5..54f94c0d5f4 100644 --- a/core/services/pipeline/task.uppercase_test.go +++ b/core/services/pipeline/task.uppercase_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestUppercaseTask(t *testing.T) { +func TestUnit_UppercaseTask(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/services/pipeline/task_object_params_test.go b/core/services/pipeline/task_object_params_test.go index a05147f90da..b67e40edecd 100644 --- a/core/services/pipeline/task_object_params_test.go +++ b/core/services/pipeline/task_object_params_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestObjectParam_UnmarshalPipelineParamValid(t *testing.T) { +func TestUnit_ObjectParam_UnmarshalPipelineParamValid(t *testing.T) { t.Parallel() decimalValue := decimal.New(173, -1) @@ -71,7 +71,7 @@ func TestObjectParam_UnmarshalPipelineParamValid(t *testing.T) { } } -func TestObjectParam_Marshal(t *testing.T) { +func TestUnit_ObjectParam_Marshal(t *testing.T) { tests := []struct { name string input *pipeline.ObjectParam diff --git a/core/services/pipeline/task_params_test.go b/core/services/pipeline/task_params_test.go index 71ca8d6f2cc..a0022fa63bc 100644 --- a/core/services/pipeline/task_params_test.go +++ b/core/services/pipeline/task_params_test.go @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline/mocks" ) -func TestStringParam_UnmarshalPipelineParam(t *testing.T) { +func TestUnit_StringParam_UnmarshalPipelineParam(t *testing.T) { t.Parallel() var nilObjectParam *pipeline.ObjectParam @@ -49,7 +49,7 @@ func TestStringParam_UnmarshalPipelineParam(t *testing.T) { } } -func TestStringSliceParam_UnmarshalPipelineParam(t *testing.T) { +func TestUnit_StringSliceParam_UnmarshalPipelineParam(t *testing.T) { t.Parallel() expected := pipeline.StringSliceParam{"foo", "bar", "baz"} @@ -84,7 +84,7 @@ func TestStringSliceParam_UnmarshalPipelineParam(t *testing.T) { } } -func TestBytesParam_UnmarshalPipelineParam(t *testing.T) { +func TestUnit_BytesParam_UnmarshalPipelineParam(t *testing.T) { t.Parallel() tests := []struct { @@ -112,7 +112,7 @@ func TestBytesParam_UnmarshalPipelineParam(t *testing.T) { } } -func TestAddressParam_UnmarshalPipelineParam(t *testing.T) { +func TestUnit_AddressParam_UnmarshalPipelineParam(t *testing.T) { t.Parallel() var addr pipeline.AddressParam @@ -158,7 +158,7 @@ func TestAddressParam_UnmarshalPipelineParam(t *testing.T) { } } -func TestAddressSliceParam_UnmarshalPipelineParam(t *testing.T) { +func TestUnit_AddressSliceParam_UnmarshalPipelineParam(t *testing.T) { t.Parallel() addr1 := common.HexToAddress("0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef") @@ -194,7 +194,7 @@ func TestAddressSliceParam_UnmarshalPipelineParam(t *testing.T) { } } -func TestUint64Param_UnmarshalPipelineParam(t *testing.T) { +func TestUnit_Uint64Param_UnmarshalPipelineParam(t *testing.T) { t.Parallel() tests := []struct { @@ -239,7 +239,7 @@ func TestUint64Param_UnmarshalPipelineParam(t *testing.T) { } } -func TestMaybeUint64Param_UnmarshalPipelineParam(t *testing.T) { +func TestUnit_MaybeUint64Param_UnmarshalPipelineParam(t *testing.T) { t.Parallel() tests := []struct { @@ -285,7 +285,7 @@ func TestMaybeUint64Param_UnmarshalPipelineParam(t *testing.T) { } } -func TestMaybeBigIntParam_UnmarshalPipelineParam(t *testing.T) { +func TestUnit_MaybeBigIntParam_UnmarshalPipelineParam(t *testing.T) { t.Parallel() fromInt := func(n int64) pipeline.MaybeBigIntParam { @@ -340,7 +340,7 @@ func TestMaybeBigIntParam_UnmarshalPipelineParam(t *testing.T) { } } -func TestMaybeInt32Param_UnmarshalPipelineParam(t *testing.T) { +func TestUnit_MaybeInt32Param_UnmarshalPipelineParam(t *testing.T) { t.Parallel() tests := []struct { @@ -380,7 +380,7 @@ func TestMaybeInt32Param_UnmarshalPipelineParam(t *testing.T) { } } -func TestBoolParam_UnmarshalPipelineParam(t *testing.T) { +func TestUnit_BoolParam_UnmarshalPipelineParam(t *testing.T) { t.Parallel() tests := []struct { @@ -408,7 +408,7 @@ func TestBoolParam_UnmarshalPipelineParam(t *testing.T) { } } -func TestDecimalParam_UnmarshalPipelineParam(t *testing.T) { +func TestUnit_DecimalParam_UnmarshalPipelineParam(t *testing.T) { t.Parallel() var nilObjectParam *pipeline.ObjectParam @@ -442,7 +442,7 @@ func TestDecimalParam_UnmarshalPipelineParam(t *testing.T) { } } -func TestURLParam_UnmarshalPipelineParam(t *testing.T) { +func TestUnit_URLParam_UnmarshalPipelineParam(t *testing.T) { t.Parallel() good, err := url.ParseRequestURI("https://chain.link/foo?bar=sergey") @@ -469,7 +469,7 @@ func TestURLParam_UnmarshalPipelineParam(t *testing.T) { } } -func TestMapParam_UnmarshalPipelineParam(t *testing.T) { +func TestUnit_MapParam_UnmarshalPipelineParam(t *testing.T) { t.Parallel() var nilObjectParam *pipeline.ObjectParam @@ -531,7 +531,7 @@ func TestMapParam_UnmarshalPipelineParam(t *testing.T) { } } -func TestSliceParam_UnmarshalPipelineParam(t *testing.T) { +func TestUnit_SliceParam_UnmarshalPipelineParam(t *testing.T) { t.Parallel() tests := []struct { @@ -557,7 +557,7 @@ func TestSliceParam_UnmarshalPipelineParam(t *testing.T) { } } -func TestHashSliceParam_UnmarshalPipelineParam(t *testing.T) { +func TestUnit_HashSliceParam_UnmarshalPipelineParam(t *testing.T) { t.Parallel() hash1 := common.HexToHash("0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef") @@ -592,7 +592,7 @@ func TestHashSliceParam_UnmarshalPipelineParam(t *testing.T) { } } -func TestSliceParam_FilterErrors(t *testing.T) { +func TestUnit_SliceParam_FilterErrors(t *testing.T) { t.Parallel() s := pipeline.SliceParam{"foo", errors.New("bar"), "baz"} @@ -601,7 +601,7 @@ func TestSliceParam_FilterErrors(t *testing.T) { require.Equal(t, pipeline.SliceParam{"foo", "baz"}, vals) } -func TestSliceParam_FilterNils(t *testing.T) { +func TestUnit_SliceParam_FilterNils(t *testing.T) { t.Parallel() testErr := errors.New("bar") s := pipeline.SliceParam{"foo", testErr, nil, "baz", nil} @@ -610,7 +610,7 @@ func TestSliceParam_FilterNils(t *testing.T) { require.Equal(t, pipeline.SliceParam{"foo", testErr, "baz"}, vals) } -func TestDecimalSliceParam_UnmarshalPipelineParam(t *testing.T) { +func TestUnit_DecimalSliceParam_UnmarshalPipelineParam(t *testing.T) { t.Parallel() expected := pipeline.DecimalSliceParam{*mustDecimal(t, "1.1"), *mustDecimal(t, "2.2"), *mustDecimal(t, "3.3")} @@ -641,7 +641,7 @@ func TestDecimalSliceParam_UnmarshalPipelineParam(t *testing.T) { } } -func TestJSONPathParam_UnmarshalPipelineParam(t *testing.T) { +func TestUnit_JSONPathParam_UnmarshalPipelineParam(t *testing.T) { t.Parallel() expected := pipeline.JSONPathParam{"1.1", "2.2", "3.3", "sergey"} @@ -669,7 +669,7 @@ func TestJSONPathParam_UnmarshalPipelineParam(t *testing.T) { } } -func TestResolveValue(t *testing.T) { +func TestUnit_ResolveValue(t *testing.T) { t.Parallel() t.Run("calls getters in order until the first one that returns without ErrParameterEmpty", func(t *testing.T) { diff --git a/core/services/pipeline/variables_test.go b/core/services/pipeline/variables_test.go index fad23d38383..1a6037dd69f 100644 --- a/core/services/pipeline/variables_test.go +++ b/core/services/pipeline/variables_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) -func TestVars_Set(t *testing.T) { +func TestUnit_Vars_Set(t *testing.T) { t.Parallel() vars := pipeline.NewVarsFrom(nil) @@ -27,7 +27,7 @@ func TestVars_Set(t *testing.T) { require.ErrorIs(t, err, pipeline.ErrVarsSetNested) } -func TestVars_Get(t *testing.T) { +func TestUnit_Vars_Get(t *testing.T) { t.Parallel() t.Run("gets the values at keypaths that exist", func(t *testing.T) { @@ -123,7 +123,7 @@ func TestVars_Get(t *testing.T) { }) } -func TestVars_Copy(t *testing.T) { +func TestUnit_Vars_Copy(t *testing.T) { t.Parallel() vars := pipeline.NewVarsFrom(map[string]any{ diff --git a/core/services/registrysyncer/local_registry_test.go b/core/services/registrysyncer/local_registry_test.go index 44dcb9cc82f..c8b02c90705 100644 --- a/core/services/registrysyncer/local_registry_test.go +++ b/core/services/registrysyncer/local_registry_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" ) -func TestLocalRegistry_DONsForCapability(t *testing.T) { +func TestUnit_LocalRegistry_DONsForCapability(t *testing.T) { lggr := logger.Test(t) getPeerID := func() (types.PeerID, error) { return [32]byte{0: 1}, nil diff --git a/core/services/registrysyncer/monitoring_test.go b/core/services/registrysyncer/monitoring_test.go index 56ca8207af4..19838e7102f 100644 --- a/core/services/registrysyncer/monitoring_test.go +++ b/core/services/registrysyncer/monitoring_test.go @@ -8,12 +8,12 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/metrics" ) -func Test_InitMonitoringResources(t *testing.T) { +func TestUnit_InitMonitoringResources(t *testing.T) { _, err := newSyncerMetricLabeler() require.NoError(t, err) } -func Test_SyncerMetricsLabeler(t *testing.T) { +func TestUnit_SyncerMetricsLabeler(t *testing.T) { testSyncerMetricLabeler := syncerMetricLabeler{metrics.NewLabeler(), nil, nil} testSyncerMetricLabeler2 := testSyncerMetricLabeler.with("foo", "baz") require.Equal(t, "baz", testSyncerMetricLabeler2.Labels["foo"]) diff --git a/core/services/registrysyncer/orm_test.go b/core/services/registrysyncer/orm_test.go index 5573e58affc..eed682b62d8 100644 --- a/core/services/registrysyncer/orm_test.go +++ b/core/services/registrysyncer/orm_test.go @@ -24,7 +24,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" ) -func TestRegistrySyncerORM_InsertAndRetrieval(t *testing.T) { +func TestIntegration_Shared_RegistrySyncerORM_InsertAndRetrieval(t *testing.T) { db := pgtest.NewSqlxDB(t) ctx := testutils.Context(t) lggr := logger.Test(t) @@ -147,7 +147,7 @@ func generateState(t *testing.T) registrysyncer.LocalRegistry { } } -func TestRegistrySyncerORM_AddLocalRegistry_DuplicateHandling(t *testing.T) { +func TestIntegration_Shared_RegistrySyncerORM_AddLocalRegistry_DuplicateHandling(t *testing.T) { db := pgtest.NewSqlxDB(t) ctx := testutils.Context(t) lggr := logger.Test(t) diff --git a/core/services/registrysyncer/syncer_test.go b/core/services/registrysyncer/syncer_test.go index 07bd099fd6e..6cb7428bd42 100644 --- a/core/services/registrysyncer/syncer_test.go +++ b/core/services/registrysyncer/syncer_test.go @@ -192,7 +192,7 @@ func toPeerIDs(ids [][32]byte) []p2ptypes.PeerID { return pids } -func TestReader_Integration(t *testing.T) { +func TestIntegration_Shared_Reader_Integration(t *testing.T) { ctx := testutils.Context(t) reg, regAddress, owner, sim := startNewChainWithRegistry(t) @@ -375,7 +375,7 @@ func TestReader_Integration(t *testing.T) { }, s.IDsToNodes) } -func TestSyncer_DBIntegration(t *testing.T) { +func TestIntegration_Shared_Syncer_DBIntegration(t *testing.T) { quarantine.Flaky(t, "DX-1925") ctx := testutils.Context(t) reg, regAddress, owner, sim := startNewChainWithRegistry(t) @@ -501,7 +501,7 @@ func TestSyncer_DBIntegration(t *testing.T) { } } -func TestSyncer_LocalNode(t *testing.T) { +func TestUnit_Syncer_LocalNode(t *testing.T) { ctx := t.Context() lggr := logger.TestLogger(t) diff --git a/core/services/registrysyncer/v2/monitoring_test.go b/core/services/registrysyncer/v2/monitoring_test.go index b35901a4ba6..b565c488bb0 100644 --- a/core/services/registrysyncer/v2/monitoring_test.go +++ b/core/services/registrysyncer/v2/monitoring_test.go @@ -8,12 +8,12 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/metrics" ) -func Test_InitMonitoringResources(t *testing.T) { +func TestUnit_InitMonitoringResources(t *testing.T) { _, err := newSyncerMetricLabeler() require.NoError(t, err) } -func Test_SyncerMetricsLabeler(t *testing.T) { +func TestUnit_SyncerMetricsLabeler(t *testing.T) { testSyncerMetricLabeler := syncerMetricLabeler{metrics.NewLabeler(), nil, nil} testSyncerMetricLabeler2 := testSyncerMetricLabeler.with("foo", "baz") require.Equal(t, "baz", testSyncerMetricLabeler2.Labels["foo"]) diff --git a/core/services/registrysyncer/v2/syncer_test.go b/core/services/registrysyncer/v2/syncer_test.go index 5f2a997cc53..9207f9aa258 100644 --- a/core/services/registrysyncer/v2/syncer_test.go +++ b/core/services/registrysyncer/v2/syncer_test.go @@ -163,7 +163,7 @@ func toPeerIDs(ids [][32]byte) []p2ptypes.PeerID { return pids } -func TestReader_Integration(t *testing.T) { +func TestIntegration_Shared_Reader_Integration(t *testing.T) { ctx := testutils.Context(t) lggr := logger.TestLogger(t) @@ -391,7 +391,7 @@ func TestReader_Integration(t *testing.T) { }, s.IDsToNodes) } -func TestSyncer_V2_DBIntegration(t *testing.T) { +func TestIntegration_Shared_Syncer_V2_DBIntegration(t *testing.T) { ctx := testutils.Context(t) lggr := logger.TestLogger(t) @@ -558,7 +558,7 @@ func TestSyncer_V2_DBIntegration(t *testing.T) { } } -func TestSyncer_V2_LocalNode(t *testing.T) { +func TestUnit_Syncer_V2_LocalNode(t *testing.T) { ctx := testutils.Context(t) lggr := logger.TestLogger(t) @@ -673,7 +673,7 @@ func TestSyncer_V2_LocalNode(t *testing.T) { assert.Equal(t, []string{"write-chain@1.0.1", "trigger@1.0.0"}, nodeInfo.CapabilityIDs) } -func TestReader_V2_FamilyOperations(t *testing.T) { +func TestIntegration_Shared_Reader_V2_FamilyOperations(t *testing.T) { ctx := testutils.Context(t) lggr := logger.TestLogger(t) diff --git a/core/services/relay/evm/cap_encoder_test.go b/core/services/relay/evm/cap_encoder_test.go index 5283603cb3e..9c8692833db 100644 --- a/core/services/relay/evm/cap_encoder_test.go +++ b/core/services/relay/evm/cap_encoder_test.go @@ -34,7 +34,7 @@ var ( wrongLength = "8d4e66" ) -func TestEVMEncoder_SingleField(t *testing.T) { +func TestUnit_EVMEncoder_SingleField(t *testing.T) { config := map[string]any{ "abi": "bytes[] Full_reports", } @@ -69,7 +69,7 @@ func TestEVMEncoder_SingleField(t *testing.T) { require.Equal(t, expected, hex.EncodeToString(encoded)) } -func TestEVMEncoder_TwoFields(t *testing.T) { +func TestUnit_EVMEncoder_TwoFields(t *testing.T) { config := map[string]any{ "abi": "uint256[] Prices, uint32[] Timestamps", } @@ -105,7 +105,7 @@ func TestEVMEncoder_TwoFields(t *testing.T) { require.Equal(t, expected, hex.EncodeToString(encoded)) } -func TestEVMEncoder_Tuple(t *testing.T) { +func TestUnit_EVMEncoder_Tuple(t *testing.T) { config := map[string]any{ "abi": "(uint256[] Prices, uint32[] Timestamps) Elem", } @@ -144,7 +144,7 @@ func TestEVMEncoder_Tuple(t *testing.T) { require.Equal(t, expected, hex.EncodeToString(encoded)) } -func TestEVMEncoder_ListOfTuples(t *testing.T) { +func TestUnit_EVMEncoder_ListOfTuples(t *testing.T) { config := map[string]any{ "abi": "(uint256 Price, uint32 Timestamp)[] Elems", } @@ -186,7 +186,7 @@ func TestEVMEncoder_ListOfTuples(t *testing.T) { require.Equal(t, expected, hex.EncodeToString(encoded)) } -func TestEVMEncoder_InvalidIDs(t *testing.T) { +func TestUnit_EVMEncoder_InvalidIDs(t *testing.T) { config := map[string]any{ "abi": "bytes[] Full_reports", } @@ -217,7 +217,7 @@ func TestEVMEncoder_InvalidIDs(t *testing.T) { assert.ErrorContains(t, err, "wrong length") } -func TestEVMEncoder_SubABI(t *testing.T) { +func TestUnit_EVMEncoder_SubABI(t *testing.T) { config := map[string]any{ "abi": "(bytes32 FeedID, bytes Bundle, uint32 Timestamp)[] Reports", "subabi": map[string]string{ diff --git a/core/services/relay/evm/ccip_test.go b/core/services/relay/evm/ccip_test.go index 8c0bfe182e1..de15e407d55 100644 --- a/core/services/relay/evm/ccip_test.go +++ b/core/services/relay/evm/ccip_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" ) -func Test_CCIPSubjectUUID(t *testing.T) { +func TestUnit_CCIPSubjectUUID(t *testing.T) { // We want the function to be // (1) an actual function (i.e., deterministic) assert.Equal(t, chainToUUID(big.NewInt(1)), chainToUUID(big.NewInt(1))) diff --git a/core/services/relay/evm/chain_components_test.go b/core/services/relay/evm/chain_components_test.go index 5df164f59ef..6002702bc72 100644 --- a/core/services/relay/evm/chain_components_test.go +++ b/core/services/relay/evm/chain_components_test.go @@ -57,7 +57,7 @@ import ( const commonGasLimitOnEvms = uint64(4712388) const finalityDepth = 4 -func TestContractReaderEventsInitValidation(t *testing.T) { +func TestUnit_ContractReaderEventsInitValidation(t *testing.T) { tests := []struct { name string chainContractReaders map[string]config.ChainContractReader @@ -220,7 +220,7 @@ func TestContractReaderEventsInitValidation(t *testing.T) { } } -func TestChainReader_HealthReport(t *testing.T) { +func TestUnit_ChainReader_HealthReport(t *testing.T) { lp := lpmocks.NewLogPoller(t) lp.EXPECT().HealthReport().Return(map[string]error{"lp_name": clcommontypes.ErrFinalityViolated}).Once() ht := headstest.NewTracker[*clevmtypes.Head, common.Hash](t) @@ -233,7 +233,7 @@ func TestChainReader_HealthReport(t *testing.T) { require.True(t, services.ContainsError(healthReport, htError), "expected chain reader to propagate headtracker's error") } -func TestSequencesHaveTxHash(t *testing.T) { +func TestIntegration_Shared_SequencesHaveTxHash(t *testing.T) { t.Parallel() helper := &helper{} @@ -283,7 +283,7 @@ func TestSequencesHaveTxHash(t *testing.T) { }, it.MaxWaitTimeForEvents(), time.Millisecond*10) } -func TestChainComponents(t *testing.T) { +func TestUnit_ChainComponents(t *testing.T) { tests.SkipFlakey(t, "https://smartcontract-it.atlassian.net/browse/DX-401") t.Parallel() diff --git a/core/services/relay/evm/chain_reader_test.go b/core/services/relay/evm/chain_reader_test.go index 3c0b1cb1b03..451d475b24a 100644 --- a/core/services/relay/evm/chain_reader_test.go +++ b/core/services/relay/evm/chain_reader_test.go @@ -31,7 +31,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" ) -func TestChainReaderSizedBigIntTypes(t *testing.T) { +func TestIntegration_Shared_ChainReaderSizedBigIntTypes(t *testing.T) { t.Parallel() tests := []string{} @@ -70,7 +70,7 @@ func TestChainReaderSizedBigIntTypes(t *testing.T) { } } -func TestChainReader_Bind(t *testing.T) { +func TestUnit_ChainReader_Bind(t *testing.T) { lp := lpmocks.NewLogPoller(t) ht := headstest.NewTracker[*evmtypes.Head](t) cr, err := evm.NewChainReaderService(t.Context(), logger.Nop(), lp, ht, nil, config.ChainReaderConfig{Contracts: map[string]config.ChainContractReader{ @@ -146,7 +146,7 @@ func TestChainReader_Bind(t *testing.T) { lp.AssertExpectations(t) } -func TestChainReaderPrimitiveTypes(t *testing.T) { +func TestIntegration_Shared_ChainReaderPrimitiveTypes(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/services/relay/evm/config_poller_test.go b/core/services/relay/evm/config_poller_test.go index b3efccd8755..ad0336044c4 100644 --- a/core/services/relay/evm/config_poller_test.go +++ b/core/services/relay/evm/config_poller_test.go @@ -44,7 +44,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils" ) -func TestConfigPoller(t *testing.T) { +func TestIntegration_Shared_ConfigPoller(t *testing.T) { quarantine.Flaky(t, "DX-1757") lggr := logger.Test(t) var ethClient *client.SimulatedBackendClient diff --git a/core/services/relay/evm/evm_service_test.go b/core/services/relay/evm/evm_service_test.go index adcb848ca5f..3db240e4b3a 100644 --- a/core/services/relay/evm/evm_service_test.go +++ b/core/services/relay/evm/evm_service_test.go @@ -153,7 +153,7 @@ func createPayload() evm.ABIPayload { return evm.ABIPayload("kitties") } -func TestEVMService(t *testing.T) { +func TestIntegration_Shared_EVMService(t *testing.T) { t.Parallel() ctx := t.Context() @@ -353,7 +353,7 @@ func TestEVMService(t *testing.T) { } } -func TestEVMService_HeaderByNumber(t *testing.T) { +func TestUnit_EVMService_HeaderByNumber(t *testing.T) { testCases := []struct { Name string Request evm.HeaderByNumberRequest @@ -524,7 +524,7 @@ func runSubmitTxGettingDifferentStatusAndReceipts(m *Mocks, ctx any, expectedRet } } -func TestConverters(t *testing.T) { +func TestIntegration_Shared_Converters(t *testing.T) { t.Parallel() t.Run("convert head", func(t *testing.T) { @@ -559,7 +559,7 @@ func TestConverters(t *testing.T) { }) } -func TestEVMService_EstimateGas(t *testing.T) { +func TestUnit_EVMService_EstimateGas(t *testing.T) { testCases := []struct { Name string Request *evm.CallMsg @@ -610,7 +610,7 @@ func TestEVMService_EstimateGas(t *testing.T) { } } -func TestEVMService_CallContract(t *testing.T) { +func TestUnit_EVMService_CallContract(t *testing.T) { testCases := []struct { Name string Request evm.CallContractRequest diff --git a/core/services/relay/evm/evm_test.go b/core/services/relay/evm/evm_test.go index c2c3f219d3e..23762fb5a29 100644 --- a/core/services/relay/evm/evm_test.go +++ b/core/services/relay/evm/evm_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" ) -func TestRelayerOpts_Validate(t *testing.T) { +func TestUnit_RelayerOpts_Validate(t *testing.T) { type fields struct { DS sqlutil.DataSource CSAKeystore core.Keystore diff --git a/core/services/relay/evm/functions/config_poller_test.go b/core/services/relay/evm/functions/config_poller_test.go index 8ca1afd6c0b..571e0181799 100644 --- a/core/services/relay/evm/functions/config_poller_test.go +++ b/core/services/relay/evm/functions/config_poller_test.go @@ -37,7 +37,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils" ) -func TestFunctionsConfigPoller(t *testing.T) { +func TestIntegration_Shared_FunctionsConfigPoller(t *testing.T) { t.Run("FunctionsPlugin", func(t *testing.T) { runTest(t, functions.FunctionsPlugin, functions.FunctionsDigestPrefix) }) diff --git a/core/services/relay/evm/functions/contract_transmitter_test.go b/core/services/relay/evm/functions/contract_transmitter_test.go index aef9759f1ae..8aeb1bc4ad0 100644 --- a/core/services/relay/evm/functions/contract_transmitter_test.go +++ b/core/services/relay/evm/functions/contract_transmitter_test.go @@ -31,7 +31,7 @@ func newMockTxStrategy(t *testing.T) *commontxmmocks.TxStrategy { return commontxmmocks.NewTxStrategy(t) } -func TestContractTransmitter_LatestConfigDigestAndEpoch(t *testing.T) { +func TestUnit_ContractTransmitter_LatestConfigDigestAndEpoch(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -78,7 +78,7 @@ func TestContractTransmitter_LatestConfigDigestAndEpoch(t *testing.T) { assert.Equal(t, uint32(2), epoch) } -func TestContractTransmitter_Transmit_V1(t *testing.T) { +func TestUnit_ContractTransmitter_Transmit_V1(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -152,7 +152,7 @@ func TestContractTransmitter_Transmit_V1(t *testing.T) { require.Error(t, ot.Transmit(testutils.Context(t), ocrtypes.ReportContext{}, reportBytes, signatures)) } -func TestContractTransmitter_Transmit_V1_CoordinatorMismatch(t *testing.T) { +func TestUnit_ContractTransmitter_Transmit_V1_CoordinatorMismatch(t *testing.T) { t.Parallel() ctx := testutils.Context(t) diff --git a/core/services/relay/evm/functions/logpoller_wrapper_test.go b/core/services/relay/evm/functions/logpoller_wrapper_test.go index 3a305937966..18c936961ef 100644 --- a/core/services/relay/evm/functions/logpoller_wrapper_test.go +++ b/core/services/relay/evm/functions/logpoller_wrapper_test.go @@ -85,7 +85,7 @@ func getMockedRequestLog(t *testing.T) logpoller.Log { } } -func TestLogPollerWrapper_SingleSubscriberEmptyEvents(t *testing.T) { +func TestIntegration_Shared_LogPollerWrapper_SingleSubscriberEmptyEvents(t *testing.T) { t.Parallel() ctx := testutils.Context(t) lp, lpWrapper, client := setUp(t, 100_000) // check only once @@ -107,7 +107,7 @@ func TestLogPollerWrapper_SingleSubscriberEmptyEvents(t *testing.T) { require.Empty(t, resps) } -func TestLogPollerWrapper_ErrorOnZeroAddresses(t *testing.T) { +func TestIntegration_Shared_LogPollerWrapper_ErrorOnZeroAddresses(t *testing.T) { t.Parallel() ctx := testutils.Context(t) lp, lpWrapper, client := setUp(t, 100_000) // check only once @@ -120,7 +120,7 @@ func TestLogPollerWrapper_ErrorOnZeroAddresses(t *testing.T) { require.Error(t, err) } -func TestLogPollerWrapper_LatestEvents_ReorgHandling(t *testing.T) { +func TestIntegration_Shared_LogPollerWrapper_LatestEvents_ReorgHandling(t *testing.T) { t.Parallel() ctx := testutils.Context(t) lp, lpWrapper, client := setUp(t, 100_000) @@ -156,7 +156,7 @@ func TestLogPollerWrapper_LatestEvents_ReorgHandling(t *testing.T) { assert.Empty(t, oracleRequests) } -func TestLogPollerWrapper_FilterPreviouslyDetectedEvents_TruncatesLogs(t *testing.T) { +func TestIntegration_Shared_LogPollerWrapper_FilterPreviouslyDetectedEvents_TruncatesLogs(t *testing.T) { t.Parallel() _, lpWrapper, _ := setUp(t, 100_000) @@ -174,7 +174,7 @@ func TestLogPollerWrapper_FilterPreviouslyDetectedEvents_TruncatesLogs(t *testin assert.Len(t, mockedDetectedEvents.isPreviouslyDetected, 1000) } -func TestLogPollerWrapper_FilterPreviouslyDetectedEvents_SkipsInvalidLog(t *testing.T) { +func TestIntegration_Shared_LogPollerWrapper_FilterPreviouslyDetectedEvents_SkipsInvalidLog(t *testing.T) { t.Parallel() _, lpWrapper, _ := setUp(t, 100_000) inputLogs := []logpoller.Log{getMockedRequestLog(t)} @@ -189,7 +189,7 @@ func TestLogPollerWrapper_FilterPreviouslyDetectedEvents_SkipsInvalidLog(t *test assert.Empty(t, mockedDetectedEvents.isPreviouslyDetected) } -func TestLogPollerWrapper_FilterPreviouslyDetectedEvents_FiltersPreviouslyDetectedEvent(t *testing.T) { +func TestIntegration_Shared_LogPollerWrapper_FilterPreviouslyDetectedEvents_FiltersPreviouslyDetectedEvent(t *testing.T) { t.Parallel() _, lpWrapper, _ := setUp(t, 100_000) mockedRequestLog := getMockedRequestLog(t) @@ -216,7 +216,7 @@ func TestLogPollerWrapper_FilterPreviouslyDetectedEvents_FiltersPreviouslyDetect assert.Empty(t, mockedDetectedEvents.isPreviouslyDetected) } -func TestLogPollerWrapper_UnregisterOldFiltersOnRouteUpgrade(t *testing.T) { +func TestIntegration_Shared_LogPollerWrapper_UnregisterOldFiltersOnRouteUpgrade(t *testing.T) { t.Parallel() ctx := testutils.Context(t) lp, lpWrapper, _ := setUp(t, 100_000) // check only once diff --git a/core/services/relay/evm/median_test.go b/core/services/relay/evm/median_test.go index f8696aa402a..79f5911eb67 100644 --- a/core/services/relay/evm/median_test.go +++ b/core/services/relay/evm/median_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/common/chains/mocks" ) -func TestNewMedianProvider(t *testing.T) { +func TestUnit_NewMedianProvider(t *testing.T) { lggr := logger.Test(t) chain := mocks.NewChain(t) diff --git a/core/services/relay/evm/mercury/config_digest_test.go b/core/services/relay/evm/mercury/config_digest_test.go index 274717c28ca..1fd8d05226f 100644 --- a/core/services/relay/evm/mercury/config_digest_test.go +++ b/core/services/relay/evm/mercury/config_digest_test.go @@ -24,7 +24,7 @@ import ( // Adapted from: https://github.com/smartcontractkit/offchain-reporting/blob/991ebe1462fd56826a1ddfb34287d542acb2baee/lib/offchainreporting2/chains/evmutil/config_digest_test.go -func TestConfigCalculationMatches(t *testing.T) { +func TestUnit_ConfigCalculationMatches(t *testing.T) { key, err := crypto.GenerateKey() require.NoError(t, err, "could not make private key for EOA owner") owner, err := bind.NewKeyedTransactorWithChainID(key, big.NewInt(1337)) diff --git a/core/services/relay/evm/mercury/config_poller_test.go b/core/services/relay/evm/mercury/config_poller_test.go index 2296bab6788..b95f2955228 100644 --- a/core/services/relay/evm/mercury/config_poller_test.go +++ b/core/services/relay/evm/mercury/config_poller_test.go @@ -20,7 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils" ) -func TestMercuryConfigPoller(t *testing.T) { +func TestIntegration_Shared_MercuryConfigPoller(t *testing.T) { feedID := evmutils.NewHash() feedIDBytes := [32]byte(feedID) diff --git a/core/services/relay/evm/mercury/offchain_config_digester_test.go b/core/services/relay/evm/mercury/offchain_config_digester_test.go index 2f6d19b8b34..9bbe425d68f 100644 --- a/core/services/relay/evm/mercury/offchain_config_digester_test.go +++ b/core/services/relay/evm/mercury/offchain_config_digester_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2plus/types" ) -func Test_OffchainConfigDigester_ConfigDigest(t *testing.T) { +func TestUnit_OffchainConfigDigester_ConfigDigest(t *testing.T) { ctx := t.Context() // ChainID and ContractAddress are taken into account for computation cd1, err := OffchainConfigDigester{ChainID: big.NewInt(0)}.ConfigDigest(ctx, types.ContractConfig{}) diff --git a/core/services/relay/evm/mercury/orm_test.go b/core/services/relay/evm/mercury/orm_test.go index 2bc2fead0d4..d1acc8550bb 100644 --- a/core/services/relay/evm/mercury/orm_test.go +++ b/core/services/relay/evm/mercury/orm_test.go @@ -19,7 +19,7 @@ var ( sURL3 = "wss://mercuryserver.example/foo" ) -func TestORM(t *testing.T) { +func TestIntegration_Shared_ORM(t *testing.T) { ctx := testutils.Context(t) db := testutils.NewSqlxDB(t) @@ -150,7 +150,7 @@ func TestORM(t *testing.T) { require.Len(t, transmissions, 1) } -func TestORM_InsertTransmitRequest_MultipleServerURLs(t *testing.T) { +func TestIntegration_Shared_ORM_InsertTransmitRequest_MultipleServerURLs(t *testing.T) { ctx := testutils.Context(t) db := testutils.NewSqlxDB(t) @@ -195,7 +195,7 @@ func TestORM_InsertTransmitRequest_MultipleServerURLs(t *testing.T) { assert.Equal(t, reports[0], l) } -func TestORM_PruneTransmitRequests(t *testing.T) { +func TestUnit_ORM_PruneTransmitRequests(t *testing.T) { ctx := testutils.Context(t) db := testutils.NewSqlxDB(t) jobID := rand.Int32() // foreign key constraints disabled so value doesn't matter @@ -288,7 +288,7 @@ func TestORM_PruneTransmitRequests(t *testing.T) { assert.Len(t, transmissions, 3) } -func TestORM_InsertTransmitRequest_LatestReport(t *testing.T) { +func TestUnit_ORM_InsertTransmitRequest_LatestReport(t *testing.T) { ctx := testutils.Context(t) db := testutils.NewSqlxDB(t) jobID := rand.Int32() // foreign key constraints disabled so value doesn't matter @@ -360,7 +360,7 @@ func TestORM_InsertTransmitRequest_LatestReport(t *testing.T) { }) } -func Test_ReportCodec_FeedIDFromReport(t *testing.T) { +func TestUnit_ReportCodec_FeedIDFromReport(t *testing.T) { t.Run("FeedIDFromReport extracts the current block number from a valid report", func(t *testing.T) { report := buildSampleV2Report(42) diff --git a/core/services/relay/evm/mercury/persistence_manager_test.go b/core/services/relay/evm/mercury/persistence_manager_test.go index 3504ef8d0b0..474a55b3812 100644 --- a/core/services/relay/evm/mercury/persistence_manager_test.go +++ b/core/services/relay/evm/mercury/persistence_manager_test.go @@ -21,7 +21,7 @@ func bootstrapPersistenceManager(t *testing.T, jobID int32, db *sqlx.DB) *Persis return NewPersistenceManager(logger.Test(t), "mercuryserver.example", orm, jobID, 2, 5*time.Millisecond, 5*time.Millisecond) } -func TestPersistenceManager(t *testing.T) { +func TestUnit_PersistenceManager(t *testing.T) { jobID1 := rand.Int32() jobID2 := jobID1 + 1 @@ -63,7 +63,7 @@ func TestPersistenceManager(t *testing.T) { }) } -func TestPersistenceManagerAsyncDelete(t *testing.T) { +func TestUnit_PersistenceManagerAsyncDelete(t *testing.T) { ctx := testutils.Context(t) jobID := rand.Int32() db := testutils.NewSqlxDB(t) @@ -111,7 +111,7 @@ func TestPersistenceManagerAsyncDelete(t *testing.T) { }, transmissions) } -func TestPersistenceManagerPrune(t *testing.T) { +func TestUnit_PersistenceManagerPrune(t *testing.T) { jobID1 := rand.Int32() jobID2 := jobID1 + 1 db := testutils.NewSqlxDB(t) diff --git a/core/services/relay/evm/mercury/queue_test.go b/core/services/relay/evm/mercury/queue_test.go index 491d976325a..fde2e968f90 100644 --- a/core/services/relay/evm/mercury/queue_test.go +++ b/core/services/relay/evm/mercury/queue_test.go @@ -60,7 +60,7 @@ func createTestTransmissions(t *testing.T) []TestTransmissionWithReport { } } -func Test_Queue(t *testing.T) { +func TestUnit_Queue(t *testing.T) { t.Parallel() testTransmissions := createTestTransmissions(t) deleter := mocks.NewAsyncDeleter(t) diff --git a/core/services/relay/evm/mercury/transmitter_test.go b/core/services/relay/evm/mercury/transmitter_test.go index f905639763b..7090c608487 100644 --- a/core/services/relay/evm/mercury/transmitter_test.go +++ b/core/services/relay/evm/mercury/transmitter_test.go @@ -41,7 +41,7 @@ func (m mockCfg) TransmitTimeout() time.Duration { return 1 * time.Hour } -func Test_MercuryTransmitter_Transmit(t *testing.T) { +func TestUnit_MercuryTransmitter_Transmit(t *testing.T) { lggr := logger.Test(t) db := testutils.NewSqlxDB(t) var jobID int32 @@ -125,7 +125,7 @@ func Test_MercuryTransmitter_Transmit(t *testing.T) { }) } -func Test_MercuryTransmitter_LatestTimestamp(t *testing.T) { +func TestUnit_MercuryTransmitter_LatestTimestamp(t *testing.T) { t.Parallel() lggr := logger.Test(t) db := testutils.NewSqlxDB(t) @@ -234,7 +234,7 @@ func (m *mockCodec) ObservationTimestampFromReport(ctx context.Context, report o return 0, nil } -func Test_MercuryTransmitter_LatestPrice(t *testing.T) { +func TestUnit_MercuryTransmitter_LatestPrice(t *testing.T) { t.Parallel() lggr := logger.Test(t) db := testutils.NewSqlxDB(t) @@ -313,7 +313,7 @@ func Test_MercuryTransmitter_LatestPrice(t *testing.T) { }) } -func Test_MercuryTransmitter_FetchInitialMaxFinalizedBlockNumber(t *testing.T) { +func TestUnit_MercuryTransmitter_FetchInitialMaxFinalizedBlockNumber(t *testing.T) { t.Parallel() lggr := logger.Test(t) @@ -393,7 +393,7 @@ func Test_MercuryTransmitter_FetchInitialMaxFinalizedBlockNumber(t *testing.T) { }) } -func Test_sortReportsLatestFirst(t *testing.T) { +func TestUnit_sortReportsLatestFirst(t *testing.T) { reports := []*pb.Report{ nil, {ObservationsTimestamp: 1}, @@ -447,7 +447,7 @@ func (m *mockQ) Push(req *pb.TransmitRequest, reportCtx ocrtypes.ReportContext) func (m *mockQ) Init(transmissions []*Transmission) {} func (m *mockQ) IsEmpty() bool { return false } -func Test_MercuryTransmitter_runQueueLoop(t *testing.T) { +func TestUnit_MercuryTransmitter_runQueueLoop(t *testing.T) { feedIDHex := utils.NewHash().Hex() lggr := logger.Test(t) c := &mocks.MockWSRPCClient{} diff --git a/core/services/relay/evm/mercury/utils/feeds_test.go b/core/services/relay/evm/mercury/utils/feeds_test.go index d6db7a4a8c4..8eab5baf33d 100644 --- a/core/services/relay/evm/mercury/utils/feeds_test.go +++ b/core/services/relay/evm/mercury/utils/feeds_test.go @@ -15,7 +15,7 @@ var ( keystonev4Feed = (FeedID)([32]uint8{01, 12, 34, 56, 78, 00, 04, 04, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00}) ) -func Test_FeedID_Version(t *testing.T) { +func TestUnit_FeedID_Version(t *testing.T) { t.Run("versioned feed ID", func(t *testing.T) { assert.Equal(t, REPORT_V1, v1FeedID.Version()) assert.True(t, v1FeedID.IsV1()) diff --git a/core/services/relay/evm/mercury/v2/data_source_test.go b/core/services/relay/evm/mercury/v2/data_source_test.go index ea4eb587499..36c3247cd66 100644 --- a/core/services/relay/evm/mercury/v2/data_source_test.go +++ b/core/services/relay/evm/mercury/v2/data_source_test.go @@ -72,7 +72,7 @@ func (ms *mockSaver) Save(r *pipeline.Run) { ms.r = r } -func Test_Datasource(t *testing.T) { +func TestUnit_Datasource(t *testing.T) { orm := &mockORM{} jb := job.Job{ Type: job.Type(pipeline.OffchainReporting2JobType), diff --git a/core/services/relay/evm/mercury/v2/reportcodec/report_codec_test.go b/core/services/relay/evm/mercury/v2/reportcodec/report_codec_test.go index e1bb07a236b..1d8fad65a62 100644 --- a/core/services/relay/evm/mercury/v2/reportcodec/report_codec_test.go +++ b/core/services/relay/evm/mercury/v2/reportcodec/report_codec_test.go @@ -24,7 +24,7 @@ func newValidReportFields() v2.ReportFields { } } -func Test_ReportCodec_BuildReport(t *testing.T) { +func TestUnit_ReportCodec_BuildReport(t *testing.T) { r := ReportCodec{} t.Run("BuildReport errors on zero values", func(t *testing.T) { @@ -118,7 +118,7 @@ func buildSampleReport(ts int64) []byte { return b } -func Test_ReportCodec_ObservationTimestampFromReport(t *testing.T) { +func TestUnit_ReportCodec_ObservationTimestampFromReport(t *testing.T) { r := ReportCodec{} t.Run("ObservationTimestampFromReport extracts observation timestamp from a valid report", func(t *testing.T) { @@ -141,7 +141,7 @@ func Test_ReportCodec_ObservationTimestampFromReport(t *testing.T) { }) } -func Test_ReportCodec_BenchmarkPriceFromReport(t *testing.T) { +func TestUnit_ReportCodec_BenchmarkPriceFromReport(t *testing.T) { r := ReportCodec{} t.Run("BenchmarkPriceFromReport extracts the benchmark price from valid report", func(t *testing.T) { diff --git a/core/services/relay/evm/mercury/v3/data_source_test.go b/core/services/relay/evm/mercury/v3/data_source_test.go index 604e706cfc4..399624c8346 100644 --- a/core/services/relay/evm/mercury/v3/data_source_test.go +++ b/core/services/relay/evm/mercury/v3/data_source_test.go @@ -75,7 +75,7 @@ func (ms *mockSaver) Save(r *pipeline.Run) { ms.r = r } -func Test_Datasource(t *testing.T) { +func TestUnit_Datasource(t *testing.T) { orm := &mockORM{} jb := job.Job{ Type: job.Type(pipeline.OffchainReporting2JobType), diff --git a/core/services/relay/evm/mercury/v3/reportcodec/report_codec_test.go b/core/services/relay/evm/mercury/v3/reportcodec/report_codec_test.go index 39592c49ae9..536d4dd5627 100644 --- a/core/services/relay/evm/mercury/v3/reportcodec/report_codec_test.go +++ b/core/services/relay/evm/mercury/v3/reportcodec/report_codec_test.go @@ -26,7 +26,7 @@ func newValidReportFields() v3.ReportFields { } } -func Test_ReportCodec_BuildReport(t *testing.T) { +func TestUnit_ReportCodec_BuildReport(t *testing.T) { r := ReportCodec{} t.Run("BuildReport errors on zero values", func(t *testing.T) { @@ -124,7 +124,7 @@ func buildSampleReport(ts int64) []byte { return b } -func Test_ReportCodec_ObservationTimestampFromReport(t *testing.T) { +func TestUnit_ReportCodec_ObservationTimestampFromReport(t *testing.T) { r := ReportCodec{} t.Run("ObservationTimestampFromReport extracts observation timestamp from a valid report", func(t *testing.T) { @@ -147,7 +147,7 @@ func Test_ReportCodec_ObservationTimestampFromReport(t *testing.T) { }) } -func Test_ReportCodec_BenchmarkPriceFromReport(t *testing.T) { +func TestUnit_ReportCodec_BenchmarkPriceFromReport(t *testing.T) { r := ReportCodec{} t.Run("BenchmarkPriceFromReport extracts the benchmark price from valid report", func(t *testing.T) { diff --git a/core/services/relay/evm/mercury/v4/data_source_test.go b/core/services/relay/evm/mercury/v4/data_source_test.go index 57b788402df..3c97180c734 100644 --- a/core/services/relay/evm/mercury/v4/data_source_test.go +++ b/core/services/relay/evm/mercury/v4/data_source_test.go @@ -71,7 +71,7 @@ func (ms *mockSaver) Save(r *pipeline.Run) { ms.r = r } -func Test_Datasource(t *testing.T) { +func TestUnit_Datasource(t *testing.T) { orm := &mockORM{} jb := job.Job{ Type: job.Type(pipeline.OffchainReporting2JobType), diff --git a/core/services/relay/evm/mercury/v4/reportcodec/report_codec_test.go b/core/services/relay/evm/mercury/v4/reportcodec/report_codec_test.go index 2caa4f4d75a..a5dfe5ac39c 100644 --- a/core/services/relay/evm/mercury/v4/reportcodec/report_codec_test.go +++ b/core/services/relay/evm/mercury/v4/reportcodec/report_codec_test.go @@ -24,7 +24,7 @@ func newValidReportFields() v4.ReportFields { } } -func Test_ReportCodec_BuildReport(t *testing.T) { +func TestUnit_ReportCodec_BuildReport(t *testing.T) { r := ReportCodec{} t.Run("BuildReport errors on zero values", func(t *testing.T) { @@ -120,7 +120,7 @@ func buildSampleReport(ts int64) []byte { return b } -func Test_ReportCodec_ObservationTimestampFromReport(t *testing.T) { +func TestUnit_ReportCodec_ObservationTimestampFromReport(t *testing.T) { r := ReportCodec{} t.Run("ObservationTimestampFromReport extracts observation timestamp from a valid report", func(t *testing.T) { @@ -143,7 +143,7 @@ func Test_ReportCodec_ObservationTimestampFromReport(t *testing.T) { }) } -func Test_ReportCodec_BenchmarkPriceFromReport(t *testing.T) { +func TestUnit_ReportCodec_BenchmarkPriceFromReport(t *testing.T) { r := ReportCodec{} t.Run("BenchmarkPriceFromReport extracts the benchmark price from valid report", func(t *testing.T) { diff --git a/core/services/relay/evm/mercury/verifier/verifier_test.go b/core/services/relay/evm/mercury/verifier/verifier_test.go index f32e2e702f3..f2a0a44fd8a 100644 --- a/core/services/relay/evm/mercury/verifier/verifier_test.go +++ b/core/services/relay/evm/mercury/verifier/verifier_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury" ) -func Test_Verifier(t *testing.T) { +func TestUnit_Verifier(t *testing.T) { t.Parallel() signedReportBinary := hexutil.MustDecode(`0x0006e1dde86b8a12add45546a14ea7e5efd10b67a373c6f4c41ecfa17d0005350000000000000000000000000000000000000000000000000000000000000201000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002800001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000034c9214519c942ad0aa84a3dd31870e6efe8b3fcab4e176c5226879b26c77000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000669150aa0000000000000000000000000000000000001504e1e6c380271bb8b129ac8f7c0000000000000000000000000000000000001504e1e6c380271bb8b129ac8f7c00000000000000000000000000000000000000000000000000000000669150ab0000000000000000000000000000000000000000000000000000002482116240000000000000000000000000000000000000000000000000000000247625a04000000000000000000000000000000000000000000000000000000024880743400000000000000000000000000000000000000000000000000000000000000002710ac21df88ab70c8822b68be53d7bed65c82ffc9204c1d7ccf3c6c4048b3ca2cafb26e7bbd8f13fe626c946baa5ffcb444319c4229b945ea65d0c99c21978a100000000000000000000000000000000000000000000000000000000000000022c07843f17aa3ecd55f52e99e889906f825f49e4ddfa9c74ca487dd4ff101cc636108a5323be838e658dffa1be67bd91e99f68c4bf86936b76c5d8193b707597`) diff --git a/core/services/relay/evm/mercury/wsrpc/cache/cache_set_test.go b/core/services/relay/evm/mercury/wsrpc/cache/cache_set_test.go index c7eac22261a..7539fdf9f12 100644 --- a/core/services/relay/evm/mercury/wsrpc/cache/cache_set_test.go +++ b/core/services/relay/evm/mercury/wsrpc/cache/cache_set_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/testutils" ) -func Test_CacheSet(t *testing.T) { +func TestUnit_CacheSet(t *testing.T) { lggr := logger.Test(t) cs := newCacheSet(lggr, Config{LatestReportTTL: 1}) disabledCs := newCacheSet(lggr, Config{LatestReportTTL: 0}) diff --git a/core/services/relay/evm/mercury/wsrpc/cache/cache_test.go b/core/services/relay/evm/mercury/wsrpc/cache/cache_test.go index 83d43795ae4..0876b635db4 100644 --- a/core/services/relay/evm/mercury/wsrpc/cache/cache_test.go +++ b/core/services/relay/evm/mercury/wsrpc/cache/cache_test.go @@ -19,7 +19,7 @@ import ( const neverExpireTTL = 1000 * time.Hour // some massive value that will never expire during a test -func Test_Cache(t *testing.T) { +func TestUnit_Cache(t *testing.T) { lggr := logger.Test(t) client := &mockClient{} cfg := Config{} diff --git a/core/services/relay/evm/mercury/wsrpc/client_test.go b/core/services/relay/evm/mercury/wsrpc/client_test.go index 482a990ad93..bc6ebfb33f9 100644 --- a/core/services/relay/evm/mercury/wsrpc/client_test.go +++ b/core/services/relay/evm/mercury/wsrpc/client_test.go @@ -57,7 +57,7 @@ func newNoopCacheSet() cache.CacheSet { return &mockCacheSet{} } -func Test_Client_Transmit(t *testing.T) { +func TestUnit_Client_Transmit(t *testing.T) { lggr := logger.Test(t) ctx := testutils.Context(t) req := &pb.TransmitRequest{} @@ -127,7 +127,7 @@ func Test_Client_Transmit(t *testing.T) { }) } -func Test_Client_LatestReport(t *testing.T) { +func TestUnit_Client_LatestReport(t *testing.T) { lggr := logger.Test(t) ctx := testutils.Context(t) cacheReads := 5 diff --git a/core/services/relay/evm/mercury/wsrpc/pool_test.go b/core/services/relay/evm/mercury/wsrpc/pool_test.go index fe50c96d190..b07992cf8dc 100644 --- a/core/services/relay/evm/mercury/wsrpc/pool_test.go +++ b/core/services/relay/evm/mercury/wsrpc/pool_test.go @@ -49,7 +49,7 @@ func newMockClient(lggr logger.Logger) *mockClient { return &mockClient{} } -func Test_Pool(t *testing.T) { +func TestUnit_Pool(t *testing.T) { lggr := logger.Sugared(logger.Test(t)).Named("PoolTestLogger") ctx := testutils.Context(t) diff --git a/core/services/relay/evm/read/batch_caller_test.go b/core/services/relay/evm/read/batch_caller_test.go index 4b9c6ba6d88..3a615d2c0c7 100644 --- a/core/services/relay/evm/read/batch_caller_test.go +++ b/core/services/relay/evm/read/batch_caller_test.go @@ -21,7 +21,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/read" ) -func TestDefaultEvmBatchCaller_BatchCallDynamicLimit(t *testing.T) { +func TestUnit_DefaultEvmBatchCaller_BatchCallDynamicLimit(t *testing.T) { testCases := []struct { name string maxBatchSize uint @@ -104,7 +104,7 @@ func TestDefaultEvmBatchCaller_BatchCallDynamicLimit(t *testing.T) { } } -func TestDefaultEvmBatchCaller_batchCallLimit(t *testing.T) { +func TestUnit_DefaultEvmBatchCaller_batchCallLimit(t *testing.T) { ctx := testutils.Context(t) testCases := []struct { numCalls uint diff --git a/core/services/relay/evm/read/bindings_test.go b/core/services/relay/evm/read/bindings_test.go index d78784d1082..de1e7464133 100644 --- a/core/services/relay/evm/read/bindings_test.go +++ b/core/services/relay/evm/read/bindings_test.go @@ -27,7 +27,7 @@ var ( } ) -func TestBindingsRegistry(t *testing.T) { +func TestUnit_BindingsRegistry(t *testing.T) { t.Parallel() t.Run("readers are addable, bindable, and retrievable", func(t *testing.T) { diff --git a/core/services/relay/evm/read/event_test.go b/core/services/relay/evm/read/event_test.go index 5681d355b4d..6b87fd8e3ed 100644 --- a/core/services/relay/evm/read/event_test.go +++ b/core/services/relay/evm/read/event_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/logpoller" ) -func Test_DecodeHardcodedType(t *testing.T) { +func TestUnit_DecodeHardcodedType(t *testing.T) { t.Parallel() t.Run("decode hardcoded type offramp CoommitReportAccess success", func(t *testing.T) { diff --git a/core/services/relay/evm/read/multieventtype_test.go b/core/services/relay/evm/read/multieventtype_test.go index 447eab010e3..d21cd1b93a7 100644 --- a/core/services/relay/evm/read/multieventtype_test.go +++ b/core/services/relay/evm/read/multieventtype_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/types/query" ) -func TestCreateQueryName(t *testing.T) { +func TestUnit_CreateQueryName(t *testing.T) { eventQueries := []EventQuery{ { Filter: query.KeyFilter{Key: "key1"}, @@ -50,7 +50,7 @@ func TestCreateQueryName(t *testing.T) { assert.Equal(t, expectedQueryName, queryName) } -func TestValidateEventQueries(t *testing.T) { +func TestUnit_ValidateEventQueries(t *testing.T) { tests := []struct { name string eventQueries []EventQuery diff --git a/core/services/relay/evm/write_target_test.go b/core/services/relay/evm/write_target_test.go index 22ad3bb561f..08c70cc6715 100644 --- a/core/services/relay/evm/write_target_test.go +++ b/core/services/relay/evm/write_target_test.go @@ -107,7 +107,7 @@ func newMockedEncodeTransmissionInfo(state uint8) ([]byte, error) { return buffer.Bytes(), nil } -func TestEvmWrite(t *testing.T) { +func TestIntegration_Shared_EvmWrite(t *testing.T) { chain := evmmocks.NewChain(t) txManager := txmmocks.NewMockEvmTxManager(t) evmClient := clienttest.NewClient(t) @@ -495,7 +495,7 @@ func findLogMatch(t *testing.T, observed *observer.ObservedLogs, msg string, key return len(matches) > 0 }, 30*time.Second, 1*time.Second) } -func TestExtractNetwork(t *testing.T) { +func TestUnit_ExtractNetwork(t *testing.T) { testCases := []struct { networkName string expectedName string diff --git a/core/services/s4/address_range_test.go b/core/services/s4/address_range_test.go index 6ed9c36c476..fd91ae1caa8 100644 --- a/core/services/s4/address_range_test.go +++ b/core/services/s4/address_range_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestAddressRange_NewFullAddressRange(t *testing.T) { +func TestIntegration_Shared_AddressRange_NewFullAddressRange(t *testing.T) { t.Parallel() full := s4.NewFullAddressRange() @@ -23,7 +23,7 @@ func TestAddressRange_NewFullAddressRange(t *testing.T) { }) } -func TestAddressRange_NewSingleAddressRange(t *testing.T) { +func TestIntegration_Shared_AddressRange_NewSingleAddressRange(t *testing.T) { t.Parallel() addr := big.NewI(0x123) @@ -38,7 +38,7 @@ func TestAddressRange_NewSingleAddressRange(t *testing.T) { assert.False(t, sar.Contains(addr)) } -func TestAddressRange_NewInitialAddressRangeForIntervals(t *testing.T) { +func TestIntegration_Shared_AddressRange_NewInitialAddressRangeForIntervals(t *testing.T) { t.Parallel() t.Run("invalid intervals", func(t *testing.T) { @@ -87,7 +87,7 @@ func TestAddressRange_NewInitialAddressRangeForIntervals(t *testing.T) { }) } -func TestAddressRange_Contains(t *testing.T) { +func TestIntegration_Shared_AddressRange_Contains(t *testing.T) { t.Parallel() r, err := s4.NewInitialAddressRangeForIntervals(256) diff --git a/core/services/s4/cached_orm_wrapper_test.go b/core/services/s4/cached_orm_wrapper_test.go index 918dd18be61..34821463b21 100644 --- a/core/services/s4/cached_orm_wrapper_test.go +++ b/core/services/s4/cached_orm_wrapper_test.go @@ -20,7 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/s4/mocks" ) -func TestGetSnapshotEmpty(t *testing.T) { +func TestIntegration_Shared_GetSnapshotEmpty(t *testing.T) { t.Run("OK-no_rows", func(t *testing.T) { ctx := testutils.Context(t) psqlORM := setupORM(t, "test") @@ -33,7 +33,7 @@ func TestGetSnapshotEmpty(t *testing.T) { }) } -func TestGetSnapshotCacheFilled(t *testing.T) { +func TestUnit_GetSnapshotCacheFilled(t *testing.T) { t.Run("OK_with_rows_already_cached", func(t *testing.T) { ctx := testutils.Context(t) rows := generateTestSnapshotRows(t, 100) @@ -76,7 +76,7 @@ func TestGetSnapshotCacheFilled(t *testing.T) { }) } -func TestUpdateInvalidatesSnapshotCache(t *testing.T) { +func TestUnit_UpdateInvalidatesSnapshotCache(t *testing.T) { t.Run("OK-GetSnapshot_cache_invalidated_after_update", func(t *testing.T) { ctx := testutils.Context(t) rows := generateTestSnapshotRows(t, 100) @@ -167,7 +167,7 @@ func TestUpdateInvalidatesSnapshotCache(t *testing.T) { }) } -func TestGet(t *testing.T) { +func TestUnit_Get(t *testing.T) { address := big.New(testutils.NewAddress().Big()) var slotID uint = 1 @@ -199,7 +199,7 @@ func TestGet(t *testing.T) { }) } -func TestDeletedExpired(t *testing.T) { +func TestUnit_DeletedExpired(t *testing.T) { var limit uint = 1 now := time.Now() @@ -230,7 +230,7 @@ func TestDeletedExpired(t *testing.T) { } // GetUnconfirmedRows(limit uint, qopts ...pg.QOpt) ([]*Row, error) -func TestGetUnconfirmedRows(t *testing.T) { +func TestUnit_GetUnconfirmedRows(t *testing.T) { var limit uint = 1 lggr := logger.TestLogger(t) diff --git a/core/services/s4/envelope_test.go b/core/services/s4/envelope_test.go index e41eca6146c..d30d2583509 100644 --- a/core/services/s4/envelope_test.go +++ b/core/services/s4/envelope_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestEnvelope(t *testing.T) { +func TestIntegration_Shared_Envelope(t *testing.T) { t.Parallel() payload := testutils.Random32Byte() diff --git a/core/services/s4/in_memory_orm_test.go b/core/services/s4/in_memory_orm_test.go index ccbc3933383..68d32eaf364 100644 --- a/core/services/s4/in_memory_orm_test.go +++ b/core/services/s4/in_memory_orm_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestInMemoryORM(t *testing.T) { +func TestIntegration_Shared_InMemoryORM(t *testing.T) { t.Parallel() address := testutils.NewAddress() @@ -68,7 +68,7 @@ func TestInMemoryORM(t *testing.T) { }) } -func TestInMemoryORM_DeleteExpired(t *testing.T) { +func TestIntegration_Shared_InMemoryORM_DeleteExpired(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -102,7 +102,7 @@ func TestInMemoryORM_DeleteExpired(t *testing.T) { assert.Len(t, rows, 156) } -func TestInMemoryORM_GetUnconfirmedRows(t *testing.T) { +func TestIntegration_Shared_InMemoryORM_GetUnconfirmedRows(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -132,7 +132,7 @@ func TestInMemoryORM_GetUnconfirmedRows(t *testing.T) { assert.Len(t, rows, 100) } -func TestInMemoryORM_GetSnapshot(t *testing.T) { +func TestIntegration_Shared_InMemoryORM_GetSnapshot(t *testing.T) { t.Parallel() ctx := testutils.Context(t) diff --git a/core/services/s4/postgres_orm_test.go b/core/services/s4/postgres_orm_test.go index 189033e1d51..54a6a9dee0b 100644 --- a/core/services/s4/postgres_orm_test.go +++ b/core/services/s4/postgres_orm_test.go @@ -48,14 +48,14 @@ func generateTestRows(t *testing.T, n int) []*s4.Row { return rows } -func TestNewPostgresOrm(t *testing.T) { +func TestIntegration_Shared_NewPostgresOrm(t *testing.T) { t.Parallel() orm := setupORM(t, "test") assert.NotNil(t, orm) } -func TestPostgresORM_UpdateAndGet(t *testing.T) { +func TestIntegration_Shared_PostgresORM_UpdateAndGet(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -87,7 +87,7 @@ func TestPostgresORM_UpdateAndGet(t *testing.T) { assert.ErrorIs(t, err, s4.ErrNotFound) } -func TestPostgresORM_UpdateSimpleFlow(t *testing.T) { +func TestIntegration_Shared_PostgresORM_UpdateSimpleFlow(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -115,7 +115,7 @@ func TestPostgresORM_UpdateSimpleFlow(t *testing.T) { assert.Error(t, orm.Update(ctx, row)) } -func TestPostgresORM_DeleteExpired(t *testing.T) { +func TestIntegration_Shared_PostgresORM_DeleteExpired(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -144,7 +144,7 @@ func TestPostgresORM_DeleteExpired(t *testing.T) { assert.Equal(t, total-expired, count) } -func TestPostgresORM_GetSnapshot(t *testing.T) { +func TestIntegration_Shared_PostgresORM_GetSnapshot(t *testing.T) { t.Parallel() orm := setupORM(t, "test") @@ -200,7 +200,7 @@ func TestPostgresORM_GetSnapshot(t *testing.T) { }) } -func TestPostgresORM_GetUnconfirmedRows(t *testing.T) { +func TestIntegration_Shared_PostgresORM_GetUnconfirmedRows(t *testing.T) { t.Parallel() orm := setupORM(t, "test") @@ -232,7 +232,7 @@ func TestPostgresORM_GetUnconfirmedRows(t *testing.T) { }) } -func TestPostgresORM_Namespace(t *testing.T) { +func TestIntegration_Shared_PostgresORM_Namespace(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -266,7 +266,7 @@ func TestPostgresORM_Namespace(t *testing.T) { assert.Len(t, snapshotA, n) } -func TestPostgresORM_BigIntVersion(t *testing.T) { +func TestIntegration_Shared_PostgresORM_BigIntVersion(t *testing.T) { t.Parallel() ctx := testutils.Context(t) diff --git a/core/services/s4/storage_test.go b/core/services/s4/storage_test.go index 2ffa19f58b1..f634b6d5533 100644 --- a/core/services/s4/storage_test.go +++ b/core/services/s4/storage_test.go @@ -33,7 +33,7 @@ func setupTestStorage(t *testing.T, now time.Time) (*mocks.ORM, s4.Storage) { return orm, storage } -func TestStorage_Constraints(t *testing.T) { +func TestUnit_Storage_Constraints(t *testing.T) { t.Parallel() _, storage := setupTestStorage(t, time.Now()) @@ -41,7 +41,7 @@ func TestStorage_Constraints(t *testing.T) { assert.Equal(t, constraints, c) } -func TestStorage_Errors(t *testing.T) { +func TestIntegration_Shared_Storage_Errors(t *testing.T) { t.Parallel() now := time.Now() @@ -160,7 +160,7 @@ func TestStorage_Errors(t *testing.T) { }) } -func TestStorage_PutAndGet(t *testing.T) { +func TestIntegration_Shared_Storage_PutAndGet(t *testing.T) { t.Parallel() now := time.Now() @@ -201,7 +201,7 @@ func TestStorage_PutAndGet(t *testing.T) { assert.Equal(t, record.Payload, rec.Payload) } -func TestStorage_List(t *testing.T) { +func TestUnit_Storage_List(t *testing.T) { t.Parallel() ormMock, storage := setupTestStorage(t, time.Now()) diff --git a/core/services/signatures/ethdss/ethdss_test.go b/core/services/signatures/ethdss/ethdss_test.go index 59e1b084896..57f6d787ba5 100644 --- a/core/services/signatures/ethdss/ethdss_test.go +++ b/core/services/signatures/ethdss/ethdss_test.go @@ -50,7 +50,7 @@ func init() { } } -func TestDSSNew(t *testing.T) { +func TestUnit_DSSNew(t *testing.T) { dssArgs := DSSArgs{secret: partSec[0], participants: partPubs, long: longterms[0], random: randoms[0], msg: msg, T: 4} dss, err := NewDSS(dssArgs) @@ -62,7 +62,7 @@ func TestDSSNew(t *testing.T) { assert.Error(t, err) } -func TestDSSPartialSigs(t *testing.T) { +func TestUnit_DSSPartialSigs(t *testing.T) { dss0 := getDSS(0) dss1 := getDSS(1) ps0, err := dss0.PartialSig() @@ -147,7 +147,7 @@ func printTest(t *testing.T, msg *big.Int, public kyber.Point, signature.CommitmentPublicAddress) } -func TestDSSSignature(t *testing.T) { +func TestUnit_DSSSignature(t *testing.T) { dsss := make([]*DSS, nbParticipants) pss := make([]*PartialSig, nbParticipants) for i := range nbParticipants { @@ -178,7 +178,7 @@ func TestDSSSignature(t *testing.T) { } } -func TestPartialSig_Hash(t *testing.T) { +func TestUnit_PartialSig_Hash(t *testing.T) { observedHashes := make(map[*big.Int]bool) for i := range nbParticipants { psig, err := getDSS(i).PartialSig() diff --git a/core/services/signatures/ethschnorr/ethschnorr_test.go b/core/services/signatures/ethschnorr/ethschnorr_test.go index 3d3bce3b7e6..937ba9c38d5 100644 --- a/core/services/signatures/ethschnorr/ethschnorr_test.go +++ b/core/services/signatures/ethschnorr/ethschnorr_test.go @@ -35,7 +35,7 @@ func printTest(t *testing.T, msg *big.Int, private kyber.Scalar, signature.CommitmentPublicAddress) } -func TestShortSchnorr_SignAndVerify(t *testing.T) { +func TestUnit_ShortSchnorr_SignAndVerify(t *testing.T) { if printTests { t.Log("tests = [\n") } @@ -94,12 +94,12 @@ func TestShortSchnorr_SignAndVerify(t *testing.T) { require.Contains(t, err.Error(), "not a valid signature") } -func TestShortSchnorr_NewSignature(t *testing.T) { +func TestUnit_ShortSchnorr_NewSignature(t *testing.T) { s := NewSignature() require.Equal(t, s.Signature, big.NewInt(0)) } -func TestShortSchnorr_ChallengeHash(t *testing.T) { +func TestUnit_ShortSchnorr_ChallengeHash(t *testing.T) { point := secp256k1Group.Point() var hash [20]byte h, err := ChallengeHash(point, hash, big.NewInt(-1)) diff --git a/core/services/signatures/secp256k1/curve_test.go b/core/services/signatures/secp256k1/curve_test.go index 325bae20d41..e93d010368c 100644 --- a/core/services/signatures/secp256k1/curve_test.go +++ b/core/services/signatures/secp256k1/curve_test.go @@ -8,11 +8,11 @@ import ( var group = &Secp256k1{} -func TestSecp256k1_String(t *testing.T) { +func TestUnit_Secp256k1_String(t *testing.T) { require.Equal(t, "Secp256k1", group.String()) } -func TestSecp256k1_Constructors(t *testing.T) { +func TestUnit_Secp256k1_Constructors(t *testing.T) { require.Equal(t, 32, group.ScalarLen()) require.Equal(t, ToInt(group.Scalar()), bigZero) require.Equal(t, 33, group.PointLen()) diff --git a/core/services/signatures/secp256k1/field_test.go b/core/services/signatures/secp256k1/field_test.go index 70c4f15d2fe..f56723128d9 100644 --- a/core/services/signatures/secp256k1/field_test.go +++ b/core/services/signatures/secp256k1/field_test.go @@ -29,7 +29,7 @@ func observedFieldElt(t *testing.T, s *fieldElt) { var randomStream = cryptotest.NewStream(&testing.T{}, 0) -func TestField_SetIntAndEqual(t *testing.T) { +func TestUnit_Field_SetIntAndEqual(t *testing.T) { tests := []int64{5, 67108864, 67108865, 4294967295} g := newFieldZero() for _, test := range tests { @@ -45,17 +45,17 @@ func TestField_SetIntAndEqual(t *testing.T) { } } -func TestField_String(t *testing.T) { +func TestUnit_Field_String(t *testing.T) { require.Equal(t, "fieldElt{0}", fieldZero.String()) } -func TestField_Equal(t *testing.T) { +func TestUnit_Field_Equal(t *testing.T) { require.True(t, (*fieldElt)(nil).Equal((*fieldElt)(nil))) require.False(t, (*fieldElt)(nil).Equal(fieldZero)) require.False(t, fieldZero.Equal((*fieldElt)(nil))) } -func TestField_Set(t *testing.T) { +func TestUnit_Field_Set(t *testing.T) { f := fieldEltFromInt(1) g := newFieldZero() g.Set(f) @@ -64,13 +64,13 @@ func TestField_Set(t *testing.T) { "Set takes a copy of the backing big.Int") } -func TestFieldEltFromInt(t *testing.T) { +func TestUnit_FieldEltFromInt(t *testing.T) { assert.Equal(t, fieldEltFromInt(1), // Also tests fieldElt.modQ fieldEltFromBigInt(new(big.Int).Add(q, big.NewInt(1))), "only one representation of a ℤ/qℤ element should be used") } -func TestField_SmokeTestPick(t *testing.T) { +func TestUnit_Field_SmokeTestPick(t *testing.T) { f := newFieldZero() f.Pick(randomStream) observedFieldElt(t, f) @@ -78,7 +78,7 @@ func TestField_SmokeTestPick(t *testing.T) { "should be greater than 1000000000, with very high probability") } -func TestField_Neg(t *testing.T) { +func TestUnit_Field_Neg(t *testing.T) { f := newFieldZero() for range numFieldSamples { f.Pick(randomStream) @@ -91,7 +91,7 @@ func TestField_Neg(t *testing.T) { } } -func TestField_Sub(t *testing.T) { +func TestUnit_Field_Sub(t *testing.T) { f := newFieldZero() for range numFieldSamples { f.Pick(randomStream) @@ -102,7 +102,7 @@ func TestField_Sub(t *testing.T) { } } -func TestField_Clone(t *testing.T) { +func TestUnit_Field_Clone(t *testing.T) { f := fieldEltFromInt(1) g := f.Clone() h := f.Clone() @@ -111,7 +111,7 @@ func TestField_Clone(t *testing.T) { assert.Equal(t, f, h, "clone does not make a copy") } -func TestField_SetBytesAndBytes(t *testing.T) { +func TestUnit_Field_SetBytesAndBytes(t *testing.T) { f := newFieldZero() g := newFieldZero() for range numFieldSamples { @@ -124,7 +124,7 @@ func TestField_SetBytesAndBytes(t *testing.T) { } } -func TestField_MaybeSquareRootInField(t *testing.T) { +func TestUnit_Field_MaybeSquareRootInField(t *testing.T) { f := newFieldZero() minusOne := fieldEltFromInt(-1) assert.Nil(t, maybeSqrtInField(minusOne), "-1 is not a square, in this field") @@ -152,7 +152,7 @@ func TestField_MaybeSquareRootInField(t *testing.T) { } } -func TestField_RightHandSide(t *testing.T) { +func TestUnit_Field_RightHandSide(t *testing.T) { assert.Equal(t, rightHandSide(fieldEltFromInt(1)), fieldEltFromInt(8)) assert.Equal(t, rightHandSide(fieldEltFromInt(2)), fieldEltFromInt(15)) } diff --git a/core/services/signatures/secp256k1/point_test.go b/core/services/signatures/secp256k1/point_test.go index b415825d0bd..86ceda687e6 100644 --- a/core/services/signatures/secp256k1/point_test.go +++ b/core/services/signatures/secp256k1/point_test.go @@ -19,11 +19,11 @@ var numPointSamples = 10 var randomStreamPoint = cryptotest.NewStream(&testing.T{}, 0) -func TestPoint_String(t *testing.T) { +func TestUnit_Point_String(t *testing.T) { require.Equal(t, "Secp256k1{X: fieldElt{0}, Y: fieldElt{0}}", newPoint().String()) } -func TestPoint_CloneAndEqual(t *testing.T) { +func TestUnit_Point_CloneAndEqual(t *testing.T) { f := newPoint() for range numPointSamples { g := f.Clone() @@ -38,7 +38,7 @@ func TestPoint_CloneAndEqual(t *testing.T) { } } -func TestPoint_NullAndAdd(t *testing.T) { +func TestUnit_Point_NullAndAdd(t *testing.T) { f, g := newPoint(), newPoint() for range numPointSamples { g.Null() @@ -48,7 +48,7 @@ func TestPoint_NullAndAdd(t *testing.T) { } } -func TestPoint_Set(t *testing.T) { +func TestUnit_Point_Set(t *testing.T) { p := newPoint() base := newPoint().Base() assert.NotEqual(t, p, base, "generator should not be zero") @@ -56,7 +56,7 @@ func TestPoint_Set(t *testing.T) { assert.Equal(t, p, base, "setting to generator should yield generator") } -func TestPoint_Embed(t *testing.T) { +func TestUnit_Point_Embed(t *testing.T) { p := newPoint() for range numPointSamples { data := make([]byte, p.EmbedLen()) @@ -92,7 +92,7 @@ func TestPoint_Embed(t *testing.T) { p.Embed(data, randomStreamPoint) } -func TestPoint_AddSubAndNeg(t *testing.T) { +func TestUnit_Point_AddSubAndNeg(t *testing.T) { zero := newPoint().Null() p := newPoint() for range numPointSamples { @@ -115,7 +115,7 @@ func TestPoint_AddSubAndNeg(t *testing.T) { } } -func TestPoint_Mul(t *testing.T) { +func TestUnit_Point_Mul(t *testing.T) { zero := newPoint().Null() multiplier := newScalar(bigZero) one := newScalar(big.NewInt(int64(1))) @@ -147,7 +147,7 @@ func TestPoint_Mul(t *testing.T) { } } -func TestPoint_Marshal(t *testing.T) { +func TestUnit_Point_Marshal(t *testing.T) { p := newPoint() for range numPointSamples { p.Pick(randomStreamPoint) @@ -184,7 +184,7 @@ func TestPoint_Marshal(t *testing.T) { "does not correspond to a curve point") } -func TestPoint_BaseTakesCopy(t *testing.T) { +func TestUnit_Point_BaseTakesCopy(t *testing.T) { p := newPoint().Base() p.Add(p, p) q := newPoint().Base() @@ -192,7 +192,7 @@ func TestPoint_BaseTakesCopy(t *testing.T) { "modifying output from Base changes S256.G{x,y}") } -func TestPoint_EthereumAddress(t *testing.T) { +func TestUnit_Point_EthereumAddress(t *testing.T) { // Example taken from // https://theethereum.wiki/w/index.php/Accounts,_Addresses,_Public_And_Private_Keys,_And_Tokens pString := "3a1076bf45ab87712ad64ccb3b10217737f7faacbf2872e88fdd9a537d8fe266" @@ -204,24 +204,24 @@ func TestPoint_EthereumAddress(t *testing.T) { assert.Equal(t, "c2d7cf95645d33006175b78989035c7c9061d3f9", hex.EncodeToString(address[:])) } -func TestIsSecp256k1Point(t *testing.T) { +func TestUnit_IsSecp256k1Point(t *testing.T) { p := curve25519.NewBlakeSHA256Curve25519(false).Point() require.False(t, IsSecp256k1Point(p)) require.True(t, IsSecp256k1Point(newPoint())) } -func TestCoordinates(t *testing.T) { +func TestUnit_Coordinates(t *testing.T) { x, y := Coordinates(newPoint()) require.Equal(t, x, bigZero) require.Equal(t, y, bigZero) } -func TestValidPublicKey(t *testing.T) { +func TestUnit_ValidPublicKey(t *testing.T) { require.False(t, ValidPublicKey(newPoint()), "zero is not a valid key") require.True(t, ValidPublicKey(newPoint().Base())) } -func TestGenerate(t *testing.T) { +func TestUnit_Generate(t *testing.T) { for !ValidPublicKey(Generate(randomStreamPoint).Public) { } diff --git a/core/services/signatures/secp256k1/public_key_test.go b/core/services/signatures/secp256k1/public_key_test.go index 428aba2e7ad..2af0f2ebc75 100644 --- a/core/services/signatures/secp256k1/public_key_test.go +++ b/core/services/signatures/secp256k1/public_key_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestValueScanIdentityPointSet(t *testing.T) { +func TestUnit_ValueScanIdentityPointSet(t *testing.T) { randomStream := cryptotest.NewStream(t, 0) for range 10 { p := NewBlakeKeccackSecp256k1().Point().Pick(randomStream) @@ -33,7 +33,7 @@ func TestValueScanIdentityPointSet(t *testing.T) { } // Tests that PublicKey.Hash gives the same result as the VRFCoordinator's -func TestHash(t *testing.T) { +func TestUnit_Hash(t *testing.T) { pk, err := NewPublicKeyFromHex("0x9dc09a0f898f3b5e8047204e7ce7e44b587920932f08431e29c9bf6923b8450a01") assert.NoError(t, err) assert.Equal(t, "0xc4406d555db624837188b91514a5f47e34d825d935ab887a35c06a3e7c41de69", pk.MustHash().String()) diff --git a/core/services/signatures/secp256k1/scalar_test.go b/core/services/signatures/secp256k1/scalar_test.go index 266db370263..992f3249790 100644 --- a/core/services/signatures/secp256k1/scalar_test.go +++ b/core/services/signatures/secp256k1/scalar_test.go @@ -34,7 +34,7 @@ func observedScalar(t *testing.T, s kyber.Scalar) { var randomStreamScalar = cryptotest.NewStream(&testing.T{}, 0) -func TestScalar_SetAndEqual(t *testing.T) { +func TestUnit_Scalar_SetAndEqual(t *testing.T) { tests := []int64{5, 67108864, 67108865, 4294967295} g := newScalar(scalarZero) for _, test := range tests { @@ -48,14 +48,14 @@ func TestScalar_SetAndEqual(t *testing.T) { } } -func TestNewScalar(t *testing.T) { +func TestUnit_NewScalar(t *testing.T) { one := newScalar(big.NewInt(1)) assert.Equal(t, ToInt(one), ToInt(newScalar(big.NewInt(0).Add(ToInt(one), GroupOrder))), "equivalence classes mod GroupOrder not equal") } -func TestScalar_SmokeTestPick(t *testing.T) { +func TestUnit_Scalar_SmokeTestPick(t *testing.T) { f := newScalar(scalarZero).Clone() for range numScalarSamples { f.Pick(randomStreamScalar) @@ -65,7 +65,7 @@ func TestScalar_SmokeTestPick(t *testing.T) { } } -func TestScalar_Neg(t *testing.T) { +func TestUnit_Scalar_Neg(t *testing.T) { f := newScalar(scalarZero).Clone() for range numScalarSamples { f.Pick(randomStreamScalar) @@ -76,7 +76,7 @@ func TestScalar_Neg(t *testing.T) { } } -func TestScalar_Sub(t *testing.T) { +func TestUnit_Scalar_Sub(t *testing.T) { f := newScalar(scalarZero).Clone() for range numScalarSamples { f.Pick(randomStreamScalar) @@ -86,7 +86,7 @@ func TestScalar_Sub(t *testing.T) { } } -func TestScalar_Clone(t *testing.T) { +func TestUnit_Scalar_Clone(t *testing.T) { f := newScalar(big.NewInt(1)) g := f.Clone() h := f.Clone() @@ -95,7 +95,7 @@ func TestScalar_Clone(t *testing.T) { assert.Equal(t, f, h, "clone does not make a copy") } -func TestScalar_Marshal(t *testing.T) { +func TestUnit_Scalar_Marshal(t *testing.T) { f := newScalar(scalarZero) g := newScalar(scalarZero) for range numFieldSamples { @@ -120,7 +120,7 @@ func TestScalar_Marshal(t *testing.T) { require.NoError(t, err) } -func TestScalar_MulDivInv(t *testing.T) { +func TestUnit_Scalar_MulDivInv(t *testing.T) { f := newScalar(scalarZero) g := newScalar(scalarZero) h := newScalar(scalarZero) @@ -144,44 +144,44 @@ func TestScalar_MulDivInv(t *testing.T) { } } -func TestScalar_AllowVarTime(t *testing.T) { +func TestUnit_Scalar_AllowVarTime(t *testing.T) { defer func() { require.Contains(t, recover(), "not constant-time!") }() newScalar(bigZero).(*secp256k1Scalar).AllowVarTime(false) } -func TestScalar_String(t *testing.T) { +func TestUnit_Scalar_String(t *testing.T) { require.Equal(t, "scalar{0}", newScalar(bigZero).String()) } -func TestScalar_SetInt64(t *testing.T) { +func TestUnit_Scalar_SetInt64(t *testing.T) { require.Equal(t, newScalar(bigZero).SetInt64(1), newScalar(big.NewInt(1))) require.True(t, newScalar(big.NewInt(1)).Zero().Equal(newScalar(bigZero))) require.Equal(t, newScalar(bigZero).One(), newScalar(big.NewInt(1))) } -func TestScalar_DivPanicsOnZeroDivisor(t *testing.T) { +func TestUnit_Scalar_DivPanicsOnZeroDivisor(t *testing.T) { defer func() { require.Contains(t, recover(), "divide by zero") }() newScalar(bigZero).Div(newScalar(bigZero).One(), newScalar(bigZero)) } -func TestScalar_InvPanicsOnZero(t *testing.T) { +func TestUnit_Scalar_InvPanicsOnZero(t *testing.T) { defer func() { require.Contains(t, recover(), "divide by zero") }() newScalar(bigZero).Inv(newScalar(bigZero)) } -func TestScalar_SetBytes(t *testing.T) { +func TestUnit_Scalar_SetBytes(t *testing.T) { u256Cardinality := zero().Lsh(big.NewInt(1), 256) newScalar(bigZero).(*secp256k1Scalar).int().Cmp( zero().Sub(u256Cardinality, GroupOrder)) } -func TestScalar_IsSecp256k1Scalar(t *testing.T) { +func TestUnit_Scalar_IsSecp256k1Scalar(t *testing.T) { c := curve25519.NewBlakeSHA256Curve25519(true) require.False(t, IsSecp256k1Scalar(c.Scalar())) require.True(t, IsSecp256k1Scalar(newScalar(bigZero))) } -func TestScalar_IntToScalar(t *testing.T) { +func TestUnit_Scalar_IntToScalar(t *testing.T) { u256Cardinality := zero().Lsh(big.NewInt(1), 256) IntToScalar(u256Cardinality) require.Equal(t, u256Cardinality, zero().Sub(zero().Lsh(big.NewInt(1), 256), diff --git a/core/services/signatures/secp256k1/suite_test.go b/core/services/signatures/secp256k1/suite_test.go index f9c48999d1a..260a429ba45 100644 --- a/core/services/signatures/secp256k1/suite_test.go +++ b/core/services/signatures/secp256k1/suite_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestSuite(t *testing.T) { +func TestUnit_Suite(t *testing.T) { s := NewBlakeKeccackSecp256k1() emptyHashAsHex := hex.EncodeToString(s.Hash().Sum(nil)) require.Equal(t, "c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", emptyHashAsHex) diff --git a/core/services/standardcapabilities/delegate_test.go b/core/services/standardcapabilities/delegate_test.go index 96d5e2c343a..0b8575f611e 100644 --- a/core/services/standardcapabilities/delegate_test.go +++ b/core/services/standardcapabilities/delegate_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/standardcapabilities" ) -func Test_ValidatedStandardCapabilitiesSpec(t *testing.T) { +func TestUnit_ValidatedStandardCapabilitiesSpec(t *testing.T) { type testCase struct { name string tomlString string diff --git a/core/services/standardcapabilities/standard_capabilities_test.go b/core/services/standardcapabilities/standard_capabilities_test.go index 5ea431b2f72..bd01132be88 100644 --- a/core/services/standardcapabilities/standard_capabilities_test.go +++ b/core/services/standardcapabilities/standard_capabilities_test.go @@ -20,7 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/plugins" ) -func TestStandardCapabilityStart(t *testing.T) { +func TestUnit_StandardCapabilityStart(t *testing.T) { t.Run("NOK-not_found_binary_does_not_block", func(t *testing.T) { ctx := t.Context() lggr := logger.TestLogger(t) diff --git a/core/services/streams/delegate_test.go b/core/services/streams/delegate_test.go index 4d14c31b11b..2d63bc12968 100644 --- a/core/services/streams/delegate_test.go +++ b/core/services/streams/delegate_test.go @@ -26,7 +26,7 @@ type mockDelegateConfig struct{} func (m *mockDelegateConfig) MaxSuccessfulRuns() uint64 { return 0 } func (m *mockDelegateConfig) ResultWriteQueueDepth() uint64 { return 0 } -func Test_Delegate(t *testing.T) { +func TestUnit_Delegate(t *testing.T) { lggr := logger.TestLogger(t) registry := &mockRegistry{} runner := &mockRunner{} @@ -56,7 +56,7 @@ func Test_Delegate(t *testing.T) { }) } -func Test_ValidatedStreamSpec(t *testing.T) { +func TestUnit_ValidatedStreamSpec(t *testing.T) { var tt = []struct { name string toml string diff --git a/core/services/streams/stream_registry_test.go b/core/services/streams/stream_registry_test.go index e20b29e9262..1cb1ee221b7 100644 --- a/core/services/streams/stream_registry_test.go +++ b/core/services/streams/stream_registry_test.go @@ -30,7 +30,7 @@ func (m *mockPipeline) StreamIDs() []StreamID { return m.streamIDs } -func Test_Registry(t *testing.T) { +func TestUnit_Registry(t *testing.T) { lggr := logger.TestLogger(t) runner := &mockRunner{} diff --git a/core/services/streams/stream_test.go b/core/services/streams/stream_test.go index 48b762d7ca9..c4b0e88360e 100644 --- a/core/services/streams/stream_test.go +++ b/core/services/streams/stream_test.go @@ -56,7 +56,7 @@ func (m *MockTask) TaskRetries() uint32 { return 0 } func (m *MockTask) TaskMinBackoff() time.Duration { return 0 } func (m *MockTask) TaskMaxBackoff() time.Duration { return 0 } -func Test_Stream(t *testing.T) { +func TestUnit_Stream(t *testing.T) { lggr := logger.Test(t) runner := &mockRunner{} ctx := testutils.Context(t) diff --git a/core/services/synchronization/telemetry_ingress_batch_client_test.go b/core/services/synchronization/telemetry_ingress_batch_client_test.go index c745bb00352..95013d0806c 100644 --- a/core/services/synchronization/telemetry_ingress_batch_client_test.go +++ b/core/services/synchronization/telemetry_ingress_batch_client_test.go @@ -21,7 +21,7 @@ import ( telemPb "github.com/smartcontractkit/chainlink/v2/core/services/synchronization/telem" ) -func TestTelemetryIngressBatchClient_HappyPath(t *testing.T) { +func TestUnit_TelemetryIngressBatchClient_HappyPath(t *testing.T) { g := gomega.NewWithT(t) // Create mocks diff --git a/core/services/synchronization/telemetry_ingress_batch_worker_test.go b/core/services/synchronization/telemetry_ingress_batch_worker_test.go index 61c2d45953b..d8d28ce4c03 100644 --- a/core/services/synchronization/telemetry_ingress_batch_worker_test.go +++ b/core/services/synchronization/telemetry_ingress_batch_worker_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/synchronization/mocks" ) -func TestTelemetryIngressWorker_BuildTelemBatchReq(t *testing.T) { +func TestUnit_TelemetryIngressWorker_BuildTelemBatchReq(t *testing.T) { telemPayload := synchronization.TelemPayload{ Telemetry: []byte("Mock telemetry"), ContractID: "0xa", diff --git a/core/services/synchronization/telemetry_ingress_client_test.go b/core/services/synchronization/telemetry_ingress_client_test.go index eebc03515a5..5dd7f82eecc 100644 --- a/core/services/synchronization/telemetry_ingress_client_test.go +++ b/core/services/synchronization/telemetry_ingress_client_test.go @@ -22,7 +22,7 @@ import ( telem "github.com/smartcontractkit/chainlink/v2/core/services/telemetry" ) -func TestTelemetryIngressClient_Send_HappyPath(t *testing.T) { +func TestUnit_TelemetryIngressClient_Send_HappyPath(t *testing.T) { // Create mocks telemClient := mocks.NewTelemClient(t) diff --git a/core/services/telemetry/chip_ingress_test.go b/core/services/telemetry/chip_ingress_test.go index 807e7805c3f..05df6f03d20 100644 --- a/core/services/telemetry/chip_ingress_test.go +++ b/core/services/telemetry/chip_ingress_test.go @@ -22,7 +22,7 @@ func (m *MockEmitter) Emit(ctx context.Context, body []byte, attrKVs ...any) err return args.Error(0) } -func TestNewChipIngressAdapter(t *testing.T) { +func TestUnit_NewChipIngressAdapter(t *testing.T) { t.Run("Success - Ethereum Mainnet", func(t *testing.T) { mockEmitter := new(MockEmitter) lggr := logger.TestLogger(t) @@ -114,7 +114,7 @@ func TestNewChipIngressAdapter(t *testing.T) { }) } -func TestChipIngressAdapter_SendLog(t *testing.T) { +func TestUnit_ChipIngressAdapter_SendLog(t *testing.T) { t.Run("Success - sends to beholder", func(t *testing.T) { mockEmitter := new(MockEmitter) lggr := logger.TestLogger(t) @@ -205,7 +205,7 @@ func TestChipIngressAdapter_SendLog(t *testing.T) { }) } -func TestChipIngressAdapter_ExportedFields(t *testing.T) { +func TestUnit_ChipIngressAdapter_ExportedFields(t *testing.T) { mockEmitter := new(MockEmitter) lggr := logger.TestLogger(t) contractID := "0x1234567890" @@ -239,7 +239,7 @@ func TestChipIngressAdapter_ExportedFields(t *testing.T) { }) } -func TestChipIngressAdapter_InterfaceCompliance(t *testing.T) { +func TestUnit_ChipIngressAdapter_InterfaceCompliance(t *testing.T) { // This test verifies that ChipIngressAdapter implements commontypes.MonitoringEndpoint mockEmitter := new(MockEmitter) lggr := logger.TestLogger(t) diff --git a/core/services/telemetry/ingress_batch_test.go b/core/services/telemetry/ingress_batch_test.go index 91e6a07ad7f..645aaaa628b 100644 --- a/core/services/telemetry/ingress_batch_test.go +++ b/core/services/telemetry/ingress_batch_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/telemetry" ) -func TestIngressAgentBatch(t *testing.T) { +func TestUnit_IngressAgentBatch(t *testing.T) { telemetryBatchClient := mocks.NewTelemetryService(t) ingressAgentBatch := telemetry.NewIngressAgentWrapper(telemetryBatchClient) monitoringEndpoint := ingressAgentBatch.GenMonitoringEndpoint("test-network", "test-chainID", "0xa", synchronization.OCR) diff --git a/core/services/telemetry/ingress_test.go b/core/services/telemetry/ingress_test.go index 7e83384dc6c..631b7a47d6e 100644 --- a/core/services/telemetry/ingress_test.go +++ b/core/services/telemetry/ingress_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/telemetry" ) -func TestIngressAgent(t *testing.T) { +func TestUnit_IngressAgent(t *testing.T) { telemetryClient := mocks.NewTelemetryService(t) ingressAgent := telemetry.NewIngressAgentWrapper(telemetryClient) monitoringEndpoint := ingressAgent.GenMonitoringEndpoint("test-network", "test-chainID", "0xa", synchronization.OCR) diff --git a/core/services/telemetry/manager_test.go b/core/services/telemetry/manager_test.go index 1473fdef867..42a45ede335 100644 --- a/core/services/telemetry/manager_test.go +++ b/core/services/telemetry/manager_test.go @@ -37,7 +37,7 @@ func setupMockConfig(t *testing.T, useBatchSend bool, chipIngressEnabled bool) * return tic } -func TestManagerAgents(t *testing.T) { +func TestUnit_ManagerAgents(t *testing.T) { tic := setupMockConfig(t, true, false) te := mocks.NewTelemetryIngressEndpoint(t) te.On("Network").Return("network-1") @@ -64,7 +64,7 @@ func TestManagerAgents(t *testing.T) { assert.Equal(t, "*telemetry.TypedIngressAgent", reflect.TypeOf(me).String()) } -func TestNewManager(t *testing.T) { +func TestUnit_NewManager(t *testing.T) { type endpointTest struct { network string chainID string @@ -196,7 +196,7 @@ func TestNewManager(t *testing.T) { require.Len(t, hr, 4) } -func TestCorrectEndpointRouting(t *testing.T) { +func TestUnit_CorrectEndpointRouting(t *testing.T) { tic := setupMockConfig(t, true, false) tic.On("Endpoints").Return(nil) @@ -284,7 +284,7 @@ func TestCorrectEndpointRouting(t *testing.T) { } // add test for current changes in manager -func TestManager_ChipIngressClient(t *testing.T) { +func TestUnit_Manager_ChipIngressClient(t *testing.T) { t.Run("disabled chip ingress", func(t *testing.T) { tic := setupMockConfig(t, true, false) tic.On("Endpoints").Return(nil) diff --git a/core/services/versioning/orm_test.go b/core/services/versioning/orm_test.go index 94934132ba3..f27f6fbb5ff 100644 --- a/core/services/versioning/orm_test.go +++ b/core/services/versioning/orm_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/static" ) -func TestORM_NodeVersion_UpsertNodeVersion(t *testing.T) { +func TestIntegration_Shared_ORM_NodeVersion_UpsertNodeVersion(t *testing.T) { ctx := t.Context() db := pgtest.NewSqlxDB(t) @@ -87,7 +87,7 @@ func TestORM_NodeVersion_UpsertNodeVersion(t *testing.T) { }) } -func Test_Version_CheckVersion(t *testing.T) { +func TestUnit_Version_CheckVersion(t *testing.T) { ctx := testutils.Context(t) db := pgtest.NewSqlxDB(t) @@ -125,7 +125,7 @@ func Test_Version_CheckVersion(t *testing.T) { assert.Equal(t, "9.9.8", dbv.String()) } -func TestORM_CheckVersion_CCIP(t *testing.T) { +func TestUnit_ORM_CheckVersion_CCIP(t *testing.T) { ctx := testutils.Context(t) db := pgtest.NewSqlxDB(t) @@ -205,7 +205,7 @@ func TestORM_CheckVersion_CCIP(t *testing.T) { } } -func TestORM_NodeVersion_FindLatestNodeVersion(t *testing.T) { +func TestUnit_ORM_NodeVersion_FindLatestNodeVersion(t *testing.T) { ctx := testutils.Context(t) db := pgtest.NewSqlxDB(t) orm := NewORM(db, logger.TestLogger(t)) diff --git a/core/services/vrf/delegate_test.go b/core/services/vrf/delegate_test.go index 9bb379d16a7..1666bad2f8a 100644 --- a/core/services/vrf/delegate_test.go +++ b/core/services/vrf/delegate_test.go @@ -193,7 +193,7 @@ func setup(t *testing.T) (vrfUniverse, *v1.Listener, job.Job) { return vuni, listener, jb } -func TestDelegate_ReorgAttackProtection(t *testing.T) { +func TestUnit_Delegate_ReorgAttackProtection(t *testing.T) { vuni, listener, jb := setup(t) // Same request has already been fulfilled twice @@ -241,7 +241,7 @@ func TestDelegate_ReorgAttackProtection(t *testing.T) { } } -func TestDelegate_ValidLog(t *testing.T) { +func TestUnit_Delegate_ValidLog(t *testing.T) { vuni, listener, jb := setup(t) txHash := evmutils.NewHash() reqID1 := evmutils.NewHash() @@ -362,7 +362,7 @@ func TestDelegate_ValidLog(t *testing.T) { } } -func TestDelegate_InvalidLog(t *testing.T) { +func TestUnit_Delegate_InvalidLog(t *testing.T) { vuni, listener, jb := setup(t) vuni.lb.On("WasAlreadyConsumed", mock.Anything, mock.Anything).Return(false, nil) done := make(chan struct{}) @@ -426,7 +426,7 @@ func TestDelegate_InvalidLog(t *testing.T) { require.Empty(t, txes) } -func TestFulfilledCheck(t *testing.T) { +func TestUnit_FulfilledCheck(t *testing.T) { vuni, listener, jb := setup(t) vuni.lb.On("WasAlreadyConsumed", mock.Anything, mock.Anything).Return(false, nil) done := make(chan struct{}) @@ -474,7 +474,7 @@ func TestFulfilledCheck(t *testing.T) { require.Empty(t, runs) } -func Test_CheckFromAddressMaxGasPrices(t *testing.T) { +func TestUnit_CheckFromAddressMaxGasPrices(t *testing.T) { t.Run("returns nil error if gasLanePrice not set in job spec", func(tt *testing.T) { spec := ` type = "vrf" @@ -568,7 +568,7 @@ decode_log->vrf->encode_tx->submit_tx }) } -func Test_CheckFromAddressesExist(t *testing.T) { +func TestUnit_CheckFromAddressesExist(t *testing.T) { t.Run("from addresses exist", func(t *testing.T) { ctx := testutils.Context(t) db := pgtest.NewSqlxDB(t) @@ -628,7 +628,7 @@ func Test_CheckFromAddressesExist(t *testing.T) { }) } -func Test_FromAddressMaxGasPricesAllEqual(t *testing.T) { +func TestUnit_FromAddressMaxGasPricesAllEqual(t *testing.T) { t.Run("all max gas prices equal", func(tt *testing.T) { fromAddresses := []string{ "0x498C2Dce1d3aEDE31A8c808c511C38a809e67684", @@ -685,7 +685,7 @@ func Test_FromAddressMaxGasPricesAllEqual(t *testing.T) { }) } -func Test_VRFV2PlusServiceFailsWhenVRFOwnerProvided(t *testing.T) { +func TestUnit_VRFV2PlusServiceFailsWhenVRFOwnerProvided(t *testing.T) { db := pgtest.NewSqlxDB(t) cfg := configtest.NewTestGeneralConfig(t) vuni := buildVrfUni(t, db, cfg) diff --git a/core/services/vrf/proof/proof_response_test.go b/core/services/vrf/proof/proof_response_test.go index 35fc6f8a12c..27a750a20b2 100644 --- a/core/services/vrf/proof/proof_response_test.go +++ b/core/services/vrf/proof/proof_response_test.go @@ -20,7 +20,7 @@ import ( proof2 "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" ) -func TestMarshaledProof(t *testing.T) { +func TestUnit_MarshaledProof(t *testing.T) { ctx := testutils.Context(t) db := pgtest.NewSqlxDB(t) keyStore := cltest.NewKeyStore(t, db) diff --git a/core/services/vrf/solidity_cross_tests/vrf_consumer_base_test.go b/core/services/vrf/solidity_cross_tests/vrf_consumer_base_test.go index e876d653d71..b7d77d6b9cf 100644 --- a/core/services/vrf/solidity_cross_tests/vrf_consumer_base_test.go +++ b/core/services/vrf/solidity_cross_tests/vrf_consumer_base_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrftesthelpers" ) -func TestConsumerBaseRejectsBadVRFCoordinator(t *testing.T) { +func TestUnit_ConsumerBaseRejectsBadVRFCoordinator(t *testing.T) { key := cltest.MustGenerateRandomKey(t) coordinator := vrftesthelpers.NewVRFCoordinatorUniverse(t, key) keyHash, _ /* jobID */, fee := registerProvingKey(t, coordinator) diff --git a/core/services/vrf/solidity_cross_tests/vrf_coordinator_interface_test.go b/core/services/vrf/solidity_cross_tests/vrf_coordinator_interface_test.go index 47c47af7c9b..26124d6d9fd 100644 --- a/core/services/vrf/solidity_cross_tests/vrf_coordinator_interface_test.go +++ b/core/services/vrf/solidity_cross_tests/vrf_coordinator_interface_test.go @@ -39,7 +39,7 @@ var ( } ) -func TestVRFParseRandomnessRequestLog(t *testing.T) { +func TestUnit_VRFParseRandomnessRequestLog(t *testing.T) { r := solidity_cross_tests.RawRandomnessRequestLogToRandomnessRequestLog(&raw) rawLog, err := r.RawData() require.NoError(t, err) diff --git a/core/services/vrf/solidity_cross_tests/vrf_coordinator_solidity_crosscheck_test.go b/core/services/vrf/solidity_cross_tests/vrf_coordinator_solidity_crosscheck_test.go index 32f4f18f491..9a0514c99be 100644 --- a/core/services/vrf/solidity_cross_tests/vrf_coordinator_solidity_crosscheck_test.go +++ b/core/services/vrf/solidity_cross_tests/vrf_coordinator_solidity_crosscheck_test.go @@ -19,7 +19,7 @@ import ( const defaultGasLimit uint32 = 500000 -func TestRequestIDMatches(t *testing.T) { +func TestUnit_RequestIDMatches(t *testing.T) { keyHash := common.HexToHash("0x01") key := cltest.MustGenerateRandomKey(t) baseContract := vrftesthelpers.NewVRFCoordinatorUniverse(t, key).RequestIDBase @@ -53,7 +53,7 @@ func registerProvingKey(t *testing.T, coordinator vrftesthelpers.CoordinatorUniv return keyHash, jobID, vrfFee } -func TestRegisterProvingKey(t *testing.T) { +func TestUnit_RegisterProvingKey(t *testing.T) { key := cltest.MustGenerateRandomKey(t) coord := vrftesthelpers.NewVRFCoordinatorUniverse(t, key) keyHash, jobID, fee := registerProvingKey(t, coord) @@ -76,7 +76,7 @@ func TestRegisterProvingKey(t *testing.T) { "VRFCoordinator registered wrong fee, on service agreement!") } -func TestFailToRegisterProvingKeyFromANonOwnerAddress(t *testing.T) { +func TestUnit_FailToRegisterProvingKeyFromANonOwnerAddress(t *testing.T) { key := cltest.MustGenerateRandomKey(t) coordinator := vrftesthelpers.NewVRFCoordinatorUniverse(t, key) @@ -129,7 +129,7 @@ func requestRandomnessV08(t *testing.T, coordinator vrftesthelpers.CoordinatorUn (*solidity_cross_tests.RawRandomnessRequestLog)(log.Event)) } -func TestRandomnessRequestLog(t *testing.T) { +func TestUnit_RandomnessRequestLog(t *testing.T) { key := cltest.MustGenerateRandomKey(t) coord := vrftesthelpers.NewVRFCoordinatorUniverseWithV08Consumer(t, key) keyHash_, jobID_, fee := registerProvingKey(t, coord) @@ -206,7 +206,7 @@ func fulfillRandomnessRequest(t *testing.T, coordinator vrftesthelpers.Coordinat return proof } -func TestFulfillRandomness(t *testing.T) { +func TestUnit_FulfillRandomness(t *testing.T) { key := cltest.MustGenerateRandomKey(t) coordinator := vrftesthelpers.NewVRFCoordinatorUniverse(t, key) keyHash, _, fee := registerProvingKey(t, coordinator) @@ -231,7 +231,7 @@ func TestFulfillRandomness(t *testing.T) { "was not paid his fee, despite successful fulfillment of randomness request!") } -func TestWithdraw(t *testing.T) { +func TestUnit_Withdraw(t *testing.T) { key := cltest.MustGenerateRandomKey(t) coordinator := vrftesthelpers.NewVRFCoordinatorUniverse(t, key) keyHash, _, fee := registerProvingKey(t, coordinator) diff --git a/core/services/vrf/solidity_cross_tests/vrf_fulfillment_cost_test.go b/core/services/vrf/solidity_cross_tests/vrf_fulfillment_cost_test.go index 0e12fe668c0..faef959729e 100644 --- a/core/services/vrf/solidity_cross_tests/vrf_fulfillment_cost_test.go +++ b/core/services/vrf/solidity_cross_tests/vrf_fulfillment_cost_test.go @@ -14,7 +14,7 @@ import ( // TestMeasureFulfillmentGasCost establishes rough bounds on the cost of // providing a proof to the VRF coordinator. -func TestMeasureFulfillmentGasCost(t *testing.T) { +func TestUnit_MeasureFulfillmentGasCost(t *testing.T) { key := cltest.MustGenerateRandomKey(t) coordinator := vrftesthelpers.NewVRFCoordinatorUniverse(t, key) keyHash, _, fee := registerProvingKey(t, coordinator) diff --git a/core/services/vrf/solidity_cross_tests/vrf_hash_to_curve_cost_test.go b/core/services/vrf/solidity_cross_tests/vrf_hash_to_curve_cost_test.go index fcf3b574c41..891ec68970d 100644 --- a/core/services/vrf/solidity_cross_tests/vrf_hash_to_curve_cost_test.go +++ b/core/services/vrf/solidity_cross_tests/vrf_hash_to_curve_cost_test.go @@ -90,7 +90,7 @@ func HashToCurveGasCostBound(numOrdinates uint64) uint64 { return baseCost + marginalCost*numOrdinates } -func TestMeasureHashToCurveGasCost(t *testing.T) { +func TestUnit_MeasureHashToCurveGasCost(t *testing.T) { contract, owner := deployVRFContract(t) numSamples := int64(numSamples()) for i := range numSamples { diff --git a/core/services/vrf/solidity_cross_tests/vrf_randomness_output_cost_test.go b/core/services/vrf/solidity_cross_tests/vrf_randomness_output_cost_test.go index d62e28a49d7..43cba7d6315 100644 --- a/core/services/vrf/solidity_cross_tests/vrf_randomness_output_cost_test.go +++ b/core/services/vrf/solidity_cross_tests/vrf_randomness_output_cost_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" ) -func TestMeasureRandomValueFromVRFProofGasCost(t *testing.T) { +func TestUnit_MeasureRandomValueFromVRFProofGasCost(t *testing.T) { r := mrand.New(mrand.NewSource(10)) sk := randomScalar(t, r) skNum := secp256k1.ToInt(sk) diff --git a/core/services/vrf/solidity_cross_tests/vrf_request_cost_test.go b/core/services/vrf/solidity_cross_tests/vrf_request_cost_test.go index 5d183358582..740a74be19b 100644 --- a/core/services/vrf/solidity_cross_tests/vrf_request_cost_test.go +++ b/core/services/vrf/solidity_cross_tests/vrf_request_cost_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrftesthelpers" ) -func TestMeasureRandomnessRequestGasCost(t *testing.T) { +func TestUnit_MeasureRandomnessRequestGasCost(t *testing.T) { key := cltest.MustGenerateRandomKey(t) coordinator := vrftesthelpers.NewVRFCoordinatorUniverse(t, key) keyHash_, _, fee := registerProvingKey(t, coordinator) diff --git a/core/services/vrf/solidity_cross_tests/vrf_solidity_crosscheck_test.go b/core/services/vrf/solidity_cross_tests/vrf_solidity_crosscheck_test.go index 667a8ce05ea..3684249a418 100644 --- a/core/services/vrf/solidity_cross_tests/vrf_solidity_crosscheck_test.go +++ b/core/services/vrf/solidity_cross_tests/vrf_solidity_crosscheck_test.go @@ -67,7 +67,7 @@ func numSamples() int { return 10 } -func TestVRF_CompareProjectiveECAddToVerifier(t *testing.T) { +func TestUnit_VRF_CompareProjectiveECAddToVerifier(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(11)) for j := 0; j < numSamples(); j++ { @@ -86,7 +86,7 @@ func TestVRF_CompareProjectiveECAddToVerifier(t *testing.T) { } } -func TestVRF_CompareBigModExpToVerifier(t *testing.T) { +func TestUnit_VRF_CompareBigModExpToVerifier(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(0)) for j := 0; j < numSamples(); j++ { @@ -101,7 +101,7 @@ func TestVRF_CompareBigModExpToVerifier(t *testing.T) { } } -func TestVRF_CompareSquareRoot(t *testing.T) { +func TestUnit_VRF_CompareSquareRoot(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(1)) for j := 0; j < numSamples(); j++ { @@ -122,7 +122,7 @@ func TestVRF_CompareSquareRoot(t *testing.T) { } } -func TestVRF_CompareYSquared(t *testing.T) { +func TestUnit_VRF_CompareYSquared(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(2)) for i := 0; i < numSamples(); i++ { @@ -134,7 +134,7 @@ func TestVRF_CompareYSquared(t *testing.T) { } } -func TestVRF_CompareFieldHash(t *testing.T) { +func TestUnit_VRF_CompareFieldHash(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(3)) msg := make([]byte, 32) @@ -166,7 +166,7 @@ func randomKey(t *testing.T, r *mrand.Rand) *ecdsa.PrivateKey { func pair(x, y *big.Int) [2]*big.Int { return [2]*big.Int{x, y} } func asPair(p kyber.Point) [2]*big.Int { return pair(secp256k1.Coordinates(p)) } -func TestVRF_CompareHashToCurve(t *testing.T) { +func TestUnit_VRF_CompareHashToCurve(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(4)) for i := 0; i < numSamples(); i++ { @@ -217,7 +217,7 @@ func randomScalar(t *testing.T, r *mrand.Rand) kyber.Scalar { return secp256k1.IntToScalar(s) } -func TestVRF_CheckSolidityPointAddition(t *testing.T) { +func TestUnit_VRF_CheckSolidityPointAddition(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(5)) for j := 0; j < numSamples(); j++ { @@ -245,7 +245,7 @@ func TestVRF_CheckSolidityPointAddition(t *testing.T) { } } -func TestVRF_CheckSolidityECMulVerify(t *testing.T) { +func TestUnit_VRF_CheckSolidityECMulVerify(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(6)) for j := 0; j < numSamples(); j++ { @@ -266,7 +266,7 @@ func TestVRF_CheckSolidityECMulVerify(t *testing.T) { } } -func TestVRF_CheckSolidityVerifyLinearCombinationWithGenerator(t *testing.T) { +func TestUnit_VRF_CheckSolidityVerifyLinearCombinationWithGenerator(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(7)) for j := 0; j < numSamples(); j++ { @@ -294,7 +294,7 @@ func TestVRF_CheckSolidityVerifyLinearCombinationWithGenerator(t *testing.T) { } } -func TestVRF_CheckSolidityLinearComination(t *testing.T) { +func TestUnit_VRF_CheckSolidityLinearComination(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(8)) for j := 0; j < numSamples(); j++ { @@ -331,7 +331,7 @@ func TestVRF_CheckSolidityLinearComination(t *testing.T) { } } -func TestVRF_CompareSolidityScalarFromCurvePoints(t *testing.T) { +func TestUnit_VRF_CompareSolidityScalarFromCurvePoints(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(9)) for j := 0; j < numSamples(); j++ { @@ -351,7 +351,7 @@ func TestVRF_CompareSolidityScalarFromCurvePoints(t *testing.T) { } } -func TestVRF_MarshalProof(t *testing.T) { +func TestUnit_VRF_MarshalProof(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(10)) for j := 0; j < numSamples(); j++ { diff --git a/core/services/vrf/solidity_cross_tests/vrf_v08_solidity_crosscheck_test.go b/core/services/vrf/solidity_cross_tests/vrf_v08_solidity_crosscheck_test.go index 078bba47637..e8b7fd148ba 100644 --- a/core/services/vrf/solidity_cross_tests/vrf_v08_solidity_crosscheck_test.go +++ b/core/services/vrf/solidity_cross_tests/vrf_v08_solidity_crosscheck_test.go @@ -37,7 +37,7 @@ func deployVRFV08TestHelper(t *testing.T) *solidity_vrf_v08_verifier_wrapper.VRF return verifier } -func TestVRFV08_InvalidPointCoordinates(t *testing.T) { +func TestUnit_VRFV08_InvalidPointCoordinates(t *testing.T) { verifier := deployVRFV08TestHelper(t) // A value outside [0, ..., FIELD_SIZE-1] should fail _, err := verifier.IsOnCurve(nil, @@ -57,7 +57,7 @@ func TestVRFV08_InvalidPointCoordinates(t *testing.T) { require.NoError(t, err) } -func TestVRFV08_CompareProjectiveECAddToVerifier(t *testing.T) { +func TestUnit_VRFV08_CompareProjectiveECAddToVerifier(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(11)) for j := 0; j < numSamples(); j++ { @@ -76,7 +76,7 @@ func TestVRFV08_CompareProjectiveECAddToVerifier(t *testing.T) { } } -func TestVRFV08_CompareBigModExpToVerifier(t *testing.T) { +func TestUnit_VRFV08_CompareBigModExpToVerifier(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(0)) for j := 0; j < numSamples(); j++ { @@ -91,7 +91,7 @@ func TestVRFV08_CompareBigModExpToVerifier(t *testing.T) { } } -func TestVRFV08_CompareSquareRoot(t *testing.T) { +func TestUnit_VRFV08_CompareSquareRoot(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(1)) for j := 0; j < numSamples(); j++ { @@ -112,7 +112,7 @@ func TestVRFV08_CompareSquareRoot(t *testing.T) { } } -func TestVRFV08_CompareYSquared(t *testing.T) { +func TestUnit_VRFV08_CompareYSquared(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(2)) for i := 0; i < numSamples(); i++ { @@ -124,7 +124,7 @@ func TestVRFV08_CompareYSquared(t *testing.T) { } } -func TestVRFV08_CompareFieldHash(t *testing.T) { +func TestUnit_VRFV08_CompareFieldHash(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(3)) msg := make([]byte, 32) @@ -139,7 +139,7 @@ func TestVRFV08_CompareFieldHash(t *testing.T) { } } -func TestVRFV08_CompareHashToCurve(t *testing.T) { +func TestUnit_VRFV08_CompareHashToCurve(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(4)) for i := 0; i < numSamples(); i++ { @@ -156,7 +156,7 @@ func TestVRFV08_CompareHashToCurve(t *testing.T) { } } -func TestVRFV08_CheckSolidityPointAddition(t *testing.T) { +func TestUnit_VRFV08_CheckSolidityPointAddition(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(5)) for j := 0; j < numSamples(); j++ { @@ -184,7 +184,7 @@ func TestVRFV08_CheckSolidityPointAddition(t *testing.T) { } } -func TestVRFV08_CheckSolidityECMulVerify(t *testing.T) { +func TestUnit_VRFV08_CheckSolidityECMulVerify(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(6)) for j := 0; j < numSamples(); j++ { @@ -205,7 +205,7 @@ func TestVRFV08_CheckSolidityECMulVerify(t *testing.T) { } } -func TestVRFV08_CheckSolidityVerifyLinearCombinationWithGenerator(t *testing.T) { +func TestUnit_VRFV08_CheckSolidityVerifyLinearCombinationWithGenerator(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(7)) for j := 0; j < numSamples(); j++ { @@ -233,7 +233,7 @@ func TestVRFV08_CheckSolidityVerifyLinearCombinationWithGenerator(t *testing.T) } } -func TestVRFV08_CheckSolidityLinearComination(t *testing.T) { +func TestUnit_VRFV08_CheckSolidityLinearComination(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(8)) for j := 0; j < numSamples(); j++ { @@ -270,7 +270,7 @@ func TestVRFV08_CheckSolidityLinearComination(t *testing.T) { } } -func TestVRFV08_CompareSolidityScalarFromCurvePoints(t *testing.T) { +func TestUnit_VRFV08_CompareSolidityScalarFromCurvePoints(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(9)) for j := 0; j < numSamples(); j++ { @@ -290,7 +290,7 @@ func TestVRFV08_CompareSolidityScalarFromCurvePoints(t *testing.T) { } } -func TestVRFV08_MarshalProof(t *testing.T) { +func TestUnit_VRFV08_MarshalProof(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(10)) for j := 0; j < numSamples(); j++ { diff --git a/core/services/vrf/v1/listener_v1_test.go b/core/services/vrf/v1/listener_v1_test.go index ac25a1912fa..2e64564f5dc 100644 --- a/core/services/vrf/v1/listener_v1_test.go +++ b/core/services/vrf/v1/listener_v1_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/utils" ) -func TestConfirmedLogExtraction(t *testing.T) { +func TestUnit_ConfirmedLogExtraction(t *testing.T) { lsn := Listener{} lsn.Reqs = []request{ { @@ -49,7 +49,7 @@ func TestConfirmedLogExtraction(t *testing.T) { assert.Empty(t, lsn.Reqs) // all processed } -func TestResponsePruning(t *testing.T) { +func TestUnit_ResponsePruning(t *testing.T) { lsn := Listener{} lsn.LatestHead = 10000 lsn.ResponseCount = map[[32]byte]uint64{ diff --git a/core/services/vrf/v2/bhs_feeder_test.go b/core/services/vrf/v2/bhs_feeder_test.go index 3d504741ed5..80821d2a27e 100644 --- a/core/services/vrf/v2/bhs_feeder_test.go +++ b/core/services/vrf/v2/bhs_feeder_test.go @@ -19,7 +19,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" ) -func TestStartHeartbeats(t *testing.T) { +func TestUnit_StartHeartbeats(t *testing.T) { t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2Universe(t, ownerKey, 2) diff --git a/core/services/vrf/v2/integration_v2_plus_test.go b/core/services/vrf/v2/integration_v2_plus_test.go index c79ffd84078..c54ff62eca6 100644 --- a/core/services/vrf/v2/integration_v2_plus_test.go +++ b/core/services/vrf/v2/integration_v2_plus_test.go @@ -337,7 +337,7 @@ func newVRFCoordinatorV2PlusUniverse(t *testing.T, key ethkey.KeyV2, numConsumer } } -func TestVRFV2PlusIntegration_SingleConsumer_HappyPath_BatchFulfillment(t *testing.T) { +func TestUnit_VRFV2PlusIntegration_SingleConsumer_HappyPath_BatchFulfillment(t *testing.T) { t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2PlusUniverse(t, ownerKey, 1, false) @@ -390,7 +390,7 @@ func TestVRFV2PlusIntegration_SingleConsumer_HappyPath_BatchFulfillment(t *testi }) } -func TestVRFV2PlusIntegration_SingleConsumer_HappyPath_BatchFulfillment_BigGasCallback(t *testing.T) { +func TestUnit_VRFV2PlusIntegration_SingleConsumer_HappyPath_BatchFulfillment_BigGasCallback(t *testing.T) { quarantine.Flaky(t, "DX-1882") t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) @@ -444,7 +444,7 @@ func TestVRFV2PlusIntegration_SingleConsumer_HappyPath_BatchFulfillment_BigGasCa }) } -func TestVRFV2PlusIntegration_SingleConsumer_HappyPath(t *testing.T) { +func TestUnit_VRFV2PlusIntegration_SingleConsumer_HappyPath(t *testing.T) { t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2PlusUniverse(t, ownerKey, 1, false) @@ -490,7 +490,7 @@ func TestVRFV2PlusIntegration_SingleConsumer_HappyPath(t *testing.T) { }) } -func TestVRFV2PlusIntegration_SingleConsumer_EOA_Request(t *testing.T) { +func TestUnit_VRFV2PlusIntegration_SingleConsumer_EOA_Request(t *testing.T) { t.Skip("questionable value of this test") t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) @@ -506,7 +506,7 @@ func TestVRFV2PlusIntegration_SingleConsumer_EOA_Request(t *testing.T) { ) } -func TestVRFV2PlusIntegration_SingleConsumer_EOA_Request_Batching_Enabled(t *testing.T) { +func TestUnit_VRFV2PlusIntegration_SingleConsumer_EOA_Request_Batching_Enabled(t *testing.T) { t.Skip("questionable value of this test") t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) @@ -522,7 +522,7 @@ func TestVRFV2PlusIntegration_SingleConsumer_EOA_Request_Batching_Enabled(t *tes ) } -func TestVRFV2PlusIntegration_SingleConsumer_EIP150_HappyPath(t *testing.T) { +func TestUnit_VRFV2PlusIntegration_SingleConsumer_EIP150_HappyPath(t *testing.T) { t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2PlusUniverse(t, ownerKey, 1, false) @@ -537,7 +537,7 @@ func TestVRFV2PlusIntegration_SingleConsumer_EIP150_HappyPath(t *testing.T) { ) } -func TestVRFV2PlusIntegration_SingleConsumer_EIP150_Revert(t *testing.T) { +func TestUnit_VRFV2PlusIntegration_SingleConsumer_EIP150_Revert(t *testing.T) { t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2PlusUniverse(t, ownerKey, 1, false) @@ -552,7 +552,7 @@ func TestVRFV2PlusIntegration_SingleConsumer_EIP150_Revert(t *testing.T) { ) } -func TestVRFV2PlusIntegration_SingleConsumer_NeedsBlockhashStore(t *testing.T) { +func TestUnit_VRFV2PlusIntegration_SingleConsumer_NeedsBlockhashStore(t *testing.T) { t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2PlusUniverse(t, ownerKey, 2, false) @@ -590,7 +590,7 @@ func TestVRFV2PlusIntegration_SingleConsumer_NeedsBlockhashStore(t *testing.T) { }) } -func TestVRFV2PlusIntegration_SingleConsumer_BlockHeaderFeeder(t *testing.T) { +func TestUnit_VRFV2PlusIntegration_SingleConsumer_BlockHeaderFeeder(t *testing.T) { t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2PlusUniverse(t, ownerKey, 1, false) @@ -630,7 +630,7 @@ func TestVRFV2PlusIntegration_SingleConsumer_BlockHeaderFeeder(t *testing.T) { }) } -func TestVRFV2PlusIntegration_SingleConsumer_NeedsTopUp(t *testing.T) { +func TestUnit_VRFV2PlusIntegration_SingleConsumer_NeedsTopUp(t *testing.T) { t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2PlusUniverse(t, ownerKey, 1, false) @@ -674,21 +674,21 @@ func TestVRFV2PlusIntegration_SingleConsumer_NeedsTopUp(t *testing.T) { }) } -func TestVRFV2PlusIntegration_SingleConsumer_BigGasCallback_Sandwich(t *testing.T) { +func TestUnit_VRFV2PlusIntegration_SingleConsumer_BigGasCallback_Sandwich(t *testing.T) { t.Skip("fails after geth upgrade https://github.com/smartcontractkit/chainlink/pull/11809") ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2PlusUniverse(t, ownerKey, 1, false) testSingleConsumerBigGasCallbackSandwich(t, ownerKey, uni.coordinatorV2UniverseCommon, uni.batchCoordinatorContractAddress, vrfcommon.V2Plus, false) } -func TestVRFV2PlusIntegration_SingleConsumer_MultipleGasLanes(t *testing.T) { +func TestUnit_VRFV2PlusIntegration_SingleConsumer_MultipleGasLanes(t *testing.T) { t.Skip("fails after geth upgrade https://github.com/smartcontractkit/chainlink/pull/11809") ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2PlusUniverse(t, ownerKey, 1, false) testSingleConsumerMultipleGasLanes(t, ownerKey, uni.coordinatorV2UniverseCommon, uni.batchCoordinatorContractAddress, vrfcommon.V2Plus, false) } -func TestVRFV2PlusIntegration_SingleConsumer_AlwaysRevertingCallback_StillFulfilled(t *testing.T) { +func TestUnit_VRFV2PlusIntegration_SingleConsumer_AlwaysRevertingCallback_StillFulfilled(t *testing.T) { quarantine.Flaky(t, "DX-1730") ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2PlusUniverse(t, ownerKey, 0, false) @@ -703,7 +703,7 @@ func TestVRFV2PlusIntegration_SingleConsumer_AlwaysRevertingCallback_StillFulfil ) } -func TestVRFV2PlusIntegration_ConsumerProxy_HappyPath(t *testing.T) { +func TestUnit_VRFV2PlusIntegration_ConsumerProxy_HappyPath(t *testing.T) { ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2PlusUniverse(t, ownerKey, 0, false) testConsumerProxyHappyPath( @@ -716,13 +716,13 @@ func TestVRFV2PlusIntegration_ConsumerProxy_HappyPath(t *testing.T) { ) } -func TestVRFV2PlusIntegration_ConsumerProxy_CoordinatorZeroAddress(t *testing.T) { +func TestUnit_VRFV2PlusIntegration_ConsumerProxy_CoordinatorZeroAddress(t *testing.T) { ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2PlusUniverse(t, ownerKey, 0, false) testConsumerProxyCoordinatorZeroAddress(t, uni.coordinatorV2UniverseCommon) } -func TestVRFV2PlusIntegration_ExternalOwnerConsumerExample(t *testing.T) { +func TestUnit_VRFV2PlusIntegration_ExternalOwnerConsumerExample(t *testing.T) { quarantine.Flaky(t, "DX-2222") owner := evmtestutils.MustNewSimTransactor(t) random := evmtestutils.MustNewSimTransactor(t) @@ -805,7 +805,7 @@ func TestVRFV2PlusIntegration_ExternalOwnerConsumerExample(t *testing.T) { require.NoError(t, err) } -func TestVRFV2PlusIntegration_SimpleConsumerExample(t *testing.T) { +func TestUnit_VRFV2PlusIntegration_SimpleConsumerExample(t *testing.T) { owner := evmtestutils.MustNewSimTransactor(t) random := evmtestutils.MustNewSimTransactor(t) genesisData := gethtypes.GenesisAlloc{ @@ -854,7 +854,7 @@ func TestVRFV2PlusIntegration_SimpleConsumerExample(t *testing.T) { AssertLinkBalances(t, linkContract, []common.Address{owner.From, consumerAddress, coordinatorAddress}, []*big.Int{assets.Ether(1_000_000_000).ToInt(), assets.Ether(0).ToInt(), assets.Ether(0).ToInt()}) } -func TestVRFV2PlusIntegration_TestMaliciousConsumer(t *testing.T) { +func TestUnit_VRFV2PlusIntegration_TestMaliciousConsumer(t *testing.T) { t.Parallel() key := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2PlusUniverse(t, key, 1, false) @@ -868,7 +868,7 @@ func TestVRFV2PlusIntegration_TestMaliciousConsumer(t *testing.T) { ) } -func TestVRFV2PlusIntegration_RequestCost(t *testing.T) { +func TestUnit_VRFV2PlusIntegration_RequestCost(t *testing.T) { ctx := testutils.Context(t) key := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2PlusUniverse(t, key, 1, false) @@ -944,7 +944,7 @@ func TestVRFV2PlusIntegration_RequestCost(t *testing.T) { }) } -func TestVRFV2PlusIntegration_MaxConsumersCost(t *testing.T) { +func TestUnit_VRFV2PlusIntegration_MaxConsumersCost(t *testing.T) { key := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2PlusUniverse(t, key, 1, false) carol := uni.vrfConsumers[0] @@ -1024,7 +1024,7 @@ func requestAndEstimateFulfillmentCost( assert.Less(t, gasEstimate, upperBound) } -func TestVRFV2PlusIntegration_FulfillmentCost(t *testing.T) { +func TestUnit_VRFV2PlusIntegration_FulfillmentCost(t *testing.T) { ctx := testutils.Context(t) key := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2PlusUniverse(t, key, 1, false) @@ -1163,7 +1163,7 @@ func setupSubscriptionAndFund( return subID } -func TestVRFV2PlusIntegration_Migration(t *testing.T) { +func TestUnit_VRFV2PlusIntegration_Migration(t *testing.T) { t.Parallel() ctx := testutils.Context(t) ownerKey := cltest.MustGenerateRandomKey(t) @@ -1337,7 +1337,7 @@ func requestRandomnessAndValidate(t *testing.T, return requestID, rw } -func TestVRFV2PlusIntegration_CancelSubscription(t *testing.T) { +func TestUnit_VRFV2PlusIntegration_CancelSubscription(t *testing.T) { key := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2PlusUniverse(t, key, 1, false) consumer := uni.vrfConsumers[0] @@ -1372,7 +1372,7 @@ func TestVRFV2PlusIntegration_CancelSubscription(t *testing.T) { AssertNativeBalance(t, uni.backend, uni.neil.From, nativeBalanceBeforeCancel.Add(nativeBalanceBeforeCancel, nativeAmount)) } -func TestVRFV2PlusIntegration_ReplayOldRequestsOnStartUp(t *testing.T) { +func TestUnit_VRFV2PlusIntegration_ReplayOldRequestsOnStartUp(t *testing.T) { t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2PlusUniverse(t, ownerKey, 1, false) diff --git a/core/services/vrf/v2/integration_v2_reverted_txns_test.go b/core/services/vrf/v2/integration_v2_reverted_txns_test.go index 95106d1877f..e184da5531f 100644 --- a/core/services/vrf/v2/integration_v2_reverted_txns_test.go +++ b/core/services/vrf/v2/integration_v2_reverted_txns_test.go @@ -44,7 +44,7 @@ var ( batchCoordinatorV2ABI = types.MustGetABI(batch_vrf_coordinator_v2.BatchVRFCoordinatorV2ABI) ) -func TestVRFV2Integration_SingleRevertedTxn_ForceFulfillment(t *testing.T) { +func TestUnit_VRFV2Integration_SingleRevertedTxn_ForceFulfillment(t *testing.T) { t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) @@ -60,7 +60,7 @@ func TestVRFV2Integration_SingleRevertedTxn_ForceFulfillment(t *testing.T) { t.Log("Done!") } -func TestVRFV2Integration_BatchRevertedTxn_ForceFulfillment(t *testing.T) { +func TestUnit_VRFV2Integration_BatchRevertedTxn_ForceFulfillment(t *testing.T) { t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2Universe(t, ownerKey, 1) @@ -86,7 +86,7 @@ func TestVRFV2Integration_BatchRevertedTxn_ForceFulfillment(t *testing.T) { t.Log("Done!") } -func TestVRFV2Integration_ForceFulfillmentRevertedTxn_Retry(t *testing.T) { +func TestUnit_VRFV2Integration_ForceFulfillmentRevertedTxn_Retry(t *testing.T) { t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) @@ -108,7 +108,7 @@ func TestVRFV2Integration_ForceFulfillmentRevertedTxn_Retry(t *testing.T) { t.Log("Done!") } -func TestVRFV2Integration_CanceledSubForceFulfillmentRevertedTxn_Retry(t *testing.T) { +func TestUnit_VRFV2Integration_CanceledSubForceFulfillmentRevertedTxn_Retry(t *testing.T) { t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) @@ -131,7 +131,7 @@ func TestVRFV2Integration_CanceledSubForceFulfillmentRevertedTxn_Retry(t *testin t.Log("Done!") } -func TestUniqueReqById_NoPendingReceipts(t *testing.T) { +func TestUnit_UniqueReqById_NoPendingReceipts(t *testing.T) { revertedForceTxns := []v2.TxnReceiptDB{ {RequestID: common.BigToHash(big.NewInt(1)).Hex(), ForceFulfillmentAttempt: 1, EVMReceipt: types.Receipt{Status: 0}}, @@ -159,7 +159,7 @@ func TestUniqueReqById_NoPendingReceipts(t *testing.T) { } } -func TestUniqueReqById_WithPendingReceipts(t *testing.T) { +func TestUnit_UniqueReqById_WithPendingReceipts(t *testing.T) { revertedForceTxns := []v2.TxnReceiptDB{ {RequestID: common.BigToHash(big.NewInt(1)).Hex(), ForceFulfillmentAttempt: 1, EVMReceipt: types.Receipt{Status: 0}}, diff --git a/core/services/vrf/v2/integration_v2_test.go b/core/services/vrf/v2/integration_v2_test.go index 15b496550f4..ef7e7bf3a99 100644 --- a/core/services/vrf/v2/integration_v2_test.go +++ b/core/services/vrf/v2/integration_v2_test.go @@ -914,7 +914,7 @@ func checkForReceipt(t *testing.T, db *sqlx.DB, txID int64) bool { return count > 0 } -func TestVRFV2Integration_SingleConsumer_ForceFulfillment(t *testing.T) { +func TestUnit_VRFV2Integration_SingleConsumer_ForceFulfillment(t *testing.T) { quarantine.Flaky(t, "DX-1875") t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) @@ -931,7 +931,7 @@ func TestVRFV2Integration_SingleConsumer_ForceFulfillment(t *testing.T) { ) } -func TestVRFV2Integration_SingleConsumer_ForceFulfillment_BatchEnabled(t *testing.T) { +func TestUnit_VRFV2Integration_SingleConsumer_ForceFulfillment_BatchEnabled(t *testing.T) { t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2Universe(t, ownerKey, 1) @@ -947,7 +947,7 @@ func TestVRFV2Integration_SingleConsumer_ForceFulfillment_BatchEnabled(t *testin ) } -func TestVRFV2Integration_SingleConsumer_HappyPath_BatchFulfillment(t *testing.T) { +func TestUnit_VRFV2Integration_SingleConsumer_HappyPath_BatchFulfillment(t *testing.T) { t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2Universe(t, ownerKey, 1) @@ -969,7 +969,7 @@ func TestVRFV2Integration_SingleConsumer_HappyPath_BatchFulfillment(t *testing.T ) } -func TestVRFV2Integration_SingleConsumer_HappyPath_BatchFulfillment_BigGasCallback(t *testing.T) { +func TestUnit_VRFV2Integration_SingleConsumer_HappyPath_BatchFulfillment_BigGasCallback(t *testing.T) { t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2Universe(t, ownerKey, 1) @@ -991,7 +991,7 @@ func TestVRFV2Integration_SingleConsumer_HappyPath_BatchFulfillment_BigGasCallba ) } -func TestVRFV2Integration_SingleConsumer_HappyPath(t *testing.T) { +func TestUnit_VRFV2Integration_SingleConsumer_HappyPath(t *testing.T) { t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2Universe(t, ownerKey, 1) @@ -1016,7 +1016,7 @@ func TestVRFV2Integration_SingleConsumer_HappyPath(t *testing.T) { ) } -func TestVRFV2Integration_SingleConsumer_EOA_Request(t *testing.T) { +func TestUnit_VRFV2Integration_SingleConsumer_EOA_Request(t *testing.T) { t.Skip("questionable value of this test") t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) @@ -1032,7 +1032,7 @@ func TestVRFV2Integration_SingleConsumer_EOA_Request(t *testing.T) { ) } -func TestVRFV2Integration_SingleConsumer_EOA_Request_Batching_Enabled(t *testing.T) { +func TestUnit_VRFV2Integration_SingleConsumer_EOA_Request_Batching_Enabled(t *testing.T) { t.Skip("questionable value of this test") t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) @@ -1164,7 +1164,7 @@ func testEoa( t.Log("Done!") } -func TestVRFV2Integration_SingleConsumer_EIP150_HappyPath(t *testing.T) { +func TestUnit_VRFV2Integration_SingleConsumer_EIP150_HappyPath(t *testing.T) { t.Skip("TODO: VRF-617") t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) @@ -1180,7 +1180,7 @@ func TestVRFV2Integration_SingleConsumer_EIP150_HappyPath(t *testing.T) { ) } -func TestVRFV2Integration_SingleConsumer_EIP150_Revert(t *testing.T) { +func TestUnit_VRFV2Integration_SingleConsumer_EIP150_Revert(t *testing.T) { t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2Universe(t, ownerKey, 1) @@ -1216,7 +1216,7 @@ func deployWrapper(t *testing.T, uni coordinatorV2UniverseCommon, wrapperOverhea return } -func TestVRFV2Integration_SingleConsumer_Wrapper(t *testing.T) { +func TestUnit_VRFV2Integration_SingleConsumer_Wrapper(t *testing.T) { t.Parallel() ctx := testutils.Context(t) wrapperOverhead := uint32(30_000) @@ -1297,7 +1297,7 @@ func TestVRFV2Integration_SingleConsumer_Wrapper(t *testing.T) { t.Log("Done!") } -func TestVRFV2Integration_Wrapper_High_Gas(t *testing.T) { +func TestUnit_VRFV2Integration_Wrapper_High_Gas(t *testing.T) { t.Parallel() ctx := testutils.Context(t) wrapperOverhead := uint32(30_000) @@ -1380,7 +1380,7 @@ func TestVRFV2Integration_Wrapper_High_Gas(t *testing.T) { t.Log("Done!") } -func TestVRFV2Integration_SingleConsumer_NeedsBlockhashStore(t *testing.T) { +func TestUnit_VRFV2Integration_SingleConsumer_NeedsBlockhashStore(t *testing.T) { t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2Universe(t, ownerKey, 2) @@ -1400,7 +1400,7 @@ func TestVRFV2Integration_SingleConsumer_NeedsBlockhashStore(t *testing.T) { ) } -func TestVRFV2Integration_SingleConsumer_NeedsTrustedBlockhashStore(t *testing.T) { +func TestUnit_VRFV2Integration_SingleConsumer_NeedsTrustedBlockhashStore(t *testing.T) { t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2PlusUniverse(t, ownerKey, 2, true) @@ -1420,7 +1420,7 @@ func TestVRFV2Integration_SingleConsumer_NeedsTrustedBlockhashStore(t *testing.T ) } -func TestVRFV2Integration_SingleConsumer_NeedsTrustedBlockhashStore_AfterDelay(t *testing.T) { +func TestUnit_VRFV2Integration_SingleConsumer_NeedsTrustedBlockhashStore_AfterDelay(t *testing.T) { t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2PlusUniverse(t, ownerKey, 2, true) @@ -1440,7 +1440,7 @@ func TestVRFV2Integration_SingleConsumer_NeedsTrustedBlockhashStore_AfterDelay(t ) } -func TestVRFV2Integration_SingleConsumer_BlockHeaderFeeder(t *testing.T) { +func TestUnit_VRFV2Integration_SingleConsumer_BlockHeaderFeeder(t *testing.T) { t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2Universe(t, ownerKey, 1) @@ -1460,7 +1460,7 @@ func TestVRFV2Integration_SingleConsumer_BlockHeaderFeeder(t *testing.T) { ) } -func TestVRFV2Integration_SingleConsumer_NeedsTopUp(t *testing.T) { +func TestUnit_VRFV2Integration_SingleConsumer_NeedsTopUp(t *testing.T) { t.Skip("fails after geth upgrade https://github.com/smartcontractkit/chainlink/pull/11809") t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) @@ -1483,21 +1483,21 @@ func TestVRFV2Integration_SingleConsumer_NeedsTopUp(t *testing.T) { ) } -func TestVRFV2Integration_SingleConsumer_BigGasCallback_Sandwich(t *testing.T) { +func TestUnit_VRFV2Integration_SingleConsumer_BigGasCallback_Sandwich(t *testing.T) { t.Skip("fails after geth upgrade https://github.com/smartcontractkit/chainlink/pull/11809") ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2Universe(t, ownerKey, 1) testSingleConsumerBigGasCallbackSandwich(t, ownerKey, uni.coordinatorV2UniverseCommon, uni.batchCoordinatorContractAddress, vrfcommon.V2, false) } -func TestVRFV2Integration_SingleConsumer_MultipleGasLanes(t *testing.T) { +func TestUnit_VRFV2Integration_SingleConsumer_MultipleGasLanes(t *testing.T) { t.Skip("fails after geth upgrade https://github.com/smartcontractkit/chainlink/pull/11809") ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2Universe(t, ownerKey, 1) testSingleConsumerMultipleGasLanes(t, ownerKey, uni.coordinatorV2UniverseCommon, uni.batchCoordinatorContractAddress, vrfcommon.V2, false) } -func TestVRFV2Integration_SingleConsumer_AlwaysRevertingCallback_StillFulfilled(t *testing.T) { +func TestUnit_VRFV2Integration_SingleConsumer_AlwaysRevertingCallback_StillFulfilled(t *testing.T) { ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2Universe(t, ownerKey, 0) testSingleConsumerAlwaysRevertingCallbackStillFulfilled( @@ -1511,7 +1511,7 @@ func TestVRFV2Integration_SingleConsumer_AlwaysRevertingCallback_StillFulfilled( ) } -func TestVRFV2Integration_ConsumerProxy_HappyPath(t *testing.T) { +func TestUnit_VRFV2Integration_ConsumerProxy_HappyPath(t *testing.T) { ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2Universe(t, ownerKey, 0) testConsumerProxyHappyPath( @@ -1524,7 +1524,7 @@ func TestVRFV2Integration_ConsumerProxy_HappyPath(t *testing.T) { ) } -func TestVRFV2Integration_ConsumerProxy_CoordinatorZeroAddress(t *testing.T) { +func TestUnit_VRFV2Integration_ConsumerProxy_CoordinatorZeroAddress(t *testing.T) { ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2Universe(t, ownerKey, 0) testConsumerProxyCoordinatorZeroAddress(t, uni.coordinatorV2UniverseCommon) @@ -1576,7 +1576,7 @@ func registerProvingKeyHelper(t *testing.T, uni coordinatorV2UniverseCommon, coo uni.backend.Commit() } -func TestExternalOwnerConsumerExample(t *testing.T) { +func TestUnit_ExternalOwnerConsumerExample(t *testing.T) { owner := evmtestutils.MustNewSimTransactor(t) random := evmtestutils.MustNewSimTransactor(t) genesisData := gethtypes.GenesisAlloc{ @@ -1640,7 +1640,7 @@ func TestExternalOwnerConsumerExample(t *testing.T) { require.NoError(t, err) } -func TestSimpleConsumerExample(t *testing.T) { +func TestUnit_SimpleConsumerExample(t *testing.T) { owner := evmtestutils.MustNewSimTransactor(t) random := evmtestutils.MustNewSimTransactor(t) genesisData := gethtypes.GenesisAlloc{ @@ -1680,7 +1680,7 @@ func TestSimpleConsumerExample(t *testing.T) { AssertLinkBalances(t, linkContract, []common.Address{owner.From, consumerAddress, coordinatorAddress}, []*big.Int{assets.Ether(1_000_000_000).ToInt(), assets.Ether(0).ToInt(), assets.Ether(0).ToInt()}) } -func TestIntegrationVRFV2(t *testing.T) { +func TestUnit_IntegrationVRFV2(t *testing.T) { t.Parallel() ctx := testutils.Context(t) // Reconfigure the sim chain with a default gas price of 1 gwei, @@ -1881,7 +1881,7 @@ func TestIntegrationVRFV2(t *testing.T) { }, testutils.WaitTimeout(t), 1*time.Second) } -func TestMaliciousConsumer(t *testing.T) { +func TestUnit_MaliciousConsumer(t *testing.T) { t.Parallel() key := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2Universe(t, key, 1) @@ -1895,7 +1895,7 @@ func TestMaliciousConsumer(t *testing.T) { ) } -func TestRequestCost(t *testing.T) { +func TestUnit_RequestCost(t *testing.T) { ctx := testutils.Context(t) key := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2Universe(t, key, 1) @@ -1967,7 +1967,7 @@ func TestRequestCost(t *testing.T) { }) } -func TestMaxConsumersCost(t *testing.T) { +func TestUnit_MaxConsumersCost(t *testing.T) { key := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2Universe(t, key, 1) carol := uni.vrfConsumers[0] @@ -2002,7 +2002,7 @@ func TestMaxConsumersCost(t *testing.T) { assert.Less(t, estimate, uint64(100000)) } -func TestFulfillmentCost(t *testing.T) { +func TestUnit_FulfillmentCost(t *testing.T) { ctx := testutils.Context(t) key := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2Universe(t, key, 1) @@ -2105,7 +2105,7 @@ func TestFulfillmentCost(t *testing.T) { }) } -func TestStartingCountsV1(t *testing.T) { +func TestUnit_StartingCountsV1(t *testing.T) { cfg, db := heavyweight.FullTestDBNoFixturesV2(t, nil) ctx := testutils.Context(t) @@ -2304,7 +2304,7 @@ func TestStartingCountsV1(t *testing.T) { assert.Equal(t, uint64(2), countsV2[big.NewInt(0x12).String()]) } -func TestVRFV2Integration_ReplayOldRequestsOnStartUp(t *testing.T) { +func TestUnit_VRFV2Integration_ReplayOldRequestsOnStartUp(t *testing.T) { t.Parallel() ownerKey := cltest.MustGenerateRandomKey(t) uni := newVRFCoordinatorV2Universe(t, ownerKey, 1) diff --git a/core/services/vrf/v2/listener_v2_helpers_test.go b/core/services/vrf/v2/listener_v2_helpers_test.go index 20c21cbdc48..0b01e4c3cfd 100644 --- a/core/services/vrf/v2/listener_v2_helpers_test.go +++ b/core/services/vrf/v2/listener_v2_helpers_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrfcommon" ) -func TestListener_EstimateFeeJuels(t *testing.T) { +func TestUnit_Listener_EstimateFeeJuels(t *testing.T) { callbackGasLimit := uint32(150_000) maxGasPriceGwei := assets.GWei(30).ToInt() weiPerUnitLink := big.NewInt(5898160000000000) @@ -32,7 +32,7 @@ func TestListener_EstimateFeeJuels(t *testing.T) { require.Error(t, err) } -func Test_TxListDeduper(t *testing.T) { +func TestUnit_TxListDeduper(t *testing.T) { tx1 := &txmgr.Tx{ ID: 1, Value: *big.NewInt(0), diff --git a/core/services/vrf/v2/listener_v2_log_listener_test.go b/core/services/vrf/v2/listener_v2_log_listener_test.go index 03cd2ce0275..305417f4ef8 100644 --- a/core/services/vrf/v2/listener_v2_log_listener_test.go +++ b/core/services/vrf/v2/listener_v2_log_listener_test.go @@ -196,7 +196,7 @@ func setupVRFLogPollerListenerTH(t *testing.T) *vrfLogPollerListenerTH { * TestInitProcessedBlock_UnfulfilledNFulfilledVRFReqs */ -func TestInitProcessedBlock_NoVRFReqs(t *testing.T) { +func TestUnit_InitProcessedBlock_NoVRFReqs(t *testing.T) { t.Skip("fails after geth upgrade https://github.com/smartcontractkit/chainlink/pull/11809") t.Parallel() ctx := t.Context() @@ -237,7 +237,7 @@ func TestInitProcessedBlock_NoVRFReqs(t *testing.T) { require.Equal(t, int64(6), lastProcessedBlock) } -func TestLogPollerFilterRegistered(t *testing.T) { +func TestIntegration_Shared_LogPollerFilterRegistered(t *testing.T) { t.Parallel() // Instantiate listener. th := setupVRFLogPollerListenerTH(t) @@ -265,7 +265,7 @@ func TestLogPollerFilterRegistered(t *testing.T) { assert.False(t, ok) } -func TestInitProcessedBlock_NoUnfulfilledVRFReqs(t *testing.T) { +func TestUnit_InitProcessedBlock_NoUnfulfilledVRFReqs(t *testing.T) { t.Skip("fails after geth upgrade https://github.com/smartcontractkit/chainlink/pull/11809") t.Parallel() ctx := t.Context() @@ -320,7 +320,7 @@ func TestInitProcessedBlock_NoUnfulfilledVRFReqs(t *testing.T) { require.Equal(t, int64(8), lastProcessedBlock) } -func TestInitProcessedBlock_OneUnfulfilledVRFReq(t *testing.T) { +func TestUnit_InitProcessedBlock_OneUnfulfilledVRFReq(t *testing.T) { t.Skip("fails after geth upgrade https://github.com/smartcontractkit/chainlink/pull/11809") t.Parallel() ctx := t.Context() @@ -372,7 +372,7 @@ func TestInitProcessedBlock_OneUnfulfilledVRFReq(t *testing.T) { require.Equal(t, int64(5), lastProcessedBlock) } -func TestInitProcessedBlock_SomeUnfulfilledVRFReqs(t *testing.T) { +func TestUnit_InitProcessedBlock_SomeUnfulfilledVRFReqs(t *testing.T) { t.Skip("fails after geth upgrade https://github.com/smartcontractkit/chainlink/pull/11809") t.Parallel() ctx := t.Context() @@ -432,7 +432,7 @@ func TestInitProcessedBlock_SomeUnfulfilledVRFReqs(t *testing.T) { require.Equal(t, int64(6), lastProcessedBlock) } -func TestInitProcessedBlock_UnfulfilledNFulfilledVRFReqs(t *testing.T) { +func TestUnit_InitProcessedBlock_UnfulfilledNFulfilledVRFReqs(t *testing.T) { t.Skip("fails after geth upgrade https://github.com/smartcontractkit/chainlink/pull/11809") t.Parallel() ctx := t.Context() @@ -506,7 +506,7 @@ func TestInitProcessedBlock_UnfulfilledNFulfilledVRFReqs(t *testing.T) { * TestUpdateLastProcessedBlock_UnfulfilledNFulfilledVRFReqs */ -func TestUpdateLastProcessedBlock_NoVRFReqs(t *testing.T) { +func TestUnit_UpdateLastProcessedBlock_NoVRFReqs(t *testing.T) { t.Skip("fails after geth upgrade https://github.com/smartcontractkit/chainlink/pull/11809") t.Parallel() ctx := t.Context() @@ -562,7 +562,7 @@ func TestUpdateLastProcessedBlock_NoVRFReqs(t *testing.T) { require.Equal(t, int64(8), lastProcessedBlock) } -func TestUpdateLastProcessedBlock_NoUnfulfilledVRFReqs(t *testing.T) { +func TestUnit_UpdateLastProcessedBlock_NoUnfulfilledVRFReqs(t *testing.T) { t.Skip("fails after geth upgrade https://github.com/smartcontractkit/chainlink/pull/11809") t.Parallel() ctx := t.Context() @@ -616,7 +616,7 @@ func TestUpdateLastProcessedBlock_NoUnfulfilledVRFReqs(t *testing.T) { require.Equal(t, int64(8), lastProcessedBlock) } -func TestUpdateLastProcessedBlock_OneUnfulfilledVRFReq(t *testing.T) { +func TestUnit_UpdateLastProcessedBlock_OneUnfulfilledVRFReq(t *testing.T) { t.Skip("fails after geth upgrade https://github.com/smartcontractkit/chainlink/pull/11809") t.Parallel() ctx := t.Context() @@ -666,7 +666,7 @@ func TestUpdateLastProcessedBlock_OneUnfulfilledVRFReq(t *testing.T) { require.Equal(t, int64(5), lastProcessedBlock) } -func TestUpdateLastProcessedBlock_SomeUnfulfilledVRFReqs(t *testing.T) { +func TestUnit_UpdateLastProcessedBlock_SomeUnfulfilledVRFReqs(t *testing.T) { t.Skip("fails after geth upgrade https://github.com/smartcontractkit/chainlink/pull/11809") t.Parallel() ctx := t.Context() @@ -722,7 +722,7 @@ func TestUpdateLastProcessedBlock_SomeUnfulfilledVRFReqs(t *testing.T) { require.Equal(t, int64(6), lastProcessedBlock) } -func TestUpdateLastProcessedBlock_UnfulfilledNFulfilledVRFReqs(t *testing.T) { +func TestUnit_UpdateLastProcessedBlock_UnfulfilledNFulfilledVRFReqs(t *testing.T) { t.Skip("fails after geth upgrade https://github.com/smartcontractkit/chainlink/pull/11809") t.Parallel() ctx := t.Context() @@ -827,7 +827,7 @@ func SetupGetUnfulfilledTH(t *testing.T) (*listenerV2, *ubig.Big) { return listener, chainID } -func TestGetUnfulfilled_NoVRFReqs(t *testing.T) { +func TestIntegration_Shared_GetUnfulfilled_NoVRFReqs(t *testing.T) { t.Parallel() listener, chainID := SetupGetUnfulfilledTH(t) @@ -856,7 +856,7 @@ func TestGetUnfulfilled_NoVRFReqs(t *testing.T) { require.Empty(t, fulfilled) } -func TestGetUnfulfilled_NoUnfulfilledVRFReqs(t *testing.T) { +func TestIntegration_Shared_GetUnfulfilled_NoUnfulfilledVRFReqs(t *testing.T) { t.Parallel() listener, chainID := SetupGetUnfulfilledTH(t) @@ -914,7 +914,7 @@ func TestGetUnfulfilled_NoUnfulfilledVRFReqs(t *testing.T) { require.Len(t, fulfilled, 5) } -func TestGetUnfulfilled_OneUnfulfilledVRFReq(t *testing.T) { +func TestIntegration_Shared_GetUnfulfilled_OneUnfulfilledVRFReq(t *testing.T) { t.Parallel() listener, chainID := SetupGetUnfulfilledTH(t) @@ -955,7 +955,7 @@ func TestGetUnfulfilled_OneUnfulfilledVRFReq(t *testing.T) { require.Empty(t, fulfilled) } -func TestGetUnfulfilled_SomeUnfulfilledVRFReq(t *testing.T) { +func TestIntegration_Shared_GetUnfulfilled_SomeUnfulfilledVRFReq(t *testing.T) { t.Parallel() listener, chainID := SetupGetUnfulfilledTH(t) @@ -1002,7 +1002,7 @@ func TestGetUnfulfilled_SomeUnfulfilledVRFReq(t *testing.T) { require.Len(t, unfulfilled, len(expected)) } -func TestGetUnfulfilled_UnfulfilledNFulfilledVRFReqs(t *testing.T) { +func TestIntegration_Shared_GetUnfulfilled_UnfulfilledNFulfilledVRFReqs(t *testing.T) { t.Parallel() listener, chainID := SetupGetUnfulfilledTH(t) diff --git a/core/services/vrf/v2/listener_v2_test.go b/core/services/vrf/v2/listener_v2_test.go index 0e067cbadbf..21b0ae30037 100644 --- a/core/services/vrf/v2/listener_v2_test.go +++ b/core/services/vrf/v2/listener_v2_test.go @@ -252,11 +252,11 @@ func testMaybeSubtractReservedLink(t *testing.T, vrfVersion vrfcommon.Version) { require.Equal(t, "70000", start.String()) } -func TestMaybeSubtractReservedLinkV2(t *testing.T) { +func TestIntegration_Shared_MaybeSubtractReservedLinkV2(t *testing.T) { testMaybeSubtractReservedLink(t, vrfcommon.V2) } -func TestMaybeSubtractReservedLinkV2Plus(t *testing.T) { +func TestIntegration_Shared_MaybeSubtractReservedLinkV2Plus(t *testing.T) { testMaybeSubtractReservedLink(t, vrfcommon.V2Plus) } @@ -333,11 +333,11 @@ func testMaybeSubtractReservedNative(t *testing.T, vrfVersion vrfcommon.Version) require.Equal(t, "70000", start.String()) } -func TestMaybeSubtractReservedNativeV2Plus(t *testing.T) { +func TestIntegration_Shared_MaybeSubtractReservedNativeV2Plus(t *testing.T) { testMaybeSubtractReservedNative(t, vrfcommon.V2Plus) } -func TestMaybeSubtractReservedNativeV2(t *testing.T) { +func TestUnit_MaybeSubtractReservedNativeV2(t *testing.T) { ctx := testutils.Context(t) db := pgtest.NewSqlxDB(t) lggr := logger.TestLogger(t) @@ -365,7 +365,7 @@ func TestMaybeSubtractReservedNativeV2(t *testing.T) { assert.Equal(t, big.NewInt(0), start) } -func TestListener_GetConfirmedAt(t *testing.T) { +func TestUnit_Listener_GetConfirmedAt(t *testing.T) { j, err := vrfcommon.ValidatedVRFSpec(testspecs.GenerateVRFSpec(testspecs.VRFSpecParams{ RequestedConfsDelay: 10, }).Toml()) @@ -405,7 +405,7 @@ func TestListener_GetConfirmedAt(t *testing.T) { require.Equal(t, uint64(200), confirmedAt) // log block number + # of confirmations } -func TestListener_Backoff(t *testing.T) { +func TestUnit_Listener_Backoff(t *testing.T) { var tests = []struct { name string initial time.Duration diff --git a/core/services/vrf/v2/listener_v2_types_test.go b/core/services/vrf/v2/listener_v2_types_test.go index a60a92f8edd..c42727a90f0 100644 --- a/core/services/vrf/v2/listener_v2_types_test.go +++ b/core/services/vrf/v2/listener_v2_types_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrfcommon" ) -func Test_BatchFulfillments_AddRun(t *testing.T) { +func TestUnit_BatchFulfillments_AddRun(t *testing.T) { batchLimit := uint32(2500) bfs := newBatchFulfillments(batchLimit, vrfcommon.V2) fromAddress := testutils.NewAddress() @@ -53,7 +53,7 @@ func Test_BatchFulfillments_AddRun(t *testing.T) { require.Len(t, bfs.fulfillments, 2) } -func Test_BatchFulfillments_AddRun_V2Plus(t *testing.T) { +func TestUnit_BatchFulfillments_AddRun_V2Plus(t *testing.T) { batchLimit := uint32(2500) bfs := newBatchFulfillments(batchLimit, vrfcommon.V2Plus) fromAddress := testutils.NewAddress() diff --git a/core/services/vrf/vrfcommon/log_dedupe_test.go b/core/services/vrf/vrfcommon/log_dedupe_test.go index f606b95e2a4..033fb12c629 100644 --- a/core/services/vrf/vrfcommon/log_dedupe_test.go +++ b/core/services/vrf/vrfcommon/log_dedupe_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestLogDeduper(t *testing.T) { +func TestUnit_LogDeduper(t *testing.T) { tests := []struct { name string logs []types.Log diff --git a/core/services/vrf/vrfcommon/validate_test.go b/core/services/vrf/vrfcommon/validate_test.go index 5afa182bee1..ec5913dbb63 100644 --- a/core/services/vrf/vrfcommon/validate_test.go +++ b/core/services/vrf/vrfcommon/validate_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/job" ) -func TestValidateVRFJobSpec(t *testing.T) { +func TestUnit_ValidateVRFJobSpec(t *testing.T) { var tt = []struct { name string toml string diff --git a/core/services/webhook/authorizer_test.go b/core/services/webhook/authorizer_test.go index 202791c26c2..51f1068e65a 100644 --- a/core/services/webhook/authorizer_test.go +++ b/core/services/webhook/authorizer_test.go @@ -23,7 +23,7 @@ type eiDisabledCfg struct{} func (eiDisabledCfg) ExternalInitiatorsEnabled() bool { return false } -func Test_Authorizer(t *testing.T) { +func TestUnit_Authorizer(t *testing.T) { db := pgtest.NewSqlxDB(t) borm := bridges.NewORM(db) diff --git a/core/services/webhook/delegate_test.go b/core/services/webhook/delegate_test.go index 7901a394d95..44d33d7ea6f 100644 --- a/core/services/webhook/delegate_test.go +++ b/core/services/webhook/delegate_test.go @@ -21,7 +21,7 @@ import ( webhookmocks "github.com/smartcontractkit/chainlink/v2/core/services/webhook/mocks" ) -func TestWebhookDelegate(t *testing.T) { +func TestUnit_WebhookDelegate(t *testing.T) { ctx := testutils.Context(t) var ( spec = &job.Job{ diff --git a/core/services/webhook/external_initiator_manager_test.go b/core/services/webhook/external_initiator_manager_test.go index a866e137aef..71760576444 100644 --- a/core/services/webhook/external_initiator_manager_test.go +++ b/core/services/webhook/external_initiator_manager_test.go @@ -21,7 +21,7 @@ import ( webhookmocks "github.com/smartcontractkit/chainlink/v2/core/services/webhook/mocks" ) -func Test_ExternalInitiatorManager_Load(t *testing.T) { +func TestUnit_ExternalInitiatorManager_Load(t *testing.T) { ctx := testutils.Context(t) db := pgtest.NewSqlxDB(t) borm := bridges.NewORM(db) @@ -57,7 +57,7 @@ func Test_ExternalInitiatorManager_Load(t *testing.T) { assert.Equal(t, jb2.ExternalJobID, jobID) } -func Test_ExternalInitiatorManager_Notify(t *testing.T) { +func TestUnit_ExternalInitiatorManager_Notify(t *testing.T) { ctx := t.Context() db := pgtest.NewSqlxDB(t) borm := bridges.NewORM(db) @@ -96,7 +96,7 @@ func Test_ExternalInitiatorManager_Notify(t *testing.T) { require.NoError(t, eim.Notify(ctx, webhookSpecTwoEIs.ID)) } -func Test_ExternalInitiatorManager_DeleteJob(t *testing.T) { +func TestUnit_ExternalInitiatorManager_DeleteJob(t *testing.T) { ctx := testutils.Context(t) db := pgtest.NewSqlxDB(t) borm := bridges.NewORM(db) diff --git a/core/services/webhook/validate_test.go b/core/services/webhook/validate_test.go index 4f5cd03a0e6..d0be66fa9b2 100644 --- a/core/services/webhook/validate_test.go +++ b/core/services/webhook/validate_test.go @@ -16,7 +16,7 @@ import ( webhookmocks "github.com/smartcontractkit/chainlink/v2/core/services/webhook/mocks" ) -func TestValidatedWebJobSpec(t *testing.T) { +func TestUnit_ValidatedWebJobSpec(t *testing.T) { t.Parallel() var tt = []struct { name string diff --git a/core/services/workflows/artifacts/orm_test.go b/core/services/workflows/artifacts/orm_test.go index ecba9cad1fc..74ae06a807d 100644 --- a/core/services/workflows/artifacts/orm_test.go +++ b/core/services/workflows/artifacts/orm_test.go @@ -18,7 +18,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestWorkflowArtifactsORM_GetAndUpdate(t *testing.T) { +func TestUnit_WorkflowArtifactsORM_GetAndUpdate(t *testing.T) { db := pgtest.NewSqlxDB(t) ctx := testutils.Context(t) lggr := logger.TestLogger(t) @@ -57,7 +57,7 @@ func TestWorkflowArtifactsORM_GetAndUpdate(t *testing.T) { assert.Equal(t, "new contents", contents) } -func Test_UpsertWorkflowSpec(t *testing.T) { +func TestUnit_UpsertWorkflowSpec(t *testing.T) { db := pgtest.NewSqlxDB(t) ctx := testutils.Context(t) lggr := logger.TestLogger(t) @@ -119,7 +119,7 @@ func Test_UpsertWorkflowSpec(t *testing.T) { }) } -func Test_DeleteWorkflowSpec(t *testing.T) { +func TestUnit_DeleteWorkflowSpec(t *testing.T) { db := pgtest.NewSqlxDB(t) ctx := testutils.Context(t) lggr := logger.TestLogger(t) @@ -160,7 +160,7 @@ func Test_DeleteWorkflowSpec(t *testing.T) { }) } -func Test_GetWorkflowSpec(t *testing.T) { +func TestUnit_GetWorkflowSpec(t *testing.T) { db := pgtest.NewSqlxDB(t) ctx := testutils.Context(t) lggr := logger.TestLogger(t) @@ -199,7 +199,7 @@ func Test_GetWorkflowSpec(t *testing.T) { }) } -func Test_GetWorkflowSpecByID(t *testing.T) { +func TestUnit_GetWorkflowSpecByID(t *testing.T) { db := pgtest.NewSqlxDB(t) ctx := testutils.Context(t) lggr := logger.TestLogger(t) @@ -238,7 +238,7 @@ func Test_GetWorkflowSpecByID(t *testing.T) { }) } -func Test_GetContentsByWorkflowID(t *testing.T) { +func TestUnit_GetContentsByWorkflowID(t *testing.T) { db := pgtest.NewSqlxDB(t) ctx := testutils.Context(t) lggr := logger.TestLogger(t) @@ -298,7 +298,7 @@ func Test_GetContentsByWorkflowID(t *testing.T) { assert.Equal(t, giveContent, gotContent) } -func Test_GetContentsByWorkflowID_SecretsProvidedButEmpty(t *testing.T) { +func TestUnit_GetContentsByWorkflowID_SecretsProvidedButEmpty(t *testing.T) { db := pgtest.NewSqlxDB(t) ctx := testutils.Context(t) lggr := logger.TestLogger(t) @@ -332,7 +332,7 @@ func Test_GetContentsByWorkflowID_SecretsProvidedButEmpty(t *testing.T) { require.ErrorIs(t, err, ErrEmptySecrets) } -func Test_UpsertWorkflowSpecWithSecrets(t *testing.T) { +func TestUnit_UpsertWorkflowSpecWithSecrets(t *testing.T) { db := pgtest.NewSqlxDB(t) ctx := testutils.Context(t) lggr := logger.TestLogger(t) diff --git a/core/services/workflows/artifacts/store_test.go b/core/services/workflows/artifacts/store_test.go index 06d94bdd4fa..26727dcf6fa 100644 --- a/core/services/workflows/artifacts/store_test.go +++ b/core/services/workflows/artifacts/store_test.go @@ -26,7 +26,7 @@ import ( "github.com/stretchr/testify/require" ) -func Test_Handler_SecretsFor(t *testing.T) { +func TestUnit_Handler_SecretsFor(t *testing.T) { lggr := logger.TestLogger(t) db := pgtest.NewSqlxDB(t) orm := &orm{ds: db, lggr: lggr} @@ -86,7 +86,7 @@ func Test_Handler_SecretsFor(t *testing.T) { assert.Equal(t, expectedSecrets, gotSecrets) } -func Test_Handler_SecretsFor_RefreshesSecrets(t *testing.T) { +func TestUnit_Handler_SecretsFor_RefreshesSecrets(t *testing.T) { lggr := logger.TestLogger(t) db := pgtest.NewSqlxDB(t) orm := &orm{ds: db, lggr: lggr} @@ -151,7 +151,7 @@ func Test_Handler_SecretsFor_RefreshesSecrets(t *testing.T) { assert.Equal(t, expectedSecrets, gotSecrets) } -func Test_Handler_SecretsFor_RefreshLogic(t *testing.T) { +func TestUnit_Handler_SecretsFor_RefreshLogic(t *testing.T) { lggr := logger.TestLogger(t) db := pgtest.NewSqlxDB(t) orm := &orm{ds: db, lggr: lggr} diff --git a/core/services/workflows/artifacts/v2/orm_test.go b/core/services/workflows/artifacts/v2/orm_test.go index 9be9309d98a..81b19b1da9c 100644 --- a/core/services/workflows/artifacts/v2/orm_test.go +++ b/core/services/workflows/artifacts/v2/orm_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/require" ) -func Test_UpsertWorkflowSpec(t *testing.T) { +func TestIntegration_Shared_UpsertWorkflowSpec(t *testing.T) { t.Run("inserts new spec", func(t *testing.T) { db := pgtest.NewSqlxDB(t) ctx := testutils.Context(t) @@ -131,7 +131,7 @@ func Test_UpsertWorkflowSpec(t *testing.T) { }) } -func Test_DeleteWorkflowSpec(t *testing.T) { +func TestIntegration_Shared_DeleteWorkflowSpec(t *testing.T) { t.Run("deletes a workflow spec by ID", func(t *testing.T) { db := pgtest.NewSqlxDB(t) ctx := testutils.Context(t) @@ -178,7 +178,7 @@ func Test_DeleteWorkflowSpec(t *testing.T) { }) } -func Test_GetWorkflowSpec(t *testing.T) { +func TestIntegration_Shared_GetWorkflowSpec(t *testing.T) { t.Run("gets a workflow spec by ID", func(t *testing.T) { db := pgtest.NewSqlxDB(t) ctx := testutils.Context(t) diff --git a/core/services/workflows/artifacts/v2/store_test.go b/core/services/workflows/artifacts/v2/store_test.go index fbbfa0c1f96..1474a230351 100644 --- a/core/services/workflows/artifacts/v2/store_test.go +++ b/core/services/workflows/artifacts/v2/store_test.go @@ -42,7 +42,7 @@ func (m *mockFetcher) RetrieveURL(ctx context.Context, req *storage_service.Down return string(m.responseMap[req.Id+"-"+req.Type.String()].Body), m.responseMap[req.Id+"-"+req.Type.String()].Err } -func Test_Store_DeleteWorkflowArtifacts(t *testing.T) { +func TestUnit_Store_DeleteWorkflowArtifacts(t *testing.T) { lggr := logger.TestLogger(t) db := pgtest.NewSqlxDB(t) orm := &orm{ds: db, lggr: lggr} @@ -93,7 +93,7 @@ func Test_Store_DeleteWorkflowArtifacts(t *testing.T) { require.ErrorIs(t, err, sql.ErrNoRows) } -func Test_Store_FetchWorkflowArtifacts_WithStorage(t *testing.T) { +func TestUnit_Store_FetchWorkflowArtifacts_WithStorage(t *testing.T) { lggr := logger.TestLogger(t) db := pgtest.NewSqlxDB(t) orm := &orm{ds: db, lggr: lggr} @@ -140,7 +140,7 @@ func Test_Store_FetchWorkflowArtifacts_WithStorage(t *testing.T) { require.Equal(t, []byte(configData), config) } -func Test_Store_FetchWorkflowArtifacts_WithoutStorage(t *testing.T) { +func TestUnit_Store_FetchWorkflowArtifacts_WithoutStorage(t *testing.T) { lggr := logger.TestLogger(t) db := pgtest.NewSqlxDB(t) orm := &orm{ds: db, lggr: lggr} @@ -183,7 +183,7 @@ func Test_Store_FetchWorkflowArtifacts_WithoutStorage(t *testing.T) { require.Equal(t, []byte(configData), config) } -func Test_Store_FetchWorkflowArtifacts_SkipsRetrieving(t *testing.T) { +func TestUnit_Store_FetchWorkflowArtifacts_SkipsRetrieving(t *testing.T) { lggr := logger.TestLogger(t) db := pgtest.NewSqlxDB(t) orm := &orm{ds: db, lggr: lggr} diff --git a/core/services/workflows/cmd/cre/examples/compile_test.go b/core/services/workflows/cmd/cre/examples/compile_test.go index cc1abb934bd..88f0f7405b5 100644 --- a/core/services/workflows/cmd/cre/examples/compile_test.go +++ b/core/services/workflows/cmd/cre/examples/compile_test.go @@ -11,7 +11,7 @@ import ( const pathPrefix = "core/services/workflows/cmd/cre/examples" -func Test_AllExampleWorkflowsCompileToWASM(t *testing.T) { +func TestUnit_AllExampleWorkflowsCompileToWASM(t *testing.T) { paths := []string{ "legacy/data_feeds", "v2/http_read", diff --git a/core/services/workflows/cmd/cre/utils/runner_test.go b/core/services/workflows/cmd/cre/utils/runner_test.go index 37aa21eb08f..7e3f44922cb 100644 --- a/core/services/workflows/cmd/cre/utils/runner_test.go +++ b/core/services/workflows/cmd/cre/utils/runner_test.go @@ -15,7 +15,7 @@ import ( v2 "github.com/smartcontractkit/chainlink/v2/core/services/workflows/v2" ) -func TestRunner(t *testing.T) { +func TestUnit_Runner(t *testing.T) { t.Parallel() t.Run("happy path with an empty workflow", func(t *testing.T) { diff --git a/core/services/workflows/delegate_test.go b/core/services/workflows/delegate_test.go index 0fb1b3d0df8..5fcf491fd1f 100644 --- a/core/services/workflows/delegate_test.go +++ b/core/services/workflows/delegate_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/testdata/testspecs" ) -func TestDelegate_JobSpecValidator(t *testing.T) { +func TestUnit_Delegate_JobSpecValidator(t *testing.T) { t.Parallel() var tt = []struct { name string diff --git a/core/services/workflows/engine_test.go b/core/services/workflows/engine_test.go index 29fd238baf6..0691bae2504 100644 --- a/core/services/workflows/engine_test.go +++ b/core/services/workflows/engine_test.go @@ -365,7 +365,7 @@ func (m *mockTriggerCapability) UnregisterTrigger(ctx context.Context, req capab return nil } -func TestEngine_Metering_ValidBillingClient(t *testing.T) { +func TestUnit_Engine_Metering_ValidBillingClient(t *testing.T) { t.Parallel() const meteringSimpleWorkflow = ` @@ -688,7 +688,7 @@ targets: }) } -func TestEngineWithHardcodedWorkflow(t *testing.T) { +func TestUnit_EngineWithHardcodedWorkflow(t *testing.T) { ctx := testutils.Context(t) reg := coreCap.NewRegistry(logger.TestLogger(t)) beholderTester := tests.Beholder(t) @@ -859,7 +859,7 @@ func (m *mc) UnregisterFromWorkflow(ctx context.Context, request capabilities.Un return nil } -func TestEngine_WriteStepHasZeroStepTimeout(t *testing.T) { +func TestUnit_Engine_WriteStepHasZeroStepTimeout(t *testing.T) { cmd := "core/services/workflows/test/zerotimeout/cmd" ctx := t.Context() @@ -1064,7 +1064,7 @@ func mockTarget(id string) *mockCapability { ) } -func TestEngine_RateLimit(t *testing.T) { +func TestUnit_Engine_RateLimit(t *testing.T) { lggr := logger.TestLogger(t) t.Run("per user rate limit", func(t *testing.T) { ctx := testutils.Context(t) @@ -1351,7 +1351,7 @@ func TestEngine_RateLimit(t *testing.T) { }) } -func TestEngine_ErrorsTheWorkflowIfAStepErrors(t *testing.T) { +func TestUnit_Engine_ErrorsTheWorkflowIfAStepErrors(t *testing.T) { t.Parallel() ctx := testutils.Context(t) reg := coreCap.NewRegistry(logger.TestLogger(t)) @@ -1375,7 +1375,7 @@ func TestEngine_ErrorsTheWorkflowIfAStepErrors(t *testing.T) { assert.Equal(t, store.StatusErrored, state.Steps["evm_median"].Status) } -func TestEngine_GracefulEarlyTermination(t *testing.T) { +func TestUnit_Engine_GracefulEarlyTermination(t *testing.T) { t.Parallel() ctx := testutils.Context(t) reg := coreCap.NewRegistry(logger.TestLogger(t)) @@ -1465,7 +1465,7 @@ func mockAction(t *testing.T) (*mockCapability, values.Value) { ), outputs } -func TestEngine_MultiStepDependencies(t *testing.T) { +func TestUnit_Engine_MultiStepDependencies(t *testing.T) { t.Parallel() ctx := testutils.Context(t) reg := coreCap.NewRegistry(logger.TestLogger(t)) @@ -1552,7 +1552,7 @@ targets: ` ) -func TestEngine_WrapsTargets(t *testing.T) { +func TestUnit_Engine_WrapsTargets(t *testing.T) { t.Parallel() ctx := testutils.Context(t) reg := coreCap.NewRegistry(logger.TestLogger(t)) @@ -1598,7 +1598,7 @@ func TestEngine_WrapsTargets(t *testing.T) { require.NoError(t, err) } -func TestEngine_GetsNodeInfoDuringInitialization(t *testing.T) { +func TestUnit_Engine_GetsNodeInfoDuringInitialization(t *testing.T) { t.Parallel() ctx := testutils.Context(t) reg := coreCap.NewRegistry(logger.TestLogger(t)) @@ -1691,7 +1691,7 @@ targets: abi: "receive(report bytes)" ` -func TestEngine_PassthroughInterpolation(t *testing.T) { +func TestUnit_Engine_PassthroughInterpolation(t *testing.T) { ctx := testutils.Context(t) reg := coreCap.NewRegistry(logger.TestLogger(t)) @@ -1739,7 +1739,7 @@ func TestEngine_PassthroughInterpolation(t *testing.T) { assert.Equal(t, gotInputs, gotOutputs) } -func TestEngine_Error(t *testing.T) { +func TestUnit_Engine_Error(t *testing.T) { err := errors.New("some error") tests := []struct { name string @@ -1806,7 +1806,7 @@ func TestEngine_Error(t *testing.T) { } } -func TestEngine_MergesWorkflowConfigAndCRConfig(t *testing.T) { +func TestUnit_Engine_MergesWorkflowConfigAndCRConfig(t *testing.T) { var ( ctx = testutils.Context(t) writeID = "write_polygon-testnet-mumbai@1.0.0" @@ -1935,7 +1935,7 @@ targets: // TestEngine_MergesWorkflowConfigAndCRConfig_CRConfigPrecedence tests that the engine merges the // workflow config with the CR config correctly, with the CR config taking precedence. -func TestEngine_MergesWorkflowConfigAndCRConfig_CRConfigPrecedence(t *testing.T) { +func TestUnit_Engine_MergesWorkflowConfigAndCRConfig_CRConfigPrecedence(t *testing.T) { var ( ctx = testutils.Context(t) actionID = "custom-compute@1.0.0" @@ -2017,7 +2017,7 @@ func TestEngine_MergesWorkflowConfigAndCRConfig_CRConfigPrecedence(t *testing.T) assert.Equalf(t, registryConfig["tickInterval"], m.(map[string]any)["tickInterval"], "tickInterval should be %s", registryConfig["tickInterval"]) } -func TestEngine_HandlesNilConfigOnchain(t *testing.T) { +func TestUnit_Engine_HandlesNilConfigOnchain(t *testing.T) { ctx := testutils.Context(t) reg := coreCap.NewRegistry(logger.TestLogger(t)) @@ -2068,7 +2068,7 @@ func TestEngine_HandlesNilConfigOnchain(t *testing.T) { assert.Len(t, m.(map[string]any), 3) } -func TestEngine_MultiBranchExecution(t *testing.T) { +func TestUnit_Engine_MultiBranchExecution(t *testing.T) { // This workflow describes 2 branches in the workflow graph. // A -> B -> C // A -> D -> E @@ -2185,7 +2185,7 @@ func basicTestTrigger(t *testing.T) *mockTriggerCapability { return mt } -func TestEngine_WithCustomComputeStep(t *testing.T) { +func TestUnit_Engine_WithCustomComputeStep(t *testing.T) { cmd := "core/services/workflows/test/wasm/legacy/cmd" ctx := testutils.Context(t) @@ -2260,7 +2260,7 @@ func TestEngine_WithCustomComputeStep(t *testing.T) { assert.True(t, res.Outputs.(*values.Map).Underlying["Value"].(*values.Bool).Underlying) } -func TestEngine_CustomComputePropagatesBreaks(t *testing.T) { +func TestUnit_Engine_CustomComputePropagatesBreaks(t *testing.T) { cmd := "core/services/workflows/test/break/cmd" ctx := testutils.Context(t) @@ -2380,7 +2380,7 @@ targets: abi: "receive(report bytes)" ` -func TestEngine_FetchesSecrets(t *testing.T) { +func TestUnit_Engine_FetchesSecrets(t *testing.T) { ctx := testutils.Context(t) reg := coreCap.NewRegistry(logger.TestLogger(t)) @@ -2445,7 +2445,7 @@ func TestEngine_FetchesSecrets(t *testing.T) { }) } -func TestEngine_CloseHappensOnlyIfWorkflowHasBeenRegistered(t *testing.T) { +func TestUnit_Engine_CloseHappensOnlyIfWorkflowHasBeenRegistered(t *testing.T) { ctx := testutils.Context(t) reg := coreCap.NewRegistry(logger.TestLogger(t)) @@ -2495,7 +2495,7 @@ func TestEngine_CloseHappensOnlyIfWorkflowHasBeenRegistered(t *testing.T) { require.NoError(t, err) } -func TestEngine_CloseUnregisterFails_NotFound(t *testing.T) { +func TestUnit_Engine_CloseUnregisterFails_NotFound(t *testing.T) { ctx := testutils.Context(t) reg := coreCap.NewRegistry(logger.TestLogger(t)) @@ -2575,7 +2575,7 @@ func (t mockRuntimeTrigger) UnregisterTrigger(ctx context.Context, request capab return args.Error(0) } -func TestMerge(t *testing.T) { +func TestUnit_Merge(t *testing.T) { tests := []struct { name string baseConfig map[string]any @@ -2660,7 +2660,7 @@ func TestMerge(t *testing.T) { // Test_stepUpdateManager ensures that the manager is concurrency safe by sending concurrent // requests to send and remove a given execution ID. -func Test_stepUpdateManager(t *testing.T) { +func TestUnit_stepUpdateManager(t *testing.T) { var ( wg sync.WaitGroup ctx = testutils.Context(t) @@ -2709,7 +2709,7 @@ func Test_stepUpdateManager(t *testing.T) { wg.Wait() } -func TestEngine_ConcurrentExecutions(t *testing.T) { +func TestUnit_Engine_ConcurrentExecutions(t *testing.T) { tests.SkipFlakey(t, "https://smartcontract-it.atlassian.net/browse/DX-397") ctx := testutils.Context(t) @@ -2769,7 +2769,7 @@ func TestEngine_ConcurrentExecutions(t *testing.T) { assert.Equal(t, 1, beholderTester.Len(t, platform.KeyWorkflowExecutionID, eid2)) } -func TestEngine_WorkflowRegistry_BillingClientCalls(t *testing.T) { +func TestUnit_Engine_WorkflowRegistry_BillingClientCalls(t *testing.T) { t.Parallel() const testWorkflow = ` diff --git a/core/services/workflows/events/emit_test.go b/core/services/workflows/events/emit_test.go index 883572ea748..99085907139 100644 --- a/core/services/workflows/events/emit_test.go +++ b/core/services/workflows/events/emit_test.go @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/workflows/events" ) -func TestEmit(t *testing.T) { +func TestUnit_Emit(t *testing.T) { // t.Parallel() // TODO: the beholder tester uses t.SetEnv and cannot use t.Parallel triggerID := "trigger_" + uuid.NewString() executionID := "execution_" + uuid.NewString() diff --git a/core/services/workflows/internal/retry_test.go b/core/services/workflows/internal/retry_test.go index 223df4d8af7..2cd500b996f 100644 --- a/core/services/workflows/internal/retry_test.go +++ b/core/services/workflows/internal/retry_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func TestRetryableZeroMaxRetries(t *testing.T) { +func TestUnit_RetryableZeroMaxRetries(t *testing.T) { t.Parallel() ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond) @@ -26,7 +26,7 @@ func TestRetryableZeroMaxRetries(t *testing.T) { assert.ErrorIs(t, err, context.DeadlineExceeded, "Expected context deadline exceeded error") } -func TestRetryableSuccessOnFirstAttempt(t *testing.T) { +func TestUnit_RetryableSuccessOnFirstAttempt(t *testing.T) { t.Parallel() ctx := t.Context() @@ -39,7 +39,7 @@ func TestRetryableSuccessOnFirstAttempt(t *testing.T) { require.NoError(t, err, "Expected no error as function succeeds on first attempt") } -func TestRetryableSuccessAfterRetries(t *testing.T) { +func TestUnit_RetryableSuccessAfterRetries(t *testing.T) { t.Parallel() ctx := t.Context() @@ -58,7 +58,7 @@ func TestRetryableSuccessAfterRetries(t *testing.T) { assert.Equal(t, 2, retries, "Expected two retries before success") } -func TestRetryableErrorOnFirstTryNoRetries(t *testing.T) { +func TestUnit_RetryableErrorOnFirstTryNoRetries(t *testing.T) { t.Parallel() ctx := t.Context() @@ -72,7 +72,7 @@ func TestRetryableErrorOnFirstTryNoRetries(t *testing.T) { assert.Equal(t, "max retries (1) reached, aborting", err.Error(), "Expected function to abort after the first try") } -func TestRetryableErrorAfterMultipleRetries(t *testing.T) { +func TestUnit_RetryableErrorAfterMultipleRetries(t *testing.T) { t.Parallel() ctx := t.Context() @@ -90,7 +90,7 @@ func TestRetryableErrorAfterMultipleRetries(t *testing.T) { assert.Equal(t, maxRetries+1, attempts, "Expected the function to be executed retry + 1 times") } -func TestRetryableCancellationHandling(t *testing.T) { +func TestUnit_RetryableCancellationHandling(t *testing.T) { t.Parallel() ctx, cancel := context.WithCancel(context.Background()) diff --git a/core/services/workflows/metering/balance_store_test.go b/core/services/workflows/metering/balance_store_test.go index 1551a295288..b8ccef32fb1 100644 --- a/core/services/workflows/metering/balance_store_test.go +++ b/core/services/workflows/metering/balance_store_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestBalanceStore(t *testing.T) { +func TestUnit_BalanceStore(t *testing.T) { t.Parallel() one := decimal.NewFromInt(1) diff --git a/core/services/workflows/metering/metering_test.go b/core/services/workflows/metering/metering_test.go index f7736109867..37601768438 100644 --- a/core/services/workflows/metering/metering_test.go +++ b/core/services/workflows/metering/metering_test.go @@ -111,7 +111,7 @@ var ( two = decimal.NewFromInt(2) ) -func Test_Report(t *testing.T) { +func TestUnit_Report(t *testing.T) { t.Parallel() t.Run("error if incorrect labels", func(t *testing.T) { @@ -123,7 +123,7 @@ func Test_Report(t *testing.T) { }) } -func Test_Report_MeteringMode(t *testing.T) { +func TestUnit_Report_MeteringMode(t *testing.T) { t.Parallel() t.Run("Reserve switches to metering mode", func(t *testing.T) { @@ -405,7 +405,7 @@ func Test_Report_MeteringMode(t *testing.T) { }) } -func Test_medianSpend(t *testing.T) { +func TestUnit_medianSpend(t *testing.T) { t.Parallel() tt := []struct { @@ -469,7 +469,7 @@ func Test_medianSpend(t *testing.T) { } } -func Test_Report_Reserve(t *testing.T) { +func TestUnit_Report_Reserve(t *testing.T) { t.Parallel() t.Run("returns an error if insufficient funding", func(t *testing.T) { @@ -515,7 +515,7 @@ func Test_Report_Reserve(t *testing.T) { }) } -func Test_Report_Deduct(t *testing.T) { +func TestUnit_Report_Deduct(t *testing.T) { t.Parallel() one := decimal.NewFromInt(1) @@ -800,7 +800,7 @@ func Test_Report_Deduct(t *testing.T) { }) } -func Test_Report_Settle(t *testing.T) { +func TestUnit_Report_Settle(t *testing.T) { t.Parallel() t.Run("returns an error if not initialized", func(t *testing.T) { @@ -1021,7 +1021,7 @@ func Test_Report_Settle(t *testing.T) { }) } -func Test_Report_FormatReport(t *testing.T) { +func TestUnit_Report_FormatReport(t *testing.T) { t.Parallel() t.Run("does not contain metadata", func(t *testing.T) { @@ -1294,7 +1294,7 @@ func Test_Report_FormatReport(t *testing.T) { }) } -func Test_Report_SendReceipt(t *testing.T) { +func TestUnit_Report_SendReceipt(t *testing.T) { t.Parallel() t.Run("returns an error if not initialized", func(t *testing.T) { @@ -1495,7 +1495,7 @@ func Test_Report_SendReceipt(t *testing.T) { }) } -func Test_Report_EmitReceipt(t *testing.T) { +func TestUnit_Report_EmitReceipt(t *testing.T) { t.Run("happy path", func(t *testing.T) { // No parallel beholderTester := beholdertest.NewObserver(t) @@ -1610,7 +1610,7 @@ func Test_Report_EmitReceipt(t *testing.T) { }) } -func Test_MeterReports(t *testing.T) { +func TestUnit_MeterReports(t *testing.T) { t.Parallel() workflowExecutionID1 := "exec1" @@ -1685,7 +1685,7 @@ func Test_MeterReports(t *testing.T) { }) } -func Test_MeterReports_Length(t *testing.T) { +func TestUnit_MeterReports_Length(t *testing.T) { t.Parallel() billingClient := mocks.NewBillingClient(t) @@ -1717,7 +1717,7 @@ func Test_MeterReports_Length(t *testing.T) { assert.Equal(t, 2, mrs.Len()) } -func Test_MeterReports_Start(t *testing.T) { +func TestUnit_MeterReports_Start(t *testing.T) { t.Parallel() t.Run("can only start report once", func(t *testing.T) { @@ -1738,7 +1738,7 @@ func Test_MeterReports_Start(t *testing.T) { }) } -func Test_MeterReports_Get(t *testing.T) { +func TestUnit_MeterReports_Get(t *testing.T) { t.Parallel() t.Run("returns when report exists", func(t *testing.T) { @@ -1772,7 +1772,7 @@ func Test_MeterReports_Get(t *testing.T) { }) } -func Test_MeterReports_End(t *testing.T) { +func TestUnit_MeterReports_End(t *testing.T) { t.Parallel() t.Run("can only end existing report", func(t *testing.T) { @@ -1834,7 +1834,7 @@ func Test_MeterReports_End(t *testing.T) { }) } -func TestRatiosFromConfig(t *testing.T) { +func TestUnit_RatiosFromConfig(t *testing.T) { t.Parallel() t.Run("happy path", func(t *testing.T) { diff --git a/core/services/workflows/models_test.go b/core/services/workflows/models_test.go index f7cb25f2edc..9c2c6a63dae 100644 --- a/core/services/workflows/models_test.go +++ b/core/services/workflows/models_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/job" ) -func TestParse_Graph(t *testing.T) { +func TestUnit_Parse_Graph(t *testing.T) { t.Parallel() testCases := []struct { name string @@ -321,7 +321,7 @@ targets: } } -func TestParsesIntsCorrectly(t *testing.T) { +func TestUnit_ParsesIntsCorrectly(t *testing.T) { spec, _, _, err := job.YAMLSpecFactory{}.Spec(testutils.Context(t), hardcodedWorkflow, "") require.NoError(t, err) diff --git a/core/services/workflows/monitoring/monitoring_test.go b/core/services/workflows/monitoring/monitoring_test.go index 235b6a10c75..e86046c3988 100644 --- a/core/services/workflows/monitoring/monitoring_test.go +++ b/core/services/workflows/monitoring/monitoring_test.go @@ -9,12 +9,12 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/workflows/monitoring" ) -func Test_InitMonitoringResources(t *testing.T) { +func TestUnit_InitMonitoringResources(t *testing.T) { _, err := monitoring.InitMonitoringResources() require.NoError(t, err) } -func Test_WorkflowMetricsLabeler(t *testing.T) { +func TestUnit_WorkflowMetricsLabeler(t *testing.T) { testWorkflowsMetricLabeler := monitoring.NewWorkflowsMetricLabeler(metrics.NewLabeler(), &monitoring.EngineMetrics{}) testWorkflowsMetricLabeler2 := testWorkflowsMetricLabeler.With("foo", "baz") require.Equal(t, "baz", testWorkflowsMetricLabeler2.Labels["foo"]) diff --git a/core/services/workflows/ratelimiter/ratelimiter_test.go b/core/services/workflows/ratelimiter/ratelimiter_test.go index 3599a0b7f7e..4a3a07ffa8d 100644 --- a/core/services/workflows/ratelimiter/ratelimiter_test.go +++ b/core/services/workflows/ratelimiter/ratelimiter_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/settings/limits" ) -func TestRateLimiter(t *testing.T) { +func TestUnit_RateLimiter(t *testing.T) { t.Parallel() config := Config{ diff --git a/core/services/workflows/store/models_test.go b/core/services/workflows/store/models_test.go index 21a3a50b6b3..9e670a7c297 100644 --- a/core/services/workflows/store/models_test.go +++ b/core/services/workflows/store/models_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink-protos/cre/go/values" ) -func TestWorkflowExecution_DeepCopy(t *testing.T) { +func TestUnit_WorkflowExecution_DeepCopy(t *testing.T) { now := time.Now() inputs, err := values.NewMap(map[string]int{}) require.NoError(t, err) diff --git a/core/services/workflows/store/store_memory_test.go b/core/services/workflows/store/store_memory_test.go index e5a08668599..5928907e3f6 100644 --- a/core/services/workflows/store/store_memory_test.go +++ b/core/services/workflows/store/store_memory_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func TestInMemoryStore_Add(t *testing.T) { +func TestUnit_InMemoryStore_Add(t *testing.T) { store := NewInMemoryStore(logger.TestLogger(t), clockwork.NewFakeClock()) execution, err := store.Add(context.Background(), map[string]*WorkflowExecutionStep{ @@ -33,7 +33,7 @@ func TestInMemoryStore_Add(t *testing.T) { assert.Error(t, err) } -func TestInMemoryStore_UpsertStep(t *testing.T) { +func TestUnit_InMemoryStore_UpsertStep(t *testing.T) { fakeClock := clockwork.NewFakeClock() store := NewInMemoryStore(logger.TestLogger(t), fakeClock) @@ -52,7 +52,7 @@ func TestInMemoryStore_UpsertStep(t *testing.T) { updatedState.UpdatedAt.After(previousUpdatedAt.Add(1*time.Hour))) } -func TestInMemoryStore_Get(t *testing.T) { +func TestUnit_InMemoryStore_Get(t *testing.T) { store := NewInMemoryStore(logger.TestLogger(t), clockwork.NewFakeClock()) _, err := store.Add(context.Background(), map[string]*WorkflowExecutionStep{}, "test-id", "w1", StatusStarted) require.NoError(t, err) @@ -64,7 +64,7 @@ func TestInMemoryStore_Get(t *testing.T) { assert.Equal(t, StatusStarted, retrievedState.Status) } -func TestInMemoryStore_FinishedExecution(t *testing.T) { +func TestUnit_InMemoryStore_FinishedExecution(t *testing.T) { store := NewInMemoryStoreWithPruneConfiguration(logger.TestLogger(t), clockwork.NewRealClock(), 10*time.Millisecond, 1*time.Hour) servicetest.Run(t, store) @@ -86,7 +86,7 @@ func TestInMemoryStore_FinishedExecution(t *testing.T) { }, 10*time.Second, 10*time.Millisecond) } -func TestInMemoryStore_ExpiresNonCompletedExecutions(t *testing.T) { +func TestUnit_InMemoryStore_ExpiresNonCompletedExecutions(t *testing.T) { expirationDuration := 50 * time.Millisecond store := NewInMemoryStoreWithPruneConfiguration(logger.TestLogger(t), clockwork.NewRealClock(), diff --git a/core/services/workflows/syncer/engine_registry_test.go b/core/services/workflows/syncer/engine_registry_test.go index 8dec866d10a..b8737ab8990 100644 --- a/core/services/workflows/syncer/engine_registry_test.go +++ b/core/services/workflows/syncer/engine_registry_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/workflows/types" ) -func TestEngineRegistry(t *testing.T) { +func TestUnit_EngineRegistry(t *testing.T) { var srv services.Service = &fakeService{} const id1 = "foo" @@ -71,7 +71,7 @@ func TestEngineRegistry(t *testing.T) { require.Len(t, es, 2) } -func TestEngineRegistry_keyFor(t *testing.T) { +func TestUnit_EngineRegistry_keyFor(t *testing.T) { owner := []byte("owner") k := EngineRegistryKey{Owner: owner, Name: "name"} assert.Equal(t, k.keyFor(), fmt.Sprintf("%x-name", owner)) diff --git a/core/services/workflows/syncer/fetcher_test.go b/core/services/workflows/syncer/fetcher_test.go index 65ec6330443..6b7cb0d4b24 100644 --- a/core/services/workflows/syncer/fetcher_test.go +++ b/core/services/workflows/syncer/fetcher_test.go @@ -47,7 +47,7 @@ func (w *wrapper) GetGatewayConnector() connector.GatewayConnector { return w.c } -func TestNewFetcherService(t *testing.T) { +func TestUnit_NewFetcherService(t *testing.T) { ctx := context.Background() lggr := logger.TestLogger(t) connector := gcmocks.NewGatewayConnector(t) @@ -297,7 +297,7 @@ func TestNewFetcherService(t *testing.T) { }) } -func TestNewFetcherFunc(t *testing.T) { +func TestUnit_NewFetcherFunc(t *testing.T) { lggr := logger.TestLogger(t) ctx := context.Background() testContent := []byte("test content") diff --git a/core/services/workflows/syncer/handler_test.go b/core/services/workflows/syncer/handler_test.go index 63714fd346e..4a9e1187e3e 100644 --- a/core/services/workflows/syncer/handler_test.go +++ b/core/services/workflows/syncer/handler_test.go @@ -117,7 +117,7 @@ func newMockDecrypter() *mockDecrypter { } } -func Test_Handler(t *testing.T) { +func TestUnit_Handler(t *testing.T) { lggr := logger.TestLogger(t) emitter := custmsg.NewLabeler() wfStore := store.NewInMemoryStore(lggr, clockwork.NewFakeClock()) @@ -314,7 +314,7 @@ const ( noDagBinaryCmd = "core/services/workflows/cmd/cre/examples/v2/simple_cron" ) -func Test_workflowRegisteredHandler(t *testing.T) { +func TestIntegration_Shared_workflowRegisteredHandler(t *testing.T) { binaryURL := "http://example.com/binary" secretsURL := "http://example.com/secrets" configURL := "http://example.com/config" @@ -866,7 +866,7 @@ func newMockArtifactStore(as *artifacts.Store, deleteWorkflowArtifactsErr error) } } -func Test_workflowDeletedHandler(t *testing.T) { +func TestIntegration_Shared_workflowDeletedHandler(t *testing.T) { workflowEncryptionKey := workflowkey.MustNewXXXTestingOnly(big.NewInt(1)) t.Run("success deleting existing engine and spec", func(t *testing.T) { var ( @@ -1103,7 +1103,7 @@ func Test_workflowDeletedHandler(t *testing.T) { }) } -func Test_workflowPausedActivatedUpdatedHandler(t *testing.T) { +func TestIntegration_Shared_workflowPausedActivatedUpdatedHandler(t *testing.T) { t.Run("success pausing activating and updating existing engine and spec", func(t *testing.T) { var ( ctx = testutils.Context(t) @@ -1236,7 +1236,7 @@ func Test_workflowPausedActivatedUpdatedHandler(t *testing.T) { }) } -func TestEngineFactoryFn_SuccessfulCreation(t *testing.T) { +func TestUnit_EngineFactoryFn_SuccessfulCreation(t *testing.T) { t.Parallel() ctx := testutils.Context(t) lggr := logger.TestLogger(t) diff --git a/core/services/workflows/syncer/v2/engine_registry_test.go b/core/services/workflows/syncer/v2/engine_registry_test.go index d0c37e91d1e..69e5ff4443d 100644 --- a/core/services/workflows/syncer/v2/engine_registry_test.go +++ b/core/services/workflows/syncer/v2/engine_registry_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/workflows/types" ) -func TestEngineRegistry(t *testing.T) { +func TestUnit_EngineRegistry(t *testing.T) { workflowID1 := types.WorkflowID([32]byte{0, 1, 2, 3, 4}) workflowID2 := types.WorkflowID([32]byte{0, 1, 2, 3, 4, 5}) diff --git a/core/services/workflows/syncer/v2/fetcher_test.go b/core/services/workflows/syncer/v2/fetcher_test.go index c4d1c0d6c34..0db78db9c2e 100644 --- a/core/services/workflows/syncer/v2/fetcher_test.go +++ b/core/services/workflows/syncer/v2/fetcher_test.go @@ -49,7 +49,7 @@ func (w *wrapper) GetGatewayConnector() connector.GatewayConnector { return w.c } -func TestNewFetcherService(t *testing.T) { +func TestUnit_NewFetcherService(t *testing.T) { ctx := context.Background() lggr := logger.TestLogger(t) storageService := mocks.NewWorkflowClient(t) @@ -346,7 +346,7 @@ func TestNewFetcherService(t *testing.T) { }) } -func TestNewFetcherFunc(t *testing.T) { +func TestUnit_NewFetcherFunc(t *testing.T) { lggr := logger.TestLogger(t) ctx := context.Background() testContent := []byte("test content") diff --git a/core/services/workflows/syncer/v2/handler_test.go b/core/services/workflows/syncer/v2/handler_test.go index 1ae98f5288f..08c3b39d006 100644 --- a/core/services/workflows/syncer/v2/handler_test.go +++ b/core/services/workflows/syncer/v2/handler_test.go @@ -114,7 +114,7 @@ func mockEngineFactory(ctx context.Context, wfid string, owner string, name type return &mockEngine{}, nil } -func Test_Handler(t *testing.T) { +func TestUnit_Handler(t *testing.T) { t.Run("fails with unsupported event type", func(t *testing.T) { lggr := logger.TestLogger(t) lf := limits.Factory{Logger: lggr} @@ -166,7 +166,7 @@ const ( binaryCmd = "core/capabilities/compute/test/simple/cmd" ) -func Test_workflowRegisteredHandler(t *testing.T) { +func TestIntegration_Shared_workflowRegisteredHandler(t *testing.T) { binaryURLFactory := func(wfID string) string { return "http://example.com/" + wfID + "/binary" } @@ -714,7 +714,7 @@ func newMockArtifactStore(as *artifacts.Store, deleteWorkflowArtifactsErr error) } } -func Test_workflowDeletedHandler(t *testing.T) { +func TestIntegration_Shared_workflowDeletedHandler(t *testing.T) { t.Run("success deleting existing engine and spec", func(t *testing.T) { var ( ctx = testutils.Context(t) @@ -978,7 +978,7 @@ func (m *mockLinkingService) GetOrganizationFromWorkflowOwner(ctx context.Contex }, nil } -func Test_Handler_OrganizationID(t *testing.T) { +func TestUnit_Handler_OrganizationID(t *testing.T) { observer := beholdertest.NewObserver(t) emitter := custmsg.NewLabeler() ctx := testutils.Context(t) diff --git a/core/services/workflows/syncer/v2/workflow_registry_test.go b/core/services/workflows/syncer/v2/workflow_registry_test.go index 5bc072ba7cf..076cbcdf49c 100644 --- a/core/services/workflows/syncer/v2/workflow_registry_test.go +++ b/core/services/workflows/syncer/v2/workflow_registry_test.go @@ -21,7 +21,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func Test_generateReconciliationEventsV2(t *testing.T) { +func TestUnit_generateReconciliationEventsV2(t *testing.T) { // Validate that if no engines are on the node in the registry, // and we see that the contract has workflow state, // that we generate a WorkflowActivatedEvent @@ -757,7 +757,7 @@ func Test_generateReconciliationEventsV2(t *testing.T) { }) } -func Test_Start(t *testing.T) { +func TestUnit_Start(t *testing.T) { t.Run("successful start and close", func(t *testing.T) { lggr := logger.TestLogger(t) workflowDonNotifier := capabilities.NewDonNotifier() @@ -787,7 +787,7 @@ func Test_Start(t *testing.T) { }) } -func Test_GetAllowlistedRequests(t *testing.T) { +func TestUnit_GetAllowlistedRequests(t *testing.T) { lggr := logger.TestLogger(t) ctx := testutils.Context(t) workflowDonNotifier := capabilities.NewDonNotifier() diff --git a/core/services/workflows/syncer/v2/workflow_syncer_v2_test.go b/core/services/workflows/syncer/v2/workflow_syncer_v2_test.go index 5b0925dff7c..bc68795e45b 100644 --- a/core/services/workflows/syncer/v2/workflow_syncer_v2_test.go +++ b/core/services/workflows/syncer/v2/workflow_syncer_v2_test.go @@ -49,7 +49,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils/crypto" ) -func Test_InitialStateSyncV2(t *testing.T) { +func TestIntegration_Shared_InitialStateSyncV2(t *testing.T) { lggr := logger.TestLogger(t) backendTH := testutils.NewEVMBackendTH(t) donID := uint32(1) @@ -151,7 +151,7 @@ func Test_InitialStateSyncV2(t *testing.T) { ) } -func Test_RegistrySyncer_SkipsEventsNotBelongingToDONV2(t *testing.T) { +func TestUnit_RegistrySyncer_SkipsEventsNotBelongingToDONV2(t *testing.T) { var ( lggr = logger.TestLogger(t) backendTH = testutils.NewEVMBackendTH(t) @@ -235,7 +235,7 @@ func Test_RegistrySyncer_SkipsEventsNotBelongingToDONV2(t *testing.T) { }, tests.WaitTimeout(t), time.Second) } -func Test_RegistrySyncer_WorkflowRegistered_InitiallyPausedV2(t *testing.T) { +func TestUnit_RegistrySyncer_WorkflowRegistered_InitiallyPausedV2(t *testing.T) { var ( ctx = coretestutils.Context(t) lggr = logger.TestLogger(t) @@ -335,7 +335,7 @@ func Test_RegistrySyncer_WorkflowRegistered_InitiallyPausedV2(t *testing.T) { require.ErrorContains(t, err, "sql: no rows in result set") } -func Test_RegistrySyncer_WorkflowRegistered_InitiallyActivatedV2(t *testing.T) { +func TestUnit_RegistrySyncer_WorkflowRegistered_InitiallyActivatedV2(t *testing.T) { var ( ctx = coretestutils.Context(t) lggr = logger.TestLogger(t) @@ -439,7 +439,7 @@ func Test_RegistrySyncer_WorkflowRegistered_InitiallyActivatedV2(t *testing.T) { }, tests.WaitTimeout(t), time.Second) } -func Test_StratReconciliation_InitialStateSyncV2(t *testing.T) { +func TestUnit_StratReconciliation_InitialStateSyncV2(t *testing.T) { t.Run("with heavy load", func(t *testing.T) { lggr := logger.TestLogger(t) backendTH := testutils.NewEVMBackendTH(t) @@ -512,7 +512,7 @@ func Test_StratReconciliation_InitialStateSyncV2(t *testing.T) { }) } -func Test_RegistrySyncer_DONUpdate(t *testing.T) { +func TestUnit_RegistrySyncer_DONUpdate(t *testing.T) { lggr := logger.TestLogger(t) backendTH := testutils.NewEVMBackendTH(t) donID := uint32(1) @@ -605,7 +605,7 @@ func Test_RegistrySyncer_DONUpdate(t *testing.T) { } } -func Test_StratReconciliation_RetriesWithBackoffV2(t *testing.T) { +func TestUnit_StratReconciliation_RetriesWithBackoffV2(t *testing.T) { lggr := logger.TestLogger(t) backendTH := testutils.NewEVMBackendTH(t) donID := uint32(1) diff --git a/core/services/workflows/syncer/versioning/contracts_test.go b/core/services/workflows/syncer/versioning/contracts_test.go index d660288ccee..cb5ce28cae4 100644 --- a/core/services/workflows/syncer/versioning/contracts_test.go +++ b/core/services/workflows/syncer/versioning/contracts_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/workflows/syncer/versioning" ) -func TestContracts_TypeAndVersion(t *testing.T) { +func TestIntegration_Shared_Contracts_TypeAndVersion(t *testing.T) { t.Parallel() t.Run("happy path", func(t *testing.T) { @@ -95,7 +95,7 @@ func TestContracts_TypeAndVersion(t *testing.T) { }) } -func TestContracts_VerifyTypeAndVersion(t *testing.T) { +func TestIntegration_Shared_Contracts_VerifyTypeAndVersion(t *testing.T) { t.Parallel() t.Run("incorrect type", func(t *testing.T) { @@ -119,7 +119,7 @@ func TestContracts_VerifyTypeAndVersion(t *testing.T) { }) } -func TestContracts_ParseTypeAndVersion(t *testing.T) { +func TestUnit_Contracts_ParseTypeAndVersion(t *testing.T) { t.Parallel() t.Run("valid string", func(t *testing.T) { @@ -148,7 +148,7 @@ func TestContracts_ParseTypeAndVersion(t *testing.T) { }) } -func TestContracts_RunWithRetries(t *testing.T) { +func TestUnit_Contracts_RunWithRetries(t *testing.T) { t.Parallel() t.Run("returns an error if max retries are exceeded", func(t *testing.T) { diff --git a/core/services/workflows/syncer/workflow_registry_test.go b/core/services/workflows/syncer/workflow_registry_test.go index 34589e57d69..da273bdc705 100644 --- a/core/services/workflows/syncer/workflow_registry_test.go +++ b/core/services/workflows/syncer/workflow_registry_test.go @@ -29,7 +29,7 @@ func (m *mockService) Ready() error { return nil } func (m *mockService) Name() string { return "svc" } -func Test_generateReconciliationEvents(t *testing.T) { +func TestUnit_generateReconciliationEvents(t *testing.T) { t.Run("WorkflowRegisteredEvent", func(t *testing.T) { lggr := logger.TestLogger(t) ctx := testutils.Context(t) diff --git a/core/services/workflows/syncer/workflow_syncer_test.go b/core/services/workflows/syncer/workflow_syncer_test.go index 333d418fbd8..6db165a3d43 100644 --- a/core/services/workflows/syncer/workflow_syncer_test.go +++ b/core/services/workflows/syncer/workflow_syncer_test.go @@ -110,7 +110,7 @@ func (t *testDonNotifier) Subscribe(ctx context.Context) (<-chan capabilities.DO return ch, func() {}, t.err } -func Test_EventHandlerStateSync(t *testing.T) { +func TestUnit_EventHandlerStateSync(t *testing.T) { lggr := logger.TestLogger(t) backendTH := testutils.NewEVMBackendTH(t) donID := uint32(1) @@ -243,7 +243,7 @@ func Test_EventHandlerStateSync(t *testing.T) { }, tests.WaitTimeout(t), time.Second) } -func Test_InitialStateSync(t *testing.T) { +func TestUnit_InitialStateSync(t *testing.T) { lggr := logger.TestLogger(t) backendTH := testutils.NewEVMBackendTH(t) donID := uint32(1) @@ -308,7 +308,7 @@ func Test_InitialStateSync(t *testing.T) { } } -func Test_SecretsWorker(t *testing.T) { +func TestUnit_SecretsWorker(t *testing.T) { tests.SkipFlakey(t, "https://smartcontract-it.atlassian.net/browse/DX-732") tc := []struct { ss SyncStrategy @@ -452,7 +452,7 @@ func Test_SecretsWorker(t *testing.T) { } } -func Test_RegistrySyncer_SkipsEventsNotBelongingToDON(t *testing.T) { +func TestUnit_RegistrySyncer_SkipsEventsNotBelongingToDON(t *testing.T) { var ( lggr = logger.TestLogger(t) backendTH = testutils.NewEVMBackendTH(t) @@ -534,7 +534,7 @@ func Test_RegistrySyncer_SkipsEventsNotBelongingToDON(t *testing.T) { }, tests.WaitTimeout(t), time.Second) } -func Test_RegistrySyncer_WorkflowRegistered_InitiallyPaused(t *testing.T) { +func TestUnit_RegistrySyncer_WorkflowRegistered_InitiallyPaused(t *testing.T) { var ( ctx = coretestutils.Context(t) lggr = logger.TestLogger(t) @@ -632,7 +632,7 @@ func Test_RegistrySyncer_WorkflowRegistered_InitiallyPaused(t *testing.T) { }, tests.WaitTimeout(t), time.Second) } -func Test_RegistrySyncer_WorkflowRegistered_InitiallyActivated(t *testing.T) { +func TestUnit_RegistrySyncer_WorkflowRegistered_InitiallyActivated(t *testing.T) { var ( ctx = coretestutils.Context(t) lggr = logger.TestLogger(t) @@ -730,7 +730,7 @@ func Test_RegistrySyncer_WorkflowRegistered_InitiallyActivated(t *testing.T) { }, tests.WaitTimeout(t), time.Second) } -func Test_StratReconciliation_InitialStateSync(t *testing.T) { +func TestUnit_StratReconciliation_InitialStateSync(t *testing.T) { quarantine.Flaky(t, "DX-2063") t.Run("with heavy load", func(t *testing.T) { lggr := logger.TestLogger(t) @@ -801,7 +801,7 @@ func Test_StratReconciliation_InitialStateSync(t *testing.T) { }) } -func Test_StratReconciliation_RetriesWithBackoff(t *testing.T) { +func TestUnit_StratReconciliation_RetriesWithBackoff(t *testing.T) { lggr := logger.TestLogger(t) backendTH := testutils.NewEVMBackendTH(t) donID := uint32(1) diff --git a/core/services/workflows/syncerlimiter/limiter_test.go b/core/services/workflows/syncerlimiter/limiter_test.go index a67871e2f4e..17c15074900 100644 --- a/core/services/workflows/syncerlimiter/limiter_test.go +++ b/core/services/workflows/syncerlimiter/limiter_test.go @@ -20,7 +20,7 @@ var ( user5String = "519BFD3D78fbb740c614432975CBE829E26C490e" ) -func TestWorkflowLimits(t *testing.T) { +func TestUnit_WorkflowLimits(t *testing.T) { t.Parallel() lggr := logger.TestLogger(t) diff --git a/core/services/workflows/types/workflow_meta_test.go b/core/services/workflows/types/workflow_meta_test.go index 7803fd21030..eb6550cbc1f 100644 --- a/core/services/workflows/types/workflow_meta_test.go +++ b/core/services/workflows/types/workflow_meta_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestWorkflowName_Validate(t *testing.T) { +func TestUnit_WorkflowName_Validate(t *testing.T) { t.Parallel() _, err := NewWorkflowName("") require.Error(t, err) @@ -18,7 +18,7 @@ func TestWorkflowName_Validate(t *testing.T) { require.NoError(t, err) } -func TestWorkflowID_FromHex(t *testing.T) { +func TestUnit_WorkflowID_FromHex(t *testing.T) { t.Parallel() _, err := WorkflowIDFromHex("wrong chars") require.Error(t, err) @@ -30,7 +30,7 @@ func TestWorkflowID_FromHex(t *testing.T) { require.NoError(t, err) } -func TestValidateWorkflowOwner(t *testing.T) { +func TestUnit_ValidateWorkflowOwner(t *testing.T) { t.Parallel() require.Error(t, ValidateWorkflowOwner("wrong chars")) require.Error(t, ValidateWorkflowOwner("00112233")) // wrong length diff --git a/core/services/workflows/v2/config_test.go b/core/services/workflows/v2/config_test.go index 2789f0f3ccf..d1d05e4e285 100644 --- a/core/services/workflows/v2/config_test.go +++ b/core/services/workflows/v2/config_test.go @@ -40,7 +40,7 @@ const ( testWorkflowTagA = "test-tag" ) -func TestEngineConfig_Validate(t *testing.T) { +func TestUnit_EngineConfig_Validate(t *testing.T) { t.Parallel() cfg := defaultTestConfig(t, nil) diff --git a/core/services/workflows/v2/engine_test.go b/core/services/workflows/v2/engine_test.go index b42a2de38f4..3a1a873abd1 100644 --- a/core/services/workflows/v2/engine_test.go +++ b/core/services/workflows/v2/engine_test.go @@ -67,7 +67,7 @@ import ( const triggerID = "basic-test-trigger@1.0.0" -func TestEngine_Init(t *testing.T) { +func TestUnit_Engine_Init(t *testing.T) { t.Parallel() module := modulemocks.NewModuleV2(t) @@ -98,7 +98,7 @@ func TestEngine_Init(t *testing.T) { require.NoError(t, engine.Close()) } -func TestEngine_Start_RateLimited(t *testing.T) { +func TestUnit_Engine_Start_RateLimited(t *testing.T) { t.Parallel() sLimiter, err := syncerlimiter.NewWorkflowLimits(logger.Test(t), syncerlimiter.Config{ Global: 2, @@ -164,7 +164,7 @@ func TestEngine_Start_RateLimited(t *testing.T) { require.NoError(t, engine4.Close()) } -func TestEngine_TriggerSubscriptions(t *testing.T) { +func TestUnit_Engine_TriggerSubscriptions(t *testing.T) { t.Parallel() module := modulemocks.NewModuleV2(t) @@ -275,7 +275,7 @@ func newTriggerSubs(n int) *sdkpb.ExecutionResult { } } -func TestEngine_OrganizationIdLogger(t *testing.T) { +func TestUnit_Engine_OrganizationIdLogger(t *testing.T) { t.Parallel() module := modulemocks.NewModuleV2(t) @@ -361,7 +361,7 @@ func TestEngine_OrganizationIdLogger(t *testing.T) { require.NoError(t, engine.Close()) } -func TestEngine_OrganizationIdLogger_OrgResolverFailure(t *testing.T) { +func TestUnit_Engine_OrganizationIdLogger_OrgResolverFailure(t *testing.T) { t.Parallel() module := modulemocks.NewModuleV2(t) @@ -476,7 +476,7 @@ func (m *mockOrgResolver) Ready() error { return nil } -func TestEngine_Execution(t *testing.T) { +func TestUnit_Engine_Execution(t *testing.T) { quarantine.Flaky(t, "DX-1725") module := modulemocks.NewModuleV2(t) module.EXPECT().Start() @@ -586,7 +586,7 @@ func TestEngine_Execution(t *testing.T) { }) } -func TestEngine_ExecutionTimeout(t *testing.T) { +func TestUnit_Engine_ExecutionTimeout(t *testing.T) { t.Parallel() module := modulemocks.NewModuleV2(t) @@ -673,7 +673,7 @@ func TestEngine_ExecutionTimeout(t *testing.T) { require.NoError(t, engine.Close()) } -func TestEngine_Metering_ValidBillingClient(t *testing.T) { +func TestUnit_Engine_Metering_ValidBillingClient(t *testing.T) { t.Parallel() module := modulemocks.NewModuleV2(t) @@ -1073,7 +1073,7 @@ func TestEngine_Metering_ValidBillingClient(t *testing.T) { require.NoError(t, engine.Close()) } -func TestEngine_CapabilityCallTimeout(t *testing.T) { +func TestUnit_Engine_CapabilityCallTimeout(t *testing.T) { t.Parallel() module := modulemocks.NewModuleV2(t) @@ -1193,7 +1193,7 @@ func TestEngine_CapabilityCallTimeout(t *testing.T) { require.NoError(t, engine.Close()) } -func TestEngine_WASMBinary_Simple(t *testing.T) { +func TestUnit_Engine_WASMBinary_Simple(t *testing.T) { cmd := "core/services/workflows/test/wasm/v2/cmd" log := logger.Test(t) binaryB := wasmtest.CreateTestBinary(cmd, false, t) @@ -1298,7 +1298,7 @@ func TestEngine_WASMBinary_Simple(t *testing.T) { } // TODO fix -func TestEngine_WASMBinary_With_Config(t *testing.T) { +func TestUnit_Engine_WASMBinary_With_Config(t *testing.T) { cmd := "core/services/workflows/test/wasm/v2/cmd/with_config" binaryB := wasmtest.CreateTestBinary(cmd, false, t) @@ -1393,7 +1393,7 @@ func TestEngine_WASMBinary_With_Config(t *testing.T) { }) } -func TestSecretsFetcher_Integration(t *testing.T) { +func TestUnit_SecretsFetcher_Integration(t *testing.T) { cmd := "core/services/workflows/test/wasm/v2/cmd/with_secrets" binaryB := wasmtest.CreateTestBinary(cmd, false, t) @@ -1582,7 +1582,7 @@ func TestSecretsFetcher_Integration(t *testing.T) { require.NoError(t, engine.Close()) } -func TestEngine_HandleNewDON(t *testing.T) { +func TestUnit_Engine_HandleNewDON(t *testing.T) { t.Parallel() t.Run("subscribe and update successfully", func(t *testing.T) { @@ -1792,7 +1792,7 @@ func TestEngine_HandleNewDON(t *testing.T) { // 2. Start the engine (which subscribes to DON updates) // 3. Trigger a real DON update via NotifyDonSet() with ConfigVersion = 2 // 4. Verify that the beholder logger labels are updated to reflect ConfigVersion = 2 -func TestEngine_DonVersionLabelUpdate(t *testing.T) { +func TestUnit_Engine_DonVersionLabelUpdate(t *testing.T) { t.Parallel() ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) diff --git a/core/services/workflows/v2/secrets_test.go b/core/services/workflows/v2/secrets_test.go index c7f6e354073..08431b2f41e 100644 --- a/core/services/workflows/v2/secrets_test.go +++ b/core/services/workflows/v2/secrets_test.go @@ -39,7 +39,7 @@ func MetricsLabelerTest(t *testing.T) *monitoring.WorkflowsMetricLabeler { return l } -func TestSecretsFetcher_BulkFetchesSecretsFromCapability(t *testing.T) { +func TestUnit_SecretsFetcher_BulkFetchesSecretsFromCapability(t *testing.T) { lggr := logger.TestLogger(t) reg := coreCap.NewRegistry(lggr) peer := coreCap.RandomUTF8BytesWord() @@ -213,7 +213,7 @@ func TestSecretsFetcher_BulkFetchesSecretsFromCapability(t *testing.T) { assert.Contains(t, errVal.Error, "failed to aggregate decryption shares") } -func TestSecretsFetcher_ReturnsErrorIfCapabilityNoFound(t *testing.T) { +func TestUnit_SecretsFetcher_ReturnsErrorIfCapabilityNoFound(t *testing.T) { lggr := logger.TestLogger(t) reg := coreCap.NewRegistry(lggr) peer := coreCap.RandomUTF8BytesWord() @@ -248,7 +248,7 @@ func TestSecretsFetcher_ReturnsErrorIfCapabilityNoFound(t *testing.T) { assert.ErrorContains(t, err, "no compatible capability found") } -func TestSecretsFetcher_ReturnsErrorIfCapabilityErrors(t *testing.T) { +func TestUnit_SecretsFetcher_ReturnsErrorIfCapabilityErrors(t *testing.T) { lggr := logger.TestLogger(t) reg := coreCap.NewRegistry(lggr) peer := coreCap.RandomUTF8BytesWord() @@ -292,7 +292,7 @@ func TestSecretsFetcher_ReturnsErrorIfCapabilityErrors(t *testing.T) { require.ErrorContains(t, err, "could not authorize the request") } -func TestSecretsFetcher_ReturnsErrorIfNoResponseForRequest(t *testing.T) { +func TestUnit_SecretsFetcher_ReturnsErrorIfNoResponseForRequest(t *testing.T) { lggr := logger.TestLogger(t) reg := coreCap.NewRegistry(lggr) peer := coreCap.RandomUTF8BytesWord() @@ -344,7 +344,7 @@ func TestSecretsFetcher_ReturnsErrorIfNoResponseForRequest(t *testing.T) { assert.Equal(t, fmt.Sprintf("could not find response for the request: %s::Bar::Foo", normalizedOwner), errVal.Error) } -func TestSecretsFetcher_ReturnsErrorIfMissingEncryptionSharesForNode(t *testing.T) { +func TestUnit_SecretsFetcher_ReturnsErrorIfMissingEncryptionSharesForNode(t *testing.T) { lggr := logger.TestLogger(t) reg := coreCap.NewRegistry(lggr) peer := coreCap.RandomUTF8BytesWord() @@ -416,7 +416,7 @@ func TestSecretsFetcher_ReturnsErrorIfMissingEncryptionSharesForNode(t *testing. assert.Contains(t, errVal.Error, "no shares found for this node's encryption key") } -func TestSecretsFetcher_ReturnsErrorIfCantCombineShares(t *testing.T) { +func TestUnit_SecretsFetcher_ReturnsErrorIfCantCombineShares(t *testing.T) { lggr := logger.TestLogger(t) reg := coreCap.NewRegistry(lggr) peer := coreCap.RandomUTF8BytesWord() diff --git a/core/sessions/ldapauth/ldap_test.go b/core/sessions/ldapauth/ldap_test.go index 928252fbc2b..c1dde0ea394 100644 --- a/core/sessions/ldapauth/ldap_test.go +++ b/core/sessions/ldapauth/ldap_test.go @@ -39,7 +39,7 @@ func setupAuthenticationProvider(t *testing.T, ldapClient ldapauth.LDAPClient) ( return db, ldapAuthProvider } -func TestORM_FindUser_Empty(t *testing.T) { +func TestIntegration_Shared_ORM_FindUser_Empty(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -62,7 +62,7 @@ func TestORM_FindUser_Empty(t *testing.T) { require.ErrorContains(t, err, "LDAP query returned no matching users") } -func TestORM_FindUser_NoGroups(t *testing.T) { +func TestIntegration_Shared_ORM_FindUser_NoGroups(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -102,7 +102,7 @@ func TestORM_FindUser_NoGroups(t *testing.T) { require.ErrorContains(t, err, "user present in directory, but matching no role groups assigned") } -func TestORM_FindUser_NotActive(t *testing.T) { +func TestIntegration_Shared_ORM_FindUser_NotActive(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -142,7 +142,7 @@ func TestORM_FindUser_NotActive(t *testing.T) { require.ErrorContains(t, err, "user not active") } -func TestORM_FindUser_Single(t *testing.T) { +func TestIntegration_Shared_ORM_FindUser_Single(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -200,7 +200,7 @@ func TestORM_FindUser_Single(t *testing.T) { require.Equal(t, sessions.UserRoleEdit, user.Role) } -func TestORM_FindUser_FallbackMatchLocalAdmin(t *testing.T) { +func TestIntegration_Shared_ORM_FindUser_FallbackMatchLocalAdmin(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -215,7 +215,7 @@ func TestORM_FindUser_FallbackMatchLocalAdmin(t *testing.T) { require.Equal(t, sessions.UserRoleAdmin, user.Role) } -func TestORM_FindUserByAPIToken_Success(t *testing.T) { +func TestIntegration_Shared_ORM_FindUserByAPIToken_Success(t *testing.T) { ctx := testutils.Context(t) // Initilaize LDAP Authentication Provider with mock client mockLdapClient := mocks.NewLDAPClient(t) @@ -234,7 +234,7 @@ func TestORM_FindUserByAPIToken_Success(t *testing.T) { require.Equal(t, sessions.UserRoleEdit, user.Role) } -func TestORM_FindUserByAPIToken_Expired(t *testing.T) { +func TestUnit_ORM_FindUserByAPIToken_Expired(t *testing.T) { ctx := testutils.Context(t) cfg := ldapauth.TestConfig{} @@ -254,7 +254,7 @@ func TestORM_FindUserByAPIToken_Expired(t *testing.T) { require.Equal(t, sessions.ErrUserSessionExpired, err) } -func TestORM_ListUsers_Full(t *testing.T) { +func TestUnit_ORM_ListUsers_Full(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -388,7 +388,7 @@ func TestORM_ListUsers_Full(t *testing.T) { require.Equal(t, sessions.UserRoleAdmin, users[4].Role) } -func TestORM_CreateSession_UpstreamBind(t *testing.T) { +func TestUnit_ORM_CreateSession_UpstreamBind(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -450,7 +450,7 @@ func TestORM_CreateSession_UpstreamBind(t *testing.T) { require.NoError(t, err) } -func TestORM_CreateSession_LocalAdminFallbackLogin(t *testing.T) { +func TestUnit_ORM_CreateSession_LocalAdminFallbackLogin(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -487,7 +487,7 @@ func TestORM_CreateSession_LocalAdminFallbackLogin(t *testing.T) { require.ErrorContains(t, err, "invalid password") } -func TestORM_SetPassword_LocalAdminFallbackLogin(t *testing.T) { +func TestUnit_ORM_SetPassword_LocalAdminFallbackLogin(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -524,7 +524,7 @@ func TestORM_SetPassword_LocalAdminFallbackLogin(t *testing.T) { require.ErrorContains(t, err, "invalid password") } -func TestORM_MapSearchGroups(t *testing.T) { +func TestUnit_ORM_MapSearchGroups(t *testing.T) { t.Parallel() cfg := ldapauth.TestConfig{} diff --git a/core/sessions/localauth/orm_test.go b/core/sessions/localauth/orm_test.go index bed51ba9a30..6a905239517 100644 --- a/core/sessions/localauth/orm_test.go +++ b/core/sessions/localauth/orm_test.go @@ -33,7 +33,7 @@ func setupORM(t *testing.T) (*sqlx.DB, sessions.AuthenticationProvider) { return db, orm } -func TestORM_FindUser(t *testing.T) { +func TestIntegration_Shared_ORM_FindUser(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -52,7 +52,7 @@ func TestORM_FindUser(t *testing.T) { assert.Equal(t, user1.HashedPassword, actual.HashedPassword) } -func TestORM_AuthorizedUserWithSession(t *testing.T) { +func TestIntegration_Shared_ORM_AuthorizedUserWithSession(t *testing.T) { t.Parallel() tests := []struct { @@ -97,7 +97,7 @@ func TestORM_AuthorizedUserWithSession(t *testing.T) { } } -func TestORM_DeleteUser(t *testing.T) { +func TestIntegration_Shared_ORM_DeleteUser(t *testing.T) { t.Parallel() ctx := testutils.Context(t) _, orm := setupORM(t) @@ -112,7 +112,7 @@ func TestORM_DeleteUser(t *testing.T) { require.Error(t, err) } -func TestORM_DeleteUserSession(t *testing.T) { +func TestIntegration_Shared_ORM_DeleteUserSession(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -136,7 +136,7 @@ func TestORM_DeleteUserSession(t *testing.T) { require.Empty(t, sessions) } -func TestORM_DeleteUserCascade(t *testing.T) { +func TestIntegration_Shared_ORM_DeleteUserCascade(t *testing.T) { ctx := testutils.Context(t) db, orm := setupORM(t) @@ -158,7 +158,7 @@ func TestORM_DeleteUserCascade(t *testing.T) { require.Empty(t, sessions) } -func TestORM_CreateSession(t *testing.T) { +func TestIntegration_Shared_ORM_CreateSession(t *testing.T) { t.Parallel() _, orm := setupORM(t) @@ -197,7 +197,7 @@ func TestORM_CreateSession(t *testing.T) { } } -func TestORM_WebAuthn(t *testing.T) { +func TestIntegration_Shared_ORM_WebAuthn(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -278,7 +278,7 @@ func TestORM_WebAuthn(t *testing.T) { require.Error(t, err) } -func TestOrm_GenerateAuthToken(t *testing.T) { +func TestIntegration_Shared_Orm_GenerateAuthToken(t *testing.T) { t.Parallel() ctx := testutils.Context(t) diff --git a/core/sessions/localauth/reaper_test.go b/core/sessions/localauth/reaper_test.go index 806c9448682..94beb779a82 100644 --- a/core/sessions/localauth/reaper_test.go +++ b/core/sessions/localauth/reaper_test.go @@ -29,7 +29,7 @@ func (c sessionReaperConfig) SessionReaperExpiration() commonconfig.Duration { return *commonconfig.MustNewDuration(142 * time.Second) } -func TestSessionReaper_ReapSessions(t *testing.T) { +func TestIntegration_Shared_SessionReaper_ReapSessions(t *testing.T) { t.Parallel() db := pgtest.NewSqlxDB(t) diff --git a/core/sessions/oidcauth/oidc_test.go b/core/sessions/oidcauth/oidc_test.go index c42b4857954..dc6356f9fe8 100644 --- a/core/sessions/oidcauth/oidc_test.go +++ b/core/sessions/oidcauth/oidc_test.go @@ -34,7 +34,7 @@ func setupAuthenticationProvider(t *testing.T) (*sqlx.DB, sessions.Authenticatio return db, oidcAuthProvider } -func TestORM_FindUser_Empty(t *testing.T) { +func TestIntegration_Shared_ORM_FindUser_Empty(t *testing.T) { t.Parallel() ctx := testutils.Context(t) // Init OIDC authenticator @@ -44,7 +44,7 @@ func TestORM_FindUser_Empty(t *testing.T) { require.ErrorContains(t, err, "user not found") } -func TestORM_FindUser_Single(t *testing.T) { +func TestIntegration_Shared_ORM_FindUser_Single(t *testing.T) { t.Parallel() ctx := testutils.Context(t) // Init OIDC authenticator @@ -66,7 +66,7 @@ func TestORM_FindUser_Single(t *testing.T) { require.Equal(t, foundUser.Role, user1.Role) } -func TestORM_FindUserByAPIToken_Success(t *testing.T) { +func TestIntegration_Shared_ORM_FindUserByAPIToken_Success(t *testing.T) { ctx := testutils.Context(t) // Init OIDC authenticator db, oidcAuthProvider := setupAuthenticationProvider(t) @@ -83,7 +83,7 @@ func TestORM_FindUserByAPIToken_Success(t *testing.T) { require.Equal(t, sessions.UserRoleEdit, foundUser.Role) } -func TestORM_FindUserByAPIToken_Expired(t *testing.T) { +func TestUnit_ORM_FindUserByAPIToken_Expired(t *testing.T) { ctx := testutils.Context(t) // Init OIDC authenticator cfg := oidcauth.TestConfig{} @@ -100,7 +100,7 @@ func TestORM_FindUserByAPIToken_Expired(t *testing.T) { require.Equal(t, sessions.ErrUserSessionExpired, err) } -func TestORM_ListUsers(t *testing.T) { +func TestUnit_ORM_ListUsers(t *testing.T) { ctx := testutils.Context(t) // Init OIDC authenticator db, oidcAuthProvider := setupAuthenticationProvider(t) @@ -136,7 +136,7 @@ func TestORM_ListUsers(t *testing.T) { } } -func TestORM_CreateSession(t *testing.T) { +func TestUnit_ORM_CreateSession(t *testing.T) { t.Parallel() ctx := testutils.Context(t) db, oidcAuthProvider := setupAuthenticationProvider(t) @@ -156,7 +156,7 @@ func TestORM_CreateSession(t *testing.T) { require.NoError(t, err) } -func TestORM_DeleteSession(t *testing.T) { +func TestUnit_ORM_DeleteSession(t *testing.T) { t.Parallel() ctx := testutils.Context(t) db, oidcAuthProvider := setupAuthenticationProvider(t) @@ -179,7 +179,7 @@ func TestORM_DeleteSession(t *testing.T) { require.NoError(t, err) } -func TestORM_ClearNonConcurrentSession(t *testing.T) { +func TestUnit_ORM_ClearNonConcurrentSession(t *testing.T) { t.Parallel() ctx := testutils.Context(t) db, oidcAuthProvider := setupAuthenticationProvider(t) @@ -202,7 +202,7 @@ func TestORM_ClearNonConcurrentSession(t *testing.T) { require.NoError(t, err) } -func Test_AuthorizeUserWithSession_Success(t *testing.T) { +func TestUnit_AuthorizeUserWithSession_Success(t *testing.T) { t.Parallel() ctx := testutils.Context(t) db, oidcAuthProvider := setupAuthenticationProvider(t) @@ -229,7 +229,7 @@ func Test_AuthorizeUserWithSession_Success(t *testing.T) { require.Equal(t, user1.Role, user.Role) } -func Test_AuthorizeUserWithSession_Expired(t *testing.T) { +func TestUnit_AuthorizeUserWithSession_Expired(t *testing.T) { t.Parallel() ctx := testutils.Context(t) cfg := oidcauth.TestConfig{} @@ -260,7 +260,7 @@ func Test_AuthorizeUserWithSession_Expired(t *testing.T) { require.Equal(t, err, sessions.ErrUserSessionExpired) } -func Test_AuthorizeUserWithSession_SessionRoleMatchesUserRole(t *testing.T) { +func TestUnit_AuthorizeUserWithSession_SessionRoleMatchesUserRole(t *testing.T) { t.Parallel() ctx := testutils.Context(t) db, oidcAuthProvider := setupAuthenticationProvider(t) @@ -286,7 +286,7 @@ func Test_AuthorizeUserWithSession_SessionRoleMatchesUserRole(t *testing.T) { require.Equal(t, sessions.UserRoleView, user.Role) } -func TestORM_CreateSession_LocalAdminFallbackLogin(t *testing.T) { +func TestUnit_ORM_CreateSession_LocalAdminFallbackLogin(t *testing.T) { t.Parallel() ctx := testutils.Context(t) db, oidcAuthProvider := setupAuthenticationProvider(t) @@ -314,7 +314,7 @@ func TestORM_CreateSession_LocalAdminFallbackLogin(t *testing.T) { require.ErrorContains(t, err, "invalid password") } -func Test_IDClaimsToUserRole(t *testing.T) { +func TestUnit_IDClaimsToUserRole(t *testing.T) { t.Parallel() cfg := oidcauth.TestConfig{} db := pgtest.NewSqlxDB(t) @@ -387,7 +387,7 @@ func Test_IDClaimsToUserRole(t *testing.T) { } } -func Test_ExtractIDClaimValues(t *testing.T) { +func TestUnit_ExtractIDClaimValues(t *testing.T) { t.Parallel() cfg := oidcauth.TestConfig{} db := pgtest.NewSqlxDB(t) diff --git a/core/sessions/user_test.go b/core/sessions/user_test.go index 6805d90d6ce..040363757d2 100644 --- a/core/sessions/user_test.go +++ b/core/sessions/user_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestNewUser(t *testing.T) { +func TestUnit_NewUser(t *testing.T) { t.Parallel() tests := []struct { @@ -49,7 +49,7 @@ func TestNewUser(t *testing.T) { } } -func TestUserGenerateAuthToken(t *testing.T) { +func TestUnit_UserGenerateAuthToken(t *testing.T) { var user sessions.User token, err := user.GenerateAuthToken() require.NoError(t, err) @@ -57,7 +57,7 @@ func TestUserGenerateAuthToken(t *testing.T) { assert.NotEqual(t, null.StringFrom(token.Secret), user.TokenHashedSecret) } -func TestAuthenticateUserByToken(t *testing.T) { +func TestUnit_AuthenticateUserByToken(t *testing.T) { var user sessions.User token, err := user.GenerateAuthToken() diff --git a/core/sessions/webauthn_test.go b/core/sessions/webauthn_test.go index 34797738492..e6539de4cae 100644 --- a/core/sessions/webauthn_test.go +++ b/core/sessions/webauthn_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" ) -func TestWebAuthnSessionStore(t *testing.T) { +func TestUnit_WebAuthnSessionStore(t *testing.T) { const key = "test-key" data := webauthn.SessionData{ Challenge: "challenge-string", diff --git a/core/shutdown/shutdown_test.go b/core/shutdown/shutdown_test.go index a712cc0a23f..aeb0f696a51 100644 --- a/core/shutdown/shutdown_test.go +++ b/core/shutdown/shutdown_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" ) -func TestHandleShutdown(t *testing.T) { +func TestUnit_HandleShutdown(t *testing.T) { proc, err := os.FindProcess(os.Getpid()) require.NoError(t, err) diff --git a/core/static/static_test.go b/core/static/static_test.go index 24dc6d58e35..07f38e589d6 100644 --- a/core/static/static_test.go +++ b/core/static/static_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" ) -func Test_short(t *testing.T) { +func TestUnit_short(t *testing.T) { for _, tt := range []struct { ver, sha string expVer, expSha string diff --git a/core/store/migrate/migrate_test.go b/core/store/migrate/migrate_test.go index a41c8672951..77674f18bd8 100644 --- a/core/store/migrate/migrate_test.go +++ b/core/store/migrate/migrate_test.go @@ -68,7 +68,7 @@ func getOCR2Spec100() OffchainReporting2OracleSpec100 { } } -func TestMigrate_0100_BootstrapConfigs(t *testing.T) { +func TestIntegration_Shared_Migrate_0100_BootstrapConfigs(t *testing.T) { cfg, db := heavyweight.FullTestDBEmptyV2(t, nil) lggr := logger.TestLogger(t) p, err := migrate.NewProvider(testutils.Context(t), db.DB) @@ -340,7 +340,7 @@ ON jobs.offchainreporting2_oracle_spec_id = ocr2.id` require.Equal(t, jobIdAndContractId{ID: 20, ContractID: "sol_187246hr3781h9fd198fh391g8f924"}, jobsAndContracts[3]) } -func TestMigrate_101_GenericOCR2(t *testing.T) { +func TestIntegration_Shared_Migrate_101_GenericOCR2(t *testing.T) { _, db := heavyweight.FullTestDBEmptyV2(t, nil) ctx := testutils.Context(t) p, err := migrate.NewProvider(ctx, db.DB) @@ -393,7 +393,7 @@ func TestMigrate_101_GenericOCR2(t *testing.T) { require.Equal(t, spec.JuelsPerFeeCoinPipeline, juels) } -func TestMigrate(t *testing.T) { +func TestIntegration_Shared_Migrate(t *testing.T) { ctx := testutils.Context(t) _, db := heavyweight.FullTestDBEmptyV2(t, nil) @@ -421,7 +421,7 @@ func TestMigrate(t *testing.T) { require.Equal(t, int64(99), ver) } -func TestSetMigrationENVVars(t *testing.T) { +func TestUnit_SetMigrationENVVars(t *testing.T) { t.Run("ValidEVMConfig", func(t *testing.T) { chainID := ubig.New(big.NewInt(1337)) testConfig := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { @@ -449,7 +449,7 @@ func TestSetMigrationENVVars(t *testing.T) { }) } -func TestNoTriggers(t *testing.T) { +func TestIntegration_Shared_NoTriggers(t *testing.T) { _, db := heavyweight.FullTestDBEmptyV2(t, nil) p, err := migrate.NewProvider(testutils.Context(t), db.DB) require.NoError(t, err) @@ -528,7 +528,7 @@ func BenchmarkBackfillingRecordsWithMigration202(b *testing.B) { } } -func TestRollback_247_TxStateEnumUpdate(t *testing.T) { +func TestIntegration_Shared_Rollback_247_TxStateEnumUpdate(t *testing.T) { ctx := testutils.Context(t) _, db := heavyweight.FullTestDBV2(t, nil) p, err := migrate.NewProvider(ctx, db.DB) diff --git a/core/store/models/common_test.go b/core/store/models/common_test.go index bc85a3ee7ec..eb220ac59b2 100644 --- a/core/store/models/common_test.go +++ b/core/store/models/common_test.go @@ -15,7 +15,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestJSON_Merge(t *testing.T) { +func TestUnit_JSON_Merge(t *testing.T) { t.Parallel() tests := []struct { @@ -93,13 +93,13 @@ func TestJSON_Merge(t *testing.T) { } } -func TestJSON_MergeNull(t *testing.T) { +func TestUnit_JSON_MergeNull(t *testing.T) { merged, err := models.Merge(models.JSON{}, models.JSON{}) require.NoError(t, err) assert.Equal(t, `{}`, merged.String()) } -func TestJSON_UnmarshalJSON(t *testing.T) { +func TestUnit_JSON_UnmarshalJSON(t *testing.T) { t.Parallel() tests := []struct { @@ -120,7 +120,7 @@ func TestJSON_UnmarshalJSON(t *testing.T) { } } -func TestJSON_ParseJSON(t *testing.T) { +func TestUnit_JSON_ParseJSON(t *testing.T) { t.Parallel() tests := []struct { @@ -143,7 +143,7 @@ func TestJSON_ParseJSON(t *testing.T) { } } -func TestWebURL_UnmarshalJSON_Error(t *testing.T) { +func TestUnit_WebURL_UnmarshalJSON_Error(t *testing.T) { t.Parallel() j := []byte(`"NotAUrl"`) wurl := &models.WebURL{} @@ -151,7 +151,7 @@ func TestWebURL_UnmarshalJSON_Error(t *testing.T) { assert.Error(t, err) } -func TestWebURL_UnmarshalJSON(t *testing.T) { +func TestUnit_WebURL_UnmarshalJSON(t *testing.T) { t.Parallel() j := []byte(`"http://www.duckduckgo.com"`) wurl := &models.WebURL{} @@ -159,7 +159,7 @@ func TestWebURL_UnmarshalJSON(t *testing.T) { assert.NoError(t, err) } -func TestWebURL_MarshalJSON(t *testing.T) { +func TestUnit_WebURL_MarshalJSON(t *testing.T) { t.Parallel() str := "http://www.duckduckgo.com" @@ -171,7 +171,7 @@ func TestWebURL_MarshalJSON(t *testing.T) { assert.Equal(t, `"`+str+`"`, string(b)) } -func TestWebURL_String_HasURL(t *testing.T) { +func TestUnit_WebURL_String_HasURL(t *testing.T) { t.Parallel() u, _ := url.Parse("http://www.duckduckgo.com") @@ -180,7 +180,7 @@ func TestWebURL_String_HasURL(t *testing.T) { assert.Equal(t, "http://www.duckduckgo.com", w.String()) } -func TestWebURL_String_HasNilURL(t *testing.T) { +func TestUnit_WebURL_String_HasNilURL(t *testing.T) { t.Parallel() w := models.WebURL{} @@ -188,7 +188,7 @@ func TestWebURL_String_HasNilURL(t *testing.T) { assert.Empty(t, w.String()) } -func TestCron_UnmarshalJSON_Success(t *testing.T) { +func TestUnit_Cron_UnmarshalJSON_Success(t *testing.T) { t.Parallel() tests := []struct { @@ -207,7 +207,7 @@ func TestCron_UnmarshalJSON_Success(t *testing.T) { } } -func TestCron_UnmarshalJSON_Invalid(t *testing.T) { +func TestUnit_Cron_UnmarshalJSON_Invalid(t *testing.T) { t.Parallel() tests := []struct { @@ -226,7 +226,7 @@ func TestCron_UnmarshalJSON_Invalid(t *testing.T) { } } -func TestSha256Hash_MarshalJSON_UnmarshalJSON(t *testing.T) { +func TestUnit_Sha256Hash_MarshalJSON_UnmarshalJSON(t *testing.T) { t.Parallel() hash := models.MustSha256HashFromHex("f5bf259689b26f1374efb3c9a9868796953a0f814bb2d39b968d0e61b58620a5") @@ -241,7 +241,7 @@ func TestSha256Hash_MarshalJSON_UnmarshalJSON(t *testing.T) { require.Equal(t, hash, newHash) } -func TestSha256Hash_Sha256HashFromHex(t *testing.T) { +func TestUnit_Sha256Hash_Sha256HashFromHex(t *testing.T) { t.Parallel() _, err := models.Sha256HashFromHex("abczzz") @@ -254,14 +254,14 @@ func TestSha256Hash_Sha256HashFromHex(t *testing.T) { require.NoError(t, err) } -func TestSha256Hash_String(t *testing.T) { +func TestUnit_Sha256Hash_String(t *testing.T) { t.Parallel() hash := models.MustSha256HashFromHex("f5bf259689b26f1374efb3c9a9868796953a0f814bb2d39b968d0e61b58620a5") assert.Equal(t, "f5bf259689b26f1374efb3c9a9868796953a0f814bb2d39b968d0e61b58620a5", hash.String()) } -func TestSha256Hash_Scan_Value(t *testing.T) { +func TestUnit_Sha256Hash_Scan_Value(t *testing.T) { t.Parallel() hash := models.MustSha256HashFromHex("f5bf259689b26f1374efb3c9a9868796953a0f814bb2d39b968d0e61b58620a5") @@ -275,7 +275,7 @@ func TestSha256Hash_Scan_Value(t *testing.T) { require.Equal(t, hash, newHash) } -func TestAddressCollection_Scan_Value(t *testing.T) { +func TestUnit_AddressCollection_Scan_Value(t *testing.T) { t.Parallel() ac := models.AddressCollection{ @@ -293,7 +293,7 @@ func TestAddressCollection_Scan_Value(t *testing.T) { require.Equal(t, ac, acNew) } -func TestAddressCollection_ToStrings(t *testing.T) { +func TestUnit_AddressCollection_ToStrings(t *testing.T) { t.Parallel() hex1 := "0xaAaAaAaaAaAaAaaAaAAAAAAAAaaaAaAaAaaAaaAa" @@ -310,7 +310,7 @@ func TestAddressCollection_ToStrings(t *testing.T) { require.Equal(t, hex2, acStrings[1]) } -func TestWebURL_Scan_Value(t *testing.T) { +func TestUnit_WebURL_Scan_Value(t *testing.T) { t.Parallel() u, err := url.Parse("https://chain.link") @@ -328,7 +328,7 @@ func TestWebURL_Scan_Value(t *testing.T) { require.Equal(t, w, wNew) } -func TestJSON_Scan_Value(t *testing.T) { +func TestUnit_JSON_Scan_Value(t *testing.T) { t.Parallel() js, err := models.ParseJSON([]byte(`{"foo":123}`)) @@ -344,7 +344,7 @@ func TestJSON_Scan_Value(t *testing.T) { require.Equal(t, js, jsNew) } -func TestJSON_Bytes(t *testing.T) { +func TestUnit_JSON_Bytes(t *testing.T) { t.Parallel() jsBytes := []byte(`{"foo":123}`) @@ -355,7 +355,7 @@ func TestJSON_Bytes(t *testing.T) { require.Equal(t, jsBytes, js.Bytes()) } -func TestJSON_MarshalJSON(t *testing.T) { +func TestUnit_JSON_MarshalJSON(t *testing.T) { t.Parallel() jsBytes := []byte(`{"foo":123}`) @@ -369,7 +369,7 @@ func TestJSON_MarshalJSON(t *testing.T) { require.Equal(t, jsBytes, bs) } -func TestJSON_UnmarshalTOML(t *testing.T) { +func TestUnit_JSON_UnmarshalTOML(t *testing.T) { t.Parallel() jsBytes := []byte(`{"foo":123}`) diff --git a/core/store/models/errors_test.go b/core/store/models/errors_test.go index 58a6238e121..a21a3f6ba03 100644 --- a/core/store/models/errors_test.go +++ b/core/store/models/errors_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/store/models" ) -func TestNewJSONAPIErrors(t *testing.T) { +func TestUnit_NewJSONAPIErrors(t *testing.T) { t.Parallel() res := models.NewJSONAPIErrors() @@ -18,7 +18,7 @@ func TestNewJSONAPIErrors(t *testing.T) { require.Empty(t, res.Errors) } -func TestNewJSONAPIErrorsWith(t *testing.T) { +func TestUnit_NewJSONAPIErrorsWith(t *testing.T) { t.Parallel() res := models.NewJSONAPIErrorsWith("foo") @@ -28,7 +28,7 @@ func TestNewJSONAPIErrorsWith(t *testing.T) { require.Equal(t, "foo", res.Errors[0].Detail) } -func TestJSONAPIErrors_Error(t *testing.T) { +func TestUnit_JSONAPIErrors_Error(t *testing.T) { t.Parallel() res := models.NewJSONAPIErrorsWith("foo") @@ -39,7 +39,7 @@ func TestJSONAPIErrors_Error(t *testing.T) { require.Equal(t, "foo,bar", res.Error()) } -func TestJSONAPIErrors_CoerceEmptyToNil(t *testing.T) { +func TestUnit_JSONAPIErrors_CoerceEmptyToNil(t *testing.T) { t.Parallel() res := models.NewJSONAPIErrors() @@ -55,7 +55,7 @@ func TestJSONAPIErrors_CoerceEmptyToNil(t *testing.T) { require.Equal(t, res, err) } -func TestJSONAPIErrors_Merge(t *testing.T) { +func TestUnit_JSONAPIErrors_Merge(t *testing.T) { t.Parallel() res1 := models.NewJSONAPIErrorsWith("foo") diff --git a/core/utils/backoff_ticker_test.go b/core/utils/backoff_ticker_test.go index c9de6e021d3..a23db4711ba 100644 --- a/core/utils/backoff_ticker_test.go +++ b/core/utils/backoff_ticker_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestBackoffTicker_Bounds(t *testing.T) { +func TestUnit_BackoffTicker_Bounds(t *testing.T) { t.Parallel() bt := NewBackoffTicker(1*time.Millisecond, 2*time.Second) @@ -17,7 +17,7 @@ func TestBackoffTicker_Bounds(t *testing.T) { assert.Equal(t, 2*time.Second, max) } -func TestBackoffTicker_StartTwice(t *testing.T) { +func TestUnit_BackoffTicker_StartTwice(t *testing.T) { t.Parallel() bt := NewBackoffTicker(1*time.Second, 10*time.Second) @@ -30,7 +30,7 @@ func TestBackoffTicker_StartTwice(t *testing.T) { assert.False(t, ok) } -func TestBackoffTicker_StopTwice(t *testing.T) { +func TestUnit_BackoffTicker_StopTwice(t *testing.T) { t.Parallel() bt := NewBackoffTicker(1*time.Second, 10*time.Second) @@ -44,7 +44,7 @@ func TestBackoffTicker_StopTwice(t *testing.T) { assert.False(t, ok) } -func TestBackoffTicker_NoTicksAfterStop(t *testing.T) { +func TestUnit_BackoffTicker_NoTicksAfterStop(t *testing.T) { t.Parallel() min := 100 * time.Millisecond @@ -77,7 +77,7 @@ func TestBackoffTicker_NoTicksAfterStop(t *testing.T) { } } -func TestBackoffTicker_Ticks(t *testing.T) { +func TestUnit_BackoffTicker_Ticks(t *testing.T) { t.Parallel() min := 100 * time.Millisecond @@ -122,7 +122,7 @@ func TestBackoffTicker_Ticks(t *testing.T) { } } -func TestBackoffTicker_Restart(t *testing.T) { +func TestUnit_BackoffTicker_Restart(t *testing.T) { t.Parallel() min := 1 * time.Second diff --git a/core/utils/big_math/big_math_test.go b/core/utils/big_math/big_math_test.go index 40cbd7bc97c..f9a8d320e7e 100644 --- a/core/utils/big_math/big_math_test.go +++ b/core/utils/big_math/big_math_test.go @@ -7,17 +7,17 @@ import ( "github.com/stretchr/testify/require" ) -func TestMax(t *testing.T) { +func TestUnit_Max(t *testing.T) { m := Max(big.NewInt(1), big.NewInt(2)) require.Equal(t, 0, big.NewInt(2).Cmp(m)) } -func TestMin(t *testing.T) { +func TestUnit_Min(t *testing.T) { m := Min(big.NewInt(1), big.NewInt(2)) require.Equal(t, 0, big.NewInt(1).Cmp(m)) } -func TestAccumulate(t *testing.T) { +func TestUnit_Accumulate(t *testing.T) { s := []*big.Int{ big.NewInt(1), big.NewInt(2), diff --git a/core/utils/collection_test.go b/core/utils/collection_test.go index 3866fa78cbe..1b019580699 100644 --- a/core/utils/collection_test.go +++ b/core/utils/collection_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestBatchSplit(t *testing.T) { +func TestUnit_BatchSplit(t *testing.T) { list := []int{} for i := range 100 { list = append(list, i) diff --git a/core/utils/crypto/private_key_test.go b/core/utils/crypto/private_key_test.go index fa26b477290..4fc1e57562c 100644 --- a/core/utils/crypto/private_key_test.go +++ b/core/utils/crypto/private_key_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils" ) -func Test_EncryptedPrivateKey(t *testing.T) { +func TestUnit_EncryptedPrivateKey(t *testing.T) { t.Parallel() privatekey := []byte("privatekey") @@ -26,7 +26,7 @@ func Test_EncryptedPrivateKey(t *testing.T) { assert.Equal(t, privatekey, actual) } -func Test_EncryptedPrivateKey_Decrypt(t *testing.T) { +func TestUnit_EncryptedPrivateKey_Decrypt(t *testing.T) { t.Parallel() passphrase := []byte("passphrase") @@ -43,7 +43,7 @@ func Test_EncryptedPrivateKey_Decrypt(t *testing.T) { assert.Equal(t, []byte(privkey), actual) } -func Test_EncryptedPrivateKey_Scan(t *testing.T) { +func TestUnit_EncryptedPrivateKey_Scan(t *testing.T) { t.Parallel() _, privKey, err := ed25519.GenerateKey(nil) @@ -74,7 +74,7 @@ func Test_EncryptedPrivateKey_Scan(t *testing.T) { assert.JSONEq(t, string(expPrivKey), string(actPrivKey)) } -func Test_EncryptedPrivateKey_Value(t *testing.T) { +func TestUnit_EncryptedPrivateKey_Value(t *testing.T) { t.Parallel() _, privKey, err := ed25519.GenerateKey(nil) diff --git a/core/utils/crypto/public_key_test.go b/core/utils/crypto/public_key_test.go index 680ef48a3d3..6c861afc1d9 100644 --- a/core/utils/crypto/public_key_test.go +++ b/core/utils/crypto/public_key_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" ) -func Test_PublicKey_String(t *testing.T) { +func TestUnit_PublicKey_String(t *testing.T) { t.Parallel() pubKey, _, err := ed25519.GenerateKey(nil) @@ -22,7 +22,7 @@ func Test_PublicKey_String(t *testing.T) { assert.Equal(t, expected, pk.String()) } -func Test_PublicKey_MarshalJSON(t *testing.T) { +func TestUnit_PublicKey_MarshalJSON(t *testing.T) { t.Parallel() pubKey, _, err := ed25519.GenerateKey(nil) @@ -36,7 +36,7 @@ func Test_PublicKey_MarshalJSON(t *testing.T) { assert.Equal(t, fmt.Sprintf(`"%s"`, hexKey), string(actual)) } -func Test_PublicKey_UnmarshalJSON(t *testing.T) { +func TestUnit_PublicKey_UnmarshalJSON(t *testing.T) { t.Parallel() pubKey, _, err := ed25519.GenerateKey(nil) @@ -50,7 +50,7 @@ func Test_PublicKey_UnmarshalJSON(t *testing.T) { assert.Equal(t, PublicKey(pubKey), *actual) } -func Test_PublicKey_Scan(t *testing.T) { +func TestUnit_PublicKey_Scan(t *testing.T) { pubKey, _, err := ed25519.GenerateKey(nil) require.NoError(t, err) @@ -72,7 +72,7 @@ func Test_PublicKey_Scan(t *testing.T) { assert.Equal(t, PublicKey(pubKey), *actual) } -func Test_PublicKey_Value(t *testing.T) { +func TestUnit_PublicKey_Value(t *testing.T) { pubKey, _, err := ed25519.GenerateKey(nil) require.NoError(t, err) diff --git a/core/utils/decimal_test.go b/core/utils/decimal_test.go index 068376ebbba..d5ebaca6406 100644 --- a/core/utils/decimal_test.go +++ b/core/utils/decimal_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestDecimal(t *testing.T) { +func TestUnit_Decimal(t *testing.T) { t.Parallel() dec := decimal.New(1, 0) diff --git a/core/utils/deferable_write_closer_test.go b/core/utils/deferable_write_closer_test.go index 18d08bd80c2..b3272880980 100644 --- a/core/utils/deferable_write_closer_test.go +++ b/core/utils/deferable_write_closer_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestDeferableWriteCloser_Close(t *testing.T) { +func TestUnit_DeferableWriteCloser_Close(t *testing.T) { d := t.TempDir() f, err := os.Create(filepath.Join(d, "test-file")) require.NoError(t, err) diff --git a/core/utils/eth_signatures_test.go b/core/utils/eth_signatures_test.go index 85b94500d68..5410b253f02 100644 --- a/core/utils/eth_signatures_test.go +++ b/core/utils/eth_signatures_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestGetSignersEthAddress_Success(t *testing.T) { +func TestUnit_GetSignersEthAddress_Success(t *testing.T) { privateKey, err := crypto.GenerateKey() require.NoError(t, err) address := crypto.PubkeyToAddress(privateKey.PublicKey) @@ -22,14 +22,14 @@ func TestGetSignersEthAddress_Success(t *testing.T) { assert.Equal(t, address, recoveredAddress) } -func TestGetSignersEthAddress_InvalidSignatureLength(t *testing.T) { +func TestUnit_GetSignersEthAddress_InvalidSignatureLength(t *testing.T) { msg := []byte("test message") sig := []byte("invalid signature length") _, err := GetSignersEthAddress(msg, sig) assert.EqualError(t, err, "invalid signature: signature length must be 65 bytes") } -func TestGenerateEthPrefixedMsgHash(t *testing.T) { +func TestUnit_GenerateEthPrefixedMsgHash(t *testing.T) { msg := []byte("test message") expectedPrefix := "\x19Ethereum Signed Message:\n" expectedHash := crypto.Keccak256Hash([]byte(expectedPrefix + "12" + string(msg))) @@ -38,7 +38,7 @@ func TestGenerateEthPrefixedMsgHash(t *testing.T) { assert.Equal(t, expectedHash, hash) } -func TestGenerateEthSignature(t *testing.T) { +func TestUnit_GenerateEthSignature(t *testing.T) { privateKey, err := crypto.GenerateKey() assert.NoError(t, err) diff --git a/core/utils/files_test.go b/core/utils/files_test.go index f7df0c454c0..6876d093294 100644 --- a/core/utils/files_test.go +++ b/core/utils/files_test.go @@ -20,7 +20,7 @@ func tempFileName() string { return filepath.Join(os.TempDir(), hex.EncodeToString(randBytes)) } -func TestFileExists(t *testing.T) { +func TestUnit_FileExists(t *testing.T) { t.Parallel() exists, err := FileExists(tempFileName()) @@ -32,7 +32,7 @@ func TestFileExists(t *testing.T) { assert.True(t, exists) } -func TestTooPermissive(t *testing.T) { +func TestUnit_TooPermissive(t *testing.T) { t.Parallel() res := TooPermissive(os.FileMode(0700), os.FileMode(0600)) @@ -45,7 +45,7 @@ func TestTooPermissive(t *testing.T) { assert.False(t, res) } -func TestFileSize_MarshalText_String(t *testing.T) { +func TestUnit_FileSize_MarshalText_String(t *testing.T) { t.Parallel() tests := []struct { @@ -75,7 +75,7 @@ func TestFileSize_MarshalText_String(t *testing.T) { } } -func TestFileSize_UnmarshalText(t *testing.T) { +func TestUnit_FileSize_UnmarshalText(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/utils/finite_ticker_test.go b/core/utils/finite_ticker_test.go index 575df7e6749..3926b9a5bdc 100644 --- a/core/utils/finite_ticker_test.go +++ b/core/utils/finite_ticker_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils" ) -func TestFiniteTicker(t *testing.T) { +func TestUnit_FiniteTicker(t *testing.T) { t.Parallel() var counter atomic.Int32 diff --git a/core/utils/jwt_test.go b/core/utils/jwt_test.go index 7fa6e2ac6fc..15f1f982f61 100644 --- a/core/utils/jwt_test.go +++ b/core/utils/jwt_test.go @@ -13,7 +13,7 @@ import ( jsonrpc "github.com/smartcontractkit/chainlink-common/pkg/jsonrpc2" ) -func TestSigningMethodEth_Sign(t *testing.T) { +func TestUnit_SigningMethodEth_Sign(t *testing.T) { t.Run("valid ECDSA key", func(t *testing.T) { privateKey, err := crypto.GenerateKey() require.NoError(t, err) @@ -36,7 +36,7 @@ func TestSigningMethodEth_Sign(t *testing.T) { }) } -func TestSigningMethodEth_Verify(t *testing.T) { +func TestUnit_SigningMethodEth_Verify(t *testing.T) { privateKey, err := crypto.GenerateKey() require.NoError(t, err) address := crypto.PubkeyToAddress(privateKey.PublicKey) @@ -83,7 +83,7 @@ func TestSigningMethodEth_Verify(t *testing.T) { }) } -func TestWithExpiry(t *testing.T) { +func TestUnit_WithExpiry(t *testing.T) { duration := 30 * time.Minute opts := &jwtOptions{} @@ -93,7 +93,7 @@ func TestWithExpiry(t *testing.T) { require.Equal(t, duration, *opts.expiryDuration) } -func TestWithIssuer(t *testing.T) { +func TestUnit_WithIssuer(t *testing.T) { issuer := "test-issuer" opts := &jwtOptions{} @@ -103,7 +103,7 @@ func TestWithIssuer(t *testing.T) { require.Equal(t, issuer, *opts.issuer) } -func TestWithAudience(t *testing.T) { +func TestUnit_WithAudience(t *testing.T) { audience := []string{"aud1", "aud2"} opts := &jwtOptions{} @@ -112,7 +112,7 @@ func TestWithAudience(t *testing.T) { require.Equal(t, audience, opts.audience) } -func TestWithSubject(t *testing.T) { +func TestUnit_WithSubject(t *testing.T) { subject := "test-subject" opts := &jwtOptions{} @@ -122,7 +122,7 @@ func TestWithSubject(t *testing.T) { require.Equal(t, subject, *opts.subject) } -func TestWithMaxExpiryDuration(t *testing.T) { +func TestUnit_WithMaxExpiryDuration(t *testing.T) { duration := 10 * time.Minute opts := &verifyOptions{} @@ -132,7 +132,7 @@ func TestWithMaxExpiryDuration(t *testing.T) { require.Equal(t, duration, *opts.maxExpiryDuration) } -func TestWithIssuedAtTolerance(t *testing.T) { +func TestUnit_WithIssuedAtTolerance(t *testing.T) { duration := 10 * time.Minute opts := &verifyOptions{} @@ -152,7 +152,7 @@ func testRequest(t *testing.T) jsonrpc.Request[json.RawMessage] { } } -func TestCreateRequestJWT(t *testing.T) { +func TestUnit_CreateRequestJWT(t *testing.T) { req := testRequest(t) t.Run("default options", func(t *testing.T) { @@ -198,7 +198,7 @@ func TestCreateRequestJWT(t *testing.T) { }) } -func TestSplitToken(t *testing.T) { +func TestUnit_SplitToken(t *testing.T) { t.Run("valid token format", func(t *testing.T) { tokenString := "header.payload.signature" @@ -223,7 +223,7 @@ func TestSplitToken(t *testing.T) { }) } -func TestVerifyRequestJWT_Integration(t *testing.T) { +func TestUnit_VerifyRequestJWT_Integration(t *testing.T) { privateKey, err := crypto.GenerateKey() require.NoError(t, err) @@ -488,7 +488,7 @@ func TestVerifyRequestJWT_Integration(t *testing.T) { }) } -func TestSigningMethodRegistration(t *testing.T) { +func TestUnit_SigningMethodRegistration(t *testing.T) { method := jwt.GetSigningMethod("ETH") require.NotNil(t, method) diff --git a/core/utils/password_test.go b/core/utils/password_test.go index 737bbc6ecac..2dac42a7f20 100644 --- a/core/utils/password_test.go +++ b/core/utils/password_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils" ) -func TestVerifyPasswordComplexity(t *testing.T) { +func TestUnit_VerifyPasswordComplexity(t *testing.T) { t.Parallel() tests := []struct { @@ -50,7 +50,7 @@ func TestVerifyPasswordComplexity(t *testing.T) { } } -func TestPasswordFromFile(t *testing.T) { +func TestUnit_PasswordFromFile(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/utils/plainhex_test.go b/core/utils/plainhex_test.go index 9597391a63f..9f9535666c7 100644 --- a/core/utils/plainhex_test.go +++ b/core/utils/plainhex_test.go @@ -47,7 +47,7 @@ var ( } ) -func TestUnmarshalBytes(t *testing.T) { +func TestUnit_UnmarshalBytes(t *testing.T) { for _, test := range unmarshalBytesTests { var v PlainHexBytes err := json.Unmarshal([]byte(test.input), &v) @@ -61,7 +61,7 @@ func TestUnmarshalBytes(t *testing.T) { } } -func TestMarshalBytes(t *testing.T) { +func TestUnit_MarshalBytes(t *testing.T) { for _, test := range encodeBytesTests { in := test.input.([]byte) out, err := json.Marshal(PlainHexBytes(in)) diff --git a/core/utils/safe/safe_test.go b/core/utils/safe/safe_test.go index e177fc3117a..c0ec9e205ac 100644 --- a/core/utils/safe/safe_test.go +++ b/core/utils/safe/safe_test.go @@ -6,7 +6,7 @@ import ( "testing" ) -func TestIntToUint64(t *testing.T) { +func TestUnit_IntToUint64(t *testing.T) { // Test Case 1: Positive integer within the range of uint64 t.Run("PositiveInteger", func(t *testing.T) { input := 12345 diff --git a/core/utils/safe_math_test.go b/core/utils/safe_math_test.go index 8295c81ff45..c0dff1a5e66 100644 --- a/core/utils/safe_math_test.go +++ b/core/utils/safe_math_test.go @@ -8,7 +8,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils" ) -func Test_NonNegativeInt64ToUint64(t *testing.T) { +func TestUnit_NonNegativeInt64ToUint64(t *testing.T) { tests := []struct { input int64 expected uint64 diff --git a/core/utils/stringutils/string_utils_test.go b/core/utils/stringutils/string_utils_test.go index f4206609d7c..5d47390307e 100644 --- a/core/utils/stringutils/string_utils_test.go +++ b/core/utils/stringutils/string_utils_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestStringUtils_ToInt64(t *testing.T) { +func TestUnit_StringUtils_ToInt64(t *testing.T) { t.Parallel() want := int64(12) @@ -18,7 +18,7 @@ func TestStringUtils_ToInt64(t *testing.T) { assert.Equal(t, want, got) } -func TestStringUtils_FromInt64(t *testing.T) { +func TestUnit_StringUtils_FromInt64(t *testing.T) { t.Parallel() want := "12" @@ -28,7 +28,7 @@ func TestStringUtils_FromInt64(t *testing.T) { assert.Equal(t, want, got) } -func TestStringUtils_ToInt32(t *testing.T) { +func TestUnit_StringUtils_ToInt32(t *testing.T) { t.Parallel() want := int32(32) @@ -39,7 +39,7 @@ func TestStringUtils_ToInt32(t *testing.T) { assert.Equal(t, want, got) } -func TestStringUtils_FromInt32(t *testing.T) { +func TestUnit_StringUtils_FromInt32(t *testing.T) { t.Parallel() want := "32" diff --git a/core/utils/thread_control_test.go b/core/utils/thread_control_test.go index 4254d8106ee..cf6b0e5acab 100644 --- a/core/utils/thread_control_test.go +++ b/core/utils/thread_control_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestThreadControl_Close(t *testing.T) { +func TestUnit_ThreadControl_Close(t *testing.T) { n := 10 tc := NewThreadControl() @@ -29,7 +29,7 @@ func TestThreadControl_Close(t *testing.T) { require.Equal(t, int32(n), finished.Load()) } -func TestThreadControl_GoCtx(t *testing.T) { +func TestUnit_ThreadControl_GoCtx(t *testing.T) { tc := NewThreadControl() defer tc.Close() diff --git a/core/utils/tomlutils/toml_test.go b/core/utils/tomlutils/toml_test.go index b640eee73eb..1349055fd35 100644 --- a/core/utils/tomlutils/toml_test.go +++ b/core/utils/tomlutils/toml_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestUtils_TomlFloat32_Success_Decimal(t *testing.T) { +func TestUnit_Utils_TomlFloat32_Success_Decimal(t *testing.T) { t.Parallel() var tomlF32 Float32 @@ -17,7 +17,7 @@ func TestUtils_TomlFloat32_Success_Decimal(t *testing.T) { assert.Equal(t, tomlF32, Float32(0.23)) } -func TestUtils_TomlFloat32_Success_Integer(t *testing.T) { +func TestUnit_Utils_TomlFloat32_Success_Integer(t *testing.T) { t.Parallel() var tomlF32 Float32 @@ -28,7 +28,7 @@ func TestUtils_TomlFloat32_Success_Integer(t *testing.T) { assert.Equal(t, tomlF32, Float32(13)) } -func TestUtils_TomlFloat32_Failure(t *testing.T) { +func TestUnit_Utils_TomlFloat32_Failure(t *testing.T) { t.Parallel() var tomlF32 Float32 @@ -38,7 +38,7 @@ func TestUtils_TomlFloat32_Failure(t *testing.T) { assert.Error(t, err) } -func TestUtils_TomlFloat64_Success_Decimal(t *testing.T) { +func TestUnit_Utils_TomlFloat64_Success_Decimal(t *testing.T) { t.Parallel() var tomlF64 Float64 @@ -49,7 +49,7 @@ func TestUtils_TomlFloat64_Success_Decimal(t *testing.T) { assert.Equal(t, tomlF64, Float64(2.82)) } -func TestUtils_TomlFloat64_Success_Integer(t *testing.T) { +func TestUnit_Utils_TomlFloat64_Success_Integer(t *testing.T) { t.Parallel() var tomlF64 Float64 @@ -60,7 +60,7 @@ func TestUtils_TomlFloat64_Success_Integer(t *testing.T) { assert.Equal(t, tomlF64, Float64(3)) } -func TestUtils_TomlFloat64_Failure(t *testing.T) { +func TestUnit_Utils_TomlFloat64_Failure(t *testing.T) { t.Parallel() var tomlF64 Float64 diff --git a/core/utils/utils_test.go b/core/utils/utils_test.go index 50ba08477b4..a38f29bb3bb 100644 --- a/core/utils/utils_test.go +++ b/core/utils/utils_test.go @@ -18,14 +18,14 @@ import ( "github.com/stretchr/testify/require" ) -func TestUtils_NewBytes32ID(t *testing.T) { +func TestUnit_Utils_NewBytes32ID(t *testing.T) { t.Parallel() id := utils.NewBytes32ID() assert.NotContains(t, id, "-") } -func TestUtils_NewSecret(t *testing.T) { +func TestUnit_Utils_NewSecret(t *testing.T) { t.Parallel() tests := []struct { @@ -44,7 +44,7 @@ func TestUtils_NewSecret(t *testing.T) { } } -func TestUtils_StringToHex(t *testing.T) { +func TestUnit_Utils_StringToHex(t *testing.T) { t.Parallel() tests := []struct { @@ -65,7 +65,7 @@ func TestUtils_StringToHex(t *testing.T) { } } -func TestUtils_DurationFromNow(t *testing.T) { +func TestUnit_Utils_DurationFromNow(t *testing.T) { t.Parallel() future := time.Now().Add(time.Second) @@ -73,7 +73,7 @@ func TestUtils_DurationFromNow(t *testing.T) { assert.Positive(t, duration) } -func TestBoundedQueue(t *testing.T) { +func TestUnit_BoundedQueue(t *testing.T) { t.Parallel() q := utils.NewBoundedQueue[int](3) @@ -113,7 +113,7 @@ func TestBoundedQueue(t *testing.T) { require.False(t, q.Full()) } -func TestBoundedPriorityQueue(t *testing.T) { +func TestUnit_BoundedPriorityQueue(t *testing.T) { t.Parallel() q := utils.NewBoundedPriorityQueue[int](map[uint]int{ @@ -165,7 +165,7 @@ func TestBoundedPriorityQueue(t *testing.T) { require.Zero(t, q.Take()) } -func Test_WithJitter(t *testing.T) { +func TestUnit_WithJitter(t *testing.T) { t.Parallel() d := 10 * time.Second @@ -177,7 +177,7 @@ func Test_WithJitter(t *testing.T) { } } -func TestIsEmpty(t *testing.T) { +func TestUnit_IsEmpty(t *testing.T) { t.Parallel() b := make([]byte, 32) @@ -187,7 +187,7 @@ func TestIsEmpty(t *testing.T) { assert.False(t, utils.IsEmpty(b)) } -func TestHashPassword(t *testing.T) { +func TestUnit_HashPassword(t *testing.T) { t.Parallel() h, err := utils.HashPassword("Qwerty123!") @@ -201,7 +201,7 @@ func TestHashPassword(t *testing.T) { assert.False(t, ok) } -func TestISO8601UTC(t *testing.T) { +func TestUnit_ISO8601UTC(t *testing.T) { t.Parallel() ts := time.Unix(1651818206, 0) @@ -209,7 +209,7 @@ func TestISO8601UTC(t *testing.T) { assert.Equal(t, "2022-05-06T06:23:26Z", str) } -func TestFormatJSON(t *testing.T) { +func TestUnit_FormatJSON(t *testing.T) { t.Parallel() json := `{"foo":123}` @@ -218,7 +218,7 @@ func TestFormatJSON(t *testing.T) { assert.Equal(t, "\"{\\\"foo\\\":123}\"", string(formatted)) } -func TestMustUnmarshalToMap(t *testing.T) { +func TestUnit_MustUnmarshalToMap(t *testing.T) { t.Parallel() json := `{"foo":123.45}` @@ -236,7 +236,7 @@ func TestMustUnmarshalToMap(t *testing.T) { }) } -func TestSha256(t *testing.T) { +func TestUnit_Sha256(t *testing.T) { t.Parallel() hexHash, err := utils.Sha256("test") @@ -247,7 +247,7 @@ func TestSha256(t *testing.T) { assert.Len(t, hash, 32) } -func TestWithCloseChan(t *testing.T) { +func TestUnit_WithCloseChan(t *testing.T) { t.Parallel() assertCtxCancelled := func(ctx context.Context, t *testing.T) { @@ -296,7 +296,7 @@ func TestWithCloseChan(t *testing.T) { }) } -func TestContextFromChan(t *testing.T) { +func TestUnit_ContextFromChan(t *testing.T) { t.Parallel() ch := make(chan struct{}) @@ -312,7 +312,7 @@ func TestContextFromChan(t *testing.T) { } } -func TestContextFromChanWithTimeout(t *testing.T) { +func TestUnit_ContextFromChanWithTimeout(t *testing.T) { t.Parallel() assertCtxCancelled := func(ctx context.Context, t *testing.T) { @@ -346,7 +346,7 @@ func TestContextFromChanWithTimeout(t *testing.T) { }) } -func TestLeftPadBitString(t *testing.T) { +func TestUnit_LeftPadBitString(t *testing.T) { t.Parallel() for _, test := range []struct { @@ -365,7 +365,7 @@ func TestLeftPadBitString(t *testing.T) { } } -func TestValidateCronSchedule(t *testing.T) { +func TestUnit_ValidateCronSchedule(t *testing.T) { t.Parallel() err := utils.ValidateCronSchedule("") @@ -381,7 +381,7 @@ func TestValidateCronSchedule(t *testing.T) { assert.Error(t, err) } -func TestPausableTicker(t *testing.T) { +func TestUnit_PausableTicker(t *testing.T) { t.Parallel() var counter atomic.Int32 @@ -416,7 +416,7 @@ func TestPausableTicker(t *testing.T) { wait20.AwaitOrFail(t) } -func TestCronTicker(t *testing.T) { +func TestUnit_CronTicker(t *testing.T) { t.Parallel() var counter atomic.Int32 @@ -448,7 +448,7 @@ func TestCronTicker(t *testing.T) { assert.Equal(t, c, counter.Load()) } -func TestErrorBuffer(t *testing.T) { +func TestUnit_ErrorBuffer(t *testing.T) { t.Parallel() err1 := errors.New("err1") diff --git a/core/web/api_test.go b/core/web/api_test.go index 76ea1951db0..9d6469cb967 100644 --- a/core/web/api_test.go +++ b/core/web/api_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestApi_ParsePaginatedRequest(t *testing.T) { +func TestIntegration_Shared_Api_ParsePaginatedRequest(t *testing.T) { t.Parallel() tests := []struct { @@ -56,7 +56,7 @@ func (r *TestResource) SetID(value string) error { return nil } -func TestApi_NewPaginatedResponse(t *testing.T) { +func TestIntegration_Shared_Api_NewPaginatedResponse(t *testing.T) { t.Parallel() tests := []struct { @@ -121,7 +121,7 @@ func TestApi_NewPaginatedResponse(t *testing.T) { } } -func TestPagination_ParsePaginatedResponse(t *testing.T) { +func TestIntegration_Shared_Pagination_ParsePaginatedResponse(t *testing.T) { t.Parallel() var docs []TestResource @@ -149,7 +149,7 @@ func (d DummyResource) GetID() string { return d.ID } -func TestNewJSONAPIResponse(t *testing.T) { +func TestIntegration_Shared_NewJSONAPIResponse(t *testing.T) { t.Parallel() buffer, err := NewJSONAPIResponse(12981) diff --git a/core/web/aptos_keys_controller_test.go b/core/web/aptos_keys_controller_test.go index 30ea49d9ded..460f34a12b2 100644 --- a/core/web/aptos_keys_controller_test.go +++ b/core/web/aptos_keys_controller_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func TestAptosKeysController_Index_HappyPath(t *testing.T) { +func TestIntegration_Shared_AptosKeysController_Index_HappyPath(t *testing.T) { t.Parallel() client, keyStore := setupAptosKeysControllerTests(t) @@ -35,7 +35,7 @@ func TestAptosKeysController_Index_HappyPath(t *testing.T) { assert.Equal(t, keys[0].PublicKeyStr(), resources[0].PubKey) } -func TestAptosKeysController_Create_HappyPath(t *testing.T) { +func TestIntegration_Shared_AptosKeysController_Create_HappyPath(t *testing.T) { t.Parallel() app := cltest.NewApplicationEVMDisabled(t) @@ -61,7 +61,7 @@ func TestAptosKeysController_Create_HappyPath(t *testing.T) { require.NoError(t, err) } -func TestAptosKeysController_Delete_NonExistentAptosKeyID(t *testing.T) { +func TestIntegration_Shared_AptosKeysController_Delete_NonExistentAptosKeyID(t *testing.T) { t.Parallel() client, _ := setupAptosKeysControllerTests(t) @@ -72,7 +72,7 @@ func TestAptosKeysController_Delete_NonExistentAptosKeyID(t *testing.T) { assert.Equal(t, http.StatusNotFound, response.StatusCode) } -func TestAptosKeysController_Delete_HappyPath(t *testing.T) { +func TestIntegration_Shared_AptosKeysController_Delete_HappyPath(t *testing.T) { t.Parallel() ctx := testutils.Context(t) diff --git a/core/web/auth/auth_test.go b/core/web/auth/auth_test.go index e5d973efa95..0785cf7c083 100644 --- a/core/web/auth/auth_test.go +++ b/core/web/auth/auth_test.go @@ -60,7 +60,7 @@ func (u userFindSuccesser) FindUserByAPIToken(ctx context.Context, token string) return u.user, nil } -func TestAuthenticateByToken_Success(t *testing.T) { +func TestUnit_AuthenticateByToken_Success(t *testing.T) { user := cltest.MustRandomUser(t) key, secret := uuid.New().String(), uuid.New().String() apiToken := auth.Token{AccessKey: key, Secret: secret} @@ -86,7 +86,7 @@ func TestAuthenticateByToken_Success(t *testing.T) { assert.Equal(t, http.StatusText(http.StatusOK), http.StatusText(w.Code)) } -func TestAuthenticateByToken_AuthFailed(t *testing.T) { +func TestUnit_AuthenticateByToken_AuthFailed(t *testing.T) { authr := userFindFailer{err: auth.ErrorAuthFailed} called := false @@ -107,7 +107,7 @@ func TestAuthenticateByToken_AuthFailed(t *testing.T) { assert.Equal(t, http.StatusText(http.StatusUnauthorized), http.StatusText(w.Code)) } -func TestAuthenticateByToken_RejectsBlankAccessKey(t *testing.T) { +func TestUnit_AuthenticateByToken_RejectsBlankAccessKey(t *testing.T) { user := cltest.MustRandomUser(t) key, secret := "", uuid.New().String() apiToken := auth.Token{AccessKey: key, Secret: secret} @@ -133,7 +133,7 @@ func TestAuthenticateByToken_RejectsBlankAccessKey(t *testing.T) { assert.Equal(t, http.StatusText(http.StatusUnauthorized), http.StatusText(w.Code)) } -func TestRequireAuth_NoneRequired(t *testing.T) { +func TestUnit_RequireAuth_NoneRequired(t *testing.T) { called := false var authr webauth.Authenticator @@ -152,7 +152,7 @@ func TestRequireAuth_NoneRequired(t *testing.T) { assert.Equal(t, http.StatusText(http.StatusOK), http.StatusText(w.Code)) } -func TestRequireAuth_AuthFailed(t *testing.T) { +func TestUnit_RequireAuth_AuthFailed(t *testing.T) { called := false var authr webauth.Authenticator router := gin.New() @@ -170,7 +170,7 @@ func TestRequireAuth_AuthFailed(t *testing.T) { assert.Equal(t, http.StatusText(http.StatusUnauthorized), http.StatusText(w.Code)) } -func TestRequireAuth_LastAuthSuccess(t *testing.T) { +func TestUnit_RequireAuth_LastAuthSuccess(t *testing.T) { called := false var authr webauth.Authenticator router := gin.New() @@ -188,7 +188,7 @@ func TestRequireAuth_LastAuthSuccess(t *testing.T) { assert.Equal(t, http.StatusText(http.StatusOK), http.StatusText(w.Code)) } -func TestRequireAuth_Error(t *testing.T) { +func TestUnit_RequireAuth_Error(t *testing.T) { called := false var authr webauth.Authenticator router := gin.New() @@ -342,7 +342,7 @@ var routesRolesMap = [...]routeRules{ // because hitting the handler are not mocked and will crash as expected // Iterate over the above routesRolesMap and assert each path is wrapped and // the user role is enforced with the correct middleware -func TestRBAC_Routemap_Admin(t *testing.T) { +func TestIntegration_Shared_RBAC_Routemap_Admin(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) @@ -380,7 +380,7 @@ func TestRBAC_Routemap_Admin(t *testing.T) { } } -func TestRBAC_Routemap_Edit(t *testing.T) { +func TestIntegration_Shared_RBAC_Routemap_Edit(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) @@ -427,7 +427,7 @@ func TestRBAC_Routemap_Edit(t *testing.T) { } } -func TestRBAC_Routemap_Run(t *testing.T) { +func TestIntegration_Shared_RBAC_Routemap_Run(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) @@ -474,7 +474,7 @@ func TestRBAC_Routemap_Run(t *testing.T) { } } -func TestRBAC_Routemap_ViewOnly(t *testing.T) { +func TestIntegration_Shared_RBAC_Routemap_ViewOnly(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) diff --git a/core/web/auth/gql_test.go b/core/web/auth/gql_test.go index 16ecdbf6883..13013579547 100644 --- a/core/web/auth/gql_test.go +++ b/core/web/auth/gql_test.go @@ -19,7 +19,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/auth" ) -func Test_AuthenticateGQL_Unauthenticated(t *testing.T) { +func TestUnit_AuthenticateGQL_Unauthenticated(t *testing.T) { t.Parallel() sessionORM := mocks.NewAuthenticationProvider(t) @@ -42,7 +42,7 @@ func Test_AuthenticateGQL_Unauthenticated(t *testing.T) { r.ServeHTTP(w, req) } -func Test_AuthenticateGQL_Authenticated(t *testing.T) { +func TestUnit_AuthenticateGQL_Authenticated(t *testing.T) { t.Parallel() sessionORM := mocks.NewAuthenticationProvider(t) @@ -71,7 +71,7 @@ func Test_AuthenticateGQL_Authenticated(t *testing.T) { r.ServeHTTP(w, req) } -func Test_GetAndSetGQLAuthenticatedSession(t *testing.T) { +func TestUnit_GetAndSetGQLAuthenticatedSession(t *testing.T) { t.Parallel() ctx := testutils.Context(t) diff --git a/core/web/bridge_types_controller_test.go b/core/web/bridge_types_controller_test.go index 28e590d2901..a6566f5acf7 100644 --- a/core/web/bridge_types_controller_test.go +++ b/core/web/bridge_types_controller_test.go @@ -20,7 +20,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestValidateBridgeType(t *testing.T) { +func TestIntegration_Shared_ValidateBridgeType(t *testing.T) { t.Parallel() tests := []struct { @@ -111,7 +111,7 @@ func TestValidateBridgeType(t *testing.T) { } } -func TestValidateBridgeNotExist(t *testing.T) { +func TestIntegration_Shared_ValidateBridgeNotExist(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -143,7 +143,7 @@ func BenchmarkBridgeTypesController_Index(b *testing.B) { } } -func TestBridgeTypesController_Index(t *testing.T) { +func TestIntegration_Shared_BridgeTypesController_Index(t *testing.T) { t.Parallel() app := cltest.NewApplication(t) @@ -212,7 +212,7 @@ func setupBridgeControllerIndex(t testing.TB, orm bridges.ORM) ([]*bridges.Bridg return []*bridges.BridgeType{bt1, bt2}, err } -func TestBridgeTypesController_Create_Success(t *testing.T) { +func TestIntegration_Shared_BridgeTypesController_Create_Success(t *testing.T) { t.Parallel() app := cltest.NewApplication(t) @@ -241,7 +241,7 @@ func TestBridgeTypesController_Create_Success(t *testing.T) { assert.NotEmpty(t, bt.OutgoingToken) } -func TestBridgeTypesController_Update_Success(t *testing.T) { +func TestIntegration_Shared_BridgeTypesController_Update_Success(t *testing.T) { t.Parallel() app := cltest.NewApplication(t) @@ -267,7 +267,7 @@ func TestBridgeTypesController_Update_Success(t *testing.T) { assert.Equal(t, cltest.WebURL(t, "http://yourbridge"), ubt.URL) } -func TestBridgeController_Show(t *testing.T) { +func TestIntegration_Shared_BridgeController_Show(t *testing.T) { t.Parallel() app := cltest.NewApplication(t) @@ -298,7 +298,7 @@ func TestBridgeController_Show(t *testing.T) { assert.Equal(t, http.StatusNotFound, resp.StatusCode, "Response should be 404") } -func TestBridgeTypesController_Create_AdapterExistsError(t *testing.T) { +func TestIntegration_Shared_BridgeTypesController_Create_AdapterExistsError(t *testing.T) { t.Parallel() app := cltest.NewApplication(t) @@ -314,7 +314,7 @@ func TestBridgeTypesController_Create_AdapterExistsError(t *testing.T) { cltest.AssertServerResponse(t, resp, http.StatusBadRequest) } -func TestBridgeTypesController_Create_BindJSONError(t *testing.T) { +func TestIntegration_Shared_BridgeTypesController_Create_BindJSONError(t *testing.T) { t.Parallel() app := cltest.NewApplication(t) @@ -330,7 +330,7 @@ func TestBridgeTypesController_Create_BindJSONError(t *testing.T) { cltest.AssertServerResponse(t, resp, http.StatusUnprocessableEntity) } -func TestBridgeTypesController_Create_DatabaseError(t *testing.T) { +func TestIntegration_Shared_BridgeTypesController_Create_DatabaseError(t *testing.T) { t.Parallel() app := cltest.NewApplication(t) diff --git a/core/web/build_info_controller_test.go b/core/web/build_info_controller_test.go index 5448ad82a21..ba4a6b7d115 100644 --- a/core/web/build_info_controller_test.go +++ b/core/web/build_info_controller_test.go @@ -12,7 +12,7 @@ import ( clhttptest "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/httptest" ) -func TestBuildInfoController_Show_APICredentials(t *testing.T) { +func TestIntegration_Shared_BuildInfoController_Show_APICredentials(t *testing.T) { t.Parallel() app := cltest.NewApplicationEVMDisabled(t) @@ -31,7 +31,7 @@ func TestBuildInfoController_Show_APICredentials(t *testing.T) { require.Contains(t, strings.TrimSpace(body), "versionTag") } -func TestBuildInfoController_Show_NoCredentials(t *testing.T) { +func TestIntegration_Shared_BuildInfoController_Show_NoCredentials(t *testing.T) { t.Parallel() app := cltest.NewApplicationEVMDisabled(t) diff --git a/core/web/capability_controller_test.go b/core/web/capability_controller_test.go index 65b87ebbf42..71b7908da6f 100644 --- a/core/web/capability_controller_test.go +++ b/core/web/capability_controller_test.go @@ -23,7 +23,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web" ) -func TestCapabilityController_ExecuteCapability_MissingBody(t *testing.T) { +func TestUnit_CapabilityController_ExecuteCapability_MissingBody(t *testing.T) { mockApp := appmocks.NewApplication(t) controller := web.CapabilityController{App: mockApp} @@ -40,7 +40,7 @@ func TestCapabilityController_ExecuteCapability_MissingBody(t *testing.T) { assert.Equal(t, http.StatusBadRequest, w.Code) } -func TestCapabilityController_ExecuteCapability_RegistryNotInitialized(t *testing.T) { +func TestUnit_CapabilityController_ExecuteCapability_RegistryNotInitialized(t *testing.T) { mockApp := appmocks.NewApplication(t) requestBody := web.CapabilityRequestOuter{ CapabilityName: "test-capability", @@ -63,7 +63,7 @@ func TestCapabilityController_ExecuteCapability_RegistryNotInitialized(t *testin assert.Equal(t, http.StatusInternalServerError, w.Code) } -func TestCapabilityController_ExecuteCapability_MissingRequiredFields(t *testing.T) { +func TestUnit_CapabilityController_ExecuteCapability_MissingRequiredFields(t *testing.T) { mockApp := appmocks.NewApplication(t) mockApp.EXPECT().GetCapabilitiesRegistry().Return(nil) @@ -83,7 +83,7 @@ func TestCapabilityController_ExecuteCapability_MissingRequiredFields(t *testing assert.Equal(t, http.StatusInternalServerError, w.Code) } -func TestCapabilityController_ExecuteCapability(t *testing.T) { +func TestUnit_CapabilityController_ExecuteCapability(t *testing.T) { mockApp := appmocks.NewApplication(t) mockRegistry := registrymock.NewCapabilitiesRegistry(t) mockApp.EXPECT().GetCapabilitiesRegistry().Return(&capabilities.Registry{ diff --git a/core/web/chains_controller_integration_test.go b/core/web/chains_controller_integration_test.go index 6e80932e1c8..ee1663a3682 100644 --- a/core/web/chains_controller_integration_test.go +++ b/core/web/chains_controller_integration_test.go @@ -23,7 +23,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func Test_CosmosChainsController_Show(t *testing.T) { +func TestUnit_CosmosChainsController_Show(t *testing.T) { t.Parallel() const validID = "Chainlink-12" @@ -130,7 +130,7 @@ TendermintURL = 'http://tender.mint' `, rc.ChainID(), gasPrice, gasLimitMult) } -func Test_CosmosChainsController_Index(t *testing.T) { +func TestUnit_CosmosChainsController_Index(t *testing.T) { t.Parallel() chainA := chainlink.RawConfig{ diff --git a/core/web/chains_controller_test.go b/core/web/chains_controller_test.go index 01ec1c357ad..eaa9e48f96a 100644 --- a/core/web/chains_controller_test.go +++ b/core/web/chains_controller_test.go @@ -31,7 +31,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func Test_EVMChainsController_Show(t *testing.T) { +func TestIntegration_Shared_EVMChainsController_Show(t *testing.T) { t.Parallel() validID := ubig.New(testutils.NewRandomEVMChainID()) @@ -109,7 +109,7 @@ func Test_EVMChainsController_Show(t *testing.T) { } } -func Test_EVMChainsController_Index(t *testing.T) { +func TestIntegration_Shared_EVMChainsController_Index(t *testing.T) { quarantine.Flaky(t, "DX-1795") t.Parallel() @@ -230,7 +230,7 @@ func setupEVMChainsControllerTest(t *testing.T, cfg chainlink.GeneralConfig) *Te } } -func Test_SolanaChainsController_Show(t *testing.T) { +func TestIntegration_Shared_SolanaChainsController_Show(t *testing.T) { t.Parallel() const validID = "Chainlink-12" @@ -353,7 +353,7 @@ FinalizedBlockOffset = 50 } } -func Test_SolanaChainsController_Index(t *testing.T) { +func TestIntegration_Shared_SolanaChainsController_Index(t *testing.T) { t.Parallel() chainA := &config.TOMLConfig{ diff --git a/core/web/cors_test.go b/core/web/cors_test.go index c08e11bc125..da932616417 100644 --- a/core/web/cors_test.go +++ b/core/web/cors_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" ) -func TestCors_DefaultOrigins(t *testing.T) { +func TestIntegration_Shared_Cors_DefaultOrigins(t *testing.T) { t.Parallel() config := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { @@ -39,7 +39,7 @@ func TestCors_DefaultOrigins(t *testing.T) { } } -func TestCors_OverrideOrigins(t *testing.T) { +func TestIntegration_Shared_Cors_OverrideOrigins(t *testing.T) { t.Parallel() tests := []struct { diff --git a/core/web/cosmos_keys_controller_test.go b/core/web/cosmos_keys_controller_test.go index c5377c3d3a9..87c76c0806c 100644 --- a/core/web/cosmos_keys_controller_test.go +++ b/core/web/cosmos_keys_controller_test.go @@ -15,7 +15,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestCosmosKeysController_Index_HappyPath(t *testing.T) { +func TestIntegration_Shared_CosmosKeysController_Index_HappyPath(t *testing.T) { t.Parallel() client, keyStore := setupCosmosKeysControllerTests(t) @@ -35,7 +35,7 @@ func TestCosmosKeysController_Index_HappyPath(t *testing.T) { assert.Equal(t, keys[0].PublicKeyStr(), resources[0].PubKey) } -func TestCosmosKeysController_Create_HappyPath(t *testing.T) { +func TestIntegration_Shared_CosmosKeysController_Create_HappyPath(t *testing.T) { t.Parallel() app := cltest.NewApplicationEVMDisabled(t) @@ -62,7 +62,7 @@ func TestCosmosKeysController_Create_HappyPath(t *testing.T) { require.NoError(t, err) } -func TestCosmosKeysController_Delete_NonExistentCosmosKeyID(t *testing.T) { +func TestIntegration_Shared_CosmosKeysController_Delete_NonExistentCosmosKeyID(t *testing.T) { t.Parallel() client, _ := setupCosmosKeysControllerTests(t) @@ -73,7 +73,7 @@ func TestCosmosKeysController_Delete_NonExistentCosmosKeyID(t *testing.T) { assert.Equal(t, http.StatusNotFound, response.StatusCode) } -func TestCosmosKeysController_Delete_HappyPath(t *testing.T) { +func TestIntegration_Shared_CosmosKeysController_Delete_HappyPath(t *testing.T) { t.Parallel() ctx := testutils.Context(t) diff --git a/core/web/dkg_recipient_keys_controller_test.go b/core/web/dkg_recipient_keys_controller_test.go index 34e3bfafd02..0843c6617e9 100644 --- a/core/web/dkg_recipient_keys_controller_test.go +++ b/core/web/dkg_recipient_keys_controller_test.go @@ -29,7 +29,7 @@ func setupDKGRecipientKeysControllerTests(t *testing.T) (cltest.HTTPClientCleane return client, app.GetKeyStore() } -func TestDKGRecipientKeysController_Index_HappyPath(t *testing.T) { +func TestIntegration_Shared_DKGRecipientKeysController_Index_HappyPath(t *testing.T) { client, keyStore := setupDKGRecipientKeysControllerTests(t) keys, err := keyStore.DKGRecipient().GetAll() require.NoError(t, err) diff --git a/core/web/eth_keys_controller_test.go b/core/web/eth_keys_controller_test.go index 5effbcbd6e6..5bbd41e2888 100644 --- a/core/web/eth_keys_controller_test.go +++ b/core/web/eth_keys_controller_test.go @@ -26,7 +26,7 @@ import ( webpresenters "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func TestETHKeysController_Index_Success(t *testing.T) { +func TestIntegration_Shared_ETHKeysController_Index_Success(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -77,7 +77,7 @@ func TestETHKeysController_Index_Success(t *testing.T) { } } -func TestETHKeysController_Index_Errors(t *testing.T) { +func TestIntegration_Shared_ETHKeysController_Index_Errors(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -115,7 +115,7 @@ func TestETHKeysController_Index_Errors(t *testing.T) { assert.Equal(t, "115792089237316195423570985008687907853269984665640564039457584007913129639935", balance.MaxGasPriceWei.String()) } -func TestETHKeysController_Index_Disabled(t *testing.T) { +func TestIntegration_Shared_ETHKeysController_Index_Disabled(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -149,7 +149,7 @@ func TestETHKeysController_Index_Disabled(t *testing.T) { assert.Nil(t, balance.MaxGasPriceWei) } -func TestETHKeysController_Index_NotDev(t *testing.T) { +func TestIntegration_Shared_ETHKeysController_Index_NotDev(t *testing.T) { t.Parallel() ethClient := cltest.NewEthMocksWithStartupAssertions(t) @@ -185,7 +185,7 @@ func TestETHKeysController_Index_NotDev(t *testing.T) { assert.Equal(t, "256", only.LinkBalance.String()) } -func TestETHKeysController_Index_NoAccounts(t *testing.T) { +func TestIntegration_Shared_ETHKeysController_Index_NoAccounts(t *testing.T) { t.Parallel() app := cltest.NewApplication(t) @@ -204,7 +204,7 @@ func TestETHKeysController_Index_NoAccounts(t *testing.T) { assert.Empty(t, balances) } -func TestETHKeysController_CreateSuccess(t *testing.T) { +func TestIntegration_Shared_ETHKeysController_CreateSuccess(t *testing.T) { t.Parallel() config := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { @@ -245,7 +245,7 @@ func TestETHKeysController_CreateSuccess(t *testing.T) { assert.Equal(t, "115792089237316195423570985008687907853269984665640564039457584007913129639935", balance.MaxGasPriceWei.String()) } -func TestETHKeysController_ChainSuccess_UpdateNonce(t *testing.T) { +func TestIntegration_Shared_ETHKeysController_ChainSuccess_UpdateNonce(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -287,7 +287,7 @@ func TestETHKeysController_ChainSuccess_UpdateNonce(t *testing.T) { assert.False(t, updatedKey.Disabled) } -func TestETHKeysController_ChainSuccess_Disable(t *testing.T) { +func TestIntegration_Shared_ETHKeysController_ChainSuccess_Disable(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -332,7 +332,7 @@ func TestETHKeysController_ChainSuccess_Disable(t *testing.T) { assert.True(t, updatedKey.Disabled) } -func TestETHKeysController_ChainSuccess_Enable(t *testing.T) { +func TestIntegration_Shared_ETHKeysController_ChainSuccess_Enable(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -376,7 +376,7 @@ func TestETHKeysController_ChainSuccess_Enable(t *testing.T) { assert.False(t, updatedKey.Disabled) } -func TestETHKeysController_ChainSuccess_ResetWithAbandon(t *testing.T) { +func TestIntegration_Shared_ETHKeysController_ChainSuccess_ResetWithAbandon(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -449,7 +449,7 @@ func TestETHKeysController_ChainSuccess_ResetWithAbandon(t *testing.T) { assert.Equal(t, "abandoned", tx.Error.String) } -func TestETHKeysController_ChainFailure_InvalidAbandon(t *testing.T) { +func TestIntegration_Shared_ETHKeysController_ChainFailure_InvalidAbandon(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -483,7 +483,7 @@ func TestETHKeysController_ChainFailure_InvalidAbandon(t *testing.T) { assert.Equal(t, http.StatusBadRequest, resp.StatusCode) } -func TestETHKeysController_ChainFailure_InvalidEnabled(t *testing.T) { +func TestIntegration_Shared_ETHKeysController_ChainFailure_InvalidEnabled(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -517,7 +517,7 @@ func TestETHKeysController_ChainFailure_InvalidEnabled(t *testing.T) { assert.Equal(t, http.StatusBadRequest, resp.StatusCode) } -func TestETHKeysController_ChainFailure_InvalidAddress(t *testing.T) { +func TestIntegration_Shared_ETHKeysController_ChainFailure_InvalidAddress(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -546,7 +546,7 @@ func TestETHKeysController_ChainFailure_InvalidAddress(t *testing.T) { assert.Equal(t, http.StatusBadRequest, resp.StatusCode) } -func TestETHKeysController_ChainFailure_MissingAddress(t *testing.T) { +func TestIntegration_Shared_ETHKeysController_ChainFailure_MissingAddress(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -575,7 +575,7 @@ func TestETHKeysController_ChainFailure_MissingAddress(t *testing.T) { assert.Equal(t, http.StatusInternalServerError, resp.StatusCode) } -func TestETHKeysController_ChainFailure_InvalidChainID(t *testing.T) { +func TestIntegration_Shared_ETHKeysController_ChainFailure_InvalidChainID(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -604,7 +604,7 @@ func TestETHKeysController_ChainFailure_InvalidChainID(t *testing.T) { assert.Equal(t, http.StatusBadRequest, resp.StatusCode) } -func TestETHKeysController_ChainFailure_MissingChainID(t *testing.T) { +func TestIntegration_Shared_ETHKeysController_ChainFailure_MissingChainID(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -637,7 +637,7 @@ func TestETHKeysController_ChainFailure_MissingChainID(t *testing.T) { assert.Equal(t, http.StatusNotFound, resp.StatusCode) } -func TestETHKeysController_DeleteSuccess(t *testing.T) { +func TestIntegration_Shared_ETHKeysController_DeleteSuccess(t *testing.T) { t.Parallel() ctx := testutils.Context(t) ethClient := cltest.NewEthMocksWithStartupAssertions(t) @@ -688,7 +688,7 @@ func TestETHKeysController_DeleteSuccess(t *testing.T) { assert.Equal(t, addr1.String(), balance.Address) } -func TestETHKeysController_DeleteFailure_InvalidAddress(t *testing.T) { +func TestIntegration_Shared_ETHKeysController_DeleteFailure_InvalidAddress(t *testing.T) { t.Parallel() ctx := testutils.Context(t) ethClient := cltest.NewEthMocksWithStartupAssertions(t) @@ -710,7 +710,7 @@ func TestETHKeysController_DeleteFailure_InvalidAddress(t *testing.T) { assert.Equal(t, http.StatusBadRequest, resp.StatusCode) } -func TestETHKeysController_DeleteFailure_KeyMissing(t *testing.T) { +func TestIntegration_Shared_ETHKeysController_DeleteFailure_KeyMissing(t *testing.T) { t.Parallel() ctx := testutils.Context(t) ethClient := cltest.NewEthMocksWithStartupAssertions(t) diff --git a/core/web/evm_forwarders_controller_test.go b/core/web/evm_forwarders_controller_test.go index a5167987ad8..6bb9158d54f 100644 --- a/core/web/evm_forwarders_controller_test.go +++ b/core/web/evm_forwarders_controller_test.go @@ -42,7 +42,7 @@ func setupEVMForwardersControllerTest(t *testing.T, overrideFn func(c *chainlink } } -func Test_EVMForwardersController_Track(t *testing.T) { +func TestIntegration_Shared_EVMForwardersController_Track(t *testing.T) { t.Parallel() chainId := big.New(testutils.NewRandomEVMChainID()) @@ -79,7 +79,7 @@ func Test_EVMForwardersController_Track(t *testing.T) { assert.NoError(t, err) } -func Test_EVMForwardersController_Index(t *testing.T) { +func TestIntegration_Shared_EVMForwardersController_Index(t *testing.T) { t.Parallel() chainId := big.New(testutils.NewRandomEVMChainID()) diff --git a/core/web/evm_transactions_controller_test.go b/core/web/evm_transactions_controller_test.go index 462e929b622..cb2e2c661c6 100644 --- a/core/web/evm_transactions_controller_test.go +++ b/core/web/evm_transactions_controller_test.go @@ -19,7 +19,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestTransactionsController_Index_Success(t *testing.T) { +func TestIntegration_Shared_TransactionsController_Index_Success(t *testing.T) { t.Parallel() app := cltest.NewApplicationWithKey(t) @@ -65,7 +65,7 @@ func TestTransactionsController_Index_Success(t *testing.T) { require.Equal(t, "3", txs[1].SentAt, "expected tx attempts order by sentAt descending") } -func TestTransactionsController_Index_Error(t *testing.T) { +func TestIntegration_Shared_TransactionsController_Index_Error(t *testing.T) { t.Parallel() app := cltest.NewApplicationWithKey(t) @@ -78,7 +78,7 @@ func TestTransactionsController_Index_Error(t *testing.T) { cltest.AssertServerResponse(t, resp, 422) } -func TestTransactionsController_Show_Success(t *testing.T) { +func TestIntegration_Shared_TransactionsController_Show_Success(t *testing.T) { t.Parallel() app := cltest.NewApplicationWithKey(t) @@ -112,7 +112,7 @@ func TestTransactionsController_Show_Success(t *testing.T) { assert.Equal(t, txp.Value, ptx.Value) } -func TestTransactionsController_Show_NotFound(t *testing.T) { +func TestIntegration_Shared_TransactionsController_Show_NotFound(t *testing.T) { t.Parallel() app := cltest.NewApplicationWithKey(t) diff --git a/core/web/evm_transfer_controller_test.go b/core/web/evm_transfer_controller_test.go index 974fd113a8f..fa23d4785e3 100644 --- a/core/web/evm_transfer_controller_test.go +++ b/core/web/evm_transfer_controller_test.go @@ -31,7 +31,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestTransfersController_CreateSuccess_From(t *testing.T) { +func TestIntegration_Shared_TransfersController_CreateSuccess_From(t *testing.T) { t.Parallel() key := cltest.MustGenerateRandomKey(t) @@ -74,7 +74,7 @@ func TestTransfersController_CreateSuccess_From(t *testing.T) { validateTxCount(t, app.GetDB(), 1) } -func TestTransfersController_CreateSuccess_From_WEI(t *testing.T) { +func TestIntegration_Shared_TransfersController_CreateSuccess_From_WEI(t *testing.T) { t.Parallel() key := cltest.MustGenerateRandomKey(t) @@ -116,7 +116,7 @@ func TestTransfersController_CreateSuccess_From_WEI(t *testing.T) { validateTxCount(t, app.GetDB(), 1) } -func TestTransfersController_CreateSuccess_From_BalanceMonitorDisabled(t *testing.T) { +func TestIntegration_Shared_TransfersController_CreateSuccess_From_BalanceMonitorDisabled(t *testing.T) { t.Parallel() key := cltest.MustGenerateRandomKey(t) @@ -163,7 +163,7 @@ func TestTransfersController_CreateSuccess_From_BalanceMonitorDisabled(t *testin validateTxCount(t, app.GetDB(), 1) } -func TestTransfersController_TransferZeroAddressError(t *testing.T) { +func TestIntegration_Shared_TransfersController_TransferZeroAddressError(t *testing.T) { t.Parallel() app := cltest.NewApplicationWithKey(t) @@ -189,7 +189,7 @@ func TestTransfersController_TransferZeroAddressError(t *testing.T) { cltest.AssertServerResponse(t, resp, http.StatusUnprocessableEntity) } -func TestTransfersController_TransferBalanceToLowError(t *testing.T) { +func TestIntegration_Shared_TransfersController_TransferBalanceToLowError(t *testing.T) { t.Parallel() key := cltest.MustGenerateRandomKey(t) @@ -225,7 +225,7 @@ func TestTransfersController_TransferBalanceToLowError(t *testing.T) { cltest.AssertServerResponse(t, resp, http.StatusUnprocessableEntity) } -func TestTransfersController_TransferBalanceToLowError_ZeroBalance(t *testing.T) { +func TestIntegration_Shared_TransfersController_TransferBalanceToLowError_ZeroBalance(t *testing.T) { t.Parallel() key := cltest.MustGenerateRandomKey(t) @@ -264,7 +264,7 @@ func TestTransfersController_TransferBalanceToLowError_ZeroBalance(t *testing.T) cltest.AssertServerResponse(t, resp, http.StatusUnprocessableEntity) } -func TestTransfersController_JSONBindingError(t *testing.T) { +func TestIntegration_Shared_TransfersController_JSONBindingError(t *testing.T) { t.Parallel() app := cltest.NewApplicationWithKey(t) @@ -278,7 +278,7 @@ func TestTransfersController_JSONBindingError(t *testing.T) { cltest.AssertServerResponse(t, resp, http.StatusBadRequest) } -func TestTransfersController_CreateSuccess_eip1559(t *testing.T) { +func TestIntegration_Shared_TransfersController_CreateSuccess_eip1559(t *testing.T) { t.Parallel() key := cltest.MustGenerateRandomKey(t) @@ -340,7 +340,7 @@ func TestTransfersController_CreateSuccess_eip1559(t *testing.T) { assert.NotEqual(t, "unstarted", resource.State) } -func TestTransfersController_FindTxAttempt(t *testing.T) { +func TestUnit_TransfersController_FindTxAttempt(t *testing.T) { tx := txmgr.Tx{ID: 1} attempt := txmgr.TxAttempt{ID: 2} txWithAttempt := txmgr.Tx{ID: 1, TxAttempts: []txmgr.TxAttempt{attempt}} diff --git a/core/web/evm_tx_attempts_controller_test.go b/core/web/evm_tx_attempts_controller_test.go index d3cfa5e92d7..845cea98d89 100644 --- a/core/web/evm_tx_attempts_controller_test.go +++ b/core/web/evm_tx_attempts_controller_test.go @@ -15,7 +15,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestTxAttemptsController_Index_Success(t *testing.T) { +func TestIntegration_Shared_TxAttemptsController_Index_Success(t *testing.T) { t.Parallel() app := cltest.NewApplicationWithKey(t) @@ -46,7 +46,7 @@ func TestTxAttemptsController_Index_Success(t *testing.T) { assert.Equal(t, "2", attempts[1].SentAt, "expected tx attempts order by sentAt descending") } -func TestTxAttemptsController_Index_Error(t *testing.T) { +func TestIntegration_Shared_TxAttemptsController_Index_Error(t *testing.T) { t.Parallel() app := cltest.NewApplicationWithKey(t) diff --git a/core/web/external_initiators_controller_test.go b/core/web/external_initiators_controller_test.go index 384fd3a3fd7..26dce2d5290 100644 --- a/core/web/external_initiators_controller_test.go +++ b/core/web/external_initiators_controller_test.go @@ -21,7 +21,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestValidateExternalInitiator(t *testing.T) { +func TestIntegration_Shared_ValidateExternalInitiator(t *testing.T) { t.Parallel() db := pgtest.NewSqlxDB(t) @@ -64,7 +64,7 @@ func TestValidateExternalInitiator(t *testing.T) { } } -func TestExternalInitiatorsController_Index(t *testing.T) { +func TestIntegration_Shared_ExternalInitiatorsController_Index(t *testing.T) { t.Parallel() app := cltest.NewApplicationWithConfig(t, @@ -130,7 +130,7 @@ func TestExternalInitiatorsController_Index(t *testing.T) { assert.Equal(t, eiFoo.OutgoingToken, eis[0].OutgoingToken) } -func TestExternalInitiatorsController_Create_success(t *testing.T) { +func TestIntegration_Shared_ExternalInitiatorsController_Create_success(t *testing.T) { t.Parallel() app := cltest.NewApplicationWithConfig(t, @@ -157,7 +157,7 @@ func TestExternalInitiatorsController_Create_success(t *testing.T) { assert.NotEmpty(t, ei.OutgoingSecret) } -func TestExternalInitiatorsController_Create_without_URL(t *testing.T) { +func TestIntegration_Shared_ExternalInitiatorsController_Create_without_URL(t *testing.T) { t.Parallel() app := cltest.NewApplicationWithConfig(t, @@ -184,7 +184,7 @@ func TestExternalInitiatorsController_Create_without_URL(t *testing.T) { assert.NotEmpty(t, ei.OutgoingSecret) } -func TestExternalInitiatorsController_Create_invalid(t *testing.T) { +func TestIntegration_Shared_ExternalInitiatorsController_Create_invalid(t *testing.T) { t.Parallel() app := cltest.NewApplicationWithConfig(t, @@ -202,7 +202,7 @@ func TestExternalInitiatorsController_Create_invalid(t *testing.T) { cltest.AssertServerResponse(t, resp, http.StatusBadRequest) } -func TestExternalInitiatorsController_Delete(t *testing.T) { +func TestIntegration_Shared_ExternalInitiatorsController_Delete(t *testing.T) { t.Parallel() app := cltest.NewApplicationWithConfig(t, @@ -224,7 +224,7 @@ func TestExternalInitiatorsController_Delete(t *testing.T) { cltest.AssertServerResponse(t, resp, http.StatusNoContent) } -func TestExternalInitiatorsController_DeleteNotFound(t *testing.T) { +func TestIntegration_Shared_ExternalInitiatorsController_DeleteNotFound(t *testing.T) { t.Parallel() app := cltest.NewApplicationWithConfig(t, diff --git a/core/web/features_controller_test.go b/core/web/features_controller_test.go index 02f75f14bc5..c9ee97b763f 100644 --- a/core/web/features_controller_test.go +++ b/core/web/features_controller_test.go @@ -15,7 +15,7 @@ import ( "github.com/stretchr/testify/require" ) -func Test_FeaturesController_List(t *testing.T) { +func TestIntegration_Shared_FeaturesController_List(t *testing.T) { app := cltest.NewApplicationWithConfig(t, configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { csa := true c.Feature.UICSAKeys = &csa diff --git a/core/web/gui_assets_test.go b/core/web/gui_assets_test.go index c3fc5fc38d7..c7efbf97eb0 100644 --- a/core/web/gui_assets_test.go +++ b/core/web/gui_assets_test.go @@ -21,7 +21,7 @@ import ( //go:embed fixtures/operator_ui/assets var testFs embed.FS -func TestGuiAssets_DefaultIndexHtml_OK(t *testing.T) { +func TestIntegration_Shared_GuiAssets_DefaultIndexHtml_OK(t *testing.T) { t.Parallel() app := cltest.NewApplication(t) @@ -52,7 +52,7 @@ func TestGuiAssets_DefaultIndexHtml_OK(t *testing.T) { } } -func TestGuiAssets_DefaultIndexHtml_NotFound(t *testing.T) { +func TestIntegration_Shared_GuiAssets_DefaultIndexHtml_NotFound(t *testing.T) { t.Parallel() app := cltest.NewApplication(t) @@ -84,7 +84,7 @@ func TestGuiAssets_DefaultIndexHtml_NotFound(t *testing.T) { } } -func TestGuiAssets_DefaultIndexHtml_RateLimited(t *testing.T) { +func TestIntegration_Shared_GuiAssets_DefaultIndexHtml_RateLimited(t *testing.T) { t.Parallel() config := configtest.NewGeneralConfig(t, nil) @@ -111,7 +111,7 @@ func TestGuiAssets_DefaultIndexHtml_RateLimited(t *testing.T) { assert.Equal(t, http.StatusTooManyRequests, resp.StatusCode) } -func TestGuiAssets_AssetsFS(t *testing.T) { +func TestIntegration_Shared_GuiAssets_AssetsFS(t *testing.T) { t.Parallel() efs := web.NewEmbedFileSystem(testFs, "fixtures/operator_ui") diff --git a/core/web/health_controller_test.go b/core/web/health_controller_test.go index 90911991700..b819a32dd4d 100644 --- a/core/web/health_controller_test.go +++ b/core/web/health_controller_test.go @@ -22,7 +22,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/mocks" ) -func TestHealthController_Readyz(t *testing.T) { +func TestIntegration_Shared_HealthController_Readyz(t *testing.T) { var tt = []struct { name string ready bool @@ -58,7 +58,7 @@ func TestHealthController_Readyz(t *testing.T) { } } -func TestHealthController_Health_status(t *testing.T) { +func TestIntegration_Shared_HealthController_Health_status(t *testing.T) { var tt = []struct { name string ready bool @@ -109,7 +109,7 @@ var ( bodyTXTFailing string ) -func TestHealthController_Health_body(t *testing.T) { +func TestIntegration_Shared_HealthController_Health_body(t *testing.T) { bodyJSON = strings.ReplaceAll(bodyJSON, "1399100", testutils.FixtureChainID.String()) bodyHTML = strings.ReplaceAll(bodyHTML, "1399100", testutils.FixtureChainID.String()) bodyTXT = strings.ReplaceAll(bodyTXT, "1399100", testutils.FixtureChainID.String()) diff --git a/core/web/health_template_test.go b/core/web/health_template_test.go index 94bef0ac7cc..16bb5dcba67 100644 --- a/core/web/health_template_test.go +++ b/core/web/health_template_test.go @@ -37,7 +37,7 @@ original error`}, // TODO truncated error } -func Test_checkTree_WriteHTMLTo(t *testing.T) { +func TestUnit_checkTree_WriteHTMLTo(t *testing.T) { ct := newCheckTree(checks()) var b bytes.Buffer require.NoError(t, ct.WriteHTMLTo(&b)) @@ -45,7 +45,7 @@ func Test_checkTree_WriteHTMLTo(t *testing.T) { require.Equalf(t, healthHTML, got, "got: %s", got) } -func Test_writeTextTo(t *testing.T) { +func TestUnit_writeTextTo(t *testing.T) { var b bytes.Buffer require.NoError(t, writeTextTo(&b, checks())) got := b.String() diff --git a/core/web/jobs_controller_test.go b/core/web/jobs_controller_test.go index 6b52428ec00..12c66c60904 100644 --- a/core/web/jobs_controller_test.go +++ b/core/web/jobs_controller_test.go @@ -45,7 +45,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func TestJobsController_Create_ValidationFailure_OffchainReportingSpec(t *testing.T) { +func TestIntegration_Shared_JobsController_Create_ValidationFailure_OffchainReportingSpec(t *testing.T) { var ( contractAddress = cltest.NewEIP55Address() ) @@ -105,7 +105,7 @@ func TestJobsController_Create_ValidationFailure_OffchainReportingSpec(t *testin } } -func TestJobController_Create_DirectRequest_Fast(t *testing.T) { +func TestIntegration_Shared_JobController_Create_DirectRequest_Fast(t *testing.T) { ctx := testutils.Context(t) app, client := setupJobsControllerTests(t) require.NoError(t, app.KeyStore.OCR().Add(ctx, cltest.DefaultOCRKey)) @@ -139,7 +139,7 @@ func mustInt32FromString(t *testing.T, s string) int32 { return int32(i) } -func TestJobController_Create_HappyPath(t *testing.T) { +func TestIntegration_Shared_JobController_Create_HappyPath(t *testing.T) { ctx := testutils.Context(t) app, client := setupJobsControllerTests(t) b1, b2 := setupBridges(t, app.GetDB()) @@ -506,7 +506,7 @@ targets: } } -func TestJobsController_Create_WebhookSpec(t *testing.T) { +func TestIntegration_Shared_JobsController_Create_WebhookSpec(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) @@ -535,7 +535,7 @@ func TestJobsController_Create_WebhookSpec(t *testing.T) { //go:embed webhook-spec-template.yml var webhookSpecTemplate string -func TestJobsController_FailToCreate_EmptyJsonAttribute(t *testing.T) { +func TestIntegration_Shared_JobsController_FailToCreate_EmptyJsonAttribute(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) @@ -555,7 +555,7 @@ func TestJobsController_FailToCreate_EmptyJsonAttribute(t *testing.T) { require.Contains(t, string(b), "syntax is not supported. Please use \\\"{}\\\" instead") } -func TestJobsController_Index_HappyPath(t *testing.T) { +func TestIntegration_Shared_JobsController_Index_HappyPath(t *testing.T) { _, client, ocrJobSpecFromFile, _, ereJobSpecFromFile, _ := setupJobSpecsControllerTestsWithJobs(t) url := url.URL{Path: "/v2/jobs"} @@ -577,7 +577,7 @@ func TestJobsController_Index_HappyPath(t *testing.T) { runOCRJobSpecAssertions(t, ocrJobSpecFromFile, resources[1]) } -func TestJobsController_Show_HappyPath(t *testing.T) { +func TestIntegration_Shared_JobsController_Show_HappyPath(t *testing.T) { _, client, ocrJobSpecFromFile, jobID, ereJobSpecFromFile, jobID2 := setupJobSpecsControllerTestsWithJobs(t) response, cleanup := client.Get("/v2/jobs/" + strconv.Itoa(int(jobID))) @@ -621,7 +621,7 @@ func TestJobsController_Show_HappyPath(t *testing.T) { runDirectRequestJobSpecAssertions(t, ereJobSpecFromFile, ereJob) } -func TestJobsController_Show_InvalidID(t *testing.T) { +func TestIntegration_Shared_JobsController_Show_InvalidID(t *testing.T) { _, client, _, _, _, _ := setupJobSpecsControllerTestsWithJobs(t) response, cleanup := client.Get("/v2/jobs/uuidLikeString") @@ -629,7 +629,7 @@ func TestJobsController_Show_InvalidID(t *testing.T) { cltest.AssertServerResponse(t, response, http.StatusUnprocessableEntity) } -func TestJobsController_Show_NonExistentID(t *testing.T) { +func TestIntegration_Shared_JobsController_Show_NonExistentID(t *testing.T) { _, client, _, _, _, _ := setupJobSpecsControllerTestsWithJobs(t) response, cleanup := client.Get("/v2/jobs/999999999") @@ -638,7 +638,7 @@ func TestJobsController_Show_NonExistentID(t *testing.T) { cltest.AssertServerResponse(t, response, http.StatusNotFound) } -func TestJobsController_Update_HappyPath(t *testing.T) { +func TestIntegration_Shared_JobsController_Update_HappyPath(t *testing.T) { ctx := testutils.Context(t) cfg := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { c.OCR.Enabled = ptr(true) @@ -704,7 +704,7 @@ func TestJobsController_Update_HappyPath(t *testing.T) { cltest.AssertServerResponse(t, response, http.StatusOK) } -func TestJobsController_Update_NonExistentID(t *testing.T) { +func TestIntegration_Shared_JobsController_Update_NonExistentID(t *testing.T) { ctx := testutils.Context(t) cfg := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { c.OCR.Enabled = ptr(true) diff --git a/core/web/lca_controller_test.go b/core/web/lca_controller_test.go index 7ec476e8eca..fb9eb77446b 100644 --- a/core/web/lca_controller_test.go +++ b/core/web/lca_controller_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" ) -func TestLCAController_FindLCA(t *testing.T) { +func TestIntegration_Shared_LCAController_FindLCA(t *testing.T) { cfg := configtest.NewTestGeneralConfig(t) ec := setupEthClientForControllerTests(t) app := cltest.NewApplicationWithConfigAndKey(t, cfg, cltest.DefaultP2PKey, ec) diff --git a/core/web/loader/loader_test.go b/core/web/loader/loader_test.go index ce7e9879e8b..6a021874992 100644 --- a/core/web/loader/loader_test.go +++ b/core/web/loader/loader_test.go @@ -32,7 +32,7 @@ import ( testutils2 "github.com/smartcontractkit/chainlink/v2/core/web/testutils" ) -func TestLoader_ChainsRelayID_HandleDuplicateIDAcrossNetworks(t *testing.T) { +func TestUnit_Loader_ChainsRelayID_HandleDuplicateIDAcrossNetworks(t *testing.T) { t.Parallel() app := coremocks.NewApplication(t) @@ -105,7 +105,7 @@ func TestLoader_ChainsRelayID_HandleDuplicateIDAcrossNetworks(t *testing.T) { require.ErrorIs(t, results[2].Error, chains.ErrNotFound) } -func TestLoader_Nodes(t *testing.T) { +func TestUnit_Loader_Nodes(t *testing.T) { t.Parallel() app := coremocks.NewApplication(t) @@ -135,7 +135,7 @@ func TestLoader_Nodes(t *testing.T) { assert.Equal(t, []commontypes.NodeStatus{}, found[2].Data) } -func TestLoader_FeedsManagers(t *testing.T) { +func TestUnit_Loader_FeedsManagers(t *testing.T) { t.Parallel() fsvc := feedsMocks.NewService(t) @@ -174,7 +174,7 @@ func TestLoader_FeedsManagers(t *testing.T) { assert.Equal(t, "feeds manager not found", found[3].Error.Error()) } -func TestLoader_JobProposals(t *testing.T) { +func TestUnit_Loader_JobProposals(t *testing.T) { t.Parallel() fsvc := feedsMocks.NewService(t) @@ -213,7 +213,7 @@ func TestLoader_JobProposals(t *testing.T) { assert.Equal(t, []feeds.JobProposal{}, found[2].Data) } -func TestLoader_JobRuns(t *testing.T) { +func TestUnit_Loader_JobRuns(t *testing.T) { t.Parallel() jobsORM := jobORMMocks.NewORM(t) @@ -240,7 +240,7 @@ func TestLoader_JobRuns(t *testing.T) { assert.Equal(t, run2, found[2].Data) } -func TestLoader_JobsByPipelineSpecIDs(t *testing.T) { +func TestUnit_Loader_JobsByPipelineSpecIDs(t *testing.T) { t.Parallel() t.Run("with out errors", func(t *testing.T) { @@ -291,7 +291,7 @@ func TestLoader_JobsByPipelineSpecIDs(t *testing.T) { }) } -func TestLoader_JobsByExternalJobIDs(t *testing.T) { +func TestUnit_Loader_JobsByExternalJobIDs(t *testing.T) { t.Parallel() t.Run("with out errors", func(t *testing.T) { @@ -317,7 +317,7 @@ func TestLoader_JobsByExternalJobIDs(t *testing.T) { }) } -func TestLoader_EthTransactionsAttempts(t *testing.T) { +func TestUnit_Loader_EthTransactionsAttempts(t *testing.T) { t.Parallel() txStore := evmtxmgrmocks.NewEvmTxStore(t) @@ -351,7 +351,7 @@ func TestLoader_EthTransactionsAttempts(t *testing.T) { assert.Equal(t, []txmgr.TxAttempt{attempt1}, found[2].Data) } -func TestLoader_SpecErrorsByJobID(t *testing.T) { +func TestUnit_Loader_SpecErrorsByJobID(t *testing.T) { t.Parallel() t.Run("without errors", func(t *testing.T) { @@ -402,7 +402,7 @@ func TestLoader_SpecErrorsByJobID(t *testing.T) { }) } -func TestLoader_loadByEthTransactionID(t *testing.T) { +func TestUnit_Loader_loadByEthTransactionID(t *testing.T) { t.Parallel() txStore := evmtxmgrmocks.NewEvmTxStore(t) diff --git a/core/web/log_controller_test.go b/core/web/log_controller_test.go index 53900297c6d..6e5946ca623 100644 --- a/core/web/log_controller_test.go +++ b/core/web/log_controller_test.go @@ -30,7 +30,7 @@ type testCase struct { expectedErrorCode int } -func TestLogController_GetLogConfig(t *testing.T) { +func TestIntegration_Shared_LogController_GetLogConfig(t *testing.T) { t.Parallel() cfg := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { @@ -63,7 +63,7 @@ func TestLogController_GetLogConfig(t *testing.T) { } } -func TestLogController_PatchLogConfig(t *testing.T) { +func TestIntegration_Shared_LogController_PatchLogConfig(t *testing.T) { t.Parallel() sqlTrue := true diff --git a/core/web/loop_registry_internal_test.go b/core/web/loop_registry_internal_test.go index 925637f1575..9ce41c23631 100644 --- a/core/web/loop_registry_internal_test.go +++ b/core/web/loop_registry_internal_test.go @@ -34,7 +34,7 @@ func newResponseWriter() *responseWriter { return &responseWriter{header: make(http.Header)} } -func TestLoopRegistryServer_CantWriteToResponse(t *testing.T) { +func TestUnit_LoopRegistryServer_CantWriteToResponse(t *testing.T) { l, o := logger.TestLoggerObserved(t, zap.ErrorLevel) s := &LoopRegistryServer{ exposedPromPort: 1, @@ -49,7 +49,7 @@ func TestLoopRegistryServer_CantWriteToResponse(t *testing.T) { assert.Equal(t, 1, o.FilterMessageSnippet("could not write to response").Len()) } -func TestLoopRegistryServer_CantMarshal(t *testing.T) { +func TestUnit_LoopRegistryServer_CantMarshal(t *testing.T) { l, o := logger.TestLoggerObserved(t, zap.ErrorLevel) s := &LoopRegistryServer{ exposedPromPort: 1, diff --git a/core/web/loop_registry_test.go b/core/web/loop_registry_test.go index b62ae9cb341..5bc52af629b 100644 --- a/core/web/loop_registry_test.go +++ b/core/web/loop_registry_test.go @@ -62,7 +62,7 @@ func (m *mockLoopImpl) run() { testMetric.Inc() } -func TestLoopRegistry(t *testing.T) { +func TestIntegration_Shared_LoopRegistry(t *testing.T) { ctx := testutils.Context(t) cfg := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { c.OCR.Enabled = ptr(true) diff --git a/core/web/ocr2_keys_controller_test.go b/core/web/ocr2_keys_controller_test.go index e3f0adfc196..3b4a0cb56d0 100644 --- a/core/web/ocr2_keys_controller_test.go +++ b/core/web/ocr2_keys_controller_test.go @@ -17,7 +17,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestOCR2KeysController_Index_HappyPath(t *testing.T) { +func TestIntegration_Shared_OCR2KeysController_Index_HappyPath(t *testing.T) { client, OCRKeyStore := setupOCR2KeysControllerTests(t) keys, _ := OCRKeyStore.GetAll() @@ -34,7 +34,7 @@ func TestOCR2KeysController_Index_HappyPath(t *testing.T) { assert.Equal(t, keys[0].ID(), resources[0].ID) } -func TestOCR2KeysController_Create_HappyPath(t *testing.T) { +func TestIntegration_Shared_OCR2KeysController_Create_HappyPath(t *testing.T) { client, OCRKeyStore := setupOCR2KeysControllerTests(t) for _, test := range []struct { @@ -71,7 +71,7 @@ func TestOCR2KeysController_Create_HappyPath(t *testing.T) { } } -func TestOCR2KeysController_Delete_NonExistentOCRKeyID(t *testing.T) { +func TestIntegration_Shared_OCR2KeysController_Delete_NonExistentOCRKeyID(t *testing.T) { client, _ := setupOCR2KeysControllerTests(t) nonExistentOCRKeyID := "eb81f4a35033ac8dd68b9d33a039a713d6fd639af6852b81f47ffeda1c95de54" @@ -80,7 +80,7 @@ func TestOCR2KeysController_Delete_NonExistentOCRKeyID(t *testing.T) { assert.Equal(t, http.StatusNotFound, response.StatusCode) } -func TestOCR2KeysController_Delete_HappyPath(t *testing.T) { +func TestIntegration_Shared_OCR2KeysController_Delete_HappyPath(t *testing.T) { ctx := testutils.Context(t) client, OCRKeyStore := setupOCR2KeysControllerTests(t) diff --git a/core/web/ocr_keys_controller_test.go b/core/web/ocr_keys_controller_test.go index a5a5fd62ab4..180742e539d 100644 --- a/core/web/ocr_keys_controller_test.go +++ b/core/web/ocr_keys_controller_test.go @@ -15,7 +15,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestOCRKeysController_Index_HappyPath(t *testing.T) { +func TestIntegration_Shared_OCRKeysController_Index_HappyPath(t *testing.T) { client, OCRKeyStore := setupOCRKeysControllerTests(t) keys, _ := OCRKeyStore.GetAll() @@ -32,7 +32,7 @@ func TestOCRKeysController_Index_HappyPath(t *testing.T) { assert.Equal(t, keys[0].ID(), resources[0].ID) } -func TestOCRKeysController_Create_HappyPath(t *testing.T) { +func TestIntegration_Shared_OCRKeysController_Create_HappyPath(t *testing.T) { client, OCRKeyStore := setupOCRKeysControllerTests(t) keys, _ := OCRKeyStore.GetAll() @@ -59,7 +59,7 @@ func TestOCRKeysController_Create_HappyPath(t *testing.T) { require.NoError(t, err) } -func TestOCRKeysController_Delete_NonExistentOCRKeyID(t *testing.T) { +func TestIntegration_Shared_OCRKeysController_Delete_NonExistentOCRKeyID(t *testing.T) { client, _ := setupOCRKeysControllerTests(t) nonExistentOCRKeyID := "eb81f4a35033ac8dd68b9d33a039a713d6fd639af6852b81f47ffeda1c95de54" @@ -68,7 +68,7 @@ func TestOCRKeysController_Delete_NonExistentOCRKeyID(t *testing.T) { assert.Equal(t, http.StatusNotFound, response.StatusCode) } -func TestOCRKeysController_Delete_HappyPath(t *testing.T) { +func TestIntegration_Shared_OCRKeysController_Delete_HappyPath(t *testing.T) { ctx := testutils.Context(t) client, OCRKeyStore := setupOCRKeysControllerTests(t) diff --git a/core/web/p2p_keys_controller_test.go b/core/web/p2p_keys_controller_test.go index af1ff49b957..c22738e2e58 100644 --- a/core/web/p2p_keys_controller_test.go +++ b/core/web/p2p_keys_controller_test.go @@ -16,7 +16,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestP2PKeysController_Index_HappyPath(t *testing.T) { +func TestIntegration_Shared_P2PKeysController_Index_HappyPath(t *testing.T) { t.Parallel() client, keyStore := setupP2PKeysControllerTests(t) @@ -37,7 +37,7 @@ func TestP2PKeysController_Index_HappyPath(t *testing.T) { assert.Equal(t, keys[0].PeerID().String(), resources[0].PeerID) } -func TestP2PKeysController_Create_HappyPath(t *testing.T) { +func TestIntegration_Shared_P2PKeysController_Create_HappyPath(t *testing.T) { t.Parallel() app := cltest.NewApplicationEVMDisabled(t) @@ -66,7 +66,7 @@ func TestP2PKeysController_Create_HappyPath(t *testing.T) { require.NoError(t, err) } -func TestP2PKeysController_Delete_NonExistentP2PKeyID(t *testing.T) { +func TestIntegration_Shared_P2PKeysController_Delete_NonExistentP2PKeyID(t *testing.T) { t.Parallel() client, _ := setupP2PKeysControllerTests(t) @@ -77,7 +77,7 @@ func TestP2PKeysController_Delete_NonExistentP2PKeyID(t *testing.T) { assert.Equal(t, http.StatusNotFound, response.StatusCode) } -func TestP2PKeysController_Delete_InvalidPeerID(t *testing.T) { +func TestIntegration_Shared_P2PKeysController_Delete_InvalidPeerID(t *testing.T) { t.Parallel() client, _ := setupP2PKeysControllerTests(t) @@ -88,7 +88,7 @@ func TestP2PKeysController_Delete_InvalidPeerID(t *testing.T) { assert.Equal(t, http.StatusUnprocessableEntity, response.StatusCode) } -func TestP2PKeysController_Delete_HappyPath(t *testing.T) { +func TestIntegration_Shared_P2PKeysController_Delete_HappyPath(t *testing.T) { t.Parallel() ctx := testutils.Context(t) diff --git a/core/web/ping_controller_test.go b/core/web/ping_controller_test.go index d5b278503bb..45893fc15a0 100644 --- a/core/web/ping_controller_test.go +++ b/core/web/ping_controller_test.go @@ -17,7 +17,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestPingController_Show_APICredentials(t *testing.T) { +func TestIntegration_Shared_PingController_Show_APICredentials(t *testing.T) { t.Parallel() app := cltest.NewApplicationEVMDisabled(t) @@ -32,7 +32,7 @@ func TestPingController_Show_APICredentials(t *testing.T) { require.JSONEq(t, `{"message":"pong"}`, body) } -func TestPingController_Show_ExternalInitiatorCredentials(t *testing.T) { +func TestIntegration_Shared_PingController_Show_ExternalInitiatorCredentials(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -71,7 +71,7 @@ func TestPingController_Show_ExternalInitiatorCredentials(t *testing.T) { require.JSONEq(t, `{"message":"pong"}`, body) } -func TestPingController_Show_NoCredentials(t *testing.T) { +func TestIntegration_Shared_PingController_Show_NoCredentials(t *testing.T) { t.Parallel() ctx := testutils.Context(t) diff --git a/core/web/pipeline_job_spec_errors_controller_test.go b/core/web/pipeline_job_spec_errors_controller_test.go index 9729bfac51d..49dd6d4325a 100644 --- a/core/web/pipeline_job_spec_errors_controller_test.go +++ b/core/web/pipeline_job_spec_errors_controller_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" ) -func TestPipelineJobSpecErrorsController_Delete_2(t *testing.T) { +func TestIntegration_Shared_PipelineJobSpecErrorsController_Delete_2(t *testing.T) { app, client, _, jID, _, _ := setupJobSpecsControllerTestsWithJobs(t) description := "job spec error description" @@ -48,7 +48,7 @@ func TestPipelineJobSpecErrorsController_Delete_2(t *testing.T) { } } -func TestPipelineJobSpecErrorsController_Delete_NotFound(t *testing.T) { +func TestIntegration_Shared_PipelineJobSpecErrorsController_Delete_NotFound(t *testing.T) { _, client, _, _, _, _ := setupJobSpecsControllerTestsWithJobs(t) resp, cleanup := client.Delete("/v2/pipeline/job_spec_errors/1") diff --git a/core/web/pipeline_runs_controller_test.go b/core/web/pipeline_runs_controller_test.go index 395298d81bb..5b283e6028a 100644 --- a/core/web/pipeline_runs_controller_test.go +++ b/core/web/pipeline_runs_controller_test.go @@ -31,7 +31,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func TestPipelineRunsController_CreateWithBody_HappyPath(t *testing.T) { +func TestIntegration_Shared_PipelineRunsController_CreateWithBody_HappyPath(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -87,7 +87,7 @@ func TestPipelineRunsController_CreateWithBody_HappyPath(t *testing.T) { } } -func TestPipelineRunsController_CreateNoBody_HappyPath(t *testing.T) { +func TestIntegration_Shared_PipelineRunsController_CreateNoBody_HappyPath(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -148,7 +148,7 @@ func TestPipelineRunsController_CreateNoBody_HappyPath(t *testing.T) { } } -func TestPipelineRunsController_Index_GlobalHappyPath(t *testing.T) { +func TestIntegration_Shared_PipelineRunsController_Index_GlobalHappyPath(t *testing.T) { client, jobID, runIDs := setupPipelineRunsControllerTests(t) url := url.URL{Path: "/v2/pipeline/runs"} @@ -176,7 +176,7 @@ func TestPipelineRunsController_Index_GlobalHappyPath(t *testing.T) { require.Len(t, parsedResponse[1].TaskRuns, 8) } -func TestPipelineRunsController_Index_HappyPath(t *testing.T) { +func TestIntegration_Shared_PipelineRunsController_Index_HappyPath(t *testing.T) { client, jobID, runIDs := setupPipelineRunsControllerTests(t) response, cleanup := client.Get("/v2/jobs/" + strconv.Itoa(int(jobID)) + "/runs") @@ -199,7 +199,7 @@ func TestPipelineRunsController_Index_HappyPath(t *testing.T) { require.Len(t, parsedResponse[1].TaskRuns, 8) } -func TestPipelineRunsController_Index_Pagination(t *testing.T) { +func TestIntegration_Shared_PipelineRunsController_Index_Pagination(t *testing.T) { client, jobID, runIDs := setupPipelineRunsControllerTests(t) response, cleanup := client.Get("/v2/jobs/" + strconv.Itoa(int(jobID)) + "/runs?page=1&size=1") @@ -221,7 +221,7 @@ func TestPipelineRunsController_Index_Pagination(t *testing.T) { require.Len(t, parsedResponse[0].TaskRuns, 8) } -func TestPipelineRunsController_Show_HappyPath(t *testing.T) { +func TestIntegration_Shared_PipelineRunsController_Show_HappyPath(t *testing.T) { client, jobID, runIDs := setupPipelineRunsControllerTests(t) response, cleanup := client.Get("/v2/jobs/" + strconv.Itoa(int(jobID)) + "/runs/" + strconv.FormatInt(runIDs[0], 10)) @@ -240,7 +240,7 @@ func TestPipelineRunsController_Show_HappyPath(t *testing.T) { require.Len(t, parsedResponse.TaskRuns, 8) } -func TestPipelineRunsController_ShowRun_InvalidID(t *testing.T) { +func TestIntegration_Shared_PipelineRunsController_ShowRun_InvalidID(t *testing.T) { t.Parallel() app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) diff --git a/core/web/presenters/bridges_test.go b/core/web/presenters/bridges_test.go index 746d361958a..fa5c69cc812 100644 --- a/core/web/presenters/bridges_test.go +++ b/core/web/presenters/bridges_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/store/models" ) -func TestBridgeResource(t *testing.T) { +func TestUnit_BridgeResource(t *testing.T) { t.Parallel() timestamp := time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC) diff --git a/core/web/presenters/chain_msg_test.go b/core/web/presenters/chain_msg_test.go index 58192caef71..0cda46ebac5 100644 --- a/core/web/presenters/chain_msg_test.go +++ b/core/web/presenters/chain_msg_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/solanatest" ) -func TestSolanaMessageResource(t *testing.T) { +func TestUnit_SolanaMessageResource(t *testing.T) { id := "1" chainID := solanatest.RandomChainID() r := NewSolanaMsgResource(id, chainID) @@ -39,7 +39,7 @@ func TestSolanaMessageResource(t *testing.T) { assert.JSONEq(t, expected, string(b)) } -func TestCosmosMessageResource(t *testing.T) { +func TestUnit_CosmosMessageResource(t *testing.T) { id := "1" chainID := cosmostest.RandomChainID() contractID := "cosmos1p3ucd3ptpw902fluyjzkq3fflq4btddac9sa3s" diff --git a/core/web/presenters/csa_key_test.go b/core/web/presenters/csa_key_test.go index d514519fafd..368cc753de7 100644 --- a/core/web/presenters/csa_key_test.go +++ b/core/web/presenters/csa_key_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" ) -func TestCSAKeyResource(t *testing.T) { +func TestUnit_CSAKeyResource(t *testing.T) { keyV2, err := csakey.NewV2() require.NoError(t, err) diff --git a/core/web/presenters/eth_key_test.go b/core/web/presenters/eth_key_test.go index 06b3d2f6f83..d157c96b754 100644 --- a/core/web/presenters/eth_key_test.go +++ b/core/web/presenters/eth_key_test.go @@ -17,7 +17,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestETHKeyResource(t *testing.T) { +func TestUnit_ETHKeyResource(t *testing.T) { var ( now = time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC) addressStr = "0x2aCFF2ec69aa9945Ed84f4F281eCCF6911A3B0eD" diff --git a/core/web/presenters/eth_tx_test.go b/core/web/presenters/eth_tx_test.go index 40c329f5214..cf54cd4069b 100644 --- a/core/web/presenters/eth_tx_test.go +++ b/core/web/presenters/eth_tx_test.go @@ -17,7 +17,7 @@ import ( txmgrcommon "github.com/smartcontractkit/chainlink-framework/chains/txmgr" ) -func TestEthTxResource(t *testing.T) { +func TestUnit_EthTxResource(t *testing.T) { t.Parallel() chainID := big.NewInt(54321) diff --git a/core/web/presenters/evm_forwarder_test.go b/core/web/presenters/evm_forwarder_test.go index d49ff3f2ecb..af795ac088b 100644 --- a/core/web/presenters/evm_forwarder_test.go +++ b/core/web/presenters/evm_forwarder_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/utils/big" ) -func TestEVMForwarderResource(t *testing.T) { +func TestUnit_EVMForwarderResource(t *testing.T) { var ( ID = int64(1) address = utils.RandomAddress() diff --git a/core/web/presenters/job_test.go b/core/web/presenters/job_test.go index 5ebeffcdd6b..9c99ff93819 100644 --- a/core/web/presenters/job_test.go +++ b/core/web/presenters/job_test.go @@ -26,7 +26,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func TestJob(t *testing.T) { +func TestUnit_Job(t *testing.T) { // Used in multiple tests timestamp := time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC) contractAddress, err := types.NewEIP55Address("0x9E40733cC9df84636505f4e6Db28DCa0dC5D1bba") diff --git a/core/web/presenters/node_test.go b/core/web/presenters/node_test.go index 91c8442aa14..8bc020aed2a 100644 --- a/core/web/presenters/node_test.go +++ b/core/web/presenters/node_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/types" ) -func TestNodeResource(t *testing.T) { +func TestUnit_NodeResource(t *testing.T) { var nodeResource NodeResource state := "test" cfg := "cfg" diff --git a/core/web/presenters/p2p_key_test.go b/core/web/presenters/p2p_key_test.go index 2d6d307f207..39b8b9b781d 100644 --- a/core/web/presenters/p2p_key_test.go +++ b/core/web/presenters/p2p_key_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) -func TestP2PKeyResource(t *testing.T) { +func TestUnit_P2PKeyResource(t *testing.T) { key := p2pkey.MustNewV2XXXTestingOnly(big.NewInt(1)) peerID := key.PeerID() peerIDStr := peerID.String() diff --git a/core/web/presenters/user_test.go b/core/web/presenters/user_test.go index ee3938cef47..102d6f0846a 100644 --- a/core/web/presenters/user_test.go +++ b/core/web/presenters/user_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/sessions" ) -func TestUserResource(t *testing.T) { +func TestUnit_UserResource(t *testing.T) { var ( ts = time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC) ) diff --git a/core/web/resolver/api_token_test.go b/core/web/resolver/api_token_test.go index d032a5c69a4..a5497e6a9da 100644 --- a/core/web/resolver/api_token_test.go +++ b/core/web/resolver/api_token_test.go @@ -14,7 +14,7 @@ import ( webauth "github.com/smartcontractkit/chainlink/v2/core/web/auth" ) -func TestResolver_CreateAPIToken(t *testing.T) { +func TestUnit_Resolver_CreateAPIToken(t *testing.T) { t.Parallel() defaultPassword := "my-password" @@ -171,7 +171,7 @@ func TestResolver_CreateAPIToken(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_DeleteAPIToken(t *testing.T) { +func TestUnit_Resolver_DeleteAPIToken(t *testing.T) { t.Parallel() defaultPassword := "my-password" diff --git a/core/web/resolver/aptos_key_test.go b/core/web/resolver/aptos_key_test.go index e0dcb2a4194..3e51967fa65 100644 --- a/core/web/resolver/aptos_key_test.go +++ b/core/web/resolver/aptos_key_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/aptoskey" ) -func TestResolver_AptosKeys(t *testing.T) { +func TestUnit_Resolver_AptosKeys(t *testing.T) { t.Parallel() query := ` diff --git a/core/web/resolver/bridge_test.go b/core/web/resolver/bridge_test.go index 5e24ec632d0..f26c5996b30 100644 --- a/core/web/resolver/bridge_test.go +++ b/core/web/resolver/bridge_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/store/models" ) -func Test_Bridges(t *testing.T) { +func TestUnit_Bridges(t *testing.T) { t.Parallel() var ( @@ -84,7 +84,7 @@ func Test_Bridges(t *testing.T) { RunGQLTests(t, testCases) } -func Test_Bridge(t *testing.T) { +func TestUnit_Bridge(t *testing.T) { t.Parallel() var ( @@ -161,7 +161,7 @@ func Test_Bridge(t *testing.T) { RunGQLTests(t, testCases) } -func Test_CreateBridge(t *testing.T) { +func TestUnit_CreateBridge(t *testing.T) { t.Parallel() var ( @@ -241,7 +241,7 @@ func Test_CreateBridge(t *testing.T) { RunGQLTests(t, testCases) } -func Test_UpdateBridge(t *testing.T) { +func TestUnit_UpdateBridge(t *testing.T) { t.Parallel() var ( @@ -359,7 +359,7 @@ func Test_UpdateBridge(t *testing.T) { RunGQLTests(t, testCases) } -func Test_DeleteBridgeMutation(t *testing.T) { +func TestUnit_DeleteBridgeMutation(t *testing.T) { t.Parallel() name := bridges.BridgeName("bridge1") diff --git a/core/web/resolver/chain_test.go b/core/web/resolver/chain_test.go index d5101dc5e75..3f91b0d0d3d 100644 --- a/core/web/resolver/chain_test.go +++ b/core/web/resolver/chain_test.go @@ -19,7 +19,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/testutils" ) -func TestResolver_Chains(t *testing.T) { +func TestUnit_Resolver_Chains(t *testing.T) { var ( chainID = *big.NewI(1) query = ` @@ -139,7 +139,7 @@ ResendAfterThreshold = '1h0m0s' RunGQLTests(t, testCases) } -func TestResolver_Chain(t *testing.T) { +func TestUnit_Resolver_Chain(t *testing.T) { var ( chainID = *big.NewI(1) query = ` diff --git a/core/web/resolver/config_test.go b/core/web/resolver/config_test.go index f380e4db55a..9e9d67ad2f5 100644 --- a/core/web/resolver/config_test.go +++ b/core/web/resolver/config_test.go @@ -23,7 +23,7 @@ var ( configMultiEffective string ) -func TestResolver_ConfigV2(t *testing.T) { +func TestUnit_Resolver_ConfigV2(t *testing.T) { t.Parallel() query := ` diff --git a/core/web/resolver/cosmos_key_test.go b/core/web/resolver/cosmos_key_test.go index c970edc0949..1a6e3010085 100644 --- a/core/web/resolver/cosmos_key_test.go +++ b/core/web/resolver/cosmos_key_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/cosmoskey" ) -func TestResolver_CosmosKeys(t *testing.T) { +func TestUnit_Resolver_CosmosKeys(t *testing.T) { t.Parallel() query := ` diff --git a/core/web/resolver/csa_keys_test.go b/core/web/resolver/csa_keys_test.go index ae7c1986c85..ed8c67d25ac 100644 --- a/core/web/resolver/csa_keys_test.go +++ b/core/web/resolver/csa_keys_test.go @@ -19,7 +19,7 @@ type expectedKey struct { Version int `json:"version"` } -func Test_CSAKeysQuery(t *testing.T) { +func TestUnit_CSAKeysQuery(t *testing.T) { query := ` query GetCSAKeys { csaKeys { @@ -72,7 +72,7 @@ func Test_CSAKeysQuery(t *testing.T) { RunGQLTests(t, testCases) } -func Test_CreateCSAKey(t *testing.T) { +func TestUnit_CreateCSAKey(t *testing.T) { query := ` mutation CreateCSAKey { createCSAKey { @@ -140,7 +140,7 @@ func Test_CreateCSAKey(t *testing.T) { RunGQLTests(t, testCases) } -func Test_DeleteCSAKey(t *testing.T) { +func TestUnit_DeleteCSAKey(t *testing.T) { query := ` mutation DeleteCSAKey($id: ID!) { deleteCSAKey(id: $id) { diff --git a/core/web/resolver/eth_key_test.go b/core/web/resolver/eth_key_test.go index db043cf5f28..3353d997516 100644 --- a/core/web/resolver/eth_key_test.go +++ b/core/web/resolver/eth_key_test.go @@ -36,7 +36,7 @@ type mockEvmConfig struct { func (m *mockEvmConfig) LinkContractAddress() string { return m.linkAddr } func (m *mockEvmConfig) GasEstimator() config.GasEstimator { return m.gasEstimatorMock } -func TestResolver_ETHKeys(t *testing.T) { +func TestUnit_Resolver_ETHKeys(t *testing.T) { t.Parallel() query := ` diff --git a/core/web/resolver/eth_transaction_test.go b/core/web/resolver/eth_transaction_test.go index eaf8bfc48db..42f70ede90d 100644 --- a/core/web/resolver/eth_transaction_test.go +++ b/core/web/resolver/eth_transaction_test.go @@ -26,7 +26,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/testutils" ) -func TestResolver_EthTransaction(t *testing.T) { +func TestUnit_Resolver_EthTransaction(t *testing.T) { t.Parallel() query := ` @@ -241,7 +241,7 @@ func TestResolver_EthTransaction(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_EthTransactions(t *testing.T) { +func TestUnit_Resolver_EthTransactions(t *testing.T) { t.Parallel() query := ` @@ -347,7 +347,7 @@ func TestResolver_EthTransactions(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_EthTransactionsAttempts(t *testing.T) { +func TestUnit_Resolver_EthTransactionsAttempts(t *testing.T) { t.Parallel() query := ` diff --git a/core/web/resolver/features_test.go b/core/web/resolver/features_test.go index 4e8f9e8c26c..5375af9d979 100644 --- a/core/web/resolver/features_test.go +++ b/core/web/resolver/features_test.go @@ -8,7 +8,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" ) -func Test_ToFeatures(t *testing.T) { +func TestUnit_ToFeatures(t *testing.T) { query := ` { features { diff --git a/core/web/resolver/feeds_manager_chain_config_test.go b/core/web/resolver/feeds_manager_chain_config_test.go index fa57ee7bea7..7d9efe7ff11 100644 --- a/core/web/resolver/feeds_manager_chain_config_test.go +++ b/core/web/resolver/feeds_manager_chain_config_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils/stringutils" ) -func Test_CreateFeedsManagerChainConfig(t *testing.T) { +func TestUnit_CreateFeedsManagerChainConfig(t *testing.T) { var ( mgrID = int64(100) cfgID = int64(1) @@ -490,7 +490,7 @@ func Test_CreateFeedsManagerChainConfig(t *testing.T) { RunGQLTests(t, testCases) } -func Test_DeleteFeedsManagerChainConfig(t *testing.T) { +func TestUnit_DeleteFeedsManagerChainConfig(t *testing.T) { var ( cfgID = int64(1) @@ -578,7 +578,7 @@ func Test_DeleteFeedsManagerChainConfig(t *testing.T) { RunGQLTests(t, testCases) } -func Test_UpdateFeedsManagerChainConfig(t *testing.T) { +func TestUnit_UpdateFeedsManagerChainConfig(t *testing.T) { var ( cfgID = int64(1) peerID = null.StringFrom("p2p_12D3KooWMoejJznyDuEk5aX6GvbjaG12UzeornPCBNzMRqdwrFJw") diff --git a/core/web/resolver/feeds_manager_test.go b/core/web/resolver/feeds_manager_test.go index e00df1be8e4..86a06622584 100644 --- a/core/web/resolver/feeds_manager_test.go +++ b/core/web/resolver/feeds_manager_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils/crypto" ) -func Test_FeedsManagers(t *testing.T) { +func TestUnit_FeedsManagers(t *testing.T) { var ( query = ` query GetFeedsManagers { @@ -86,7 +86,7 @@ func Test_FeedsManagers(t *testing.T) { RunGQLTests(t, testCases) } -func Test_FeedsManager(t *testing.T) { +func TestUnit_FeedsManager(t *testing.T) { var ( mgrID = int64(1) query = ` @@ -160,7 +160,7 @@ func Test_FeedsManager(t *testing.T) { RunGQLTests(t, testCases) } -func Test_CreateFeedsManager(t *testing.T) { +func TestUnit_CreateFeedsManager(t *testing.T) { var ( mgrID = int64(1) name = "manager1" @@ -333,7 +333,7 @@ func Test_CreateFeedsManager(t *testing.T) { RunGQLTests(t, testCases) } -func Test_UpdateFeedsManager(t *testing.T) { +func TestUnit_UpdateFeedsManager(t *testing.T) { var ( mgrID = int64(1) name = "manager1" @@ -462,7 +462,7 @@ func Test_UpdateFeedsManager(t *testing.T) { RunGQLTests(t, testCases) } -func Test_EnableFeedsManager(t *testing.T) { +func TestUnit_EnableFeedsManager(t *testing.T) { var ( mgrID = int64(1) name = "manager1" @@ -569,7 +569,7 @@ func Test_EnableFeedsManager(t *testing.T) { RunGQLTests(t, testCases) } -func Test_DisableFeedsManager(t *testing.T) { +func TestUnit_DisableFeedsManager(t *testing.T) { var ( mgrID = int64(1) name = "manager1" diff --git a/core/web/resolver/job_error_test.go b/core/web/resolver/job_error_test.go index 6f47c4e1145..d4ab8a9e691 100644 --- a/core/web/resolver/job_error_test.go +++ b/core/web/resolver/job_error_test.go @@ -18,7 +18,7 @@ import ( // JobErrors are only embedded on the job and are not fetchable by it's own id, // so we test the job error resolvers by fetching a job by id. -func TestResolver_JobErrors(t *testing.T) { +func TestUnit_Resolver_JobErrors(t *testing.T) { var ( id = int32(1) errorID = int64(200) @@ -75,7 +75,7 @@ func TestResolver_JobErrors(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_DismissJobError(t *testing.T) { +func TestUnit_Resolver_DismissJobError(t *testing.T) { t.Parallel() id := int64(1) diff --git a/core/web/resolver/job_proposal_spec_test.go b/core/web/resolver/job_proposal_spec_test.go index cc3421d0f85..54f8966d9b4 100644 --- a/core/web/resolver/job_proposal_spec_test.go +++ b/core/web/resolver/job_proposal_spec_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/feeds" ) -func TestResolver_ApproveJobProposalSpec(t *testing.T) { +func TestUnit_Resolver_ApproveJobProposalSpec(t *testing.T) { t.Parallel() mutation := ` @@ -119,7 +119,7 @@ func TestResolver_ApproveJobProposalSpec(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_CancelJobProposalSpec(t *testing.T) { +func TestUnit_Resolver_CancelJobProposalSpec(t *testing.T) { t.Parallel() mutation := ` @@ -206,7 +206,7 @@ func TestResolver_CancelJobProposalSpec(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_RejectJobProposalSpec(t *testing.T) { +func TestUnit_Resolver_RejectJobProposalSpec(t *testing.T) { t.Parallel() mutation := ` @@ -293,7 +293,7 @@ func TestResolver_RejectJobProposalSpec(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_UpdateJobProposalSpecDefinition(t *testing.T) { +func TestUnit_Resolver_UpdateJobProposalSpecDefinition(t *testing.T) { t.Parallel() mutation := ` @@ -385,7 +385,7 @@ func TestResolver_UpdateJobProposalSpecDefinition(t *testing.T) { // Tests resolving a job proposal spec. Since there is not GetJobProposalSpec // query, we rely on the GetJobProposal query to fetch the nested specs -func TestResolver_GetJobProposal_Spec(t *testing.T) { +func TestUnit_Resolver_GetJobProposal_Spec(t *testing.T) { t.Parallel() timestamp := time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC) diff --git a/core/web/resolver/job_proposal_test.go b/core/web/resolver/job_proposal_test.go index 3c09435e56e..82e35fec9fd 100644 --- a/core/web/resolver/job_proposal_test.go +++ b/core/web/resolver/job_proposal_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/feeds" ) -func TestResolver_GetJobProposal(t *testing.T) { +func TestUnit_Resolver_GetJobProposal(t *testing.T) { t.Parallel() query := ` diff --git a/core/web/resolver/job_run_test.go b/core/web/resolver/job_run_test.go index 1225001f6eb..44879a6387c 100644 --- a/core/web/resolver/job_run_test.go +++ b/core/web/resolver/job_run_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils/stringutils" ) -func TestQuery_PaginatedJobRuns(t *testing.T) { +func TestUnit_Query_PaginatedJobRuns(t *testing.T) { t.Parallel() query := ` @@ -84,7 +84,7 @@ func TestQuery_PaginatedJobRuns(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_JobRun(t *testing.T) { +func TestUnit_Resolver_JobRun(t *testing.T) { t.Parallel() query := ` @@ -235,7 +235,7 @@ func TestResolver_JobRun(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_RunJob(t *testing.T) { +func TestUnit_Resolver_RunJob(t *testing.T) { t.Parallel() mutation := ` diff --git a/core/web/resolver/job_test.go b/core/web/resolver/job_test.go index 14273507ac2..ef7c2996fcb 100644 --- a/core/web/resolver/job_test.go +++ b/core/web/resolver/job_test.go @@ -28,7 +28,7 @@ import ( // This tests the main fields on the job results. Embedded spec testing is done // in the `spec_test` file -func TestResolver_Jobs(t *testing.T) { +func TestUnit_Resolver_Jobs(t *testing.T) { var ( externalJobID = uuid.MustParse(("00000000-0000-0000-0000-000000000001")) @@ -138,7 +138,7 @@ func TestResolver_Jobs(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_Job(t *testing.T) { +func TestUnit_Resolver_Job(t *testing.T) { var ( id = int32(1) externalJobID = uuid.MustParse(("00000000-0000-0000-0000-000000000001")) @@ -291,7 +291,7 @@ func TestResolver_Job(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_CreateJob(t *testing.T) { +func TestUnit_Resolver_CreateJob(t *testing.T) { t.Parallel() mutation := ` @@ -401,7 +401,7 @@ func TestResolver_CreateJob(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_DeleteJob(t *testing.T) { +func TestUnit_Resolver_DeleteJob(t *testing.T) { t.Parallel() id := int32(123) diff --git a/core/web/resolver/log_test.go b/core/web/resolver/log_test.go index 7aa242c025a..65c9b7dee48 100644 --- a/core/web/resolver/log_test.go +++ b/core/web/resolver/log_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/config" ) -func TestResolver_SetSQLLogging(t *testing.T) { +func TestUnit_Resolver_SetSQLLogging(t *testing.T) { t.Parallel() mutation := ` @@ -63,7 +63,7 @@ type databaseConfig struct { func (d *databaseConfig) LogSQL() bool { return d.logSQL } -func TestResolver_SQLLogging(t *testing.T) { +func TestUnit_Resolver_SQLLogging(t *testing.T) { t.Parallel() query := ` @@ -106,7 +106,7 @@ func (l *log) Level() zapcore.Level { return l.level } -func TestResolver_GlobalLogLevel(t *testing.T) { +func TestUnit_Resolver_GlobalLogLevel(t *testing.T) { t.Parallel() query := ` @@ -144,7 +144,7 @@ func TestResolver_GlobalLogLevel(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_SetGlobalLogLevel(t *testing.T) { +func TestUnit_Resolver_SetGlobalLogLevel(t *testing.T) { t.Parallel() mutation := ` diff --git a/core/web/resolver/node_test.go b/core/web/resolver/node_test.go index 7d04616fb83..a042a607204 100644 --- a/core/web/resolver/node_test.go +++ b/core/web/resolver/node_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/testutils" ) -func TestResolver_Nodes(t *testing.T) { +func TestUnit_Resolver_Nodes(t *testing.T) { t.Parallel() query := ` @@ -101,7 +101,7 @@ func TestResolver_Nodes(t *testing.T) { RunGQLTests(t, testCases) } -func Test_NodeQuery(t *testing.T) { +func TestUnit_NodeQuery(t *testing.T) { t.Parallel() query := ` diff --git a/core/web/resolver/ocr2_keys_test.go b/core/web/resolver/ocr2_keys_test.go index 48a227a9026..de791c4a706 100644 --- a/core/web/resolver/ocr2_keys_test.go +++ b/core/web/resolver/ocr2_keys_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" ) -func TestResolver_GetOCR2KeyBundles(t *testing.T) { +func TestUnit_Resolver_GetOCR2KeyBundles(t *testing.T) { t.Parallel() query := ` @@ -105,7 +105,7 @@ func TestResolver_GetOCR2KeyBundles(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_CreateOCR2KeyBundle(t *testing.T) { +func TestUnit_Resolver_CreateOCR2KeyBundle(t *testing.T) { t.Parallel() mutation := ` @@ -188,7 +188,7 @@ func TestResolver_CreateOCR2KeyBundle(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_DeleteOCR2KeyBundle(t *testing.T) { +func TestUnit_Resolver_DeleteOCR2KeyBundle(t *testing.T) { t.Parallel() fakeKey := ocr2key.MustNewInsecure(keystest.NewRandReaderFromSeed(1), "evm") diff --git a/core/web/resolver/ocr_test.go b/core/web/resolver/ocr_test.go index 6a6cfea3d4d..61321c7b942 100644 --- a/core/web/resolver/ocr_test.go +++ b/core/web/resolver/ocr_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" ) -func TestResolver_GetOCRKeyBundles(t *testing.T) { +func TestUnit_Resolver_GetOCRKeyBundles(t *testing.T) { t.Parallel() query := ` @@ -68,7 +68,7 @@ func TestResolver_GetOCRKeyBundles(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_OCRCreateBundle(t *testing.T) { +func TestUnit_Resolver_OCRCreateBundle(t *testing.T) { t.Parallel() mutation := ` @@ -119,7 +119,7 @@ func TestResolver_OCRCreateBundle(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_OCRDeleteBundle(t *testing.T) { +func TestUnit_Resolver_OCRDeleteBundle(t *testing.T) { t.Parallel() fakeKey := ocrkey.MustNewV2XXXTestingOnly(big.NewInt(1)) diff --git a/core/web/resolver/p2p_test.go b/core/web/resolver/p2p_test.go index 7b53f9d34df..5f15dba0398 100644 --- a/core/web/resolver/p2p_test.go +++ b/core/web/resolver/p2p_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) -func TestResolver_GetP2PKeys(t *testing.T) { +func TestUnit_Resolver_GetP2PKeys(t *testing.T) { t.Parallel() query := ` @@ -67,7 +67,7 @@ func TestResolver_GetP2PKeys(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_CreateP2PKey(t *testing.T) { +func TestUnit_Resolver_CreateP2PKey(t *testing.T) { t.Parallel() query := ` @@ -116,7 +116,7 @@ func TestResolver_CreateP2PKey(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_DeleteP2PKey(t *testing.T) { +func TestUnit_Resolver_DeleteP2PKey(t *testing.T) { t.Parallel() fakeKey := p2pkey.MustNewV2XXXTestingOnly(big.NewInt(1)) diff --git a/core/web/resolver/solana_key_test.go b/core/web/resolver/solana_key_test.go index 9ef5cd85a42..dc80ab5b8b2 100644 --- a/core/web/resolver/solana_key_test.go +++ b/core/web/resolver/solana_key_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/solkey" ) -func TestResolver_SolanaKeys(t *testing.T) { +func TestUnit_Resolver_SolanaKeys(t *testing.T) { t.Parallel() query := ` diff --git a/core/web/resolver/spec_test.go b/core/web/resolver/spec_test.go index 56b7bb8b1c9..09d97d04e18 100644 --- a/core/web/resolver/spec_test.go +++ b/core/web/resolver/spec_test.go @@ -29,7 +29,7 @@ import ( // Specs are only embedded on the job and are not fetchable by it's own id, so // we test the spec resolvers by fetching a job by id. -func TestResolver_CronSpec(t *testing.T) { +func TestUnit_Resolver_CronSpec(t *testing.T) { var ( id = int32(1) ) @@ -83,7 +83,7 @@ func TestResolver_CronSpec(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_DirectRequestSpec(t *testing.T) { +func TestUnit_Resolver_DirectRequestSpec(t *testing.T) { var ( id = int32(1) requesterAddress = common.HexToAddress("0x3cCad4715152693fE3BC4460591e3D3Fbd071b42") @@ -149,7 +149,7 @@ func TestResolver_DirectRequestSpec(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_FluxMonitorSpec(t *testing.T) { +func TestUnit_Resolver_FluxMonitorSpec(t *testing.T) { var ( id = int32(1) ) @@ -298,7 +298,7 @@ func TestResolver_FluxMonitorSpec(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_KeeperSpec(t *testing.T) { +func TestUnit_Resolver_KeeperSpec(t *testing.T) { var ( id = int32(1) fromAddress = common.HexToAddress("0x3cCad4715152693fE3BC4460591e3D3Fbd071b42") @@ -358,7 +358,7 @@ func TestResolver_KeeperSpec(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_OCRSpec(t *testing.T) { +func TestUnit_Resolver_OCRSpec(t *testing.T) { var ( id = int32(1) ) @@ -455,7 +455,7 @@ func TestResolver_OCRSpec(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_OCR2Spec(t *testing.T) { +func TestUnit_Resolver_OCR2Spec(t *testing.T) { var ( id = int32(1) ) @@ -575,7 +575,7 @@ func TestResolver_OCR2Spec(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_VRFSpec(t *testing.T) { +func TestUnit_Resolver_VRFSpec(t *testing.T) { var ( id = int32(1) ) @@ -685,7 +685,7 @@ func TestResolver_VRFSpec(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_WebhookSpec(t *testing.T) { +func TestUnit_Resolver_WebhookSpec(t *testing.T) { var ( id = int32(1) ) @@ -733,7 +733,7 @@ func TestResolver_WebhookSpec(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_BlockhashStoreSpec(t *testing.T) { +func TestUnit_Resolver_BlockhashStoreSpec(t *testing.T) { var ( id = int32(1) ) @@ -841,7 +841,7 @@ func TestResolver_BlockhashStoreSpec(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_BlockHeaderFeederSpec(t *testing.T) { +func TestUnit_Resolver_BlockHeaderFeederSpec(t *testing.T) { var ( id = int32(1) ) @@ -945,7 +945,7 @@ func TestResolver_BlockHeaderFeederSpec(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_BootstrapSpec(t *testing.T) { +func TestUnit_Resolver_BootstrapSpec(t *testing.T) { var ( id = int32(1) ) @@ -1017,7 +1017,7 @@ func TestResolver_BootstrapSpec(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_WorkflowSpec(t *testing.T) { +func TestUnit_Resolver_WorkflowSpec(t *testing.T) { var ( id = int32(1) ) @@ -1071,7 +1071,7 @@ func TestResolver_WorkflowSpec(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_GatewaySpec(t *testing.T) { +func TestUnit_Resolver_GatewaySpec(t *testing.T) { var ( id = int32(1) ) @@ -1129,7 +1129,7 @@ func TestResolver_GatewaySpec(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_StandardCapabilitiesSpec(t *testing.T) { +func TestUnit_Resolver_StandardCapabilitiesSpec(t *testing.T) { var ( id = int32(1) ) @@ -1186,7 +1186,7 @@ func TestResolver_StandardCapabilitiesSpec(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_StreamSpec(t *testing.T) { +func TestUnit_Resolver_StreamSpec(t *testing.T) { var ( id1 = int32(1) id2 = int32(2) diff --git a/core/web/resolver/starknet_key_test.go b/core/web/resolver/starknet_key_test.go index 42d5943a2c4..306d1271bec 100644 --- a/core/web/resolver/starknet_key_test.go +++ b/core/web/resolver/starknet_key_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/starkkey" ) -func TestResolver_StarkNetKeys(t *testing.T) { +func TestUnit_Resolver_StarkNetKeys(t *testing.T) { t.Parallel() query := ` diff --git a/core/web/resolver/sui_key_test.go b/core/web/resolver/sui_key_test.go index c1b66ad100c..8781f8bc73a 100644 --- a/core/web/resolver/sui_key_test.go +++ b/core/web/resolver/sui_key_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/suikey" ) -func TestResolver_SuiKeys(t *testing.T) { +func TestUnit_Resolver_SuiKeys(t *testing.T) { t.Parallel() query := ` diff --git a/core/web/resolver/ton_key_test.go b/core/web/resolver/ton_key_test.go index 7e286cd4d26..4c08ffd5e7a 100644 --- a/core/web/resolver/ton_key_test.go +++ b/core/web/resolver/ton_key_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tonkey" ) -func TestResolver_TONKeys(t *testing.T) { +func TestUnit_Resolver_TONKeys(t *testing.T) { t.Parallel() query := ` diff --git a/core/web/resolver/tron_key_test.go b/core/web/resolver/tron_key_test.go index 3b2b7892f50..878f1cc286e 100644 --- a/core/web/resolver/tron_key_test.go +++ b/core/web/resolver/tron_key_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" ) -func TestResolver_TronKeys(t *testing.T) { +func TestUnit_Resolver_TronKeys(t *testing.T) { t.Parallel() query := ` diff --git a/core/web/resolver/user_test.go b/core/web/resolver/user_test.go index deb958055a1..7ab8ceafee0 100644 --- a/core/web/resolver/user_test.go +++ b/core/web/resolver/user_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/auth" ) -func TestResolver_UpdateUserPassword(t *testing.T) { +func TestUnit_Resolver_UpdateUserPassword(t *testing.T) { t.Parallel() mutation := ` diff --git a/core/web/resolver/vrf_test.go b/core/web/resolver/vrf_test.go index 7001c68467d..e9723f9c6f5 100644 --- a/core/web/resolver/vrf_test.go +++ b/core/web/resolver/vrf_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" ) -func TestResolver_GetVRFKey(t *testing.T) { +func TestUnit_Resolver_GetVRFKey(t *testing.T) { t.Parallel() query := ` @@ -102,7 +102,7 @@ func TestResolver_GetVRFKey(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_GetVRFKeys(t *testing.T) { +func TestUnit_Resolver_GetVRFKeys(t *testing.T) { t.Parallel() query := ` @@ -160,7 +160,7 @@ func TestResolver_GetVRFKeys(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_CreateVRFKey(t *testing.T) { +func TestUnit_Resolver_CreateVRFKey(t *testing.T) { t.Parallel() mutation := ` @@ -212,7 +212,7 @@ func TestResolver_CreateVRFKey(t *testing.T) { RunGQLTests(t, testCases) } -func TestResolver_DeleteVRFKey(t *testing.T) { +func TestUnit_Resolver_DeleteVRFKey(t *testing.T) { t.Parallel() mutation := ` diff --git a/core/web/router_test.go b/core/web/router_test.go index be27e34a7d3..0bec84330a4 100644 --- a/core/web/router_test.go +++ b/core/web/router_test.go @@ -19,7 +19,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestTokenAuthRequired_NoCredentials(t *testing.T) { +func TestIntegration_Shared_TokenAuthRequired_NoCredentials(t *testing.T) { ctx := testutils.Context(t) app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(ctx)) @@ -37,7 +37,7 @@ func TestTokenAuthRequired_NoCredentials(t *testing.T) { assert.Equal(t, http.StatusUnauthorized, resp.StatusCode) } -func TestTokenAuthRequired_SessionCredentials(t *testing.T) { +func TestIntegration_Shared_TokenAuthRequired_SessionCredentials(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) @@ -52,7 +52,7 @@ func TestTokenAuthRequired_SessionCredentials(t *testing.T) { assert.Equal(t, http.StatusUnprocessableEntity, resp.StatusCode) } -func TestTokenAuthRequired_TokenCredentials(t *testing.T) { +func TestIntegration_Shared_TokenAuthRequired_TokenCredentials(t *testing.T) { ctx := testutils.Context(t) app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(ctx)) @@ -85,7 +85,7 @@ func TestTokenAuthRequired_TokenCredentials(t *testing.T) { assert.Equal(t, http.StatusOK, resp.StatusCode) } -func TestTokenAuthRequired_BadTokenCredentials(t *testing.T) { +func TestIntegration_Shared_TokenAuthRequired_BadTokenCredentials(t *testing.T) { ctx := testutils.Context(t) app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(ctx)) @@ -118,7 +118,7 @@ func TestTokenAuthRequired_BadTokenCredentials(t *testing.T) { assert.Equal(t, http.StatusUnauthorized, resp.StatusCode) } -func TestSessions_RateLimited(t *testing.T) { +func TestIntegration_Shared_Sessions_RateLimited(t *testing.T) { ctx := testutils.Context(t) app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(ctx)) @@ -147,7 +147,7 @@ func TestSessions_RateLimited(t *testing.T) { assert.Equal(t, 429, resp.StatusCode) } -func TestRouter_LargePOSTBody(t *testing.T) { +func TestIntegration_Shared_Router_LargePOSTBody(t *testing.T) { ctx := testutils.Context(t) app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(ctx)) @@ -167,7 +167,7 @@ func TestRouter_LargePOSTBody(t *testing.T) { assert.Equal(t, http.StatusRequestEntityTooLarge, resp.StatusCode) } -func TestRouter_GinHelmetHeaders(t *testing.T) { +func TestIntegration_Shared_Router_GinHelmetHeaders(t *testing.T) { ctx := testutils.Context(t) app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(ctx)) diff --git a/core/web/sessions_controller_test.go b/core/web/sessions_controller_test.go index b43f2c6803b..fb2e5e3d9fe 100644 --- a/core/web/sessions_controller_test.go +++ b/core/web/sessions_controller_test.go @@ -20,7 +20,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestSessionsController_Create(t *testing.T) { +func TestIntegration_Shared_SessionsController_Create(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -86,7 +86,7 @@ func mustInsertSession(t *testing.T, ds sqlutil.DataSource, session *sessions.Se require.NoError(t, err) } -func TestSessionsController_Create_ReapSessions(t *testing.T) { +func TestIntegration_Shared_SessionsController_Create_ReapSessions(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -123,7 +123,7 @@ func TestSessionsController_Create_ReapSessions(t *testing.T) { } } -func TestSessionsController_Destroy(t *testing.T) { +func TestIntegration_Shared_SessionsController_Destroy(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -168,7 +168,7 @@ func TestSessionsController_Destroy(t *testing.T) { } } -func TestSessionsController_Destroy_ReapSessions(t *testing.T) { +func TestIntegration_Shared_SessionsController_Destroy_ReapSessions(t *testing.T) { t.Parallel() ctx := testutils.Context(t) diff --git a/core/web/solana_keys_controller_test.go b/core/web/solana_keys_controller_test.go index 5654b26456b..f341c591d88 100644 --- a/core/web/solana_keys_controller_test.go +++ b/core/web/solana_keys_controller_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func TestSolanaKeysController_Index_HappyPath(t *testing.T) { +func TestIntegration_Shared_SolanaKeysController_Index_HappyPath(t *testing.T) { t.Parallel() client, keyStore := setupSolanaKeysControllerTests(t) @@ -35,7 +35,7 @@ func TestSolanaKeysController_Index_HappyPath(t *testing.T) { assert.Equal(t, keys[0].PublicKeyStr(), resources[0].PubKey) } -func TestSolanaKeysController_Create_HappyPath(t *testing.T) { +func TestIntegration_Shared_SolanaKeysController_Create_HappyPath(t *testing.T) { t.Parallel() app := cltest.NewApplicationEVMDisabled(t) @@ -61,7 +61,7 @@ func TestSolanaKeysController_Create_HappyPath(t *testing.T) { require.NoError(t, err) } -func TestSolanaKeysController_Delete_NonExistentSolanaKeyID(t *testing.T) { +func TestIntegration_Shared_SolanaKeysController_Delete_NonExistentSolanaKeyID(t *testing.T) { t.Parallel() client, _ := setupSolanaKeysControllerTests(t) @@ -72,7 +72,7 @@ func TestSolanaKeysController_Delete_NonExistentSolanaKeyID(t *testing.T) { assert.Equal(t, http.StatusNotFound, response.StatusCode) } -func TestSolanaKeysController_Delete_HappyPath(t *testing.T) { +func TestIntegration_Shared_SolanaKeysController_Delete_HappyPath(t *testing.T) { t.Parallel() ctx := testutils.Context(t) diff --git a/core/web/starknet_keys_controller_test.go b/core/web/starknet_keys_controller_test.go index cca1cfbd67a..acd303530c5 100644 --- a/core/web/starknet_keys_controller_test.go +++ b/core/web/starknet_keys_controller_test.go @@ -15,7 +15,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestStarkNetKeysController_Index_HappyPath(t *testing.T) { +func TestIntegration_Shared_StarkNetKeysController_Index_HappyPath(t *testing.T) { t.Parallel() client, keyStore := setupStarkNetKeysControllerTests(t) @@ -35,7 +35,7 @@ func TestStarkNetKeysController_Index_HappyPath(t *testing.T) { assert.Equal(t, keys[0].StarkKeyStr(), resources[0].StarkKey) } -func TestStarkNetKeysController_Create_HappyPath(t *testing.T) { +func TestIntegration_Shared_StarkNetKeysController_Create_HappyPath(t *testing.T) { t.Parallel() app := cltest.NewApplicationEVMDisabled(t) @@ -61,7 +61,7 @@ func TestStarkNetKeysController_Create_HappyPath(t *testing.T) { require.NoError(t, err) } -func TestStarkNetKeysController_Delete_NonExistentStarkNetKeyID(t *testing.T) { +func TestIntegration_Shared_StarkNetKeysController_Delete_NonExistentStarkNetKeyID(t *testing.T) { t.Parallel() client, _ := setupStarkNetKeysControllerTests(t) @@ -72,7 +72,7 @@ func TestStarkNetKeysController_Delete_NonExistentStarkNetKeyID(t *testing.T) { assert.Equal(t, http.StatusNotFound, response.StatusCode) } -func TestStarkNetKeysController_Delete_HappyPath(t *testing.T) { +func TestIntegration_Shared_StarkNetKeysController_Delete_HappyPath(t *testing.T) { t.Parallel() ctx := testutils.Context(t) diff --git a/core/web/sui_keys_controller_test.go b/core/web/sui_keys_controller_test.go index 97eebc3ab68..8d9b80a4c6b 100644 --- a/core/web/sui_keys_controller_test.go +++ b/core/web/sui_keys_controller_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -func TestSuiKeysController_Index_HappyPath(t *testing.T) { +func TestIntegration_Shared_SuiKeysController_Index_HappyPath(t *testing.T) { t.Parallel() client, keyStore := setupSuiKeysControllerTests(t) @@ -35,7 +35,7 @@ func TestSuiKeysController_Index_HappyPath(t *testing.T) { assert.Equal(t, keys[0].PublicKeyStr(), resources[0].PubKey) } -func TestSuiKeysController_Create_HappyPath(t *testing.T) { +func TestIntegration_Shared_SuiKeysController_Create_HappyPath(t *testing.T) { t.Parallel() app := cltest.NewApplicationEVMDisabled(t) @@ -61,7 +61,7 @@ func TestSuiKeysController_Create_HappyPath(t *testing.T) { require.NoError(t, err) } -func TestSuiKeysController_Delete_NonExistentSuiKeyID(t *testing.T) { +func TestIntegration_Shared_SuiKeysController_Delete_NonExistentSuiKeyID(t *testing.T) { t.Parallel() client, _ := setupSuiKeysControllerTests(t) @@ -72,7 +72,7 @@ func TestSuiKeysController_Delete_NonExistentSuiKeyID(t *testing.T) { assert.Equal(t, http.StatusNotFound, response.StatusCode) } -func TestSuiKeysController_Delete_HappyPath(t *testing.T) { +func TestIntegration_Shared_SuiKeysController_Delete_HappyPath(t *testing.T) { t.Parallel() ctx := testutils.Context(t) diff --git a/core/web/ton_keys_controller_test.go b/core/web/ton_keys_controller_test.go index 685a4a60b65..1b93341286a 100644 --- a/core/web/ton_keys_controller_test.go +++ b/core/web/ton_keys_controller_test.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestTONKeysController_Index_HappyPath(t *testing.T) { +func TestIntegration_Shared_TONKeysController_Index_HappyPath(t *testing.T) { t.Parallel() client, keyStore := setupTONKeysControllerTests(t) @@ -34,7 +34,7 @@ func TestTONKeysController_Index_HappyPath(t *testing.T) { require.Equal(t, keys[0].PublicKeyStr(), resources[0].PubKey) } -func TestTONKeysController_Create_HappyPath(t *testing.T) { +func TestIntegration_Shared_TONKeysController_Create_HappyPath(t *testing.T) { t.Parallel() app := cltest.NewApplicationEVMDisabled(t) @@ -62,7 +62,7 @@ func TestTONKeysController_Create_HappyPath(t *testing.T) { require.NoError(t, err) } -func TestTONKeysController_Delete_NonExistentTONKeyID(t *testing.T) { +func TestIntegration_Shared_TONKeysController_Delete_NonExistentTONKeyID(t *testing.T) { t.Parallel() client, _ := setupTONKeysControllerTests(t) @@ -73,7 +73,7 @@ func TestTONKeysController_Delete_NonExistentTONKeyID(t *testing.T) { require.Equal(t, http.StatusNotFound, response.StatusCode) } -func TestTONKeysController_Delete_HappyPath(t *testing.T) { +func TestIntegration_Shared_TONKeysController_Delete_HappyPath(t *testing.T) { t.Parallel() ctx := testutils.Context(t) diff --git a/core/web/tron_keys_controller_test.go b/core/web/tron_keys_controller_test.go index 5628d7ac2dc..b9093a10a5b 100644 --- a/core/web/tron_keys_controller_test.go +++ b/core/web/tron_keys_controller_test.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestTronKeysController_Index_HappyPath(t *testing.T) { +func TestIntegration_Shared_TronKeysController_Index_HappyPath(t *testing.T) { t.Parallel() client, keyStore := setupTronKeysControllerTests(t) @@ -34,7 +34,7 @@ func TestTronKeysController_Index_HappyPath(t *testing.T) { require.Equal(t, keys[0].PublicKeyStr(), resources[0].PubKey) } -func TestTronKeysController_Create_HappyPath(t *testing.T) { +func TestIntegration_Shared_TronKeysController_Create_HappyPath(t *testing.T) { t.Parallel() app := cltest.NewApplicationEVMDisabled(t) @@ -60,7 +60,7 @@ func TestTronKeysController_Create_HappyPath(t *testing.T) { require.NoError(t, err) } -func TestTronKeysController_Delete_NonExistentTronKeyID(t *testing.T) { +func TestIntegration_Shared_TronKeysController_Delete_NonExistentTronKeyID(t *testing.T) { t.Parallel() client, _ := setupTronKeysControllerTests(t) @@ -71,7 +71,7 @@ func TestTronKeysController_Delete_NonExistentTronKeyID(t *testing.T) { require.Equal(t, http.StatusNotFound, response.StatusCode) } -func TestTronKeysController_Delete_HappyPath(t *testing.T) { +func TestIntegration_Shared_TronKeysController_Delete_HappyPath(t *testing.T) { t.Parallel() ctx := testutils.Context(t) diff --git a/core/web/user_controller_test.go b/core/web/user_controller_test.go index 38cb6948ff1..dc81a10004b 100644 --- a/core/web/user_controller_test.go +++ b/core/web/user_controller_test.go @@ -19,7 +19,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/utils" ) -func TestUserController_UpdatePassword(t *testing.T) { +func TestIntegration_Shared_UserController_UpdatePassword(t *testing.T) { t.Parallel() app := cltest.NewApplicationEVMDisabled(t) @@ -84,7 +84,7 @@ func TestUserController_UpdatePassword(t *testing.T) { } } -func TestUserController_CreateUser(t *testing.T) { +func TestIntegration_Shared_UserController_CreateUser(t *testing.T) { t.Parallel() app := cltest.NewApplicationEVMDisabled(t) @@ -178,7 +178,7 @@ func TestUserController_CreateUser(t *testing.T) { } } -func TestUserController_UpdateRole(t *testing.T) { +func TestIntegration_Shared_UserController_UpdateRole(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -225,7 +225,7 @@ func TestUserController_UpdateRole(t *testing.T) { } } -func TestUserController_DeleteUser(t *testing.T) { +func TestIntegration_Shared_UserController_DeleteUser(t *testing.T) { t.Parallel() ctx := testutils.Context(t) @@ -252,7 +252,7 @@ func TestUserController_DeleteUser(t *testing.T) { assert.Contains(t, errors.Errors[0].Detail, "specified user not found") } -func TestUserController_NewAPIToken(t *testing.T) { +func TestIntegration_Shared_UserController_NewAPIToken(t *testing.T) { t.Parallel() app := cltest.NewApplicationEVMDisabled(t) @@ -273,7 +273,7 @@ func TestUserController_NewAPIToken(t *testing.T) { assert.NotEmpty(t, authToken.Secret) } -func TestUserController_NewAPIToken_unauthorized(t *testing.T) { +func TestIntegration_Shared_UserController_NewAPIToken_unauthorized(t *testing.T) { t.Parallel() app := cltest.NewApplicationEVMDisabled(t) @@ -289,7 +289,7 @@ func TestUserController_NewAPIToken_unauthorized(t *testing.T) { assert.Equal(t, http.StatusUnauthorized, resp.StatusCode) } -func TestUserController_DeleteAPIKey(t *testing.T) { +func TestIntegration_Shared_UserController_DeleteAPIKey(t *testing.T) { t.Parallel() app := cltest.NewApplicationEVMDisabled(t) @@ -306,7 +306,7 @@ func TestUserController_DeleteAPIKey(t *testing.T) { require.Equal(t, http.StatusNoContent, resp.StatusCode) } -func TestUserController_DeleteAPIKey_unauthorized(t *testing.T) { +func TestIntegration_Shared_UserController_DeleteAPIKey_unauthorized(t *testing.T) { t.Parallel() app := cltest.NewApplicationEVMDisabled(t) diff --git a/core/web/vault_controller_test.go b/core/web/vault_controller_test.go index e3d18fd60d7..8e9a8e61416 100644 --- a/core/web/vault_controller_test.go +++ b/core/web/vault_controller_test.go @@ -40,7 +40,7 @@ func setupVaultControllerTests(t *testing.T) (cltest.HTTPClientCleaner, keystore return client, app.GetKeyStore(), orm } -func TestVaultController_VerifyDKGResult_HappyPath(t *testing.T) { +func TestIntegration_Shared_VaultController_VerifyDKGResult_HappyPath(t *testing.T) { client, keystore, orm := setupVaultControllerTests(t) keys, err := keystore.DKGRecipient().GetAll() @@ -96,7 +96,7 @@ func TestVaultController_VerifyDKGResult_HappyPath(t *testing.T) { cltest.AssertServerResponse(t, response, http.StatusOK) } -func TestVaultController_VerifyDKGResult_WrongKey(t *testing.T) { +func TestIntegration_Shared_VaultController_VerifyDKGResult_WrongKey(t *testing.T) { client, keystore, orm := setupVaultControllerTests(t) keys, err := keystore.DKGRecipient().GetAll() @@ -157,7 +157,7 @@ func TestVaultController_VerifyDKGResult_WrongKey(t *testing.T) { cltest.AssertServerResponse(t, response, http.StatusBadRequest) } -func TestVaultController_VerifyDKGResult_CantFindResultForInstanceID(t *testing.T) { +func TestIntegration_Shared_VaultController_VerifyDKGResult_CantFindResultForInstanceID(t *testing.T) { client, _, _ := setupVaultControllerTests(t) bdata, err := json.Marshal(web.VerifyDKGResultRequest{ @@ -171,7 +171,7 @@ func TestVaultController_VerifyDKGResult_CantFindResultForInstanceID(t *testing. cltest.AssertServerResponse(t, response, http.StatusNotFound) } -func TestVaultController_VerifyDKGResult_MissingInstanceIDOrPublicKey(t *testing.T) { +func TestIntegration_Shared_VaultController_VerifyDKGResult_MissingInstanceIDOrPublicKey(t *testing.T) { client, _, _ := setupVaultControllerTests(t) bdata, err := json.Marshal(web.VerifyDKGResultRequest{ @@ -193,7 +193,7 @@ func TestVaultController_VerifyDKGResult_MissingInstanceIDOrPublicKey(t *testing cltest.AssertServerResponse(t, response, http.StatusBadRequest) } -func TestVaultController_ExportDKGResult(t *testing.T) { +func TestIntegration_Shared_VaultController_ExportDKGResult(t *testing.T) { client, keystore, orm := setupVaultControllerTests(t) keys, err := keystore.DKGRecipient().GetAll() diff --git a/core/web/workflow_keys_controller_test.go b/core/web/workflow_keys_controller_test.go index 8d877ae57d5..5261a67778c 100644 --- a/core/web/workflow_keys_controller_test.go +++ b/core/web/workflow_keys_controller_test.go @@ -28,7 +28,7 @@ func setupWorkflowKeysControllerTests(t *testing.T) (cltest.HTTPClientCleaner, k return client, app.GetKeyStore() } -func TestWorkflowKeysController_Index_HappyPath(t *testing.T) { +func TestIntegration_Shared_WorkflowKeysController_Index_HappyPath(t *testing.T) { client, keyStore := setupWorkflowKeysControllerTests(t) keys, err := keyStore.Workflow().GetAll() require.NoError(t, err) diff --git a/deployment/ccip/changeset/aptos/config/lane_test.go b/deployment/ccip/changeset/aptos/config/lane_test.go index b2272795d50..767e80693cb 100644 --- a/deployment/ccip/changeset/aptos/config/lane_test.go +++ b/deployment/ccip/changeset/aptos/config/lane_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipevm" ) -func TestToEVMUpdateLanesConfig(t *testing.T) { +func TestUnit_ToEVMUpdateLanesConfig(t *testing.T) { t.Parallel() tests := []struct { name string diff --git a/deployment/ccip/changeset/aptos/cs_add_token_pool_test.go b/deployment/ccip/changeset/aptos/cs_add_token_pool_test.go index 69465d3c7be..3c6ab7fafbc 100644 --- a/deployment/ccip/changeset/aptos/cs_add_token_pool_test.go +++ b/deployment/ccip/changeset/aptos/cs_add_token_pool_test.go @@ -37,7 +37,7 @@ var testTokenTransferFeeConfig = fee_quoter.TokenTransferFeeConfig{ IsEnabled: true, } -func TestAddTokenPool_Apply(t *testing.T) { +func TestIntegration_Aptos_AddTokenPool_Apply(t *testing.T) { quarantine.Flaky(t, "DX-2088") t.Parallel() // Setup environment and config with 1 Aptos chain diff --git a/deployment/ccip/changeset/aptos/cs_deploy_aptos_chain_test.go b/deployment/ccip/changeset/aptos/cs_deploy_aptos_chain_test.go index 61c78d4556f..a282eec5f5f 100644 --- a/deployment/ccip/changeset/aptos/cs_deploy_aptos_chain_test.go +++ b/deployment/ccip/changeset/aptos/cs_deploy_aptos_chain_test.go @@ -29,7 +29,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/common/types" ) -func TestDeployAptosChainImp_VerifyPreconditions(t *testing.T) { +func TestIntegration_Aptos_DeployAptosChainImp_VerifyPreconditions(t *testing.T) { t.Parallel() tests := []struct { name string @@ -237,7 +237,7 @@ func TestDeployAptosChainImp_VerifyPreconditions(t *testing.T) { } } -func TestDeployAptosChain_Apply(t *testing.T) { +func TestIntegration_Aptos_DeployAptosChain_Apply(t *testing.T) { t.Parallel() // Setup environment with 1 Aptos chain diff --git a/deployment/ccip/changeset/aptos/cs_set_ocr3_offramp_test.go b/deployment/ccip/changeset/aptos/cs_set_ocr3_offramp_test.go index 584a5d29fc9..d87d78fbca4 100644 --- a/deployment/ccip/changeset/aptos/cs_set_ocr3_offramp_test.go +++ b/deployment/ccip/changeset/aptos/cs_set_ocr3_offramp_test.go @@ -20,7 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" ) -func TestSetOCR3Offramp_Apply(t *testing.T) { +func TestIntegration_Aptos_PSetOCR3Offramp_Apply(t *testing.T) { t.Parallel() // Setup environment and config deployedEnvironment, _ := testhelpers.NewMemoryEnvironment( diff --git a/deployment/ccip/changeset/aptos/cs_update_aptos_lanes_test.go b/deployment/ccip/changeset/aptos/cs_update_aptos_lanes_test.go index 51b18d37a7d..c76d0ee5f89 100644 --- a/deployment/ccip/changeset/aptos/cs_update_aptos_lanes_test.go +++ b/deployment/ccip/changeset/aptos/cs_update_aptos_lanes_test.go @@ -30,7 +30,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipevm" ) -func TestAddAptosLanes_Apply(t *testing.T) { +func TestIntegration_Aptos_AddAptosLanes_Apply(t *testing.T) { t.Parallel() // Setup environment and config deployedEnvironment, _ := testhelpers.NewMemoryEnvironment( diff --git a/deployment/ccip/changeset/ccip-attestation/cs_configure_evm_signer_registry_test.go b/deployment/ccip/changeset/ccip-attestation/cs_configure_evm_signer_registry_test.go index c90b15fd136..bb93f45ac01 100644 --- a/deployment/ccip/changeset/ccip-attestation/cs_configure_evm_signer_registry_test.go +++ b/deployment/ccip/changeset/ccip-attestation/cs_configure_evm_signer_registry_test.go @@ -51,7 +51,7 @@ func deployTestSignerRegistry(t *testing.T, env cldf.Environment, selector uint6 return signerRegistry.Address } -func TestEVMSignerRegistryConfiguration_Preconditions(t *testing.T) { +func TestUnit_EVMSignerRegistryConfiguration_Preconditions(t *testing.T) { t.Parallel() selector := uint64(ccip_attestation.BaseMainnetSelector) @@ -135,7 +135,7 @@ func TestEVMSignerRegistryConfiguration_Preconditions(t *testing.T) { } } -func TestEVMSignerRegistryConfiguration_StateValidation(t *testing.T) { +func TestUnit_EVMSignerRegistryConfiguration_StateValidation(t *testing.T) { t.Parallel() selector := uint64(ccip_attestation.BaseMainnetSelector) @@ -184,7 +184,7 @@ func TestEVMSignerRegistryConfiguration_StateValidation(t *testing.T) { require.ErrorContains(t, err, "is already a signer") } -func TestEVMSignerRegistryConfiguration_DirectExecution(t *testing.T) { +func TestUnit_EVMSignerRegistryConfiguration_DirectExecution(t *testing.T) { t.Parallel() selector := uint64(ccip_attestation.BaseMainnetSelector) @@ -233,7 +233,7 @@ func TestEVMSignerRegistryConfiguration_DirectExecution(t *testing.T) { require.Equal(t, uint64(2), count.Uint64()) } -func TestEVMSignerRegistryConfiguration_NoRegistries(t *testing.T) { +func TestUnit_EVMSignerRegistryConfiguration_NoRegistries(t *testing.T) { t.Parallel() selector := uint64(ccip_attestation.BaseMainnetSelector) diff --git a/deployment/ccip/changeset/ccip-attestation/cs_deploy_evm_signer_registry_test.go b/deployment/ccip/changeset/ccip-attestation/cs_deploy_evm_signer_registry_test.go index 81e584f9966..a081c887cce 100644 --- a/deployment/ccip/changeset/ccip-attestation/cs_deploy_evm_signer_registry_test.go +++ b/deployment/ccip/changeset/ccip-attestation/cs_deploy_evm_signer_registry_test.go @@ -52,7 +52,7 @@ func makeSigners(n int) []signer_registry.ISignerRegistrySigner { return signers } -func TestEVMSignerRegistry_Preconditions(t *testing.T) { +func TestUnit_EVMSignerRegistry_Preconditions(t *testing.T) { t.Parallel() // Create a minimal environment for precondition tests @@ -193,7 +193,7 @@ func TestEVMSignerRegistry_Preconditions(t *testing.T) { } } -func TestEVMSignerRegistry_DeploysOnlyOnBaseChains(t *testing.T) { +func TestUnit_EVMSignerRegistry_DeploysOnlyOnBaseChains(t *testing.T) { t.Parallel() // Create environment with Base Mainnet and Base Sepolia chain IDs @@ -253,7 +253,7 @@ func TestEVMSignerRegistry_DeploysOnlyOnBaseChains(t *testing.T) { require.Equal(t, signer2, signers[1].EvmAddress) } -func TestEVMSignerRegistry_SkipsNonBaseChains(t *testing.T) { +func TestUnit_EVMSignerRegistry_SkipsNonBaseChains(t *testing.T) { t.Parallel() // Create environment with non-Base chains diff --git a/deployment/ccip/changeset/crossfamily/cs_set_token_transfer_fee_config_test.go b/deployment/ccip/changeset/crossfamily/cs_set_token_transfer_fee_config_test.go index a14ee8b2299..8e9fee6996c 100644 --- a/deployment/ccip/changeset/crossfamily/cs_set_token_transfer_fee_config_test.go +++ b/deployment/ccip/changeset/crossfamily/cs_set_token_transfer_fee_config_test.go @@ -88,7 +88,7 @@ func getSolanaTokenTransferFeeConfig(t *testing.T, tEnv cldf.Environment, srcSel return cfg } -func TestSetTokenTransferFeeConfig_Validations(t *testing.T) { +func TestIntegration_Solana_SetTokenTransferFeeConfig_Validations(t *testing.T) { // Build a mixed env with EVM + non-EVM so we can validate both families in one table-driven test env, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithCCIPSolanaContractVersion(ccip_cs_sol_v0_1_1.SolanaContractV0_1_1), @@ -280,7 +280,7 @@ func TestSetTokenTransferFeeConfig_Validations(t *testing.T) { } } -func TestSetTokenTransferFeeConfig_EmptyConfigIsGracefullyHandled(t *testing.T) { +func TestIntegration_Solana_SetTokenTransferFeeConfig_EmptyConfigIsGracefullyHandled(t *testing.T) { env, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithCCIPSolanaContractVersion(ccip_cs_sol_v0_1_1.SolanaContractV0_1_1), testhelpers.WithNumOfChains(2), @@ -296,7 +296,7 @@ func TestSetTokenTransferFeeConfig_EmptyConfigIsGracefullyHandled(t *testing.T) require.NoError(t, err) } -func TestSetTokenTransferFeeConfig_EVM_V1_6_0_Only(t *testing.T) { +func TestIntegration_Solana_SetTokenTransferFeeConfig_EVM_V1_6_0_Only(t *testing.T) { // Setup EVM environment env, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(2)) @@ -359,7 +359,7 @@ func TestSetTokenTransferFeeConfig_EVM_V1_6_0_Only(t *testing.T) { require.Equal(t, cfg1, cfg2) } -func TestSetTokenTransferFeeConfig_EVM_V1_5_1_Only(t *testing.T) { +func TestIntegration_Solana_SetTokenTransferFeeConfig_EVM_V1_5_1_Only(t *testing.T) { // Setup EVM environment env, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(2), @@ -454,7 +454,7 @@ func TestSetTokenTransferFeeConfig_EVM_V1_5_1_Only(t *testing.T) { require.Equal(t, cfg1, cfg2) } -func TestSetTokenTransferFeeConfig_Solana_V0_1_0_Only(t *testing.T) { +func TestIntegration_Solana_SetTokenTransferFeeConfig_Solana_V0_1_0_Only(t *testing.T) { // Setup Solana environment env, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithCCIPSolanaContractVersion(ccip_cs_sol_v0_1_1.SolanaContractV0_1_1), @@ -547,7 +547,7 @@ func TestSetTokenTransferFeeConfig_Solana_V0_1_0_Only(t *testing.T) { require.True(t, solCfgY.TokenTransferConfig.IsEnabled) } -func TestSetTokenTransferFeeConfig_MixedFamilies_SingleApply(t *testing.T) { +func TestIntegration_Solana_SetTokenTransferFeeConfig_MixedFamilies_SingleApply(t *testing.T) { // Build a mixed env with EVM + non-EVM env, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithCCIPSolanaContractVersion(ccip_cs_sol_v0_1_1.SolanaContractV0_1_1), diff --git a/deployment/ccip/changeset/crossfamily/v1_6/cs_add_evm_solana_lane_test.go b/deployment/ccip/changeset/crossfamily/v1_6/cs_add_evm_solana_lane_test.go index 60a250ac701..ed16b7ee7bb 100644 --- a/deployment/ccip/changeset/crossfamily/v1_6/cs_add_evm_solana_lane_test.go +++ b/deployment/ccip/changeset/crossfamily/v1_6/cs_add_evm_solana_lane_test.go @@ -29,7 +29,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) -func TestAddEVMSolanaLaneBidirectional(t *testing.T) { +func TestIntegration_Solana_AddEVMSolanaLaneBidirectional(t *testing.T) { quarantine.Flaky(t, "DX-1741") for _, tc := range []struct { name string diff --git a/deployment/ccip/changeset/cs_grant_and_mint_link_token_test.go b/deployment/ccip/changeset/cs_grant_and_mint_link_token_test.go index 18a416d89cc..51dce97670c 100644 --- a/deployment/ccip/changeset/cs_grant_and_mint_link_token_test.go +++ b/deployment/ccip/changeset/cs_grant_and_mint_link_token_test.go @@ -19,7 +19,7 @@ import ( tokencs "github.com/smartcontractkit/chainlink/deployment/tokens/changesets" ) -func TestDeployLinktokenAndTransferOwnershipCS(t *testing.T) { +func TestUnit_DeployLinktokenAndTransferOwnershipCS(t *testing.T) { t.Parallel() selector := chainselectors.TEST_90000001.Selector @@ -81,7 +81,7 @@ func TestDeployLinktokenAndTransferOwnershipCS(t *testing.T) { require.GreaterOrEqual(t, totalSupply.Cmp(expectedMintAmount), 0, "Total supply should be at least the minted amount") } -func TestDeployLinktokenAndGrantMintRole(t *testing.T) { +func TestUnit_DeployLinktokenAndGrantMintRole(t *testing.T) { t.Parallel() selector := chainselectors.TEST_90000001.Selector diff --git a/deployment/ccip/changeset/cs_orchestrate_changesets_test.go b/deployment/ccip/changeset/cs_orchestrate_changesets_test.go index f52b4526198..2433b7eed68 100644 --- a/deployment/ccip/changeset/cs_orchestrate_changesets_test.go +++ b/deployment/ccip/changeset/cs_orchestrate_changesets_test.go @@ -109,7 +109,7 @@ func newRuntimeWithMCMS(t *testing.T) *runtime.Runtime { return rt } -func TestOrchestrateChangesets_VerifyPreconditions(t *testing.T) { +func TestUnit_OrchestrateChangesets_VerifyPreconditions(t *testing.T) { t.Run("description failure", func(t *testing.T) { env, err := environment.New(t.Context(), environment.WithLogger(logger.Test(t)), @@ -179,7 +179,7 @@ func TestOrchestrateChangesets_VerifyPreconditions(t *testing.T) { }) } -func TestOrchestrateChangesets_Apply(t *testing.T) { +func TestUnit_OrchestrateChangesets_Apply(t *testing.T) { t.Run("first fails", func(t *testing.T) { rt := newRuntimeWithMCMS(t) @@ -257,7 +257,7 @@ func TestOrchestrateChangesets_Apply(t *testing.T) { }) } -func TestOrchestrateChangesetsConfig_MCMSGetsOverridden(t *testing.T) { +func TestUnit_OrchestrateChangesetsConfig_MCMSGetsOverridden(t *testing.T) { rt := newRuntimeWithMCMS(t) env := rt.Environment() state, err := stateview.LoadOnchainState(env) diff --git a/deployment/ccip/changeset/cs_prerequisites_test.go b/deployment/ccip/changeset/cs_prerequisites_test.go index 1329b5dd842..9c4c6f12b2f 100644 --- a/deployment/ccip/changeset/cs_prerequisites_test.go +++ b/deployment/ccip/changeset/cs_prerequisites_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" ) -func TestDeployPrerequisites(t *testing.T) { +func TestUnit_DeployPrerequisites(t *testing.T) { t.Parallel() e, err := environment.New(t.Context(), @@ -30,7 +30,7 @@ func TestDeployPrerequisites(t *testing.T) { testDeployPrerequisitesWithEnv(t, *e) } -func TestDeployPrerequisitesZk(t *testing.T) { +func TestUnit_DeployPrerequisitesZk(t *testing.T) { // Timeouts in CI tests.SkipFlakey(t, "https://smartcontract-it.atlassian.net/browse/CCIP-6427") diff --git a/deployment/ccip/changeset/globals/ocr3_test.go b/deployment/ccip/changeset/globals/ocr3_test.go index 8c45f748987..5c6b6ab24ff 100644 --- a/deployment/ccip/changeset/globals/ocr3_test.go +++ b/deployment/ccip/changeset/globals/ocr3_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" ) -func Test_MergeWithOverrides(t *testing.T) { +func TestUnit_MergeWithOverrides(t *testing.T) { assert.Equal(t, ExecOCRParams.DeltaProgress, ExecOCRParamsForEthereum.DeltaProgress) assert.Equal(t, ExecOCRParams.DeltaResend, ExecOCRParamsForEthereum.DeltaResend) assert.Equal(t, ExecOCRParams.DeltaInitial, ExecOCRParamsForEthereum.DeltaInitial) diff --git a/deployment/ccip/changeset/save_existing_test.go b/deployment/ccip/changeset/save_existing_test.go index 1469326a6fd..b2bc2459c1a 100644 --- a/deployment/ccip/changeset/save_existing_test.go +++ b/deployment/ccip/changeset/save_existing_test.go @@ -22,7 +22,7 @@ import ( commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" ) -func TestSaveExistingCCIP(t *testing.T) { +func TestUnit_SaveExistingCCIP(t *testing.T) { t.Parallel() rt, err := runtime.New(t.Context(), runtime.WithEnvOpts( diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_chain_contracts_test.go b/deployment/ccip/changeset/solana_v0_1_1/cs_chain_contracts_test.go index 13b509ac698..dfc5e646acb 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_chain_contracts_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_chain_contracts_test.go @@ -79,12 +79,12 @@ func deployTokenAndMint(t *testing.T, tenv cldf.Environment, solChain uint64, wa } // remote chain setup -func TestAddRemoteChainWithMcms(t *testing.T) { +func TestIntegration_Solana_AddRemoteChainWithMcms(t *testing.T) { t.Parallel() doTestAddRemoteChain(t, true) } -func TestAddRemoteChainWithoutMcms(t *testing.T) { +func TestIntegration_Solana_AddRemoteChainWithoutMcms(t *testing.T) { t.Parallel() skipInCI(t) doTestAddRemoteChain(t, false) @@ -642,19 +642,19 @@ func doTestBilling(t *testing.T, mcms bool) { require.Equal(t, feeAggResult+1000, newFeeAggResult) } -func TestBillingWithMcms(t *testing.T) { +func TestIntegration_Solana_BillingWithMcms(t *testing.T) { quarantine.Flaky(t, "DX-1723") t.Parallel() doTestBilling(t, true) } -func TestBillingWithoutMcms(t *testing.T) { +func TestIntegration_Solana_BillingWithoutMcms(t *testing.T) { t.Parallel() skipInCI(t) doTestBilling(t, false) } -func TestSetTokenAuthority(t *testing.T) { +func TestIntegration_Solana_SetTokenAuthority(t *testing.T) { quarantine.Flaky(t, "DX-1778") t.Parallel() tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithSolChains(1), testhelpers.WithCCIPSolanaContractVersion(ccipChangesetSolana.SolanaContractV0_1_1)) @@ -876,13 +876,13 @@ func doTestTokenAdminRegistry(t *testing.T, mcms bool) { } } -func TestTokenAdminRegistryWithMcms(t *testing.T) { +func TestIntegration_Solana_TokenAdminRegistryWithMcms(t *testing.T) { quarantine.Flaky(t, "DX-1720") t.Parallel() doTestTokenAdminRegistry(t, true) } -func TestTokenAdminRegistryWithoutMcms(t *testing.T) { +func TestIntegration_Solana_TokenAdminRegistryWithoutMcms(t *testing.T) { t.Parallel() skipInCI(t) doTestTokenAdminRegistry(t, false) @@ -987,21 +987,21 @@ func doTestPoolLookupTable(t *testing.T, e cldf.Environment, mcms bool, tokenMet require.Equal(t, lookupTablePubKey, tokenAdminRegistry.LookupTable) } -func TestPoolLookupTableWithMcms(t *testing.T) { +func TestIntegration_Solana_PoolLookupTableWithMcms(t *testing.T) { quarantine.Flaky(t, "DX-1753") t.Parallel() tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithSolChains(1), testhelpers.WithCCIPSolanaContractVersion(ccipChangesetSolana.SolanaContractV0_1_1)) doTestPoolLookupTable(t, tenv.Env, true, shared.CLLMetadata) } -func TestPoolLookupTableWithoutMcms(t *testing.T) { +func TestIntegration_Solana_PoolLookupTableWithoutMcms(t *testing.T) { t.Parallel() skipInCI(t) tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithSolChains(1), testhelpers.WithCCIPSolanaContractVersion(ccipChangesetSolana.SolanaContractV0_1_1)) doTestPoolLookupTable(t, tenv.Env, false, shared.CLLMetadata) } -func TestDeployCCIPContracts(t *testing.T) { +func TestIntegration_Solana_DeployCCIPContracts(t *testing.T) { // TODO: Fix this test to use the new changeset t.Parallel() skipInCI(t) @@ -1009,7 +1009,7 @@ func TestDeployCCIPContracts(t *testing.T) { } // ocr3 test -func TestSetOcr3Active(t *testing.T) { +func TestIntegration_Solana_SetOcr3Active(t *testing.T) { quarantine.Flaky(t, "DX-1775") t.Parallel() tenv, _ := testhelpers.NewMemoryEnvironment(t, @@ -1039,7 +1039,7 @@ func TestSetOcr3Active(t *testing.T) { require.NoError(t, err) } -func TestSetOcr3Candidate(t *testing.T) { +func TestIntegration_Solana_SetOcr3Candidate(t *testing.T) { quarantine.Flaky(t, "DX-1771") t.Parallel() tenv, _ := testhelpers.NewMemoryEnvironment(t, diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_test.go b/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_test.go index db838bcccc5..089e3e5c48f 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_test.go @@ -103,7 +103,7 @@ func initialDeployCS(t *testing.T, e cldf.Environment, buildConfig *ccipChangese } // use this for a quick deploy test -func TestDeployChainContractsChangesetPreload(t *testing.T) { +func TestUnit_DeployChainContractsChangesetPreload(t *testing.T) { quarantine.Flaky(t, "DX-1729") t.Parallel() @@ -145,7 +145,7 @@ func skipInCI(t *testing.T) { // 2. Build the upgraded contracts. We need the declare ids to match the existing deployed programs, // so we need to do a local build again. We cannot do a remote fetch because those artifacts will not have the same keys as step 1. // Doing this in CI is expensive, so we skip it for now. -func TestUpgrade(t *testing.T) { +func TestIntegration_Solana_Upgrade(t *testing.T) { t.Parallel() skipInCI(t) @@ -345,7 +345,7 @@ func TestUpgrade(t *testing.T) { require.NoError(t, err) } -func TestClose(t *testing.T) { +func TestIntegration_Solana_Close(t *testing.T) { t.Parallel() skipInCI(t) @@ -422,7 +422,7 @@ func TestClose(t *testing.T) { require.NoError(t, err) } -func TestIDL(t *testing.T) { +func TestIntegration_Solana_IDL(t *testing.T) { skipInCI(t) tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithSolChains(1), testhelpers.WithCCIPSolanaContractVersion(ccipChangesetSolana.SolanaContractV0_1_1)) solChain := tenv.Env.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilySolana))[0] diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_ops_test.go b/deployment/ccip/changeset/solana_v0_1_1/cs_ops_test.go index a263184c37a..06612cc3c88 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_ops_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_ops_test.go @@ -18,13 +18,13 @@ import ( commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" ) -func TestGenericOpsWithMcms(t *testing.T) { +func TestIntegration_Solana_GenericOpsWithMcms(t *testing.T) { t.Parallel() skipInCI(t) // takes too long in CI doTestGenericOps(t, true) } -func TestGenericOpsWithoutMcms(t *testing.T) { +func TestIntegration_Solana_GenericOpsWithoutMcms(t *testing.T) { t.Parallel() skipInCI(t) doTestGenericOps(t, false) diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_solana_token_test.go b/deployment/ccip/changeset/solana_v0_1_1/cs_solana_token_test.go index ea6d8239624..4057afb876c 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_solana_token_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_solana_token_test.go @@ -26,7 +26,7 @@ import ( commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" ) -func TestSolanaTokenOps(t *testing.T) { +func TestIntegration_Solana_SolanaTokenOps(t *testing.T) { quarantine.Flaky(t, "DX-1728") t.Parallel() tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithSolChains(1), testhelpers.WithCCIPSolanaContractVersion(changeset_solana.SolanaContractV0_1_1)) @@ -176,7 +176,7 @@ func TestSolanaTokenOps(t *testing.T) { require.Equal(t, 9, int(outDec)) } -func TestDeployLinkToken(t *testing.T) { +func TestUnit_DeployLinkToken(t *testing.T) { selector := chain_selectors.TEST_22222222222222222222222222222222222222222222.Selector rt, err := runtime.New(t.Context(), runtime.WithEnvOpts( environment.WithSolanaContainer(t, []uint64{selector}, t.TempDir(), map[string]string{}), diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_token_pool_test.go b/deployment/ccip/changeset/solana_v0_1_1/cs_token_pool_test.go index 9f0fa465a1e..ef5f8fe20df 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_token_pool_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_token_pool_test.go @@ -49,7 +49,7 @@ const ( PartnerMetadata3 = "partner_testing_3" ) -func TestAddTokenPoolWithoutMcms(t *testing.T) { +func TestIntegration_Solana_AddTokenPoolWithoutMcms(t *testing.T) { t.Parallel() skipInCI(t) @@ -57,7 +57,7 @@ func TestAddTokenPoolWithoutMcms(t *testing.T) { doTestTokenPool(t, tenv.Env, TokenPoolTestConfig{MCMS: false, TokenMetadata: shared.CLLMetadata}) } -func TestAddTokenPoolWithMcms(t *testing.T) { +func TestIntegration_Solana_AddTokenPoolWithMcms(t *testing.T) { quarantine.Flaky(t, "DX-1797") t.Parallel() tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithSolChains(1), testhelpers.WithCCIPSolanaContractVersion(ccipChangesetSolana.SolanaContractV0_1_1)) @@ -671,7 +671,7 @@ var zeroRateLimitConfig = ccipChangesetSolana.RateLimiterConfig{ }, } -func TestAddTokenPoolE2EWithMcms(t *testing.T) { +func TestIntegration_Solana_AddTokenPoolE2EWithMcms(t *testing.T) { quarantine.Flaky(t, "DX-1774") t.Parallel() tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithSolChains(1), testhelpers.WithCCIPSolanaContractVersion(ccipChangesetSolana.SolanaContractV0_1_1)) @@ -764,7 +764,7 @@ func TestAddTokenPoolE2EWithMcms(t *testing.T) { require.NoError(t, err) } -func TestPartnerTokenPools(t *testing.T) { +func TestIntegration_Solana_PartnerTokenPools(t *testing.T) { skipInCI(t) tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithSolChains(1), testhelpers.WithCCIPSolanaContractVersion(ccipChangesetSolana.SolanaContractV0_1_1)) e := tenv.Env @@ -794,7 +794,7 @@ func TestPartnerTokenPools(t *testing.T) { doTestTokenPool(t, e, TokenPoolTestConfig{MCMS: true, TokenMetadata: PartnerMetadata}) } -func TestPartnerTokenPoolsWithUpgrades(t *testing.T) { +func TestIntegration_Solana_PartnerTokenPoolsWithUpgrades(t *testing.T) { skipInCI(t) tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithSolChains(1), testhelpers.WithCCIPSolanaContractVersion(ccipChangesetSolana.SolanaContractV0_1_1)) e := tenv.Env @@ -887,7 +887,7 @@ func getTokenPoolBaseChainConfig(t *testing.T, e cldf.Environment, solChain uint return base } -func TestCreatingMultisig(t *testing.T) { +func TestIntegration_Solana_CreatingMultisig(t *testing.T) { skipInCI(t) tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithSolChains(1), testhelpers.WithCCIPSolanaContractVersion(ccipChangesetSolana.SolanaContractV0_1_1)) solChain := tenv.Env.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilySolana))[0] diff --git a/deployment/ccip/changeset/solana_v0_1_1/save_existing_test.go b/deployment/ccip/changeset/solana_v0_1_1/save_existing_test.go index 7719644964e..64e7999e8fb 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/save_existing_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/save_existing_test.go @@ -19,7 +19,7 @@ import ( commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" ) -func TestSaveExistingCCIP(t *testing.T) { +func TestUnit_SaveExistingCCIP(t *testing.T) { t.Parallel() e, err := environment.New(t.Context()) @@ -58,7 +58,7 @@ func TestSaveExistingCCIP(t *testing.T) { require.Equal(t, state.SolChains[selector].LinkToken.String(), solAddr2) } -func TestSaveExisting(t *testing.T) { +func TestUnit_SaveExisting(t *testing.T) { t.Parallel() e, err := environment.New(t.Context()) diff --git a/deployment/ccip/changeset/solana_v0_1_1/self_serve_test.go b/deployment/ccip/changeset/solana_v0_1_1/self_serve_test.go index 859d45fdbcd..a541c09d1fa 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/self_serve_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/self_serve_test.go @@ -35,14 +35,14 @@ import ( commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" ) -func TestOnboardTokenPoolForSelfServeWithMCMs(t *testing.T) { +func TestIntegration_Solana_OnboardTokenPoolForSelfServeWithMCMs(t *testing.T) { // TODO: Fix this test skipInCI(t) t.Parallel() doTestOnboardTokenPoolForSelfServe(t, true) } -func TestOnboardTokenPoolForSelfServeWithoutMCMs(t *testing.T) { +func TestIntegration_Solana_OnboardTokenPoolForSelfServeWithoutMCMs(t *testing.T) { t.Parallel() doTestOnboardTokenPoolForSelfServe(t, false) } diff --git a/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_test.go b/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_test.go index ef1c7d8af0a..dfc763e4421 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_test.go @@ -40,7 +40,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/internal/soltestutils" ) -func TestValidateContracts(t *testing.T) { +func TestUnit_ValidateContracts(t *testing.T) { validPubkey := solana.NewWallet().PublicKey() zeroPubkey := solana.PublicKey{} // Zero public key @@ -102,7 +102,7 @@ func TestValidateContracts(t *testing.T) { } } -func TestValidate(t *testing.T) { +func TestUnit_Validate(t *testing.T) { selector := chainselectors.TEST_22222222222222222222222222222222222222222222.Selector tests := []struct { @@ -343,7 +343,7 @@ func prepareEnvironmentForOwnershipTransfer(t *testing.T) (cldf.Environment, sta return e, state } -func TestTransferCCIPToMCMSWithTimelockSolana(t *testing.T) { +func TestIntegration_Solana_TransferCCIPToMCMSWithTimelockSolana(t *testing.T) { t.Parallel() skipInCI(t) @@ -435,7 +435,7 @@ func TestTransferCCIPToMCMSWithTimelockSolana(t *testing.T) { }, 30*time.Second, 5*time.Second, "RMNRemote config PDA owner was not changed to timelock signer PDA") } -func TestTransferCCIPFromMCMSWithTimelockSolana(t *testing.T) { +func TestIntegration_Solana_TransferCCIPFromMCMSWithTimelockSolana(t *testing.T) { t.Parallel() skipInCI(t) diff --git a/deployment/ccip/changeset/testhelpers/cciptesthelpertypes/types_test.go b/deployment/ccip/changeset/testhelpers/cciptesthelpertypes/types_test.go index b709adb9e2a..bea4bf23db3 100644 --- a/deployment/ccip/changeset/testhelpers/cciptesthelpertypes/types_test.go +++ b/deployment/ccip/changeset/testhelpers/cciptesthelpertypes/types_test.go @@ -22,7 +22,7 @@ func chainSelectorSlice(n int) []cciptypes.ChainSelector { return selectors } -func TestRandomTopology_getChainToFChainMapping(t *testing.T) { +func TestUnit_RandomTopology_getChainToFChainMapping(t *testing.T) { type args struct { chainSelectors []cciptypes.ChainSelector } @@ -155,7 +155,7 @@ func generateTestP2PIDs(count int) [][32]byte { return p2pIDs } -func TestRandomTopology_getNodesForChain(t *testing.T) { +func TestUnit_RandomTopology_getNodesForChain(t *testing.T) { type args struct { fChain int nonBootstrapP2pIDs [][32]byte @@ -277,7 +277,7 @@ func TestRandomTopology_getNodesForChain(t *testing.T) { } } -func TestRandomTopology_validate(t *testing.T) { +func TestUnit_RandomTopology_validate(t *testing.T) { const homeChainSelector = 1 type args struct { chainSelectors []cciptypes.ChainSelector @@ -401,7 +401,7 @@ func TestRandomTopology_validate(t *testing.T) { } } -func TestRandomTopology_ChainToNodeMapping(t *testing.T) { +func TestUnit_RandomTopology_ChainToNodeMapping(t *testing.T) { const homeChainSelector = 1 type args struct { nonBootstrapP2pIDs [][32]byte @@ -586,7 +586,7 @@ func TestRandomTopology_ChainToNodeMapping(t *testing.T) { } } -func TestTopology_ChainToNodeMapping(t *testing.T) { +func TestUnit_Topology_ChainToNodeMapping(t *testing.T) { type args struct { nonBootstrapP2pIDs [][32]byte nonHomeChainSelectors []cciptypes.ChainSelector diff --git a/deployment/ccip/changeset/v1_5/e2e_test.go b/deployment/ccip/changeset/v1_5/e2e_test.go index cd84a452282..f72cfa4d830 100644 --- a/deployment/ccip/changeset/v1_5/e2e_test.go +++ b/deployment/ccip/changeset/v1_5/e2e_test.go @@ -29,7 +29,7 @@ import ( // This test only works if the destination chain id is 1337 // Otherwise it shows error for offchain and onchain config digest mismatch -func TestE2ELegacy(t *testing.T) { +func TestIntegration_Shared_E2ELegacy(t *testing.T) { e, _ := testhelpers.NewMemoryEnvironment( t, testhelpers.WithPrerequisiteDeploymentOnly(&changeset.V1_5DeploymentConfig{ diff --git a/deployment/ccip/changeset/v1_5_1/cs_accept_admin_role_test.go b/deployment/ccip/changeset/v1_5_1/cs_accept_admin_role_test.go index ffcec8a6de7..69ad1393266 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_accept_admin_role_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_accept_admin_role_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func TestAcceptAdminRoleChangeset_Validations(t *testing.T) { +func TestUnit_AcceptAdminRoleChangeset_Validations(t *testing.T) { t.Parallel() e, selectorA, _, tokens := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) @@ -119,7 +119,7 @@ func TestAcceptAdminRoleChangeset_Validations(t *testing.T) { } } -func TestAcceptAdminRoleChangeset_Execution(t *testing.T) { +func TestUnit_AcceptAdminRoleChangeset_Execution(t *testing.T) { for _, mcmsConfig := range []*proposalutils.TimelockConfig{nil, {MinDelay: 0 * time.Second}} { msg := "Accept admin role with MCMS" if mcmsConfig == nil { diff --git a/deployment/ccip/changeset/v1_5_1/cs_add_token_e2e_test.go b/deployment/ccip/changeset/v1_5_1/cs_add_token_e2e_test.go index 125ebea433d..5e2e338777d 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_add_token_e2e_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_add_token_e2e_test.go @@ -31,7 +31,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func TestAddTokenE2E(t *testing.T) { +func TestIntegration_Shared_AddTokenE2E(t *testing.T) { t.Parallel() tests := []struct { diff --git a/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_test.go b/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_test.go index 6c49b7f6313..798bea22ec5 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_test.go @@ -139,7 +139,7 @@ func validateSolanaConfig(t *testing.T, state stateview.CCIPOnChainState, solCha require.Equal(t, solChainUpdates[solanaSelector].RateLimiterConfig.Outbound.IsEnabled, outboundRateLimiterConfig.IsEnabled) } -func TestValidateRemoteChains(t *testing.T) { +func TestUnit_ValidateRemoteChains(t *testing.T) { t.Parallel() tests := []struct { @@ -192,7 +192,7 @@ func TestValidateRemoteChains(t *testing.T) { } } -func TestValidateTokenPoolConfig(t *testing.T) { +func TestUnit_ValidateTokenPoolConfig(t *testing.T) { t.Parallel() e, selectorA, _, tokens := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.Test(t), true) @@ -245,7 +245,7 @@ func TestValidateTokenPoolConfig(t *testing.T) { } } -func TestValidateConfigureTokenPoolContractsConfig(t *testing.T) { +func TestUnit_ValidateConfigureTokenPoolContractsConfig(t *testing.T) { t.Parallel() e, err := environment.New(t.Context(), @@ -345,7 +345,7 @@ func TestValidateConfigureTokenPoolContractsConfig(t *testing.T) { } } -func TestValidateConfigureTokenPoolContracts(t *testing.T) { +func TestUnit_ValidateConfigureTokenPoolContracts(t *testing.T) { t.Parallel() type regPass struct { @@ -719,7 +719,7 @@ func TestValidateConfigureTokenPoolContracts(t *testing.T) { } } -func TestValidateConfigureTokenPoolContractsForSolana(t *testing.T) { +func TestIntegration_Solana_ValidateConfigureTokenPoolContractsForSolana(t *testing.T) { quarantine.Flaky(t, "DX-1726") t.Parallel() var err error diff --git a/deployment/ccip/changeset/v1_5_1/cs_deploy_token_pool_factory_test.go b/deployment/ccip/changeset/v1_5_1/cs_deploy_token_pool_factory_test.go index b36e699c492..33940827aff 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_deploy_token_pool_factory_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_deploy_token_pool_factory_test.go @@ -25,7 +25,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" ) -func TestDeployTokenPoolFactoryChangeset(t *testing.T) { +func TestUnit_DeployTokenPoolFactoryChangeset(t *testing.T) { t.Parallel() tests := []struct { diff --git a/deployment/ccip/changeset/v1_5_1/cs_deploy_token_pools_test.go b/deployment/ccip/changeset/v1_5_1/cs_deploy_token_pools_test.go index 8d171d1bcc4..e2357d5133c 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_deploy_token_pools_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_deploy_token_pools_test.go @@ -26,7 +26,7 @@ import ( commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" ) -func TestValidateDeployTokenPoolContractsConfig(t *testing.T) { +func TestUnit_ValidateDeployTokenPoolContractsConfig(t *testing.T) { t.Parallel() e, err := environment.New(t.Context(), @@ -97,7 +97,7 @@ func TestValidateDeployTokenPoolContractsConfig(t *testing.T) { } } -func TestValidateDeployTokenPoolInput(t *testing.T) { +func TestUnit_ValidateDeployTokenPoolInput(t *testing.T) { t.Parallel() e, selectorA, _, tokens := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.Test(t), true) @@ -229,7 +229,7 @@ func TestValidateDeployTokenPoolInput(t *testing.T) { } } -func TestDeployTokenPoolContracts(t *testing.T) { +func TestUnit_DeployTokenPoolContracts(t *testing.T) { t.Parallel() acceptLiquidity := false diff --git a/deployment/ccip/changeset/v1_5_1/cs_deploy_usdc_token_pools_test.go b/deployment/ccip/changeset/v1_5_1/cs_deploy_usdc_token_pools_test.go index 7fc132284bc..a5dbb5abde0 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_deploy_usdc_token_pools_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_deploy_usdc_token_pools_test.go @@ -85,7 +85,7 @@ func deployUSDCPrerequisites( return usdcToken, messenger } -func TestValidateDeployUSDCTokenPoolContractsConfig(t *testing.T) { +func TestUnit_ValidateDeployUSDCTokenPoolContractsConfig(t *testing.T) { t.Parallel() e, err := environment.New(t.Context(), @@ -136,7 +136,7 @@ func TestValidateDeployUSDCTokenPoolContractsConfig(t *testing.T) { } } -func TestValidateDeployUSDCTokenPoolInput(t *testing.T) { +func TestUnit_ValidateDeployUSDCTokenPoolInput(t *testing.T) { t.Parallel() selector := chain_selectors.TEST_90000001.Selector @@ -238,7 +238,7 @@ func TestValidateDeployUSDCTokenPoolInput(t *testing.T) { } } -func TestDeployUSDCTokenPoolContracts(t *testing.T) { +func TestUnit_DeployUSDCTokenPoolContracts(t *testing.T) { t.Parallel() for _, numRuns := range []int{1, 2} { diff --git a/deployment/ccip/changeset/v1_5_1/cs_fast_transfer_token_pools_test.go b/deployment/ccip/changeset/v1_5_1/cs_fast_transfer_token_pools_test.go index 46234224bd3..1f4e419b5cb 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_fast_transfer_token_pools_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_fast_transfer_token_pools_test.go @@ -19,7 +19,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func TestFastTransferUpdateLaneConfigChangeset_ValidationErrors(t *testing.T) { +func TestUnit_FastTransferUpdateLaneConfigChangeset_ValidationErrors(t *testing.T) { e, selectorA, selectorB, tokens := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) e = testhelpers.DeployTestTokenPools(t, e, map[uint64]v1_5_1.DeployTokenPoolInput{ @@ -90,7 +90,7 @@ func TestFastTransferUpdateLaneConfigChangeset_ValidationErrors(t *testing.T) { } } -func TestFastTransferFillerAllowlistChangeset_ValidationErrors(t *testing.T) { +func TestUnit_FastTransferFillerAllowlistChangeset_ValidationErrors(t *testing.T) { e, selectorA, selectorB, tokens := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) e = testhelpers.DeployTestTokenPools(t, e, map[uint64]v1_5_1.DeployTokenPoolInput{ @@ -167,7 +167,7 @@ func TestFastTransferFillerAllowlistChangeset_ValidationErrors(t *testing.T) { }) } -func TestFastTransferFillerAllowlistChangeset_RemoveFillers(t *testing.T) { +func TestUnit_FastTransferFillerAllowlistChangeset_RemoveFillers(t *testing.T) { e, selectorA, selectorB, tokens := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) e = testhelpers.DeployTestTokenPools(t, e, map[uint64]v1_5_1.DeployTokenPoolInput{ @@ -289,7 +289,7 @@ func TestFastTransferFillerAllowlistChangeset_RemoveFillers(t *testing.T) { } } -func TestFastTransferFillerAllowlistChangeset_AddAndRemoveSimultaneously(t *testing.T) { +func TestUnit_FastTransferFillerAllowlistChangeset_AddAndRemoveSimultaneously(t *testing.T) { e, selectorA, selectorB, tokens := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) e = testhelpers.DeployTestTokenPools(t, e, map[uint64]v1_5_1.DeployTokenPoolInput{ @@ -489,7 +489,7 @@ var testCases = []testCase{ }, } -func TestFastTransferUpdateLaneConfigChangeset_WithMCMS(t *testing.T) { +func TestUnit_FastTransferUpdateLaneConfigChangeset_WithMCMS(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { e, selectorA, selectorB, tokens := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), tc.mcmsEnabled) @@ -557,7 +557,7 @@ func TestFastTransferUpdateLaneConfigChangeset_WithMCMS(t *testing.T) { } } -func TestFastTransferFillerAllowlistChangeset_WithMCMS(t *testing.T) { +func TestUnit_FastTransferFillerAllowlistChangeset_WithMCMS(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { e, selectorA, selectorB, tokens := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), tc.mcmsEnabled) @@ -620,7 +620,7 @@ func TestFastTransferFillerAllowlistChangeset_WithMCMS(t *testing.T) { } } -func TestFastTransferUpdateLaneConfigChangeset_EdgeCases(t *testing.T) { +func TestUnit_FastTransferUpdateLaneConfigChangeset_EdgeCases(t *testing.T) { e, selectorA, selectorB, tokens := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) e = testhelpers.DeployTestTokenPools(t, e, map[uint64]v1_5_1.DeployTokenPoolInput{ @@ -799,7 +799,7 @@ func TestFastTransferUpdateLaneConfigChangeset_EdgeCases(t *testing.T) { } } -func TestFastTransferFillerAllowlistChangeset_DuplicateFillerValidation(t *testing.T) { +func TestUnit_FastTransferFillerAllowlistChangeset_DuplicateFillerValidation(t *testing.T) { e, selectorA, selectorB, tokens := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) e = testhelpers.DeployTestTokenPools(t, e, map[uint64]v1_5_1.DeployTokenPoolInput{ @@ -857,7 +857,7 @@ func TestFastTransferFillerAllowlistChangeset_DuplicateFillerValidation(t *testi require.Contains(t, err.Error(), "is not in the allowlist") } -func TestFastTransferUpdateLaneConfigChangeset_SettlementOverheadGasAndCustomExtraArgs(t *testing.T) { +func TestUnit_FastTransferUpdateLaneConfigChangeset_SettlementOverheadGasAndCustomExtraArgs(t *testing.T) { e, selectorA, selectorB, tokens := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), false) e = testhelpers.DeployTestTokenPools(t, e, map[uint64]v1_5_1.DeployTokenPoolInput{ @@ -978,7 +978,7 @@ func TestFastTransferUpdateLaneConfigChangeset_SettlementOverheadGasAndCustomExt } } -func TestFastTransferUpdateLaneConfigChangeset_DestinationPoolTypeAndVersion(t *testing.T) { +func TestUnit_FastTransferUpdateLaneConfigChangeset_DestinationPoolTypeAndVersion(t *testing.T) { e, selectorA, selectorB, tokens := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), false) // Deploy different types of pools on different chains @@ -1119,7 +1119,7 @@ func TestFastTransferUpdateLaneConfigChangeset_DestinationPoolTypeAndVersion(t * } } -func TestFastTransferUpdateLaneConfigChangeset_ValidationErrors_DestinationFields(t *testing.T) { +func TestUnit_FastTransferUpdateLaneConfigChangeset_ValidationErrors_DestinationFields(t *testing.T) { e, selectorA, selectorB, tokens := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), false) e = testhelpers.DeployTestTokenPools(t, e, map[uint64]v1_5_1.DeployTokenPoolInput{ diff --git a/deployment/ccip/changeset/v1_5_1/cs_hybrid_token_pool_groups_test.go b/deployment/ccip/changeset/v1_5_1/cs_hybrid_token_pool_groups_test.go index dfb4f579fad..6332d6b9520 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_hybrid_token_pool_groups_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_hybrid_token_pool_groups_test.go @@ -67,7 +67,7 @@ func configureHybridTokenPoolChains(t *testing.T, e cldf.Environment, selectorA, require.NoError(t, err) } -func TestHybridTokenPoolUpdateGroupsChangeset_ValidationErrors(t *testing.T) { +func TestUnit_HybridTokenPoolUpdateGroupsChangeset_ValidationErrors(t *testing.T) { e, selectorA, selectorB, tokens := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) externalMinterA, _ := testhelpers.DeployTokenGovernor(t, e, selectorA, tokens[selectorA].Address) @@ -208,7 +208,7 @@ func TestHybridTokenPoolUpdateGroupsChangeset_ValidationErrors(t *testing.T) { } } -func TestHybridTokenPoolUpdateGroupsChangeset_BasicUpdates(t *testing.T) { +func TestUnit_HybridTokenPoolUpdateGroupsChangeset_BasicUpdates(t *testing.T) { e, selectorA, selectorB, tokens := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) externalMinterA, _ := testhelpers.DeployTokenGovernor(t, e, selectorA, tokens[selectorA].Address) @@ -311,7 +311,7 @@ func TestHybridTokenPoolUpdateGroupsChangeset_BasicUpdates(t *testing.T) { } } -func TestHybridTokenPoolUpdateGroupsChangeset_WithMCMS(t *testing.T) { +func TestUnit_HybridTokenPoolUpdateGroupsChangeset_WithMCMS(t *testing.T) { testCases := []struct { name string mcmsEnabled bool @@ -405,7 +405,7 @@ func TestHybridTokenPoolUpdateGroupsChangeset_WithMCMS(t *testing.T) { } } -func TestHybridTokenPoolUpdateGroupsChangeset_EdgeCases(t *testing.T) { +func TestUnit_HybridTokenPoolUpdateGroupsChangeset_EdgeCases(t *testing.T) { e, selectorA, selectorB, tokens := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), false) externalMinterA, _ := testhelpers.DeployTokenGovernor(t, e, selectorA, tokens[selectorA].Address) @@ -454,7 +454,7 @@ func TestHybridTokenPoolUpdateGroupsChangeset_EdgeCases(t *testing.T) { require.Equal(t, v1_5_1.BurnAndMint, v1_5_1.Group(currentGroup)) } -func TestHybridTokenPoolUpdateGroupsChangeset_NoOpUpdate(t *testing.T) { +func TestUnit_HybridTokenPoolUpdateGroupsChangeset_NoOpUpdate(t *testing.T) { e, selectorA, selectorB, tokens := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), false) externalMinterA, _ := testhelpers.DeployTokenGovernor(t, e, selectorA, tokens[selectorA].Address) diff --git a/deployment/ccip/changeset/v1_5_1/cs_propose_admin_role_test.go b/deployment/ccip/changeset/v1_5_1/cs_propose_admin_role_test.go index 69f45a35154..51db62dc62f 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_propose_admin_role_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_propose_admin_role_test.go @@ -20,7 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func TestProposeAdminRoleChangeset_Validations(t *testing.T) { +func TestUnit_ProposeAdminRoleChangeset_Validations(t *testing.T) { t.Parallel() e, selectorA, _, tokens := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) @@ -160,7 +160,7 @@ func TestProposeAdminRoleChangeset_Validations(t *testing.T) { } } -func TestProposeAdminRoleChangeset_ExecutionWithoutExternalAdmin(t *testing.T) { +func TestUnit_ProposeAdminRoleChangeset_ExecutionWithoutExternalAdmin(t *testing.T) { for _, mcmsConfig := range []*proposalutils.TimelockConfig{nil, {MinDelay: 0 * time.Second}} { msg := "Propose admin role without external admin with MCMS" if mcmsConfig == nil { @@ -232,7 +232,7 @@ func TestProposeAdminRoleChangeset_ExecutionWithoutExternalAdmin(t *testing.T) { } } -func TestProposeAdminRoleChangeset_ExecutionWithExternalAdmin(t *testing.T) { +func TestUnit_ProposeAdminRoleChangeset_ExecutionWithExternalAdmin(t *testing.T) { for _, mcmsConfig := range []*proposalutils.TimelockConfig{nil, {MinDelay: 0 * time.Second}} { msg := "Propose admin role with external admin with MCMS" if mcmsConfig == nil { @@ -300,7 +300,7 @@ func TestProposeAdminRoleChangeset_ExecutionWithExternalAdmin(t *testing.T) { } } -func TestProposeAdminRoleChangesetV2_Validations(t *testing.T) { +func TestUnit_ProposeAdminRoleChangesetV2_Validations(t *testing.T) { t.Parallel() e, _, selectorB, _ := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) @@ -453,7 +453,7 @@ func TestProposeAdminRoleChangesetV2_Validations(t *testing.T) { } } -func TestProposeAdminRoleChangesetV2_ExecutionWithMCMS(t *testing.T) { +func TestUnit_ProposeAdminRoleChangesetV2_ExecutionWithMCMS(t *testing.T) { t.Parallel() mcmsConfig := &proposalutils.TimelockConfig{MinDelay: 0 * time.Second} @@ -505,7 +505,7 @@ func TestProposeAdminRoleChangesetV2_ExecutionWithMCMS(t *testing.T) { require.Equal(t, adminAddressB, configOnB.PendingAdministrator) } -func TestProposeAdminRoleChangesetV2_ExecutionWithoutMCMS(t *testing.T) { +func TestUnit_ProposeAdminRoleChangesetV2_ExecutionWithoutMCMS(t *testing.T) { t.Parallel() e, selectorA, selectorB, _ := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), false) @@ -555,7 +555,7 @@ func TestProposeAdminRoleChangesetV2_ExecutionWithoutMCMS(t *testing.T) { require.Equal(t, adminAddressB, configOnB.PendingAdministrator) } -func TestProposeAdminRoleChangesetV2_MultipleTokensPerChain(t *testing.T) { +func TestUnit_ProposeAdminRoleChangesetV2_MultipleTokensPerChain(t *testing.T) { t.Parallel() mcmsConfig := &proposalutils.TimelockConfig{MinDelay: 0 * time.Second} @@ -614,7 +614,7 @@ func TestProposeAdminRoleChangesetV2_MultipleTokensPerChain(t *testing.T) { require.Equal(t, adminAddress3, config3.PendingAdministrator) } -func TestProposeAdminRoleChangesetV2_EmptyConfigReturnsError(t *testing.T) { +func TestUnit_ProposeAdminRoleChangesetV2_EmptyConfigReturnsError(t *testing.T) { t.Parallel() e, _, _, _ := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) @@ -632,7 +632,7 @@ func TestProposeAdminRoleChangesetV2_EmptyConfigReturnsError(t *testing.T) { require.ErrorContains(t, err, "at least one chain with token admin info must be specified") } -func TestProposeAdminRoleChangesetV2_PendingAdminValidation(t *testing.T) { +func TestUnit_ProposeAdminRoleChangesetV2_PendingAdminValidation(t *testing.T) { t.Parallel() mcmsConfig := &proposalutils.TimelockConfig{MinDelay: 0 * time.Second} @@ -712,7 +712,7 @@ func TestProposeAdminRoleChangesetV2_PendingAdminValidation(t *testing.T) { require.Equal(t, adminAddress2, config.PendingAdministrator, "Pending administrator should be updated to the new admin address") } -func TestProposeAdminRoleChangesetV2_OverrideFunctionality(t *testing.T) { +func TestUnit_ProposeAdminRoleChangesetV2_OverrideFunctionality(t *testing.T) { t.Parallel() mcmsConfig := &proposalutils.TimelockConfig{MinDelay: 0 * time.Second} diff --git a/deployment/ccip/changeset/v1_5_1/cs_set_pool_test.go b/deployment/ccip/changeset/v1_5_1/cs_set_pool_test.go index 36e5f55beca..a9357666d59 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_set_pool_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_set_pool_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func TestSetPoolChangeset_Validations(t *testing.T) { +func TestUnit_SetPoolChangeset_Validations(t *testing.T) { t.Parallel() e, selectorA, _, tokens := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) @@ -119,7 +119,7 @@ func TestSetPoolChangeset_Validations(t *testing.T) { } } -func TestSetPoolChangeset_Execution(t *testing.T) { +func TestUnit_SetPoolChangeset_Execution(t *testing.T) { for _, mcmsConfig := range []*proposalutils.TimelockConfig{nil, {MinDelay: 0 * time.Second}} { msg := "Set pool with MCMS" if mcmsConfig == nil { diff --git a/deployment/ccip/changeset/v1_5_1/cs_set_token_transfer_fee_config_test.go b/deployment/ccip/changeset/v1_5_1/cs_set_token_transfer_fee_config_test.go index 1a6d8f0515e..8b0892d5149 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_set_token_transfer_fee_config_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_set_token_transfer_fee_config_test.go @@ -50,7 +50,7 @@ func ReadTokenTransferFeeConfig(t *testing.T, e testhelpers.DeployedEnv, srcSele return onramp.GetTokenTransferFeeConfig(&bind.CallOpts{Context: e.Env.GetContext()}, token) } -func TestSetTokenTransferFeeConfig_Validations(t *testing.T) { +func TestIntegration_Shared_SetTokenTransferFeeConfig_Validations(t *testing.T) { t.Parallel() // Spin up a memory env with minimal prerequisite deployment @@ -195,7 +195,7 @@ func TestSetTokenTransferFeeConfig_Validations(t *testing.T) { } } -func TestSetTokenTransferFeeConfig_EmptyConfigIsGracefullyHandled(t *testing.T) { +func TestIntegration_Shared_SetTokenTransferFeeConfig_EmptyConfigIsGracefullyHandled(t *testing.T) { // Spin up a memory env with minimal prerequisite deployment e, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(2), @@ -232,7 +232,7 @@ func TestSetTokenTransferFeeConfig_EmptyConfigIsGracefullyHandled(t *testing.T) require.NoError(t, err) } -func TestSetTokenTransferFeeConfig_Execution_WithoutMCMS(t *testing.T) { +func TestIntegration_Shared_SetTokenTransferFeeConfig_Execution_WithoutMCMS(t *testing.T) { // Spin up a memory env with minimal prerequisite deployment e, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(2), @@ -302,7 +302,7 @@ func TestSetTokenTransferFeeConfig_Execution_WithoutMCMS(t *testing.T) { require.True(t, cfgA.AggregateRateLimitEnabled) } -func TestSetTokenTransferFeeConfig_Execution_WithMCMS(t *testing.T) { +func TestIntegration_Shared_SetTokenTransferFeeConfig_Execution_WithMCMS(t *testing.T) { // Spin up a memory env with minimal prerequisite deployment e, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(2), @@ -415,7 +415,7 @@ func TestSetTokenTransferFeeConfig_Execution_WithMCMS(t *testing.T) { require.False(t, cfgB.IsEnabled, "tokenB should be using default fee config after reset") } -func TestSetTokenTransferFeeConfig_MultipleChains(t *testing.T) { +func TestIntegration_Shared_SetTokenTransferFeeConfig_MultipleChains(t *testing.T) { // Spin up a memory env with minimal prerequisite deployment e, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(2), diff --git a/deployment/ccip/changeset/v1_5_1/cs_sync_usdc_domains_with_chains_test.go b/deployment/ccip/changeset/v1_5_1/cs_sync_usdc_domains_with_chains_test.go index 1435bbd88ea..9afdb93b4aa 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_sync_usdc_domains_with_chains_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_sync_usdc_domains_with_chains_test.go @@ -25,7 +25,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) -func TestValidateSyncUSDCDomainsWithChainsConfig(t *testing.T) { +func TestIntegration_Shared_ValidateSyncUSDCDomainsWithChainsConfig(t *testing.T) { t.Parallel() testCases := []struct { @@ -183,7 +183,7 @@ func TestValidateSyncUSDCDomainsWithChainsConfig(t *testing.T) { } } -func TestSyncUSDCDomainsWithChainsChangeset(t *testing.T) { +func TestIntegration_Shared_SyncUSDCDomainsWithChainsChangeset(t *testing.T) { t.Parallel() for _, mcmsConfig := range []*proposalutils.TimelockConfig{nil, {MinDelay: 0 * time.Second}} { diff --git a/deployment/ccip/changeset/v1_5_1/cs_transfer_admin_role_test.go b/deployment/ccip/changeset/v1_5_1/cs_transfer_admin_role_test.go index 0a24ed57a02..0d0d6a75a14 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_transfer_admin_role_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_transfer_admin_role_test.go @@ -22,7 +22,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func TestTransferAdminRoleChangeset_Validations(t *testing.T) { +func TestUnit_UnitTransferAdminRoleChangeset_Validations(t *testing.T) { t.Parallel() e, selectorA, _, tokens := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) @@ -139,7 +139,7 @@ func TestTransferAdminRoleChangeset_Validations(t *testing.T) { } } -func TestTransferAdminRoleChangeset_Execution(t *testing.T) { +func TestUnit_UnitTransferAdminRoleChangeset_Execution(t *testing.T) { for _, mcmsConfig := range []*proposalutils.TimelockConfig{nil, {MinDelay: 0 * time.Second}} { msg := "Transfer admin role with MCMS" if mcmsConfig == nil { @@ -243,7 +243,7 @@ func TestTransferAdminRoleChangeset_Execution(t *testing.T) { } } -func TestTransferAdminRoleChangesetV2_EmptyConfigReturnsError(t *testing.T) { +func TestUnit_UnitTransferAdminRoleChangesetV2_EmptyConfigReturnsError(t *testing.T) { t.Parallel() e, _, _, _ := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) @@ -258,7 +258,7 @@ func TestTransferAdminRoleChangesetV2_EmptyConfigReturnsError(t *testing.T) { require.ErrorContains(t, err, "at least one chain with token admin info must be specified") } -func TestTransferAdminRoleChangesetV2_ExecutionWithMCMS(t *testing.T) { +func TestUnit_UnitTransferAdminRoleChangesetV2_ExecutionWithMCMS(t *testing.T) { t.Parallel() mcmsConfig := &proposalutils.TimelockConfig{MinDelay: 0 * time.Second} @@ -309,7 +309,7 @@ func TestTransferAdminRoleChangesetV2_ExecutionWithMCMS(t *testing.T) { require.Equal(t, newAdminB, configOnB.PendingAdministrator) } -func TestTransferAdminRoleChangesetV2_ExecutionWithoutMCMS(t *testing.T) { +func TestUnit_UnitTransferAdminRoleChangesetV2_ExecutionWithoutMCMS(t *testing.T) { t.Parallel() e, selectorA, selectorB, _ := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), false) @@ -415,7 +415,7 @@ func TestTransferAdminRoleChangesetV2_ExecutionWithoutMCMS(t *testing.T) { require.Equal(t, newAdminB, configOnB.PendingAdministrator) } -func TestTransferAdminRoleChangesetV2_MultipleTokensPerChain(t *testing.T) { +func TestUnit_UnitTransferAdminRoleChangesetV2_MultipleTokensPerChain(t *testing.T) { t.Parallel() mcmsConfig := &proposalutils.TimelockConfig{MinDelay: 0 * time.Second} @@ -456,7 +456,7 @@ func TestTransferAdminRoleChangesetV2_MultipleTokensPerChain(t *testing.T) { } } -func TestTransferAdminRoleChangesetV2_Validations(t *testing.T) { +func TestUnit_UnitTransferAdminRoleChangesetV2_Validations(t *testing.T) { t.Parallel() mcmsConfig := &proposalutils.TimelockConfig{MinDelay: 0 * time.Second} diff --git a/deployment/ccip/changeset/v1_5_1/cs_update_admin_role_test.go b/deployment/ccip/changeset/v1_5_1/cs_update_admin_role_test.go index fb91dbcf5ea..ff1038dd0d4 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_update_admin_role_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_update_admin_role_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func TestUpdateAdminRoleChangesetV2_Validations(t *testing.T) { +func TestUnit_UnitUpdateAdminRoleChangesetV2_Validations(t *testing.T) { t.Parallel() mcmsConfig := &proposalutils.TimelockConfig{MinDelay: 0 * time.Second} @@ -138,7 +138,7 @@ func TestUpdateAdminRoleChangesetV2_Validations(t *testing.T) { } } -func TestUpdateAdminRoleChangesetV2_EmptyConfigIsGracefullyHandled(t *testing.T) { +func TestUnit_UnitUpdateAdminRoleChangesetV2_EmptyConfigIsGracefullyHandled(t *testing.T) { t.Parallel() e, _, _, _ := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) @@ -152,7 +152,7 @@ func TestUpdateAdminRoleChangesetV2_EmptyConfigIsGracefullyHandled(t *testing.T) require.NoError(t, err) } -func TestUpdateAdminRoleChangesetV2_ExecutionWithoutMCMS(t *testing.T) { +func TestUnit_UnitUpdateAdminRoleChangesetV2_ExecutionWithoutMCMS(t *testing.T) { t.Parallel() e, selectorA, selectorB, _ := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), false) @@ -254,7 +254,7 @@ func TestUpdateAdminRoleChangesetV2_ExecutionWithoutMCMS(t *testing.T) { require.Equal(t, newAdminB, configOnB.PendingAdministrator) } -func TestUpdateAdminRoleChangesetV2_ExecutionWithMCMS(t *testing.T) { +func TestUnit_UnitUpdateAdminRoleChangesetV2_ExecutionWithMCMS(t *testing.T) { t.Parallel() mcmsConfig := &proposalutils.TimelockConfig{MinDelay: 0 * time.Second} @@ -305,7 +305,7 @@ func TestUpdateAdminRoleChangesetV2_ExecutionWithMCMS(t *testing.T) { require.Equal(t, newAdminB, configOnB.PendingAdministrator) } -func TestUpdateAdminRoleChangesetV2_MultipleTokensPerChain(t *testing.T) { +func TestUnit_UnitUpdateAdminRoleChangesetV2_MultipleTokensPerChain(t *testing.T) { t.Parallel() mcmsConfig := &proposalutils.TimelockConfig{MinDelay: 0 * time.Second} diff --git a/deployment/ccip/changeset/v1_6/accept_ownership_test.go b/deployment/ccip/changeset/v1_6/accept_ownership_test.go index b75a3fa19d7..e01da52eac3 100644 --- a/deployment/ccip/changeset/v1_6/accept_ownership_test.go +++ b/deployment/ccip/changeset/v1_6/accept_ownership_test.go @@ -13,7 +13,7 @@ import ( commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" ) -func Test_NewAcceptOwnershipChangeset(t *testing.T) { +func TestIntegration_Shared_NewAcceptOwnershipChangeset(t *testing.T) { t.Parallel() e, _ := testhelpers.NewMemoryEnvironment(t) _, err := stateview.LoadOnchainState(e.Env) diff --git a/deployment/ccip/changeset/v1_6/cs_active_candidate_test.go b/deployment/ccip/changeset/v1_6/cs_active_candidate_test.go index 33ebd1b7b45..c8c3f0589c4 100644 --- a/deployment/ccip/changeset/v1_6/cs_active_candidate_test.go +++ b/deployment/ccip/changeset/v1_6/cs_active_candidate_test.go @@ -28,7 +28,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func Test_ActiveCandidate(t *testing.T) { +func TestIntegration_Shared_ActiveCandidate(t *testing.T) { t.Parallel() // Setup an environment with 2 chains, a source and a dest. // We want to have the active instance execute a few messages diff --git a/deployment/ccip/changeset/v1_6/cs_add_lane_test.go b/deployment/ccip/changeset/v1_6/cs_add_lane_test.go index 80beb5a4cc0..6935489e29a 100644 --- a/deployment/ccip/changeset/v1_6/cs_add_lane_test.go +++ b/deployment/ccip/changeset/v1_6/cs_add_lane_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" ) -func TestAddLanesWithTestRouter(t *testing.T) { +func TestIntegration_Shared_AddLanesWithTestRouter(t *testing.T) { t.Parallel() e, _ := testhelpers.NewMemoryEnvironment(t) // Here we have CR + nodes set up, but no CCIP contracts deployed. @@ -51,7 +51,7 @@ func TestAddLanesWithTestRouter(t *testing.T) { // dev is on going for sending request between solana and evm chains // this test is there to ensure addLane works between solana and evm chains -func TestAddLanesWithSolana(t *testing.T) { +func TestIntegration_Solana_AddLanesWithSolana(t *testing.T) { t.Parallel() e, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithSolChains(1)) // Here we have CR + nodes set up, but no CCIP contracts deployed. diff --git a/deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e_test.go b/deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e_test.go index a53b0badc16..dc20fc918b6 100644 --- a/deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e_test.go +++ b/deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e_test.go @@ -67,7 +67,7 @@ func checkConnectivity( require.Equal(t, state.Chains[selector].OnRamp.Address().Hex(), onRamp.Hex(), "onRamp must equal expected") } -func TestConnectNewChain(t *testing.T) { +func TestIntegration_Shared_ConnectNewChain(t *testing.T) { t.Parallel() mustHaveOwner := func(t *testing.T, ownable commonchangeset.Ownable, expectedOwner string) { owner, err := ownable.Owner(nil) @@ -235,7 +235,7 @@ func TestConnectNewChain(t *testing.T) { } } -func TestAddAndPromoteCandidatesForNewChain(t *testing.T) { +func TestIntegration_Shared_AddAndPromoteCandidatesForNewChain(t *testing.T) { t.Parallel() type test struct { Msg string @@ -543,7 +543,7 @@ func TestAddAndPromoteCandidatesForNewChain(t *testing.T) { } } -func TestRemoveLinkTokenAddressIfExists(t *testing.T) { +func TestIntegration_Shared_RemoveLinkTokenAddressIfExists(t *testing.T) { t.Parallel() t.Run("should remove LINK token successfully if already exists", func(t *testing.T) { @@ -603,7 +603,7 @@ func TestRemoveLinkTokenAddressIfExists(t *testing.T) { }) } -func TestValidateTransmitterAddresses(t *testing.T) { +func TestIntegration_Shared_ValidateTransmitterAddresses(t *testing.T) { t.Parallel() t.Run("should fail if the number of transmitter address is less than 3f+1", func(t *testing.T) { // Test the core validation logic from ValidateTransmitters method diff --git a/deployment/ccip/changeset/v1_6/cs_ccip_home_test.go b/deployment/ccip/changeset/v1_6/cs_ccip_home_test.go index adc41800853..48f1fcb141c 100644 --- a/deployment/ccip/changeset/v1_6/cs_ccip_home_test.go +++ b/deployment/ccip/changeset/v1_6/cs_ccip_home_test.go @@ -37,7 +37,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) -func TestInvalidOCR3Params(t *testing.T) { +func TestIntegration_Shared_InvalidOCR3Params(t *testing.T) { e, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithPrerequisiteDeploymentOnly(nil)) chain1 := e.Env.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilyEVM))[0] @@ -98,7 +98,7 @@ func TestInvalidOCR3Params(t *testing.T) { require.True(t, matched) } -func Test_PromoteCandidate(t *testing.T) { +func TestIntegration_Shared_PromoteCandidate(t *testing.T) { for _, tc := range []struct { name string mcmsEnabled bool @@ -190,7 +190,7 @@ func Test_PromoteCandidate(t *testing.T) { } } -func Test_SetCandidate(t *testing.T) { +func TestIntegration_Shared_SetCandidate(t *testing.T) { for _, tc := range []struct { name string mcmsEnabled bool @@ -320,7 +320,7 @@ func Test_SetCandidate(t *testing.T) { } } -func Test_RevokeCandidate(t *testing.T) { +func TestIntegration_Shared_RevokeCandidate(t *testing.T) { for _, tc := range []struct { name string mcmsEnabled bool @@ -459,7 +459,7 @@ func Test_RevokeCandidate(t *testing.T) { } } -func Test_UpdateChainConfigs(t *testing.T) { +func TestIntegration_Shared_UpdateChainConfigs(t *testing.T) { for _, tc := range []struct { name string mcmsEnabled bool diff --git a/deployment/ccip/changeset/v1_6/cs_chain_contracts_test.go b/deployment/ccip/changeset/v1_6/cs_chain_contracts_test.go index 6d8af23e446..61ef74507e8 100644 --- a/deployment/ccip/changeset/v1_6/cs_chain_contracts_test.go +++ b/deployment/ccip/changeset/v1_6/cs_chain_contracts_test.go @@ -47,7 +47,7 @@ import ( commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" ) -func TestUpdateOnRampsDests(t *testing.T) { +func TestIntegration_Shared_UpdateOnRampsDests(t *testing.T) { for _, tc := range []struct { name string mcmsEnabled bool @@ -123,7 +123,7 @@ func TestUpdateOnRampsDests(t *testing.T) { } } -func TestUpdateOnRampDynamicConfig(t *testing.T) { +func TestIntegration_Shared_UpdateOnRampDynamicConfig(t *testing.T) { for _, tc := range []struct { name string mcmsEnabled bool @@ -191,7 +191,7 @@ func TestUpdateOnRampDynamicConfig(t *testing.T) { } } -func TestUpdateOnRampAllowList(t *testing.T) { +func TestIntegration_Shared_UpdateOnRampAllowList(t *testing.T) { for _, tc := range []struct { name string mcmsEnabled bool @@ -267,7 +267,7 @@ func TestUpdateOnRampAllowList(t *testing.T) { } } -func TestWithdrawOnRampFeeTokens(t *testing.T) { +func TestIntegration_Shared_WithdrawOnRampFeeTokens(t *testing.T) { for _, tc := range []struct { name string mcmsEnabled bool @@ -383,7 +383,7 @@ func TestWithdrawOnRampFeeTokens(t *testing.T) { } } -func TestUpdateOffRampsSources(t *testing.T) { +func TestIntegration_Shared_UpdateOffRampsSources(t *testing.T) { for _, tc := range []struct { name string mcmsEnabled bool @@ -459,7 +459,7 @@ func TestUpdateOffRampsSources(t *testing.T) { } } -func TestUpdateFQDests(t *testing.T) { +func TestIntegration_Shared_UpdateFQDests(t *testing.T) { for _, tc := range []struct { name string mcmsEnabled bool @@ -527,7 +527,7 @@ func TestUpdateFQDests(t *testing.T) { } } -func TestUpdateFeeQuoterDestsConfig_Validate_MultipleReportsEnabled(t *testing.T) { +func TestIntegration_Shared_UpdateFeeQuoterDestsConfig_Validate_MultipleReportsEnabled(t *testing.T) { tenv, _ := testhelpers.NewMemoryEnvironment(t) allChains := maps.Keys(tenv.Env.BlockChains.EVMChains()) source := allChains[0] @@ -617,7 +617,7 @@ func TestUpdateFeeQuoterDestsConfig_Validate_MultipleReportsEnabled(t *testing.T require.NoError(t, err) } -func TestUpdateRouterRamps(t *testing.T) { +func TestIntegration_Shared_UpdateRouterRamps(t *testing.T) { for _, tc := range []struct { name string transferHomeContracts bool @@ -722,7 +722,7 @@ func TestUpdateRouterRamps(t *testing.T) { } } -func TestUpdateDynamicConfigOffRampChangeset(t *testing.T) { +func TestIntegration_Shared_UpdateDynamicConfigOffRampChangeset(t *testing.T) { for _, tc := range []struct { name string mcmsEnabled bool @@ -782,7 +782,7 @@ func TestUpdateDynamicConfigOffRampChangeset(t *testing.T) { } } -func TestUpdateNonceManagersCS(t *testing.T) { +func TestIntegration_Shared_UpdateNonceManagersCS(t *testing.T) { for _, tc := range []struct { name string mcmsEnabled bool @@ -840,7 +840,7 @@ func TestUpdateNonceManagersCS(t *testing.T) { } } -func TestUpdateNonceManagersCSApplyPreviousRampsUpdates(t *testing.T) { +func TestIntegration_Shared_UpdateNonceManagersCSApplyPreviousRampsUpdates(t *testing.T) { e, tenv := testhelpers.NewMemoryEnvironment( t, testhelpers.WithPrerequisiteDeploymentOnly(&changeset.V1_5DeploymentConfig{ @@ -943,7 +943,7 @@ func TestUpdateNonceManagersCSApplyPreviousRampsUpdates(t *testing.T) { require.NoError(t, err) } -func TestSetOCR3ConfigValidations(t *testing.T) { +func TestIntegration_Shared_SetOCR3ConfigValidations(t *testing.T) { e, _ := testhelpers.NewMemoryEnvironment( t, testhelpers.WithPrerequisiteDeploymentOnly(nil)) @@ -1061,7 +1061,7 @@ func TestSetOCR3ConfigValidations(t *testing.T) { require.Contains(t, err.Error(), "OCR3 config FRoleDON is lower than chainConfig FChain") } -func TestApplyFeeTokensUpdatesFeeQuoterChangeset(t *testing.T) { +func TestIntegration_Shared_ApplyFeeTokensUpdatesFeeQuoterChangeset(t *testing.T) { for _, tc := range []struct { name string mcmsEnabled bool @@ -1146,7 +1146,7 @@ func TestApplyFeeTokensUpdatesFeeQuoterChangeset(t *testing.T) { } } -func TestApplyPremiumMultiplierWeiPerEthUpdatesFeeQuoterChangeset(t *testing.T) { +func TestIntegration_Shared_ApplyPremiumMultiplierWeiPerEthUpdatesFeeQuoterChangeset(t *testing.T) { for _, tc := range []struct { name string mcmsEnabled bool @@ -1258,7 +1258,7 @@ func TestApplyPremiumMultiplierWeiPerEthUpdatesFeeQuoterChangeset(t *testing.T) } } -func TestUpdateTokenPriceFeedsFeeQuoterChangeset(t *testing.T) { +func TestIntegration_Shared_UpdateTokenPriceFeedsFeeQuoterChangeset(t *testing.T) { for _, tc := range []struct { name string mcmsEnabled bool @@ -1375,7 +1375,7 @@ func TestUpdateTokenPriceFeedsFeeQuoterChangeset(t *testing.T) { } } -func TestApplyTokenTransferFeeConfigUpdatesFeeQuoterChangeset(t *testing.T) { +func TestIntegration_Shared_ApplyTokenTransferFeeConfigUpdatesFeeQuoterChangeset(t *testing.T) { for _, tc := range []struct { name string mcmsEnabled bool @@ -1483,7 +1483,7 @@ func TestApplyTokenTransferFeeConfigUpdatesFeeQuoterChangeset(t *testing.T) { } } -func TestApplyTokenTransferFeeConfigUpdatesFeeQuoterChangesetV2(t *testing.T) { +func TestIntegration_Shared_ApplyTokenTransferFeeConfigUpdatesFeeQuoterChangesetV2(t *testing.T) { for _, tc := range []struct { name string mcmsEnabled bool @@ -1617,7 +1617,7 @@ func TestApplyTokenTransferFeeConfigUpdatesFeeQuoterChangesetV2(t *testing.T) { } } -func TestUpdateWrappedNativeOnRouterChangeset(t *testing.T) { +func TestIntegration_Shared_UpdateWrappedNativeOnRouterChangeset(t *testing.T) { for _, tc := range []struct { name string mcmsEnabled bool diff --git a/deployment/ccip/changeset/v1_6/cs_deploy_chain_test.go b/deployment/ccip/changeset/v1_6/cs_deploy_chain_test.go index 429a0744f61..40e4d94211a 100644 --- a/deployment/ccip/changeset/v1_6/cs_deploy_chain_test.go +++ b/deployment/ccip/changeset/v1_6/cs_deploy_chain_test.go @@ -30,7 +30,7 @@ import ( commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" ) -func TestDeployChainContractsChangeset(t *testing.T) { +func TestUnit_DeployChainContractsChangeset(t *testing.T) { t.Parallel() homeChainSel := chain_selectors.TEST_90000001.Selector @@ -45,7 +45,7 @@ func TestDeployChainContractsChangeset(t *testing.T) { testDeployChainContractsChangesetWithEnv(t, *env, homeChainSel) } -func TestDeployChainContractsChangesetZk(t *testing.T) { +func TestUnit_DeployChainContractsChangesetZk(t *testing.T) { // Timeouts in CI tests.SkipFlakey(t, "https://smartcontract-it.atlassian.net/browse/CCIP-6427") @@ -176,12 +176,12 @@ func testDeployChainContractsChangesetWithEnv(t *testing.T, e cldf.Environment, } } -func TestDeployCCIPContracts(t *testing.T) { +func TestIntegration_Shared_DeployCCIPContracts(t *testing.T) { t.Parallel() testhelpers.DeployCCIPContractsTest(t, 0, 0) } -func TestDeployStaticLinkToken(t *testing.T) { +func TestIntegration_Shared_DeployStaticLinkToken(t *testing.T) { t.Parallel() e, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithStaticLink()) // load onchain state diff --git a/deployment/ccip/changeset/v1_6/cs_home_chain_test.go b/deployment/ccip/changeset/v1_6/cs_home_chain_test.go index f6363f65cf5..7aaa94d8466 100644 --- a/deployment/ccip/changeset/v1_6/cs_home_chain_test.go +++ b/deployment/ccip/changeset/v1_6/cs_home_chain_test.go @@ -27,7 +27,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" ) -func TestDeployHomeChain(t *testing.T) { +func TestUnit_DeployHomeChain(t *testing.T) { t.Parallel() homeChainSel := chain_selectors.TEST_90000001.Selector @@ -78,7 +78,7 @@ func TestDeployHomeChain(t *testing.T) { require.Len(t, capRegSnap.Nodes, len(p2pIds)) } -func TestDeployHomeChainIdempotent(t *testing.T) { +func TestIntegration_Shared_DeployHomeChainIdempotent(t *testing.T) { e, _ := testhelpers.NewMemoryEnvironment(t) nodes, err := deployment.NodeInfo(e.Env.NodeIDs, e.Env.Offchain) require.NoError(t, err) @@ -99,7 +99,7 @@ func TestDeployHomeChainIdempotent(t *testing.T) { require.NoError(t, err) } -func TestDeployDonIDClaimerAndOffSet(t *testing.T) { +func TestIntegration_Shared_DeployDonIDClaimerAndOffSet(t *testing.T) { ctx := testcontext.Get(t) deployedEnvironment, _ := testhelpers.NewMemoryEnvironment(t) e := deployedEnvironment.Env @@ -163,7 +163,7 @@ func TestDeployDonIDClaimerAndOffSet(t *testing.T) { require.Equal(t, nextDonID+1, nextDonIDAfterOffset) } -func TestRemoveDonsValidate(t *testing.T) { +func TestIntegration_Shared_RemoveDonsValidate(t *testing.T) { e, _ := testhelpers.NewMemoryEnvironment(t) s, err := stateview.LoadOnchainState(e.Env) require.NoError(t, err) @@ -218,7 +218,7 @@ func TestRemoveDonsValidate(t *testing.T) { } } -func TestRemoveDons(t *testing.T) { +func TestIntegration_Shared_RemoveDons(t *testing.T) { e, _ := testhelpers.NewMemoryEnvironment(t) s, err := stateview.LoadOnchainState(e.Env) require.NoError(t, err) @@ -268,7 +268,7 @@ func TestRemoveDons(t *testing.T) { require.Len(t, donsAfter, len(donsBefore)-1) } -func TestAddDonAfterRemoveDons(t *testing.T) { +func TestIntegration_Shared_AddDonAfterRemoveDons(t *testing.T) { e, _ := testhelpers.NewMemoryEnvironment(t) s, err := stateview.LoadOnchainState(e.Env) require.NoError(t, err) @@ -338,7 +338,7 @@ func TestAddDonAfterRemoveDons(t *testing.T) { require.NoError(t, err) } -func TestAddUpdateAndRemoveNops(t *testing.T) { +func TestIntegration_Shared_AddUpdateAndRemoveNops(t *testing.T) { for _, tc := range []struct { name string mcmsEnabled bool @@ -471,7 +471,7 @@ func TestAddUpdateAndRemoveNops(t *testing.T) { } } -func TestRemoveNodes(t *testing.T) { +func TestIntegration_Shared_RemoveNodes(t *testing.T) { for _, tc := range []struct { name string mcmsEnabled bool diff --git a/deployment/ccip/changeset/v1_6/cs_jobspec_test.go b/deployment/ccip/changeset/v1_6/cs_jobspec_test.go index 5c7e008903c..7a5045149e4 100644 --- a/deployment/ccip/changeset/v1_6/cs_jobspec_test.go +++ b/deployment/ccip/changeset/v1_6/cs_jobspec_test.go @@ -14,7 +14,7 @@ import ( ccip "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/validate" ) -func TestJobSpecChangeset(t *testing.T) { +func TestIntegration_Shared_JobSpecChangeset(t *testing.T) { t.Parallel() var err error tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNoJobsAndContracts()) @@ -54,7 +54,7 @@ func TestJobSpecChangeset(t *testing.T) { } } -func TestJobSpecChangesetIdempotent(t *testing.T) { +func TestIntegration_Shared_JobSpecChangesetIdempotent(t *testing.T) { e, _ := testhelpers.NewMemoryEnvironment(t) // we call the changeset again to ensure that it doesn't return any new job specs // as the job specs are already created in the first call diff --git a/deployment/ccip/changeset/v1_6/cs_migration_from_v1_5_test.go b/deployment/ccip/changeset/v1_6/cs_migration_from_v1_5_test.go index eb392ea9458..e613a44a6ce 100644 --- a/deployment/ccip/changeset/v1_6/cs_migration_from_v1_5_test.go +++ b/deployment/ccip/changeset/v1_6/cs_migration_from_v1_5_test.go @@ -340,7 +340,7 @@ func initMigrationEnvironment(t *testing.T, numChains int, mcmsCfg proposalutils return e } -func TestInitAndPromoteChainUpgrades(t *testing.T) { +func TestIntegration_Shared_InitAndPromoteChainUpgrades(t *testing.T) { mcmsCfg := proposalutils.TimelockConfig{ MinDelay: 0 * time.Second, MCMSAction: mcmstypes.TimelockActionSchedule, diff --git a/deployment/ccip/changeset/v1_6/cs_translate_onramp_to_feequoter_test.go b/deployment/ccip/changeset/v1_6/cs_translate_onramp_to_feequoter_test.go index 331ced603b6..c20e338219e 100644 --- a/deployment/ccip/changeset/v1_6/cs_translate_onramp_to_feequoter_test.go +++ b/deployment/ccip/changeset/v1_6/cs_translate_onramp_to_feequoter_test.go @@ -37,7 +37,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipevm" ) -func TestTranslateEVM2EVMOnRampsToFeeQuoterChangeset(t *testing.T) { +func TestIntegration_Shared_TranslateEVM2EVMOnRampsToFeeQuoterChangeset(t *testing.T) { ctx := testcontext.Get(t) // 1. Deploy 1.5 pre-requisites diff --git a/deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes_test.go b/deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes_test.go index 39db02547e2..dfcbdc40d26 100644 --- a/deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes_test.go +++ b/deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes_test.go @@ -152,7 +152,7 @@ func checkBidirectionalLaneConnectivity( } } -func TestBuildConfigs(t *testing.T) { +func TestUnit_BuildConfigs(t *testing.T) { selectors := []uint64{1, 2} chains := make([]v1_6.ChainDefinition, len(selectors)) @@ -266,7 +266,7 @@ func TestBuildConfigs(t *testing.T) { }, configs.UpdateRouterRampsConfig) } -func TestUpdateBidirectionalLanesChangeset(t *testing.T) { +func TestIntegration_Shared_UpdateBidirectionalLanesChangeset(t *testing.T) { t.Parallel() type test struct { diff --git a/deployment/ccip/changeset/v1_6_2/cs_configure_cctp_message_transmitter_proxy_test.go b/deployment/ccip/changeset/v1_6_2/cs_configure_cctp_message_transmitter_proxy_test.go index 114a36be2f8..f41a5ae978a 100644 --- a/deployment/ccip/changeset/v1_6_2/cs_configure_cctp_message_transmitter_proxy_test.go +++ b/deployment/ccip/changeset/v1_6_2/cs_configure_cctp_message_transmitter_proxy_test.go @@ -121,7 +121,7 @@ func setupCCTPMsgTransmitterProxyContractsForConfigure( return usdcToken, messenger } -func TestValidateConfigureCCTPMessageTransmitterProxyInput(t *testing.T) { +func TestUnit_ValidateConfigureCCTPMessageTransmitterProxyInput(t *testing.T) { t.Parallel() rt := setupCCTPMsgTransmitterProxyEnvironmentForConfigure(t, true) @@ -186,7 +186,7 @@ func TestValidateConfigureCCTPMessageTransmitterProxyInput(t *testing.T) { } } -func TestConfigureCCTPMessageTransmitterProxy(t *testing.T) { +func TestUnit_ConfigureCCTPMessageTransmitterProxy(t *testing.T) { quarantine.Flaky(t, "DX-2064") t.Parallel() diff --git a/deployment/ccip/changeset/v1_6_2/cs_configure_usdc_token_pool_test.go b/deployment/ccip/changeset/v1_6_2/cs_configure_usdc_token_pool_test.go index 5211517172b..cdf89a3a521 100644 --- a/deployment/ccip/changeset/v1_6_2/cs_configure_usdc_token_pool_test.go +++ b/deployment/ccip/changeset/v1_6_2/cs_configure_usdc_token_pool_test.go @@ -122,7 +122,7 @@ func setupUSDCTokenPoolsContractsForConfigure( return usdcToken, messenger } -func TestValidateConfigUSDCTokenPoolInput(t *testing.T) { +func TestUnit_ValidateConfigUSDCTokenPoolInput(t *testing.T) { t.Parallel() rt := setupUSDCTokenPoolsEnvironmentForConfigure(t, true) @@ -280,7 +280,7 @@ func TestValidateConfigUSDCTokenPoolInput(t *testing.T) { } } -func TestConfigureUSDCTokenPools(t *testing.T) { +func TestUnit_ConfigureUSDCTokenPools(t *testing.T) { t.Parallel() rt := setupUSDCTokenPoolsEnvironmentForConfigure(t, true) diff --git a/deployment/ccip/changeset/v1_6_2/cs_deploy_cctp_message_transmitter_proxy_test.go b/deployment/ccip/changeset/v1_6_2/cs_deploy_cctp_message_transmitter_proxy_test.go index d07bee6fc29..c0269d111e9 100644 --- a/deployment/ccip/changeset/v1_6_2/cs_deploy_cctp_message_transmitter_proxy_test.go +++ b/deployment/ccip/changeset/v1_6_2/cs_deploy_cctp_message_transmitter_proxy_test.go @@ -114,7 +114,7 @@ func setupCCTPMsgTransmitterProxyContractsForDeploy( return messenger } -func TestValidateDeployCCTPMessageTransmitterProxyInput(t *testing.T) { +func TestUnit_ValidateDeployCCTPMessageTransmitterProxyInput(t *testing.T) { t.Parallel() rt := setupCCTPMsgTransmitterProxyEnvironmentForDeploy(t, false) @@ -153,7 +153,7 @@ func TestValidateDeployCCTPMessageTransmitterProxyInput(t *testing.T) { } } -func TestDeployCCTPMessageTransmitterProxy(t *testing.T) { +func TestUnit_DeployCCTPMessageTransmitterProxy(t *testing.T) { t.Parallel() rt := setupCCTPMsgTransmitterProxyEnvironmentForDeploy(t, true) diff --git a/deployment/ccip/changeset/v1_6_2/cs_deploy_usdc_token_pools_test.go b/deployment/ccip/changeset/v1_6_2/cs_deploy_usdc_token_pools_test.go index b9607976e7e..4c564ea38dc 100644 --- a/deployment/ccip/changeset/v1_6_2/cs_deploy_usdc_token_pools_test.go +++ b/deployment/ccip/changeset/v1_6_2/cs_deploy_usdc_token_pools_test.go @@ -118,7 +118,7 @@ func setupUSDCTokenPoolsContractsForDeploy( return usdcToken, messenger } -func TestValidateDeployUSDCTokenPoolContractsConfig(t *testing.T) { +func TestUnit_ValidateDeployUSDCTokenPoolContractsConfig(t *testing.T) { t.Parallel() rt := setupUSDCTokenPoolsEnvironmentForDeploy(t, true) @@ -174,7 +174,7 @@ func TestValidateDeployUSDCTokenPoolContractsConfig(t *testing.T) { } } -func TestValidateDeployUSDCTokenPoolInput(t *testing.T) { +func TestUnit_ValidateDeployUSDCTokenPoolInput(t *testing.T) { t.Parallel() rt := setupUSDCTokenPoolsEnvironmentForDeploy(t, true) @@ -318,7 +318,7 @@ func TestValidateDeployUSDCTokenPoolInput(t *testing.T) { } } -func TestDeployUSDCTokenPool(t *testing.T) { +func TestUnit_DeployUSDCTokenPool(t *testing.T) { t.Parallel() rt := setupUSDCTokenPoolsEnvironmentForDeploy(t, true) @@ -366,7 +366,7 @@ func TestDeployUSDCTokenPool(t *testing.T) { } } -func TestDeployHybridLockReleaseUSDCTokenPool(t *testing.T) { +func TestUnit_DeployHybridLockReleaseUSDCTokenPool(t *testing.T) { t.Parallel() rt := setupUSDCTokenPoolsEnvironmentForDeploy(t, true) diff --git a/deployment/ccip/manualexechelpers/exec_test.go b/deployment/ccip/manualexechelpers/exec_test.go index 3b7b2a5ec20..494f4202c66 100644 --- a/deployment/ccip/manualexechelpers/exec_test.go +++ b/deployment/ccip/manualexechelpers/exec_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/manualexechelpers" ) -func TestRootMap_AddAndGet(t *testing.T) { +func TestUnit_RootMap_AddAndGet(t *testing.T) { // Mock data root1 := manualexechelpers.RootCacheEntry{Root: offramp.InternalMerkleRoot{MinSeqNr: 1, MaxSeqNr: 10}, BlockNumber: 1} root2 := manualexechelpers.RootCacheEntry{Root: offramp.InternalMerkleRoot{MinSeqNr: 11, MaxSeqNr: 20}, BlockNumber: 2} diff --git a/deployment/ccip/shared/deployergroup/deployer_group_test.go b/deployment/ccip/shared/deployergroup/deployer_group_test.go index b47a377c747..4da42e3cd90 100644 --- a/deployment/ccip/shared/deployergroup/deployer_group_test.go +++ b/deployment/ccip/shared/deployergroup/deployer_group_test.go @@ -187,7 +187,7 @@ var deployerGroupTestCases = []deployerGroupTestCase{ }, } -func TestDeployerGroup(t *testing.T) { +func TestIntegration_Shared_DeployerGroup(t *testing.T) { for _, tc := range deployerGroupTestCases { t.Run(tc.name, func(t *testing.T) { e, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(2)) @@ -223,7 +223,7 @@ func TestDeployerGroup(t *testing.T) { } } -func TestDeployerGroupMCMS(t *testing.T) { +func TestIntegration_Shared_DeployerGroupMCMS(t *testing.T) { for _, tc := range deployerGroupTestCases { t.Run(tc.name, func(t *testing.T) { if tc.name == "happy path" { @@ -292,7 +292,7 @@ func TestDeployerGroupMCMS(t *testing.T) { } } -func TestDeployerGroupWithTimelockAddressQualifier(t *testing.T) { +func TestIntegration_Shared_DeployerGroupWithTimelockAddressQualifier(t *testing.T) { var err error linktokenOwnerQualifier := "link-owner" selectorIndex := uint64(0) @@ -377,7 +377,7 @@ func TestDeployerGroupWithTimelockAddressQualifier(t *testing.T) { require.Equal(t, sumOfMints, amount) } -func TestDeployerGroupGenerateMultipleProposals(t *testing.T) { +func TestIntegration_Shared_DeployerGroupGenerateMultipleProposals(t *testing.T) { tc := dummyMultiChainDeployerGroupChangesetConfig{ address: common.HexToAddress("0x455E5AA18469bC6ccEF49594645666C587A3a71B"), mints: []mintConfig{ @@ -443,7 +443,7 @@ func TestDeployerGroupGenerateMultipleProposals(t *testing.T) { require.NotEmpty(t, cs.DescribedTimelockProposals[2]) } -func TestDeployerGroupMultipleProposalsMCMS(t *testing.T) { +func TestIntegration_Shared_DeployerGroupMultipleProposalsMCMS(t *testing.T) { cfg := dummyMultiChainDeployerGroupChangesetConfig{ address: common.HexToAddress("0x455E5AA18469bC6ccEF49594645666C587A3a71B"), mints: []mintConfig{ @@ -516,7 +516,7 @@ func TestDeployerGroupMultipleProposalsMCMS(t *testing.T) { require.Equal(t, sumOfMints, amount) } -func TestEmptyBatch(t *testing.T) { +func TestIntegration_Shared_EmptyBatch(t *testing.T) { e, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(2)) cfg := dummyEmptyBatchChangesetConfig{ diff --git a/deployment/ccip/shared/stateview/state_test.go b/deployment/ccip/shared/stateview/state_test.go index 121805eb7e9..48e82f0d78c 100644 --- a/deployment/ccip/shared/stateview/state_test.go +++ b/deployment/ccip/shared/stateview/state_test.go @@ -30,7 +30,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/common/types" ) -func TestLoadChainState_MultipleFeeQuoters(t *testing.T) { +func TestIntegration_Shared_LoadChainState_MultipleFeeQuoters(t *testing.T) { tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(3)) fq1 := utils.RandomAddress().Hex() fq2 := utils.RandomAddress().Hex() @@ -44,7 +44,7 @@ func TestLoadChainState_MultipleFeeQuoters(t *testing.T) { require.Equal(t, deployment.Version1_2_0, *state.FeeQuoterVersion, "expected latest fee quoter version to be selected") } -func TestSmokeState(t *testing.T) { +func TestIntegration_Shared_SmokeState(t *testing.T) { tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(3)) state, err := stateview.LoadOnchainState(tenv.Env) require.NoError(t, err) @@ -52,7 +52,7 @@ func TestSmokeState(t *testing.T) { require.NoError(t, err) } -func TestMCMSState(t *testing.T) { +func TestIntegration_Shared_MCMSState(t *testing.T) { tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNoJobsAndContracts()) addressbook := cldf.NewMemoryAddressBook() newTv := cldf.NewTypeAndVersion(types.ManyChainMultisig, deployment.Version1_0_0) @@ -69,7 +69,7 @@ func TestMCMSState(t *testing.T) { require.Equal(t, addr.String(), state.Chains[tenv.HomeChainSel].CancellerMcm.Address().String()) } -func TestEnforceMCMSUsageIfProd(t *testing.T) { +func TestUnit_EnforceMCMSUsageIfProd(t *testing.T) { t.Parallel() tests := []struct { diff --git a/deployment/ccip/shared/stateview/view_test.go b/deployment/ccip/shared/stateview/view_test.go index c8980aa76cb..394bee7c81a 100644 --- a/deployment/ccip/shared/stateview/view_test.go +++ b/deployment/ccip/shared/stateview/view_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" ) -func TestSmokeView(t *testing.T) { +func TestIntegration_Shared_SmokeView(t *testing.T) { t.Parallel() tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(3)) jsonData, err := stateview.ViewCCIP(tenv.Env) diff --git a/deployment/ccip/shared/token_info_test.go b/deployment/ccip/shared/token_info_test.go index 8c0d468be49..444518c8c7f 100644 --- a/deployment/ccip/shared/token_info_test.go +++ b/deployment/ccip/shared/token_info_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestNewMergedRegistry(t *testing.T) { +func TestUnit_NewMergedRegistry(t *testing.T) { tests := []struct { name string newTokens map[string][]TokenSymbol diff --git a/deployment/ccip/view/v1_2/price_registry_test.go b/deployment/ccip/view/v1_2/price_registry_test.go index 4b5701f9cbd..bb361d52f43 100644 --- a/deployment/ccip/view/v1_2/price_registry_test.go +++ b/deployment/ccip/view/v1_2/price_registry_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" ) -func TestGeneratePriceRegistryView(t *testing.T) { +func TestUnit_GeneratePriceRegistryView(t *testing.T) { t.Parallel() selector := chainselectors.TEST_90000001.Selector diff --git a/deployment/ccip/view/v1_5/offramp_test.go b/deployment/ccip/view/v1_5/offramp_test.go index 31826ed6b91..fc6ccf1a68d 100644 --- a/deployment/ccip/view/v1_5/offramp_test.go +++ b/deployment/ccip/view/v1_5/offramp_test.go @@ -21,7 +21,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" ) -func TestOffRampView(t *testing.T) { +func TestUnit_OffRampView(t *testing.T) { t.Parallel() srcSelector := chainsel.TEST_90000001.Selector diff --git a/deployment/ccip/view/v1_5/onramp_test.go b/deployment/ccip/view/v1_5/onramp_test.go index a69f7179c26..b7d64bd372a 100644 --- a/deployment/ccip/view/v1_5/onramp_test.go +++ b/deployment/ccip/view/v1_5/onramp_test.go @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" ) -func TestOnRampView(t *testing.T) { +func TestUnit_OnRampView(t *testing.T) { t.Parallel() selector := chainsel.TEST_90000001.Selector diff --git a/deployment/ccip/view/v1_5/rmn_test.go b/deployment/ccip/view/v1_5/rmn_test.go index a87ef1c56d3..b10d03a180d 100644 --- a/deployment/ccip/view/v1_5/rmn_test.go +++ b/deployment/ccip/view/v1_5/rmn_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" ) -func TestGenerateRMNView(t *testing.T) { +func TestUnit_GenerateRMNView(t *testing.T) { t.Parallel() selector := chainsel.TEST_90000001.Selector diff --git a/deployment/ccip/view/v1_6/ccip_home_test.go b/deployment/ccip/view/v1_6/ccip_home_test.go index d8aad15b836..0ac167efcd8 100644 --- a/deployment/ccip/view/v1_6/ccip_home_test.go +++ b/deployment/ccip/view/v1_6/ccip_home_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" ) -func TestCCIPHomeView(t *testing.T) { +func TestUnit_CCIPHomeView(t *testing.T) { t.Parallel() selector := chain_selectors.TEST_90000001.Selector diff --git a/deployment/ccip/view/v1_6/rmnremote_test.go b/deployment/ccip/view/v1_6/rmnremote_test.go index 1fca5d52a85..494ecc64111 100644 --- a/deployment/ccip/view/v1_6/rmnremote_test.go +++ b/deployment/ccip/view/v1_6/rmnremote_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/globals" ) -func Test_RMNRemote_Curse_View(t *testing.T) { +func TestUnit_RMNRemote_Curse_View(t *testing.T) { t.Parallel() selector := chainselectors.TEST_90000001.Selector @@ -50,32 +50,32 @@ func Test_RMNRemote_Curse_View(t *testing.T) { require.Equal(t, selector, view.CursedSubjectEntries[1].Selector) } -func Test_RMN_Selector_To_Solana_Subject(t *testing.T) { +func TestUnit_RMN_Selector_To_Solana_Subject(t *testing.T) { subject := globals.FamilyAwareSelectorToSubject(chainselectors.BINANCE_SMART_CHAIN_TESTNET.Selector, chainselectors.FamilySolana) require.Equal(t, []byte{251, 150, 143, 3, 112, 145, 21, 184, 0, 0, 0, 0, 0, 0, 0, 0}, subject[:]) } -func Test_RMN_Subject_To_Solana_Selector(t *testing.T) { +func TestUnit_RMN_Subject_To_Solana_Selector(t *testing.T) { selector := globals.FamilyAwareSubjectToSelector([16]byte{251, 150, 143, 3, 112, 145, 21, 184, 0, 0, 0, 0, 0, 0, 0, 0}, chainselectors.FamilySolana) require.Equal(t, chainselectors.BINANCE_SMART_CHAIN_TESTNET.Selector, selector) } -func Test_RMN_Selector_To_Subject(t *testing.T) { +func TestUnit_RMN_Selector_To_Subject(t *testing.T) { subject := globals.FamilyAwareSelectorToSubject(chainselectors.BINANCE_SMART_CHAIN_TESTNET.Selector, chainselectors.FamilyEVM) require.Equal(t, []byte{0, 0, 0, 0, 0, 0, 0, 0, 184, 21, 145, 112, 3, 143, 150, 251}, subject[:]) } -func Test_RMN_Subject_To_Selector(t *testing.T) { +func TestUnit_RMN_Subject_To_Selector(t *testing.T) { selector := globals.FamilyAwareSubjectToSelector([16]byte{0, 0, 0, 0, 0, 0, 0, 0, 184, 21, 145, 112, 3, 143, 150, 251}, chainselectors.FamilyEVM) require.Equal(t, chainselectors.BINANCE_SMART_CHAIN_TESTNET.Selector, selector) } -func Test_GlobalSubject_To_Selector(t *testing.T) { +func TestUnit_GlobalSubject_To_Selector(t *testing.T) { selector := globals.FamilyAwareSubjectToSelector(globals.GlobalCurseSubject(), chainselectors.FamilyEVM) require.Equal(t, uint64(0), selector) } -func Test_GlobalSubject_To_Selector_Solana(t *testing.T) { +func TestUnit_GlobalSubject_To_Selector_Solana(t *testing.T) { selector := globals.FamilyAwareSubjectToSelector(globals.GlobalCurseSubject(), chainselectors.FamilySolana) require.Equal(t, uint64(0), selector) } diff --git a/deployment/common/changeset/deploy_link_token_test.go b/deployment/common/changeset/deploy_link_token_test.go index 95b5fb80d50..5c0589d1bdc 100644 --- a/deployment/common/changeset/deploy_link_token_test.go +++ b/deployment/common/changeset/deploy_link_token_test.go @@ -16,7 +16,7 @@ import ( commonState "github.com/smartcontractkit/chainlink/deployment/common/changeset/state" ) -func TestDeployLinkToken(t *testing.T) { +func TestUnit_DeployLinkToken(t *testing.T) { t.Parallel() selector := chain_selectors.TEST_90000001.Selector @@ -43,7 +43,7 @@ func TestDeployLinkToken(t *testing.T) { require.NoError(t, err) } -func TestDeployLinkTokenZk(t *testing.T) { +func TestUnit_DeployLinkTokenZk(t *testing.T) { // Timeouts in CI tests.SkipFlakey(t, "https://smartcontract-it.atlassian.net/browse/CCIP-6427") diff --git a/deployment/common/changeset/deploy_mcms_with_timelock_test.go b/deployment/common/changeset/deploy_mcms_with_timelock_test.go index 82d715a95ca..45bfb4ec8d6 100644 --- a/deployment/common/changeset/deploy_mcms_with_timelock_test.go +++ b/deployment/common/changeset/deploy_mcms_with_timelock_test.go @@ -36,7 +36,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/internal/soltestutils" ) -func TestGrantRoleInTimeLock(t *testing.T) { +func TestUnit_GrantRoleInTimeLock(t *testing.T) { selector := chain_selectors.TEST_90000001.Selector env, err := environment.New(t.Context(), environment.WithEVMSimulatedWithConfig(t, []uint64{selector}, onchain.EVMSimLoaderConfig{ @@ -121,7 +121,7 @@ func TestGrantRoleInTimeLock(t *testing.T) { require.Contains(t, proposers, existingProposer.Address().Hex()) } -func TestDeployMCMSWithTimelockV2WithFewExistingContracts(t *testing.T) { +func TestUnit_DeployMCMSWithTimelockV2WithFewExistingContracts(t *testing.T) { ctx := t.Context() selector1 := chain_selectors.TEST_90000001.Selector @@ -253,7 +253,7 @@ func TestDeployMCMSWithTimelockV2WithFewExistingContracts(t *testing.T) { require.Equal(t, bypassers, []string{evmState1.BypasserMcm.Address().Hex()}) } -func TestDeployMCMSWithTimelockV2(t *testing.T) { +func TestUnit_DeployMCMSWithTimelockV2(t *testing.T) { quarantine.Flaky(t, "DX-1719") t.Parallel() @@ -442,7 +442,7 @@ func TestDeployMCMSWithTimelockV2(t *testing.T) { } // TestDeployMCMSWithTimelockV2SkipInit tests calling the deploy changeset when accounts have already been initialized -func TestDeployMCMSWithTimelockV2SkipInitSolana(t *testing.T) { +func TestUnit_DeployMCMSWithTimelockV2SkipInitSolana(t *testing.T) { tests.SkipFlakey(t, "https://smartcontract-it.atlassian.net/browse/DX-438") t.Parallel() diff --git a/deployment/common/changeset/evm/mcms/mcms_test.go b/deployment/common/changeset/evm/mcms/mcms_test.go index 41a9dc59455..3c7e2883bc0 100644 --- a/deployment/common/changeset/evm/mcms/mcms_test.go +++ b/deployment/common/changeset/evm/mcms/mcms_test.go @@ -19,7 +19,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func TestDeployMCMSWithConfig(t *testing.T) { +func TestUnit_DeployMCMSWithConfig(t *testing.T) { lggr := logger.TestLogger(t) selector := chainsel.TEST_90000001.Selector @@ -59,7 +59,7 @@ func TestDeployMCMSWithConfig(t *testing.T) { require.Contains(t, mcmWithLabel.Tv.Labels, label, "label mismatch") } -func TestDeployMCMSWithTimelockContracts(t *testing.T) { +func TestUnit_DeployMCMSWithTimelockContracts(t *testing.T) { selector := chainsel.TEST_90000001.Selector env, err := environment.New(t.Context(), environment.WithEVMSimulated(t, []uint64{selector}), diff --git a/deployment/common/changeset/example/add_mint_burners_link_test.go b/deployment/common/changeset/example/add_mint_burners_link_test.go index 9acc72a4b20..640b6ebedfe 100644 --- a/deployment/common/changeset/example/add_mint_burners_link_test.go +++ b/deployment/common/changeset/example/add_mint_burners_link_test.go @@ -12,7 +12,7 @@ import ( ) // TestAddMintersBurnersLink tests the AddMintersBurnersLink changeset -func TestAddMintersBurnersLink(t *testing.T) { +func TestUnit_AddMintersBurnersLink(t *testing.T) { t.Parallel() var ( diff --git a/deployment/common/changeset/example/datastore/exemplar_deploy_link_token_test.go b/deployment/common/changeset/example/datastore/exemplar_deploy_link_token_test.go index 21ebc5bed96..731a5546889 100644 --- a/deployment/common/changeset/example/datastore/exemplar_deploy_link_token_test.go +++ b/deployment/common/changeset/example/datastore/exemplar_deploy_link_token_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" ) -func Test_ExemplarDeployLinkToken(t *testing.T) { +func TestUnit_ExemplarDeployLinkToken(t *testing.T) { t.Parallel() selector := chainselectors.TEST_90000001.Selector diff --git a/deployment/common/changeset/example/link_transfer_test.go b/deployment/common/changeset/example/link_transfer_test.go index 8ce4cd50626..7d3e931f019 100644 --- a/deployment/common/changeset/example/link_transfer_test.go +++ b/deployment/common/changeset/example/link_transfer_test.go @@ -54,7 +54,7 @@ func setupLinkTransferRuntime(t *testing.T) (*runtime.Runtime, uint64) { return rt, selector } -func TestValidate(t *testing.T) { +func TestUnit_Validate(t *testing.T) { rt, selector := setupLinkTransferRuntime(t) chain := rt.Environment().BlockChains.EVMChains()[selector] @@ -225,7 +225,7 @@ func TestValidate(t *testing.T) { } } -func TestLinkTransferMCMSV2(t *testing.T) { +func TestUnit_LinkTransferMCMSV2(t *testing.T) { t.Parallel() var ( diff --git a/deployment/common/changeset/example/mint_link_test.go b/deployment/common/changeset/example/mint_link_test.go index 6796db0d0ea..8dbb5d058da 100644 --- a/deployment/common/changeset/example/mint_link_test.go +++ b/deployment/common/changeset/example/mint_link_test.go @@ -16,7 +16,7 @@ import ( ) // TestMintLink tests the MintLink changeset -func TestMintLink(t *testing.T) { +func TestUnit_MintLink(t *testing.T) { t.Parallel() var ( diff --git a/deployment/common/changeset/example/operations/deploy_and_mint_example_test.go b/deployment/common/changeset/example/operations/deploy_and_mint_example_test.go index aa9d83a726f..63d5398ae16 100644 --- a/deployment/common/changeset/example/operations/deploy_and_mint_example_test.go +++ b/deployment/common/changeset/example/operations/deploy_and_mint_example_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" ) -func TestDeployAndMintExampleChangeset(t *testing.T) { +func TestUnit_DeployAndMintExampleChangeset(t *testing.T) { selector := chain_selectors.TEST_90000001.Selector env, err := environment.New(t.Context(), environment.WithEVMSimulated(t, []uint64{selector})) require.NoError(t, err) diff --git a/deployment/common/changeset/example/operations/retry_config_example_test.go b/deployment/common/changeset/example/operations/retry_config_example_test.go index dee3e2c0309..2c4cc5e0d9c 100644 --- a/deployment/common/changeset/example/operations/retry_config_example_test.go +++ b/deployment/common/changeset/example/operations/retry_config_example_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/operations" ) -func TestDisableRetryExampleChangeset(t *testing.T) { +func TestUnit_DisableRetryExampleChangeset(t *testing.T) { env, err := environment.New(t.Context()) require.NoError(t, err) @@ -18,7 +18,7 @@ func TestDisableRetryExampleChangeset(t *testing.T) { require.ErrorContains(t, err, "operation failed") } -func TestUpdateInputExampleChangeset(t *testing.T) { +func TestUnit_UpdateInputExampleChangeset(t *testing.T) { env, err := environment.New(t.Context()) require.NoError(t, err) diff --git a/deployment/common/changeset/example/operations/terminal_error_example_test.go b/deployment/common/changeset/example/operations/terminal_error_example_test.go index dcc60ac7538..8a141189da8 100644 --- a/deployment/common/changeset/example/operations/terminal_error_example_test.go +++ b/deployment/common/changeset/example/operations/terminal_error_example_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/operations" ) -func TestTerminalErrorExampleChangeset(t *testing.T) { +func TestUnit_TerminalErrorExampleChangeset(t *testing.T) { env, err := environment.New(t.Context()) require.NoError(t, err) diff --git a/deployment/common/changeset/example/solana_transfer_mcm_test.go b/deployment/common/changeset/example/solana_transfer_mcm_test.go index ad353fcc8e4..4d1b73f0fe1 100644 --- a/deployment/common/changeset/example/solana_transfer_mcm_test.go +++ b/deployment/common/changeset/example/solana_transfer_mcm_test.go @@ -31,7 +31,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/utils/solutils" ) -func TestTransferFromTimelockConfig_VerifyPreconditions(t *testing.T) { +func TestUnit_TransferFromTimelockConfig_VerifyPreconditions(t *testing.T) { t.Parallel() receiverKey := solana.NewWallet().PublicKey() @@ -187,7 +187,7 @@ func TestTransferFromTimelockConfig_VerifyPreconditions(t *testing.T) { } } -func TestTransferFromTimelockConfig_Apply(t *testing.T) { +func TestUnit_TransferFromTimelockConfig_Apply(t *testing.T) { quarantine.Flaky(t, "DX-1754") t.Parallel() diff --git a/deployment/common/changeset/mcms_firedrill_test.go b/deployment/common/changeset/mcms_firedrill_test.go index 1fb65662a6c..5e99cf29a48 100644 --- a/deployment/common/changeset/mcms_firedrill_test.go +++ b/deployment/common/changeset/mcms_firedrill_test.go @@ -23,7 +23,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/utils/solutils" ) -func TestMCMSSignFireDrillChangeset(t *testing.T) { +func TestUnit_MCMSSignFireDrillChangeset(t *testing.T) { t.Parallel() evmSelector1 := chain_selectors.TEST_90000001.Selector diff --git a/deployment/common/changeset/save_existing_test.go b/deployment/common/changeset/save_existing_test.go index 97bd88987cb..ee7debb1ad0 100644 --- a/deployment/common/changeset/save_existing_test.go +++ b/deployment/common/changeset/save_existing_test.go @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func TestSaveExisting(t *testing.T) { +func TestUnit_SaveExisting(t *testing.T) { dummyEnv := cldf.Environment{ Name: "dummy", Logger: logger.TestLogger(t), @@ -60,7 +60,7 @@ func TestSaveExisting(t *testing.T) { require.Len(t, addressForChain1, 1) } -func TestSaveExistingAddressWithLabels(t *testing.T) { +func TestUnit_SaveExistingAddressWithLabels(t *testing.T) { dummyEnv := cldf.Environment{ Name: "dummy", Logger: logger.TestLogger(t), @@ -99,7 +99,7 @@ func TestSaveExistingAddressWithLabels(t *testing.T) { require.Equal(t, "dummyType 1.5.0 label1 label2", addressForChain1[common.BigToAddress(big.NewInt(1)).String()].String()) } -func TestSaveExistingMCMSAddressWithLabels(t *testing.T) { +func TestUnit_SaveExistingMCMSAddressWithLabels(t *testing.T) { dummyEnv := cldf.Environment{ Name: "dummy", Logger: logger.TestLogger(t), diff --git a/deployment/common/changeset/set_config_mcms_test.go b/deployment/common/changeset/set_config_mcms_test.go index 2e392ae3dee..4e046ff2877 100644 --- a/deployment/common/changeset/set_config_mcms_test.go +++ b/deployment/common/changeset/set_config_mcms_test.go @@ -30,7 +30,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/internal/soltestutils" ) -func TestSetConfigMCMSV2EVM(t *testing.T) { +func TestUnit_SetConfigMCMSV2EVM(t *testing.T) { t.Parallel() selector1 := chain_selectors.TEST_90000001.Selector @@ -165,7 +165,7 @@ func TestSetConfigMCMSV2EVM(t *testing.T) { } } -func TestSetConfigMCMSV2Solana(t *testing.T) { +func TestUnit_SetConfigMCMSV2Solana(t *testing.T) { t.Parallel() selector := chain_selectors.TEST_22222222222222222222222222222222222222222222.Selector @@ -273,7 +273,7 @@ func TestSetConfigMCMSV2Solana(t *testing.T) { }) } -func TestValidateV2(t *testing.T) { +func TestUnit_ValidateV2(t *testing.T) { tests.SkipFlakey(t, "https://smartcontract-it.atlassian.net/browse/DX-439") t.Parallel() @@ -514,7 +514,7 @@ func createSolSigner(t *testing.T) (*ecdsa.PrivateKey, common.Address) { return key, crypto.PubkeyToAddress(*publicKey) } -func TestSetConfigMCMSV2Partial(t *testing.T) { +func TestUnit_SetConfigMCMSV2Partial(t *testing.T) { t.Parallel() selector := chain_selectors.TEST_90000001.Selector diff --git a/deployment/common/changeset/solana/fund_mcm_pdas_test.go b/deployment/common/changeset/solana/fund_mcm_pdas_test.go index 9ba8f1ec560..92424c3e573 100644 --- a/deployment/common/changeset/solana/fund_mcm_pdas_test.go +++ b/deployment/common/changeset/solana/fund_mcm_pdas_test.go @@ -22,7 +22,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/common/types" ) -func TestFundMCMSignersChangeset_VerifyPreconditions(t *testing.T) { +func TestUnit_FundMCMSignersChangeset_VerifyPreconditions(t *testing.T) { t.Parallel() selector1 := chainselectors.TEST_22222222222222222222222222222222222222222222.Selector @@ -204,7 +204,7 @@ func TestFundMCMSignersChangeset_VerifyPreconditions(t *testing.T) { } } -func TestFundMCMSignersChangeset_Apply(t *testing.T) { +func TestUnit_FundMCMSignersChangeset_Apply(t *testing.T) { quarantine.Flaky(t, "DX-1776") t.Parallel() diff --git a/deployment/common/changeset/solana/grant_role_timelock_test.go b/deployment/common/changeset/solana/grant_role_timelock_test.go index 45ae52507ed..6d3556ef332 100644 --- a/deployment/common/changeset/solana/grant_role_timelock_test.go +++ b/deployment/common/changeset/solana/grant_role_timelock_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/internal/soltestutils" ) -func TestGrantRoleTimelockSolana(t *testing.T) { +func TestUnit_GrantRoleTimelockSolana(t *testing.T) { t.Skip("fails with Program is not deployed (DoajfR5tK24xVw51fWcawUZWhAXD8yrBJVacc13neVQA) in CI") t.Parallel() diff --git a/deployment/common/changeset/solana/transfer_ownership_test.go b/deployment/common/changeset/solana/transfer_ownership_test.go index 9e6714737f0..619b8668a3e 100644 --- a/deployment/common/changeset/solana/transfer_ownership_test.go +++ b/deployment/common/changeset/solana/transfer_ownership_test.go @@ -21,7 +21,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/internal/soltestutils" ) -func TestTransferToMCMSToTimelockSolana(t *testing.T) { +func TestUnit_TransferToMCMSToTimelockSolana(t *testing.T) { quarantine.Flaky(t, "DX-1773") t.Parallel() diff --git a/deployment/common/changeset/solana/update_delay_timelock_test.go b/deployment/common/changeset/solana/update_delay_timelock_test.go index 4981e484f5c..adf0076018b 100644 --- a/deployment/common/changeset/solana/update_delay_timelock_test.go +++ b/deployment/common/changeset/solana/update_delay_timelock_test.go @@ -22,7 +22,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/common/types" ) -func TestUpdateTimelockDelaySolana_VerifyPreconditions(t *testing.T) { +func TestUnit_UpdateTimelockDelaySolana_VerifyPreconditions(t *testing.T) { t.Parallel() selector1 := chainselectors.TEST_22222222222222222222222222222222222222222222.Selector @@ -124,7 +124,7 @@ func TestUpdateTimelockDelaySolana_VerifyPreconditions(t *testing.T) { } } -func TestUpdateTimelockDelaySolana_Apply(t *testing.T) { +func TestUnit_UpdateTimelockDelaySolana_Apply(t *testing.T) { tests.SkipFlakey(t, "https://smartcontract-it.atlassian.net/browse/DX-762") t.Parallel() diff --git a/deployment/common/changeset/state/evm_test.go b/deployment/common/changeset/state/evm_test.go index d0f4b9f73f2..0e926a9ca7a 100644 --- a/deployment/common/changeset/state/evm_test.go +++ b/deployment/common/changeset/state/evm_test.go @@ -23,7 +23,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/common/types" ) -func TestMCMSWithTimelockState_GenerateMCMSWithTimelockViewV2(t *testing.T) { +func TestUnit_MCMSWithTimelockState_GenerateMCMSWithTimelockViewV2(t *testing.T) { selector := chain_selectors.TEST_90000001.Selector env, err := environment.New(t.Context(), environment.WithEVMSimulated(t, []uint64{selector}), @@ -131,7 +131,7 @@ func TestMCMSWithTimelockState_GenerateMCMSWithTimelockViewV2(t *testing.T) { } } -func TestAddressesForChain(t *testing.T) { +func TestUnit_AddressesForChain(t *testing.T) { chainSelector := chain_selectors.ETHEREUM_MAINNET.Selector t.Run("environment with AddressBook only", func(t *testing.T) { diff --git a/deployment/common/changeset/state/solana_test.go b/deployment/common/changeset/state/solana_test.go index d6cea1f0a2f..98db3ac2d0a 100644 --- a/deployment/common/changeset/state/solana_test.go +++ b/deployment/common/changeset/state/solana_test.go @@ -24,7 +24,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/internal/soltestutils" ) -func TestMCMSWithTimelockState_GenerateMCMSWithTimelockViewSolana(t *testing.T) { +func TestUnit_MCMSWithTimelockState_GenerateMCMSWithTimelockViewSolana(t *testing.T) { tests.SkipFlakey(t, "https://smartcontract-it.atlassian.net/browse/DX-404") t.Parallel() diff --git a/deployment/common/changeset/state_test.go b/deployment/common/changeset/state_test.go index 97c90c7d426..fe07153800e 100644 --- a/deployment/common/changeset/state_test.go +++ b/deployment/common/changeset/state_test.go @@ -18,7 +18,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestMaybeLoadMCMSWithTimelockChainState(t *testing.T) { +func TestUnit_MaybeLoadMCMSWithTimelockChainState(t *testing.T) { type testCase struct { name string chain cldf_evm.Chain diff --git a/deployment/common/changeset/test_helpers_test.go b/deployment/common/changeset/test_helpers_test.go index 5a36599c2e0..17a42634ba2 100644 --- a/deployment/common/changeset/test_helpers_test.go +++ b/deployment/common/changeset/test_helpers_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func TestChangeSetLegacyFunction_PassingCase(t *testing.T) { +func TestUnit_ChangeSetLegacyFunction_PassingCase(t *testing.T) { t.Parallel() e := NewNoopEnvironment(t) @@ -40,7 +40,7 @@ func TestChangeSetLegacyFunction_PassingCase(t *testing.T) { require.NoError(t, err) } -func TestChangeSetLegacyFunction_ErrorCase(t *testing.T) { +func TestUnit_ChangeSetLegacyFunction_ErrorCase(t *testing.T) { t.Parallel() e := NewNoopEnvironment(t) @@ -79,7 +79,7 @@ func NewNoopEnvironment(t *testing.T) cldf.Environment { ) } -func TestApplyChangesetsHelpers(t *testing.T) { +func TestUnit_ApplyChangesetsHelpers(t *testing.T) { t.Parallel() changesets := []ConfiguredChangeSet{ diff --git a/deployment/common/changeset/transfer_to_mcms_with_timelock_test.go b/deployment/common/changeset/transfer_to_mcms_with_timelock_test.go index 43ca6cacaaa..53497a64960 100644 --- a/deployment/common/changeset/transfer_to_mcms_with_timelock_test.go +++ b/deployment/common/changeset/transfer_to_mcms_with_timelock_test.go @@ -26,7 +26,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/common/types" ) -func TestTransferToMCMSWithTimelockV2(t *testing.T) { +func TestUnit_TransferToMCMSWithTimelockV2(t *testing.T) { selector := chain_selectors.TEST_90000001.Selector rt, err := runtime.New(t.Context(), runtime.WithEnvOpts( environment.WithEVMSimulated(t, []uint64{selector}), @@ -90,7 +90,7 @@ func TestTransferToMCMSWithTimelockV2(t *testing.T) { require.Equal(t, chain.DeployerKey.From, o) } -func TestTransferToMCMSWithTimelockV2DataStore(t *testing.T) { +func TestUnit_TransferToMCMSWithTimelockV2DataStore(t *testing.T) { selector := chain_selectors.TEST_90000001.Selector rt, err := runtime.New(t.Context(), runtime.WithEnvOpts( environment.WithEVMSimulated(t, []uint64{selector}), @@ -185,7 +185,7 @@ func TestTransferToMCMSWithTimelockV2DataStore(t *testing.T) { require.Equal(t, chain.DeployerKey.From, o) } -func TestRenounceTimelockDeployerConfigValidate(t *testing.T) { +func TestUnit_RenounceTimelockDeployerConfigValidate(t *testing.T) { tests.SkipFlakey(t, "https://smartcontract-it.atlassian.net/browse/DX-724") t.Parallel() @@ -255,7 +255,7 @@ func TestRenounceTimelockDeployerConfigValidate(t *testing.T) { } } -func TestRenounceTimelockDeployer(t *testing.T) { +func TestUnit_RenounceTimelockDeployer(t *testing.T) { selector := chain_selectors.TEST_90000001.Selector rt, err := runtime.New(t.Context(), runtime.WithEnvOpts( environment.WithEVMSimulated(t, []uint64{selector}), diff --git a/deployment/common/opsutils/evm_test.go b/deployment/common/opsutils/evm_test.go index 4e170841019..59d2fcfc251 100644 --- a/deployment/common/opsutils/evm_test.go +++ b/deployment/common/opsutils/evm_test.go @@ -33,7 +33,7 @@ import ( commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" ) -func TestCloneTransactOptsWithGas(t *testing.T) { +func TestUnit_CloneTransactOptsWithGas(t *testing.T) { t.Parallel() orig := &bind.TransactOpts{ GasLimit: 100, @@ -52,7 +52,7 @@ func TestCloneTransactOptsWithGas(t *testing.T) { assert.Nil(t, opsutils.CloneTransactOptsWithGas(nil, 1, 1)) } -func TestGasBoostConfigsForChainMap(t *testing.T) { +func TestUnit_GasBoostConfigsForChainMap(t *testing.T) { t.Parallel() chainMap := map[uint64]string{1: "a", 2: "b"} gasBoostConfigs := map[uint64]commontypes.GasBoostConfig{ @@ -67,7 +67,7 @@ func TestGasBoostConfigsForChainMap(t *testing.T) { assert.Empty(t, opsutils.GasBoostConfigsForChainMap[string](nil, gasBoostConfigs)) } -func TestGetBoostedGasForAttempt_DefaultsAndOverrides(t *testing.T) { +func TestUnit_GetBoostedGasForAttempt_DefaultsAndOverrides(t *testing.T) { t.Parallel() cfg := commontypes.GasBoostConfig{} limit, price := opsutils.GetBoostedGasForAttempt(cfg, 0) @@ -88,7 +88,7 @@ func TestGetBoostedGasForAttempt_DefaultsAndOverrides(t *testing.T) { assert.Equal(t, uint64(2000+3*100), price) } -func TestRetryDeploymentWithGasBoost(t *testing.T) { +func TestUnit_RetryDeploymentWithGasBoost(t *testing.T) { t.Parallel() cfg := &commontypes.GasBoostConfig{ InitialGasLimit: 1000, @@ -103,7 +103,7 @@ func TestRetryDeploymentWithGasBoost(t *testing.T) { assert.NotNil(t, opsutils.RetryDeploymentWithGasBoost[string](nil)) } -func TestAddEVMCallSequenceToCSOutput_SequenceError(t *testing.T) { +func TestUnit_AddEVMCallSequenceToCSOutput_SequenceError(t *testing.T) { t.Parallel() env, err := environment.New(t.Context(), @@ -131,7 +131,7 @@ func TestAddEVMCallSequenceToCSOutput_SequenceError(t *testing.T) { assert.Equal(t, seqReport.ExecutionReports, result.Reports) } -func TestAddEVMCallSequenceToCSOutput_NoMCMS(t *testing.T) { +func TestUnit_AddEVMCallSequenceToCSOutput_NoMCMS(t *testing.T) { t.Parallel() env, err := environment.New(t.Context(), @@ -156,7 +156,7 @@ func TestAddEVMCallSequenceToCSOutput_NoMCMS(t *testing.T) { assert.Equal(t, seqReport.ExecutionReports, result.Reports) } -func TestAddEVMCallSequenceToCSOutput_AllConfirmed(t *testing.T) { +func TestUnit_AddEVMCallSequenceToCSOutput_AllConfirmed(t *testing.T) { t.Parallel() env, err := environment.New(t.Context(), @@ -183,7 +183,7 @@ func TestAddEVMCallSequenceToCSOutput_AllConfirmed(t *testing.T) { assert.Nil(t, result.MCMSTimelockProposals) } -func TestAddEVMCallSequenceToCSOutput_ProposalCombination(t *testing.T) { +func TestIntegration_Shared_AddEVMCallSequenceToCSOutput_ProposalCombination(t *testing.T) { t.Parallel() deployedEnvironment, _ := testhelpers.NewMemoryEnvironment( t, @@ -290,7 +290,7 @@ func TestAddEVMCallSequenceToCSOutput_ProposalCombination(t *testing.T) { "Aggregated proposal should contain operations") } -func TestNewEVMCallOperation(t *testing.T) { +func TestUnit_NewEVMCallOperation(t *testing.T) { t.Parallel() version, _ := semver.NewVersion("1.0.0") @@ -436,7 +436,7 @@ func TestNewEVMCallOperation(t *testing.T) { }) } -func TestContractOpts_Validate(t *testing.T) { +func TestUnit_ContractOpts_Validate(t *testing.T) { tests := []struct { desc string opts *opsutils.ContractOpts @@ -494,7 +494,7 @@ func TestContractOpts_Validate(t *testing.T) { } } -func TestNewEVMDeployOperation(t *testing.T) { +func TestUnit_NewEVMDeployOperation(t *testing.T) { t.Parallel() contractType := cldf.ContractType("TestContract") version, _ := semver.NewVersion("1.0.0") diff --git a/deployment/common/proposalutils/analyze_test.go b/deployment/common/proposalutils/analyze_test.go index 5096877ad7c..29d119bdc43 100644 --- a/deployment/common/proposalutils/analyze_test.go +++ b/deployment/common/proposalutils/analyze_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/rmn_home" ) -func Test_AnalyzeRmnHomeSetConfig(t *testing.T) { +func TestUnit_AnalyzeRmnHomeSetConfig(t *testing.T) { dataEncoded := "EY26xQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA+mHAtKPceHWHsUU/gZ3gbQUSqxoUZSI6A1wsufMtT1Ds0lEhXpCRE0bKF15QNbgZoIwngeB5DppZ27p+FxzwtFJl4urMXKidA5eY8JSHVPtI1h4ZiTOwbcUx4ju2t4QG2jZ8/J045hVKKkjqbrOPTnFXdd4sYe0Egs4TMSMiShZgAHkr6j6Bhgz3+4p0ob33+C3inZ/H6HxUrzaTVNBUGFa+O4yMWpkJ/FppF/cGzqRqFrEWePBy5HGnhxR8MH8IQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3kG6T8nZGtkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAzPCjGiIfPJsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMEYRtq/7p2oAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" data := make([]byte, base64.StdEncoding.DecodedLen(len(dataEncoded))) _, err := base64.StdEncoding.Decode(data, []byte(dataEncoded)) diff --git a/deployment/common/proposalutils/propose_test.go b/deployment/common/proposalutils/propose_test.go index 77bad4caa17..001ce6b667c 100644 --- a/deployment/common/proposalutils/propose_test.go +++ b/deployment/common/proposalutils/propose_test.go @@ -27,7 +27,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/internal/soltestutils" ) -func TestBuildProposalFromBatchesV2(t *testing.T) { +func TestUnit_BuildProposalFromBatchesV2(t *testing.T) { quarantine.Flaky(t, "DX-1824") t.Parallel() diff --git a/deployment/common/view/nops_test.go b/deployment/common/view/nops_test.go index e891335a075..7c7e7b2dbe0 100644 --- a/deployment/common/view/nops_test.go +++ b/deployment/common/view/nops_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) -func TestGenerateNopsView(t *testing.T) { +func TestUnit_GenerateNopsView(t *testing.T) { t.Parallel() lggr := logger.Test(t) // Create 3 node IDs diff --git a/deployment/common/view/v1_0/capreg_test.go b/deployment/common/view/v1_0/capreg_test.go index 4321f83d488..6732e3271b5 100644 --- a/deployment/common/view/v1_0/capreg_test.go +++ b/deployment/common/view/v1_0/capreg_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/common/view/types" ) -func TestCapRegView_Denormalize(t *testing.T) { +func TestUnit_CapRegView_Denormalize(t *testing.T) { type fields struct { ContractMetaData types.ContractMetaData Capabilities []CapabilityView diff --git a/deployment/common/view/v1_0/link_token_test.go b/deployment/common/view/v1_0/link_token_test.go index 062388966b1..47236f7b209 100644 --- a/deployment/common/view/v1_0/link_token_test.go +++ b/deployment/common/view/v1_0/link_token_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" ) -func TestLinkTokenView(t *testing.T) { +func TestUnit_LinkTokenView(t *testing.T) { selector := chainselectors.TEST_90000001.Selector env, err := environment.New(t.Context(), environment.WithEVMSimulated(t, []uint64{selector}), @@ -32,7 +32,7 @@ func TestLinkTokenView(t *testing.T) { testLinkTokenViewWithChain(t, chain, lt) } -func TestLinkTokenViewZk(t *testing.T) { +func TestUnit_LinkTokenViewZk(t *testing.T) { // Timeouts in CI tests.SkipFlakey(t, "https://smartcontract-it.atlassian.net/browse/CCIP-6427") diff --git a/deployment/common/view/v1_0/static_link_token_test.go b/deployment/common/view/v1_0/static_link_token_test.go index 350698d72c5..e796684c4fe 100644 --- a/deployment/common/view/v1_0/static_link_token_test.go +++ b/deployment/common/view/v1_0/static_link_token_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/link_token_interface" ) -func TestStaticLinkTokenView(t *testing.T) { +func TestUnit_StaticLinkTokenView(t *testing.T) { selector := chain_selectors.TEST_90000001.Selector env, err := environment.New(t.Context(), environment.WithEVMSimulated(t, []uint64{selector}), diff --git a/deployment/common/view/v1_0/workflowreg_test.go b/deployment/common/view/v1_0/workflowreg_test.go index 35e6b92da40..e61007a8911 100644 --- a/deployment/common/view/v1_0/workflowreg_test.go +++ b/deployment/common/view/v1_0/workflowreg_test.go @@ -15,7 +15,7 @@ import ( ) // TestNewWorkflowView tests the helper function that converts on-chain WorkflowMetadata -> WorkflowView. -func TestNewWorkflowView(t *testing.T) { +func TestUnit_NewWorkflowView(t *testing.T) { t.Run("nil input => error", func(t *testing.T) { // Updated: nil input now returns an error. wv, err := NewWorkflowView(nil) @@ -53,7 +53,7 @@ func TestNewWorkflowView(t *testing.T) { } // TestGenerateWorkflowRegistryView uses a mock workflow registry to test the main view generation function. -func TestGenerateWorkflowRegistryView(t *testing.T) { +func TestUnit_GenerateWorkflowRegistryView(t *testing.T) { tests := []struct { name string mockSetup func(*mocks.WorkflowRegistryInterface) @@ -170,7 +170,7 @@ func TestGenerateWorkflowRegistryView(t *testing.T) { } } -func TestWorkflowStatus_MarshalUnmarshal(t *testing.T) { +func TestUnit_WorkflowStatus_MarshalUnmarshal(t *testing.T) { tests := []struct { name string ws WorkflowStatus diff --git a/deployment/common/view/v2_0/capreg_test.go b/deployment/common/view/v2_0/capreg_test.go index 9f636239e6e..73882910994 100644 --- a/deployment/common/view/v2_0/capreg_test.go +++ b/deployment/common/view/v2_0/capreg_test.go @@ -23,7 +23,7 @@ type fields struct { Nops []v2_0.NopView } -func TestCapRegView_Denormalize(t *testing.T) { +func TestUnit_CapRegView_Denormalize(t *testing.T) { donConfig := map[string]any{ "defaultConfig": map[string]any{}, } diff --git a/deployment/cre/capabilities_registry/v2/changeset/add_capabilities_test.go b/deployment/cre/capabilities_registry/v2/changeset/add_capabilities_test.go index b00fff83995..7d304756216 100644 --- a/deployment/cre/capabilities_registry/v2/changeset/add_capabilities_test.go +++ b/deployment/cre/capabilities_registry/v2/changeset/add_capabilities_test.go @@ -68,7 +68,7 @@ var ( } ) -func TestAddCapabilities_VerifyPreconditions(t *testing.T) { +func TestUnit_AddCapabilities_VerifyPreconditions(t *testing.T) { cs := changeset.AddCapabilities{} env := test.SetupEnvV2(t, false) @@ -187,7 +187,7 @@ func requireCapability(t *testing.T, fixture *test.EnvWrapperV2, capID string) { require.True(t, cfgFound, "expected don to have %s capability configuration", capID) } -func TestAddCapabilities_Apply(t *testing.T) { +func TestUnit_AddCapabilities_Apply(t *testing.T) { // SetupEnvV2 deploys a cap reg v2 and configures it. So no need to do that here, just leverage the existing one. fixture := test.SetupEnvV2(t, false) @@ -200,7 +200,7 @@ func TestAddCapabilities_Apply(t *testing.T) { requireCapability(t, fixture, anotherCapID) } -func TestAddCapabilities_Apply_MCMS(t *testing.T) { +func TestUnit_AddCapabilities_Apply_MCMS(t *testing.T) { // SetupEnvV2 deploys a cap reg v2 and configures it. So no need to do that here, just leverage the existing one. fixture := test.SetupEnvV2(t, true) diff --git a/deployment/cre/capabilities_registry/v2/changeset/configure_capabilities_registry_test.go b/deployment/cre/capabilities_registry/v2/changeset/configure_capabilities_registry_test.go index 6c340e1712a..fdc751b9a7f 100644 --- a/deployment/cre/capabilities_registry/v2/changeset/configure_capabilities_registry_test.go +++ b/deployment/cre/capabilities_registry/v2/changeset/configure_capabilities_registry_test.go @@ -48,7 +48,7 @@ const ( nodeID1 = "1" ) -func TestConfigureCapabilitiesRegistry(t *testing.T) { +func TestUnit_ConfigureCapabilitiesRegistry(t *testing.T) { t.Parallel() t.Run("select by address", func(t *testing.T) { @@ -128,7 +128,7 @@ func suite(t *testing.T, fixture *testFixture) { }) } -func TestConfigureCapabilitiesRegistryInput_YAMLSerialization(t *testing.T) { +func TestUnit_ConfigureCapabilitiesRegistryInput_YAMLSerialization(t *testing.T) { originalInput := changeset.ConfigureCapabilitiesRegistryInput{ ChainSelector: 123456789, CapabilitiesRegistryAddress: "0x1234567890123456789012345678901234567890", @@ -278,7 +278,7 @@ func TestConfigureCapabilitiesRegistryInput_YAMLSerialization(t *testing.T) { }) } -func TestConfigureCapabilitiesRegistryInput_YAMLFromFile(t *testing.T) { +func TestUnit_ConfigureCapabilitiesRegistryInput_YAMLFromFile(t *testing.T) { yamlConfig := ` chainSelector: 421614 capabilitiesRegistryAddress: "0x1234567890123456789012345678901234567890" diff --git a/deployment/cre/capabilities_registry/v2/changeset/delete_don_test.go b/deployment/cre/capabilities_registry/v2/changeset/delete_don_test.go index 5009d3a6fc9..698d8627ad8 100644 --- a/deployment/cre/capabilities_registry/v2/changeset/delete_don_test.go +++ b/deployment/cre/capabilities_registry/v2/changeset/delete_don_test.go @@ -161,7 +161,7 @@ func setupRegistryForDeleteDON(t *testing.T, secondDON bool) *delFixture { } } -func TestDeleteDONChangeset_ByName_Direct_Succeeds(t *testing.T) { +func TestUnit_DeleteDONChangeset_ByName_Direct_Succeeds(t *testing.T) { t.Parallel() fx := setupRegistryForDeleteDON(t, false) @@ -183,7 +183,7 @@ func TestDeleteDONChangeset_ByName_Direct_Succeeds(t *testing.T) { require.Error(t, err) } -func TestDeleteDONChangeset_ByNames_Multi_Succeeds(t *testing.T) { +func TestUnit_DeleteDONChangeset_ByNames_Multi_Succeeds(t *testing.T) { t.Parallel() fx := setupRegistryForDeleteDON(t, true) @@ -208,7 +208,7 @@ func TestDeleteDONChangeset_ByNames_Multi_Succeeds(t *testing.T) { } } -func TestDeleteDONChangeset_VerifyPreconditions_EmptyList(t *testing.T) { +func TestUnit_DeleteDONChangeset_VerifyPreconditions_EmptyList(t *testing.T) { t.Parallel() var cs changeset.DeleteDONs err := cs.VerifyPreconditions(cldf.Environment{}, changeset.DeleteDONsInput{ @@ -220,7 +220,7 @@ func TestDeleteDONChangeset_VerifyPreconditions_EmptyList(t *testing.T) { assert.Contains(t, err.Error(), "must provide at least one DON name") } -func TestDeleteDONChangeset_Apply_MissingDON_Fails(t *testing.T) { +func TestUnit_DeleteDONChangeset_Apply_MissingDON_Fails(t *testing.T) { t.Parallel() selector := chainselectors.TEST_90000001.Selector @@ -248,7 +248,7 @@ func TestDeleteDONChangeset_Apply_MissingDON_Fails(t *testing.T) { // Avoid asserting specific substrings to keep this robust across ABI/runtime changes. } -func TestDeleteDONChangeset_ChainNotFound(t *testing.T) { +func TestUnit_DeleteDONChangeset_ChainNotFound(t *testing.T) { t.Parallel() rt, err := runtime.New(t.Context(), runtime.WithEnvOpts( @@ -265,7 +265,7 @@ func TestDeleteDONChangeset_ChainNotFound(t *testing.T) { assert.Contains(t, err.Error(), "chain not found for selector") } -func TestDeleteDONChangeset_QualifierNotFound(t *testing.T) { +func TestUnit_DeleteDONChangeset_QualifierNotFound(t *testing.T) { t.Parallel() selector := chainselectors.TEST_90000001.Selector @@ -284,7 +284,7 @@ func TestDeleteDONChangeset_QualifierNotFound(t *testing.T) { assert.Contains(t, err.Error(), "failed to get registry address") } -func TestDeleteDON_MCMS_Configuration(t *testing.T) { +func TestUnit_DeleteDON_MCMS_Configuration(t *testing.T) { t.Parallel() fx := setupRegistryForDeleteDON(t, false) diff --git a/deployment/cre/capabilities_registry/v2/changeset/deploy_capabilities_registry_test.go b/deployment/cre/capabilities_registry/v2/changeset/deploy_capabilities_registry_test.go index 097ef66b2d8..0182cbe2827 100644 --- a/deployment/cre/capabilities_registry/v2/changeset/deploy_capabilities_registry_test.go +++ b/deployment/cre/capabilities_registry/v2/changeset/deploy_capabilities_registry_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" ) -func TestDeployCapabilitiesRegistry(t *testing.T) { +func TestUnit_DeployCapabilitiesRegistry(t *testing.T) { t.Parallel() selector := chainselectors.TEST_90000001.Selector diff --git a/deployment/cre/capabilities_registry/v2/changeset/multiple_mcms_test.go b/deployment/cre/capabilities_registry/v2/changeset/multiple_mcms_test.go index a9ad5313a30..239894623f3 100644 --- a/deployment/cre/capabilities_registry/v2/changeset/multiple_mcms_test.go +++ b/deployment/cre/capabilities_registry/v2/changeset/multiple_mcms_test.go @@ -22,7 +22,7 @@ import ( // TestMultipleMCMSDeploymentsConflict demonstrates the gap where GetMCMSContracts // cannot distinguish between multiple MCMS deployments on the same chain -func TestMultipleMCMSDeploymentsConflict(t *testing.T) { +func TestUnit_MultipleMCMSDeploymentsConflict(t *testing.T) { t.Parallel() selector := chainselectors.TEST_90000001.Selector diff --git a/deployment/cre/capabilities_registry/v2/changeset/pkg/bytes_test.go b/deployment/cre/capabilities_registry/v2/changeset/pkg/bytes_test.go index 50c09955ca8..04ad863d05d 100644 --- a/deployment/cre/capabilities_registry/v2/changeset/pkg/bytes_test.go +++ b/deployment/cre/capabilities_registry/v2/changeset/pkg/bytes_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestHexStringTo32Bytes(t *testing.T) { +func TestUnit_HexStringTo32Bytes(t *testing.T) { t.Run("valid hex string with 0x prefix", func(t *testing.T) { hexStr := "0x0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20" expected := [32]byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20} diff --git a/deployment/cre/capabilities_registry/v2/changeset/pkg/capability_config_test.go b/deployment/cre/capabilities_registry/v2/changeset/pkg/capability_config_test.go index 60b8ce5549c..0ff499c85f0 100644 --- a/deployment/cre/capabilities_registry/v2/changeset/pkg/capability_config_test.go +++ b/deployment/cre/capabilities_registry/v2/changeset/pkg/capability_config_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/cre/capabilities_registry/v2/changeset/pkg" ) -func TestCapabilityConfig_MarshalUnmarshal(t *testing.T) { +func TestUnit_CapabilityConfig_MarshalUnmarshal(t *testing.T) { t.Parallel() t.Run("matching keys to proto", func(t *testing.T) { @@ -54,7 +54,7 @@ func TestCapabilityConfig_MarshalUnmarshal(t *testing.T) { }) } -func TestCapabilityConfig_UnmarshalWithValidation(t *testing.T) { +func TestUnit_CapabilityConfig_UnmarshalWithValidation(t *testing.T) { t.Parallel() t.Run("unknown fields are detected and reported", func(t *testing.T) { diff --git a/deployment/cre/capabilities_registry/v2/changeset/set_dons_families_test.go b/deployment/cre/capabilities_registry/v2/changeset/set_dons_families_test.go index 4c6e90d0039..32107f80a25 100644 --- a/deployment/cre/capabilities_registry/v2/changeset/set_dons_families_test.go +++ b/deployment/cre/capabilities_registry/v2/changeset/set_dons_families_test.go @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) -func TestSetDONsFamilies_VerifyPreconditions(t *testing.T) { +func TestUnit_SetDONsFamilies_VerifyPreconditions(t *testing.T) { cs := changeset.SetDONsFamilies{} env := test.SetupEnvV2(t, false) @@ -53,7 +53,7 @@ func TestSetDONsFamilies_VerifyPreconditions(t *testing.T) { }) } -func TestSetDONsFamilies_Apply(t *testing.T) { +func TestUnit_SetDONsFamilies_Apply(t *testing.T) { cs := changeset.SetDONsFamilies{} env := test.SetupEnvV2(t, false) diff --git a/deployment/cre/capabilities_registry/v2/changeset/update_don_test.go b/deployment/cre/capabilities_registry/v2/changeset/update_don_test.go index 3e4637d543a..fb6da7d4d63 100644 --- a/deployment/cre/capabilities_registry/v2/changeset/update_don_test.go +++ b/deployment/cre/capabilities_registry/v2/changeset/update_don_test.go @@ -205,7 +205,7 @@ func setupRegistryForUpdateDON(t *testing.T, isWorkflow, useMCMS bool) *updFixtu } // Happy path: non-workflow DON; also renames the DON; capability config updated; visibility/F preserved. -func TestUpdateDONChangeset_ByName_Direct_Succeeds(t *testing.T) { +func TestUnit_UpdateDONChangeset_ByName_Direct_Succeeds(t *testing.T) { t.Parallel() fx := setupRegistryForUpdateDON(t /*isWorkflow=*/, false, false) @@ -254,7 +254,7 @@ func TestUpdateDONChangeset_ByName_Direct_Succeeds(t *testing.T) { assert.Equal(t, wantProto, got.CapabilityConfigurations[0].Config) } -func TestUpdateDONChangeset_ByName_Direct_Succeeds_MCMS(t *testing.T) { +func TestUnit_UpdateDONChangeset_ByName_Direct_Succeeds_MCMS(t *testing.T) { t.Parallel() fx := setupRegistryForUpdateDON(t /*isWorkflow=*/, false, true) @@ -295,7 +295,7 @@ func TestUpdateDONChangeset_ByName_Direct_Succeeds_MCMS(t *testing.T) { } // Safety gate: workflow DON should refuse without Force=true (changeset passes Force through to operation). -func TestUpdateDONChangeset_ByName_Workflow_RefusesWithoutForce(t *testing.T) { +func TestUnit_UpdateDONChangeset_ByName_Workflow_RefusesWithoutForce(t *testing.T) { t.Parallel() fx := setupRegistryForUpdateDON(t /*isWorkflow=*/, true, false) @@ -313,7 +313,7 @@ func TestUpdateDONChangeset_ByName_Workflow_RefusesWithoutForce(t *testing.T) { } // Force override: workflow DON update succeeds when Force=true. -func TestUpdateDONChangeset_ByName_Workflow_Force_Succeeds(t *testing.T) { +func TestUnit_UpdateDONChangeset_ByName_Workflow_Force_Succeeds(t *testing.T) { t.Parallel() fx := setupRegistryForUpdateDON(t /*isWorkflow=*/, true, false) @@ -352,7 +352,7 @@ func TestUpdateDONChangeset_ByName_Workflow_Force_Succeeds(t *testing.T) { // VerifyPreconditions: empty Name is rejected. // NOTE: current implementation returns "must provide a non-empty DONName" -func TestUpdateDONChangeset_VerifyPreconditions_EmptyName(t *testing.T) { +func TestUnit_UpdateDONChangeset_VerifyPreconditions_EmptyName(t *testing.T) { t.Parallel() var cs changeset.UpdateDON err := cs.VerifyPreconditions(cldf.Environment{}, changeset.UpdateDONInput{ @@ -365,7 +365,7 @@ func TestUpdateDONChangeset_VerifyPreconditions_EmptyName(t *testing.T) { } // Chain not found: Apply should fail early with a clear message. -func TestUpdateDONChangeset_ByName_ChainNotFound(t *testing.T) { +func TestUnit_UpdateDONChangeset_ByName_ChainNotFound(t *testing.T) { t.Parallel() // Env with no chains (or use a selector not present in env) @@ -385,7 +385,7 @@ func TestUpdateDONChangeset_ByName_ChainNotFound(t *testing.T) { } // Qualifier not found in DataStore: Apply should fail when it cannot look up the registry address. -func TestUpdateDONChangeset_ByName_QualifierNotFound(t *testing.T) { +func TestUnit_UpdateDONChangeset_ByName_QualifierNotFound(t *testing.T) { t.Parallel() selector := chainselectors.TEST_90000001.Selector diff --git a/deployment/cre/common/strategies/mcms_transaction_test.go b/deployment/cre/common/strategies/mcms_transaction_test.go index cc7ccad1dc0..54c3836f202 100644 --- a/deployment/cre/common/strategies/mcms_transaction_test.go +++ b/deployment/cre/common/strategies/mcms_transaction_test.go @@ -32,7 +32,7 @@ func getMCMSTransaction(t *testing.T, env deployment.Environment) *strategies.MC } } -func TestMCMSTransaction_BuildProposal(t *testing.T) { +func TestUnit_MCMSTransaction_BuildProposal(t *testing.T) { t.Parallel() fixture := test.SetupEnvV2(t, true) diff --git a/deployment/cre/contracts/contracts_test.go b/deployment/cre/contracts/contracts_test.go index a273f3e43d6..49ca4d7934a 100644 --- a/deployment/cre/contracts/contracts_test.go +++ b/deployment/cre/contracts/contracts_test.go @@ -31,7 +31,7 @@ import ( capabilities_registry "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" ) -func TestGetOwnableContractV2(t *testing.T) { +func TestUnit_GetOwnableContractV2(t *testing.T) { t.Parallel() v1 := semver.MustParse("1.1.0") @@ -97,7 +97,7 @@ func TestGetOwnableContractV2(t *testing.T) { }) } -func TestGetOwnerTypeAndVersionV2(t *testing.T) { +func TestUnit_GetOwnerTypeAndVersionV2(t *testing.T) { t.Parallel() selector := chainsel.TEST_90000001.Selector @@ -186,7 +186,7 @@ func TestGetOwnerTypeAndVersionV2(t *testing.T) { }) } -func TestNewOwnableV2(t *testing.T) { +func TestUnit_NewOwnableV2(t *testing.T) { t.Parallel() selector := chainsel.TEST_90000001.Selector @@ -294,7 +294,7 @@ func TestNewOwnableV2(t *testing.T) { }) } -func TestGetOwnedContractV2(t *testing.T) { +func TestUnit_GetOwnedContractV2(t *testing.T) { t.Parallel() selector := chainsel.TEST_90000001.Selector diff --git a/deployment/cre/forwarder/configure_test.go b/deployment/cre/forwarder/configure_test.go index e9bc1bed568..65798a24daf 100644 --- a/deployment/cre/forwarder/configure_test.go +++ b/deployment/cre/forwarder/configure_test.go @@ -18,7 +18,7 @@ import ( changeset3 "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" ) -func TestConfigureForwardersSeq(t *testing.T) { +func TestUnit_ConfigureForwardersSeq(t *testing.T) { envWrapper, donConfig := setupForwarderTest(t, false) env := envWrapper.Env @@ -39,7 +39,7 @@ func TestConfigureForwardersSeq(t *testing.T) { require.NotNil(t, output.Output.Config, "should have configuration") } -func TestConfigureForwarders(t *testing.T) { +func TestUnit_ConfigureForwarders(t *testing.T) { envWrapper, donConfig := setupForwarderTest(t, false) env := envWrapper.Env registryChainSel := envWrapper.RegistrySelector @@ -60,7 +60,7 @@ func TestConfigureForwarders(t *testing.T) { require.Empty(t, changesetOutput.MCMSTimelockProposals, "should not have MCMS proposals when not using MCMS") } -func TestConfigureForwarders_WithMCMS(t *testing.T) { +func TestUnit_ConfigureForwarders_WithMCMS(t *testing.T) { envWrapper, donConfig := setupForwarderTest(t, true) env := envWrapper.Env registryChainSel := envWrapper.RegistrySelector @@ -86,7 +86,7 @@ func TestConfigureForwarders_WithMCMS(t *testing.T) { require.NotEmpty(t, changesetOutput.MCMSTimelockProposals, "should have MCMS proposals when using MCMS") } -func TestConfigureForwarders_SpecificChains(t *testing.T) { +func TestUnit_ConfigureForwarders_SpecificChains(t *testing.T) { // This test needs a custom setup to deploy to multiple chains first envWrapper := test.SetupEnvV2(t, false) env := envWrapper.Env diff --git a/deployment/cre/jobs/operations/propose_gateway_job_test.go b/deployment/cre/jobs/operations/propose_gateway_job_test.go index 08a478ac4ea..2ed081863de 100644 --- a/deployment/cre/jobs/operations/propose_gateway_job_test.go +++ b/deployment/cre/jobs/operations/propose_gateway_job_test.go @@ -127,7 +127,7 @@ var commonInput = ProposeGatewayJobInput{ JobLabels: map[string]string{}, } -func TestProposeGatewayJob(t *testing.T) { +func TestUnit_ProposeGatewayJob(t *testing.T) { t.Parallel() testCases := []struct { diff --git a/deployment/cre/jobs/pkg/cre_settings_job_test.go b/deployment/cre/jobs/pkg/cre_settings_job_test.go index 5782de7201a..53d6ee80e0e 100644 --- a/deployment/cre/jobs/pkg/cre_settings_job_test.go +++ b/deployment/cre/jobs/pkg/cre_settings_job_test.go @@ -8,7 +8,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/cresettings" ) -func TestCRESettingsJob_ResolveJob(t *testing.T) { +func TestUnit_CRESettingsJob_ResolveJob(t *testing.T) { tests := []struct { name string settings string diff --git a/deployment/cre/jobs/pkg/gateway_job_test.go b/deployment/cre/jobs/pkg/gateway_job_test.go index e30e81ddf66..b5f0cfc4713 100644 --- a/deployment/cre/jobs/pkg/gateway_job_test.go +++ b/deployment/cre/jobs/pkg/gateway_job_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestGateway_Validate(t *testing.T) { +func TestUnit_Gateway_Validate(t *testing.T) { t.Parallel() g := GatewayJob{} @@ -325,7 +325,7 @@ WriteTimeoutMillis = 16000 ` ) -func TestGateway_Resolve(t *testing.T) { +func TestUnit_Gateway_Resolve(t *testing.T) { t.Parallel() g := GatewayJob{ @@ -385,7 +385,7 @@ func TestGateway_Resolve(t *testing.T) { assert.Equal(t, expected, spec) } -func TestGateway_Resolve_WithVaultHandler(t *testing.T) { +func TestUnit_Gateway_Resolve_WithVaultHandler(t *testing.T) { t.Parallel() g := GatewayJob{ @@ -447,7 +447,7 @@ func TestGateway_Resolve_WithVaultHandler(t *testing.T) { assert.Equal(t, expectedWithVault, spec) } -func TestGateway_Resolve_WithHTTPCapabilitiesHandler(t *testing.T) { +func TestUnit_Gateway_Resolve_WithHTTPCapabilitiesHandler(t *testing.T) { t.Parallel() g := GatewayJob{ diff --git a/deployment/cre/jobs/pkg/std_cap_test.go b/deployment/cre/jobs/pkg/std_cap_test.go index 4b37852dba7..f9f85cba28e 100644 --- a/deployment/cre/jobs/pkg/std_cap_test.go +++ b/deployment/cre/jobs/pkg/std_cap_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/cre/jobs/pkg" ) -func TestStdCap_Validate(t *testing.T) { +func TestUnit_StdCap_Validate(t *testing.T) { t.Parallel() tests := []struct { @@ -73,7 +73,7 @@ config = """{"proxyMode": "direct"}""" ` ) -func TestStdCap_Resolve(t *testing.T) { +func TestUnit_StdCap_Resolve(t *testing.T) { t.Parallel() tests := []struct { diff --git a/deployment/cre/jobs/propose_evm_cap_test.go b/deployment/cre/jobs/propose_evm_cap_test.go index 5b8ff6d3801..00072fd3241 100644 --- a/deployment/cre/jobs/propose_evm_cap_test.go +++ b/deployment/cre/jobs/propose_evm_cap_test.go @@ -75,7 +75,7 @@ func seedAddressesForSelector(t *testing.T, ds *datastore.MemoryDataStore, sel u })) } -func TestProposeEVMCapJobSpec_VerifyPreconditions_success(t *testing.T) { +func TestUnit_ProposeEVMCapJobSpec_VerifyPreconditions_success(t *testing.T) { var env cldf.Environment ds := datastore.NewMemoryDataStore() @@ -105,7 +105,7 @@ func TestProposeEVMCapJobSpec_VerifyPreconditions_success(t *testing.T) { require.NoError(t, err) } -func TestProposeEVMCapJobSpec_VerifyPreconditions_requiredFields(t *testing.T) { +func TestUnit_ProposeEVMCapJobSpec_VerifyPreconditions_requiredFields(t *testing.T) { var env cldf.Environment ds := datastore.NewMemoryDataStore() selector := chainsel.ETHEREUM_TESTNET_SEPOLIA.Selector @@ -144,7 +144,7 @@ func TestProposeEVMCapJobSpec_VerifyPreconditions_requiredFields(t *testing.T) { } } -func TestProposeEVMCapJobSpec_VerifyPreconditions_missingAddresses(t *testing.T) { +func TestUnit_ProposeEVMCapJobSpec_VerifyPreconditions_missingAddresses(t *testing.T) { var env cldf.Environment ds := datastore.NewMemoryDataStore() selector := chainsel.ETHEREUM_TESTNET_SEPOLIA.Selector @@ -181,7 +181,7 @@ func TestProposeEVMCapJobSpec_VerifyPreconditions_missingAddresses(t *testing.T) assert.Contains(t, err.Error(), "failed to get CRE forwarder address") } -func TestProposeEVMCapJobSpec_VerifyPreconditions_mismatchAndMinimums(t *testing.T) { +func TestUnit_ProposeEVMCapJobSpec_VerifyPreconditions_mismatchAndMinimums(t *testing.T) { var env cldf.Environment ds := datastore.NewMemoryDataStore() chain := chainsel.ETHEREUM_TESTNET_SEPOLIA @@ -255,7 +255,7 @@ func TestProposeEVMCapJobSpec_VerifyPreconditions_mismatchAndMinimums(t *testing }) } -func TestProposeEVMCapJobSpec_Apply_success(t *testing.T) { +func TestUnit_ProposeEVMCapJobSpec_Apply_success(t *testing.T) { testEnv := test.SetupEnvV2(t, false) env := testEnv.Env @@ -311,7 +311,7 @@ func TestProposeEVMCapJobSpec_Apply_success(t *testing.T) { assert.Len(t, out.Reports, 1) } -func TestProposeEVMCapJobSpec_Apply_duplicateNodeIDs(t *testing.T) { +func TestUnit_ProposeEVMCapJobSpec_Apply_duplicateNodeIDs(t *testing.T) { testEnv := test.SetupEnvV2(t, false) env := testEnv.Env diff --git a/deployment/cre/jobs/propose_job_spec_test.go b/deployment/cre/jobs/propose_job_spec_test.go index 7670c01e8de..3995f1fcd6c 100644 --- a/deployment/cre/jobs/propose_job_spec_test.go +++ b/deployment/cre/jobs/propose_job_spec_test.go @@ -29,7 +29,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/cre/test" ) -func TestProposeJobSpec_VerifyPreconditions(t *testing.T) { +func TestUnit_ProposeJobSpec_VerifyPreconditions(t *testing.T) { j := jobs.ProposeJobSpec{} var env cldf.Environment @@ -262,7 +262,7 @@ func TestProposeJobSpec_VerifyPreconditions(t *testing.T) { } } -func TestProposeJobSpec_VerifyPreconditions_EVM(t *testing.T) { +func TestUnit_ProposeJobSpec_VerifyPreconditions_EVM(t *testing.T) { j := jobs.ProposeJobSpec{} var env cldf.Environment @@ -438,7 +438,7 @@ func TestProposeJobSpec_VerifyPreconditions_EVM(t *testing.T) { } } -func TestProposeJobSpec_Apply(t *testing.T) { +func TestUnit_ProposeJobSpec_Apply(t *testing.T) { testEnv := test.SetupEnvV2(t, false) env := testEnv.Env @@ -1687,7 +1687,7 @@ PerSenderBurst = 100 }) } -func TestProposeJobSpec_VerifyPreconditions_CRESettings(t *testing.T) { +func TestUnit_ProposeJobSpec_VerifyPreconditions_CRESettings(t *testing.T) { allDefault, err := toml.Marshal(map[string]any{ "global": cresettings.Default, "org": map[string]any{"org_foo": cresettings.Default}, diff --git a/deployment/cre/jobs/propose_std_cap_test.go b/deployment/cre/jobs/propose_std_cap_test.go index 1c147cd27fb..4452d98f4db 100644 --- a/deployment/cre/jobs/propose_std_cap_test.go +++ b/deployment/cre/jobs/propose_std_cap_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/cre/test" ) -func TestProposeStandardCapabilityJob_VerifyPreconditions(t *testing.T) { +func TestUnit_ProposeStandardCapabilityJob_VerifyPreconditions(t *testing.T) { j := jobs.ProposeStandardCapabilityJob{} var env cldf.Environment @@ -51,7 +51,7 @@ func TestProposeStandardCapabilityJob_VerifyPreconditions(t *testing.T) { require.NoError(t, err) } -func TestProposeStandardCapabilityJob_Apply(t *testing.T) { +func TestUnit_ProposeStandardCapabilityJob_Apply(t *testing.T) { testEnv := test.SetupEnvV2(t, false) // Build minimal environment @@ -78,7 +78,7 @@ func TestProposeStandardCapabilityJob_Apply(t *testing.T) { assert.Len(t, reqs, 4) } -func TestProposeStandardCapabilityJob_Apply_HTTPTrigger(t *testing.T) { +func TestUnit_ProposeStandardCapabilityJob_Apply_HTTPTrigger(t *testing.T) { testEnv := test.SetupEnvV2(t, false) env := testEnv.Env @@ -115,7 +115,7 @@ func TestProposeStandardCapabilityJob_Apply_HTTPTrigger(t *testing.T) { } } -func TestProposeStandardCapabilityJob_Apply_HTTPAction(t *testing.T) { +func TestUnit_ProposeStandardCapabilityJob_Apply_HTTPAction(t *testing.T) { testEnv := test.SetupEnvV2(t, false) env := testEnv.Env @@ -152,7 +152,7 @@ func TestProposeStandardCapabilityJob_Apply_HTTPAction(t *testing.T) { } } -func TestProposeStandardCapabilityJob_VerifyPreconditions_HTTPJobs(t *testing.T) { +func TestUnit_ProposeStandardCapabilityJob_VerifyPreconditions_HTTPJobs(t *testing.T) { j := jobs.ProposeStandardCapabilityJob{} var env cldf.Environment diff --git a/deployment/cre/jobs/types/job_spec_template_test.go b/deployment/cre/jobs/types/job_spec_template_test.go index 3d9c8219e4e..823fe2358c7 100644 --- a/deployment/cre/jobs/types/job_spec_template_test.go +++ b/deployment/cre/jobs/types/job_spec_template_test.go @@ -11,7 +11,7 @@ import ( job_types "github.com/smartcontractkit/chainlink/deployment/cre/jobs/types" ) -func TestJobSpecTemplate_UnmarshalJSON(t *testing.T) { +func TestUnit_JobSpecTemplate_UnmarshalJSON(t *testing.T) { t.Run("cron string", func(t *testing.T) { var in jobs.ProposeJobSpecInput js := `{"environment":"e","domain":"d","don_name":"don","don_filters":[],"job_name":"j","template":"cron","inputs":{}}` @@ -34,7 +34,7 @@ func TestJobSpecTemplate_UnmarshalJSON(t *testing.T) { }) } -func TestJobSpecTemplate_UnmarshalYAML(t *testing.T) { +func TestUnit_JobSpecTemplate_UnmarshalYAML(t *testing.T) { t.Run("cron string", func(t *testing.T) { var in jobs.ProposeJobSpecInput yml := "environment: e\ndomain: d\ndon_name: don\ndon_filters: []\njob_name: j\ntemplate: cron\ninputs: {}\n" diff --git a/deployment/cre/jobs/types/job_spec_test.go b/deployment/cre/jobs/types/job_spec_test.go index 1cacb68e02f..93affe2f2fc 100644 --- a/deployment/cre/jobs/types/job_spec_test.go +++ b/deployment/cre/jobs/types/job_spec_test.go @@ -10,7 +10,7 @@ import ( job_types "github.com/smartcontractkit/chainlink/deployment/cre/jobs/types" ) -func TestJobSpecInput_ToStandardCapabilityJob(t *testing.T) { +func TestUnit_JobSpecInput_ToStandardCapabilityJob(t *testing.T) { t.Parallel() jobName := "test-job" diff --git a/deployment/cre/mcms/changeset/configure_test.go b/deployment/cre/mcms/changeset/configure_test.go index 593089b03cd..97f65cdef0d 100644 --- a/deployment/cre/mcms/changeset/configure_test.go +++ b/deployment/cre/mcms/changeset/configure_test.go @@ -20,7 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/cre/mcms/pkg" ) -func TestMCMSConfiguration(t *testing.T) { +func TestUnit_MCMSConfiguration(t *testing.T) { t.Parallel() // Test environment with a simulated EVM blockchain loader := testenv.NewLoader() diff --git a/deployment/cre/mcms/changeset/deploy_test.go b/deployment/cre/mcms/changeset/deploy_test.go index a3225cd72c1..074b50ed871 100644 --- a/deployment/cre/mcms/changeset/deploy_test.go +++ b/deployment/cre/mcms/changeset/deploy_test.go @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/cre/mcms/pkg" ) -func TestMCMSDeployment(t *testing.T) { +func TestUnit_MCMSDeployment(t *testing.T) { t.Parallel() // Test environment with a simulated EVM blockchain loader := testenv.NewLoader() diff --git a/deployment/cre/ocr3/config_test.go b/deployment/cre/ocr3/config_test.go index 2e4419a673b..ad50c3b0363 100644 --- a/deployment/cre/ocr3/config_test.go +++ b/deployment/cre/ocr3/config_test.go @@ -84,7 +84,7 @@ var ocr3Cfg = ` "MaxFaultyOracles": 3 }` -func Test_configureOCR3Request_generateOCR3Config(t *testing.T) { +func TestUnit_configureOCR3Request_generateOCR3Config(t *testing.T) { nodes := loadTestData(t, "testdata/testnet_wf_view.json") var cfg OracleConfig diff --git a/deployment/cre/ocr3/oracle_config_test.go b/deployment/cre/ocr3/oracle_config_test.go index 032c1a4d0fc..f0c5b76105f 100644 --- a/deployment/cre/ocr3/oracle_config_test.go +++ b/deployment/cre/ocr3/oracle_config_test.go @@ -9,7 +9,7 @@ import ( "gopkg.in/yaml.v3" ) -func TestOracleConfig_JSON(t *testing.T) { +func TestUnit_OracleConfig_JSON(t *testing.T) { t.Run("Legacy config returns an error", func(t *testing.T) { var cfg OracleConfig err := json.Unmarshal([]byte(legacyOcr3Cfg), &cfg) diff --git a/deployment/cre/ocr3/types_test.go b/deployment/cre/ocr3/types_test.go index 0f3a0e1908c..eb5c3b98f38 100644 --- a/deployment/cre/ocr3/types_test.go +++ b/deployment/cre/ocr3/types_test.go @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) -func Test_toNodeKeys(t *testing.T) { +func TestUnit_toNodeKeys(t *testing.T) { registryChainSel := chainsel.TEST_90000001 registryChainID, err := chainsel.ChainIdFromSelector(registryChainSel.Selector) if err != nil { diff --git a/deployment/cre/ocr3/v2/changeset/configure_ocr3_test.go b/deployment/cre/ocr3/v2/changeset/configure_ocr3_test.go index d5fa3ded533..d660426027b 100644 --- a/deployment/cre/ocr3/v2/changeset/configure_ocr3_test.go +++ b/deployment/cre/ocr3/v2/changeset/configure_ocr3_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/cre/test" ) -func TestConfigureOCR3(t *testing.T) { +func TestUnit_ConfigureOCR3(t *testing.T) { env := test.SetupEnvV2(t, false) testCases := []struct { diff --git a/deployment/cre/ocr3/v2/changeset/deploy_ocr3_test.go b/deployment/cre/ocr3/v2/changeset/deploy_ocr3_test.go index ba8eab6dc92..9270f3e9de8 100644 --- a/deployment/cre/ocr3/v2/changeset/deploy_ocr3_test.go +++ b/deployment/cre/ocr3/v2/changeset/deploy_ocr3_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/cre/test" ) -func TestDeployOCR3(t *testing.T) { +func TestUnit_DeployOCR3(t *testing.T) { env := test.SetupEnvV2(t, false) // Apply the changeset to deploy the V2 capabilities registry diff --git a/deployment/cre/ocr3/v2/changeset/deploy_vault_test.go b/deployment/cre/ocr3/v2/changeset/deploy_vault_test.go index 0841eece266..82132b162a7 100644 --- a/deployment/cre/ocr3/v2/changeset/deploy_vault_test.go +++ b/deployment/cre/ocr3/v2/changeset/deploy_vault_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/cre/test" ) -func TestDeployVault(t *testing.T) { +func TestUnit_DeployVault(t *testing.T) { env := test.SetupEnvV2(t, false) changesetOutput, err := DeployVault{}.Apply(*env.Env, DeployVaultInput{ diff --git a/deployment/cre/pkg/offchain/changeset/register_nodes_with_jd_test.go b/deployment/cre/pkg/offchain/changeset/register_nodes_with_jd_test.go index 6165bcff408..51022b50997 100644 --- a/deployment/cre/pkg/offchain/changeset/register_nodes_with_jd_test.go +++ b/deployment/cre/pkg/offchain/changeset/register_nodes_with_jd_test.go @@ -19,7 +19,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/cre/test" ) -func TestCsRegisterNodesWithJD_Apply(t *testing.T) { +func TestUnit_CsRegisterNodesWithJD_Apply(t *testing.T) { t.Parallel() zone := test.Zone @@ -373,7 +373,7 @@ func TestCsRegisterNodesWithJD_Apply(t *testing.T) { }) } -func TestCsRegisterNodesWithJDV2_Apply(t *testing.T) { +func TestUnit_CsRegisterNodesWithJDV2_Apply(t *testing.T) { t.Parallel() t.Run("registers nodes for a DON", func(t *testing.T) { diff --git a/deployment/cre/pkg/offchain/types_test.go b/deployment/cre/pkg/offchain/types_test.go index aa8b7ab05fb..90377b264be 100644 --- a/deployment/cre/pkg/offchain/types_test.go +++ b/deployment/cre/pkg/offchain/types_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/shared/ptypes" ) -func TestAddToFilter(t *testing.T) { +func TestUnit_AddToFilter(t *testing.T) { t.Run("CSA public key appends", func(t *testing.T) { req := require.New(t) @@ -60,7 +60,7 @@ func TestAddToFilter(t *testing.T) { }) } -func TestAddToFilterIfNotPresent(t *testing.T) { +func TestUnit_AddToFilterIfNotPresent(t *testing.T) { t.Run("CSA key dedupes", func(t *testing.T) { req := require.New(t) @@ -157,7 +157,7 @@ func TestAddToFilterIfNotPresent(t *testing.T) { }) } -func TestMultipleFilters(t *testing.T) { +func TestUnit_MultipleFilters(t *testing.T) { req := require.New(t) filter := &nodev1.ListNodesRequest_Filter{} diff --git a/deployment/cre/state/view_test.go b/deployment/cre/state/view_test.go index 0a1bb439c85..c3036c1034c 100644 --- a/deployment/cre/state/view_test.go +++ b/deployment/cre/state/view_test.go @@ -15,7 +15,7 @@ import ( test2 "github.com/smartcontractkit/chainlink/deployment/cre/test" ) -func TestCREView(t *testing.T) { +func TestUnit_CREView(t *testing.T) { t.Parallel() env := test2.SetupEnvV2(t, false) diff --git a/deployment/cre/test/env_setup_test.go b/deployment/cre/test/env_setup_test.go index 75ce3967785..3a03542d01e 100644 --- a/deployment/cre/test/env_setup_test.go +++ b/deployment/cre/test/env_setup_test.go @@ -8,7 +8,7 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/datastore" ) -func TestSetupEnvV2(t *testing.T) { +func TestUnit_SetupEnvV2(t *testing.T) { envV2 := SetupEnvV2(t, false) env := envV2.Env diff --git a/deployment/cre/workflow_registry/v2/changeset/admin_workflow_registry_test.go b/deployment/cre/workflow_registry/v2/changeset/admin_workflow_registry_test.go index 087e99f4b20..caabf2ecd43 100644 --- a/deployment/cre/workflow_registry/v2/changeset/admin_workflow_registry_test.go +++ b/deployment/cre/workflow_registry/v2/changeset/admin_workflow_registry_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/cre/contracts" ) -func TestAdminBatchPauseWorkflows(t *testing.T) { +func TestUnit_AdminBatchPauseWorkflows(t *testing.T) { t.Parallel() testWorkflowID1 := [32]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32} @@ -69,7 +69,7 @@ func TestAdminBatchPauseWorkflows(t *testing.T) { }) } -func TestAdminPauseWorkflow(t *testing.T) { +func TestUnit_AdminPauseWorkflow(t *testing.T) { t.Parallel() testWorkflowID := [32]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32} @@ -125,7 +125,7 @@ func TestAdminPauseWorkflow(t *testing.T) { }) } -func TestAdminPauseAllByOwner(t *testing.T) { +func TestUnit_AdminPauseAllByOwner(t *testing.T) { t.Parallel() testOwner := common.HexToAddress("0x1234567890123456789012345678901234567890") @@ -193,7 +193,7 @@ func TestAdminPauseAllByOwner(t *testing.T) { }) } -func TestAdminPauseAllByDON(t *testing.T) { +func TestUnit_AdminPauseAllByDON(t *testing.T) { t.Parallel() testDONFamily := "test-don-family" @@ -261,7 +261,7 @@ func TestAdminPauseAllByDON(t *testing.T) { }) } -func TestAdminBatchPauseWorkflowsValidation(t *testing.T) { +func TestUnit_AdminBatchPauseWorkflowsValidation(t *testing.T) { t.Parallel() fixture := setupTest(t) diff --git a/deployment/cre/workflow_registry/v2/changeset/configure_workflow_registry_test.go b/deployment/cre/workflow_registry/v2/changeset/configure_workflow_registry_test.go index 48a086f2e06..2571c09667b 100644 --- a/deployment/cre/workflow_registry/v2/changeset/configure_workflow_registry_test.go +++ b/deployment/cre/workflow_registry/v2/changeset/configure_workflow_registry_test.go @@ -10,7 +10,7 @@ import ( crecontracts "github.com/smartcontractkit/chainlink/deployment/cre/contracts" ) -func TestSetConfig(t *testing.T) { +func TestUnit_SetConfig(t *testing.T) { t.Parallel() t.Run("basic metadata config", func(t *testing.T) { @@ -59,7 +59,7 @@ func TestSetConfig(t *testing.T) { }) } -func TestUpdateAllowedSigners(t *testing.T) { +func TestUnit_UpdateAllowedSigners(t *testing.T) { t.Parallel() t.Run("update allowed signers", func(t *testing.T) { @@ -108,7 +108,7 @@ func TestUpdateAllowedSigners(t *testing.T) { }) } -func TestSetWorkflowOwnerConfig(t *testing.T) { +func TestUnit_SetWorkflowOwnerConfig(t *testing.T) { t.Parallel() t.Run("set workflow owner config", func(t *testing.T) { @@ -152,7 +152,7 @@ func TestSetWorkflowOwnerConfig(t *testing.T) { }) } -func TestSetDONLimit(t *testing.T) { +func TestUnit_SetDONLimit(t *testing.T) { t.Parallel() t.Run("set DON limit", func(t *testing.T) { @@ -198,7 +198,7 @@ func TestSetDONLimit(t *testing.T) { }) } -func TestSetUserDONOverride(t *testing.T) { +func TestUnit_SetUserDONOverride(t *testing.T) { t.Parallel() t.Run("set user DON override", func(t *testing.T) { @@ -268,7 +268,7 @@ func TestSetUserDONOverride(t *testing.T) { }) } -func TestSetCapabilitiesRegistry(t *testing.T) { +func TestUnit_SetCapabilitiesRegistry(t *testing.T) { t.Parallel() // Test data for DON registry configuration @@ -367,7 +367,7 @@ func TestSetCapabilitiesRegistry(t *testing.T) { }) } -func TestConfigureWorkflowRegistryValidation(t *testing.T) { +func TestUnit_ConfigureWorkflowRegistryValidation(t *testing.T) { t.Parallel() fixture := setupTest(t) diff --git a/deployment/cre/workflow_registry/v2/changeset/deploy_workflow_registry_test.go b/deployment/cre/workflow_registry/v2/changeset/deploy_workflow_registry_test.go index 61b40b85ec0..bc884a3a6b1 100644 --- a/deployment/cre/workflow_registry/v2/changeset/deploy_workflow_registry_test.go +++ b/deployment/cre/workflow_registry/v2/changeset/deploy_workflow_registry_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/runtime" ) -func TestDeployWorkflowRegistry(t *testing.T) { +func TestUnit_DeployWorkflowRegistry(t *testing.T) { // Create a minimal environment with one EVM chain selector := chainselectors.TEST_90000001.Selector rt, err := runtime.New(t.Context(), runtime.WithEnvOpts( diff --git a/deployment/data-feeds/changeset/accept_ownership_test.go b/deployment/data-feeds/changeset/accept_ownership_test.go index 5be4dd4c9a2..613baa324a4 100644 --- a/deployment/data-feeds/changeset/accept_ownership_test.go +++ b/deployment/data-feeds/changeset/accept_ownership_test.go @@ -21,7 +21,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) -func TestAcceptOwnership(t *testing.T) { +func TestUnit_AcceptOwnership(t *testing.T) { t.Parallel() selector := chain_selectors.TEST_90000001.Selector diff --git a/deployment/data-feeds/changeset/aptos/deploy_data_feeds_test.go b/deployment/data-feeds/changeset/aptos/deploy_data_feeds_test.go index 474bfa5131f..db1e36b582d 100644 --- a/deployment/data-feeds/changeset/aptos/deploy_data_feeds_test.go +++ b/deployment/data-feeds/changeset/aptos/deploy_data_feeds_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" ) -func TestDeployAptosCache(t *testing.T) { +func TestIntegration_Aptos_DeployAptosCache(t *testing.T) { t.Parallel() selector := chain_selectors.APTOS_LOCALNET.Selector diff --git a/deployment/data-feeds/changeset/aptos/set_feed_config_test.go b/deployment/data-feeds/changeset/aptos/set_feed_config_test.go index 936b9cfb826..82220507fb0 100644 --- a/deployment/data-feeds/changeset/aptos/set_feed_config_test.go +++ b/deployment/data-feeds/changeset/aptos/set_feed_config_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) -func TestSetFeedConfig(t *testing.T) { +func TestIntegration_Aptos_SetFeedConfig(t *testing.T) { t.Parallel() selector := chain_selectors.APTOS_LOCALNET.Selector diff --git a/deployment/data-feeds/changeset/aptos/set_workflow_config_test.go b/deployment/data-feeds/changeset/aptos/set_workflow_config_test.go index 58142f1ca9e..00aae3a4925 100644 --- a/deployment/data-feeds/changeset/aptos/set_workflow_config_test.go +++ b/deployment/data-feeds/changeset/aptos/set_workflow_config_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" ) -func TestSetWorkflowConfig(t *testing.T) { +func TestIntegration_Aptos_SetWorkflowConfig(t *testing.T) { t.Parallel() selector := chain_selectors.APTOS_LOCALNET.Selector diff --git a/deployment/data-feeds/changeset/aptos/transfer_ownership_test.go b/deployment/data-feeds/changeset/aptos/transfer_ownership_test.go index 39e58693fc8..a6c00738e3b 100644 --- a/deployment/data-feeds/changeset/aptos/transfer_ownership_test.go +++ b/deployment/data-feeds/changeset/aptos/transfer_ownership_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" ) -func TestTransferOwnership(t *testing.T) { +func TestIntegration_Aptos_TransferOwnership(t *testing.T) { t.Parallel() selector := chain_selectors.APTOS_LOCALNET.Selector rt, err := runtime.New(t.Context(), runtime.WithEnvOpts( diff --git a/deployment/data-feeds/changeset/confirm_aggregator_test.go b/deployment/data-feeds/changeset/confirm_aggregator_test.go index 98c4fcb3540..87157446623 100644 --- a/deployment/data-feeds/changeset/confirm_aggregator_test.go +++ b/deployment/data-feeds/changeset/confirm_aggregator_test.go @@ -22,7 +22,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) -func TestConfirmAggregator(t *testing.T) { +func TestUnit_ConfirmAggregator(t *testing.T) { t.Parallel() selector := chain_selectors.TEST_90000001.Selector diff --git a/deployment/data-feeds/changeset/deploy_aggregator_proxy_test.go b/deployment/data-feeds/changeset/deploy_aggregator_proxy_test.go index 90862dbcd71..4bee643fae0 100644 --- a/deployment/data-feeds/changeset/deploy_aggregator_proxy_test.go +++ b/deployment/data-feeds/changeset/deploy_aggregator_proxy_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) -func TestAggregatorProxy(t *testing.T) { +func TestUnit_AggregatorProxy(t *testing.T) { t.Parallel() selector := chain_selectors.TEST_90000001.Selector diff --git a/deployment/data-feeds/changeset/deploy_bundle_aggregator_proxy_test.go b/deployment/data-feeds/changeset/deploy_bundle_aggregator_proxy_test.go index 5788587ff5f..fdef826cad0 100644 --- a/deployment/data-feeds/changeset/deploy_bundle_aggregator_proxy_test.go +++ b/deployment/data-feeds/changeset/deploy_bundle_aggregator_proxy_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) -func TestBundleAggregatorProxy(t *testing.T) { +func TestUnit_BundleAggregatorProxy(t *testing.T) { t.Parallel() selector := chain_selectors.TEST_90000001.Selector diff --git a/deployment/data-feeds/changeset/deploy_cache_test.go b/deployment/data-feeds/changeset/deploy_cache_test.go index 64c2d63d4c4..d703ec06d3b 100644 --- a/deployment/data-feeds/changeset/deploy_cache_test.go +++ b/deployment/data-feeds/changeset/deploy_cache_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) -func TestDeployCache(t *testing.T) { +func TestUnit_DeployCache(t *testing.T) { t.Parallel() selector := chain_selectors.TEST_90000001.Selector diff --git a/deployment/data-feeds/changeset/migrate_feeds_test.go b/deployment/data-feeds/changeset/migrate_feeds_test.go index 1770ddd2672..5d8c7ca9904 100644 --- a/deployment/data-feeds/changeset/migrate_feeds_test.go +++ b/deployment/data-feeds/changeset/migrate_feeds_test.go @@ -21,7 +21,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) -func TestMigrateFeeds(t *testing.T) { +func TestUnit_MigrateFeeds(t *testing.T) { t.Parallel() selector := chain_selectors.TEST_90000001.Selector diff --git a/deployment/data-feeds/changeset/new_feed_with_proxy_test.go b/deployment/data-feeds/changeset/new_feed_with_proxy_test.go index 167244586b6..b5f97eef343 100644 --- a/deployment/data-feeds/changeset/new_feed_with_proxy_test.go +++ b/deployment/data-feeds/changeset/new_feed_with_proxy_test.go @@ -24,7 +24,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) -func TestNewFeedWithProxy(t *testing.T) { +func TestUnit_NewFeedWithProxy(t *testing.T) { t.Parallel() selector := chain_selectors.TEST_90000001.Selector diff --git a/deployment/data-feeds/changeset/propose_aggregator_test.go b/deployment/data-feeds/changeset/propose_aggregator_test.go index 697c2bdb2de..d96bf7267a1 100644 --- a/deployment/data-feeds/changeset/propose_aggregator_test.go +++ b/deployment/data-feeds/changeset/propose_aggregator_test.go @@ -22,7 +22,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) -func TestProposeAggregator(t *testing.T) { +func TestUnit_ProposeAggregator(t *testing.T) { t.Parallel() selector := chain_selectors.TEST_90000001.Selector diff --git a/deployment/data-feeds/changeset/remove_dataid_proxy_mapping_test.go b/deployment/data-feeds/changeset/remove_dataid_proxy_mapping_test.go index d840dd1226d..75ad8193d6f 100644 --- a/deployment/data-feeds/changeset/remove_dataid_proxy_mapping_test.go +++ b/deployment/data-feeds/changeset/remove_dataid_proxy_mapping_test.go @@ -22,7 +22,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) -func TestRemoveFeedProxyMapping(t *testing.T) { +func TestUnit_RemoveFeedProxyMapping(t *testing.T) { t.Parallel() selector := chain_selectors.TEST_90000001.Selector diff --git a/deployment/data-feeds/changeset/remove_feed_config_test.go b/deployment/data-feeds/changeset/remove_feed_config_test.go index 07733c6c3e8..f1558b14834 100644 --- a/deployment/data-feeds/changeset/remove_feed_config_test.go +++ b/deployment/data-feeds/changeset/remove_feed_config_test.go @@ -24,7 +24,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) -func TestRemoveFeedConfig(t *testing.T) { +func TestUnit_RemoveFeedConfig(t *testing.T) { t.Parallel() selector := chain_selectors.TEST_90000001.Selector diff --git a/deployment/data-feeds/changeset/remove_feed_test.go b/deployment/data-feeds/changeset/remove_feed_test.go index a907465552e..2d8d3ba06c5 100644 --- a/deployment/data-feeds/changeset/remove_feed_test.go +++ b/deployment/data-feeds/changeset/remove_feed_test.go @@ -24,7 +24,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) -func TestRemoveFeed(t *testing.T) { +func TestUnit_RemoveFeed(t *testing.T) { t.Parallel() selector := chain_selectors.TEST_90000001.Selector diff --git a/deployment/data-feeds/changeset/set_bundle_feed_config_test.go b/deployment/data-feeds/changeset/set_bundle_feed_config_test.go index 6db869f5e1e..c2e01aa7451 100644 --- a/deployment/data-feeds/changeset/set_bundle_feed_config_test.go +++ b/deployment/data-feeds/changeset/set_bundle_feed_config_test.go @@ -24,7 +24,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) -func TestSetBundleFeedConfig(t *testing.T) { +func TestUnit_SetBundleFeedConfig(t *testing.T) { t.Parallel() selector := chain_selectors.TEST_90000001.Selector diff --git a/deployment/data-feeds/changeset/set_feed_admin_test.go b/deployment/data-feeds/changeset/set_feed_admin_test.go index 6ee84a63a16..d7fda781280 100644 --- a/deployment/data-feeds/changeset/set_feed_admin_test.go +++ b/deployment/data-feeds/changeset/set_feed_admin_test.go @@ -22,7 +22,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) -func TestSetCacheAdmin(t *testing.T) { +func TestUnit_SetCacheAdmin(t *testing.T) { t.Parallel() selector := chain_selectors.TEST_90000001.Selector diff --git a/deployment/data-feeds/changeset/set_feed_config_test.go b/deployment/data-feeds/changeset/set_feed_config_test.go index 3fa67ee1c4a..0e2582c3a65 100644 --- a/deployment/data-feeds/changeset/set_feed_config_test.go +++ b/deployment/data-feeds/changeset/set_feed_config_test.go @@ -24,7 +24,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) -func TestSetFeedConfig(t *testing.T) { +func TestUnit_SetFeedConfig(t *testing.T) { t.Parallel() selector := chain_selectors.TEST_90000001.Selector diff --git a/deployment/data-feeds/changeset/solana/deploy_cache_test.go b/deployment/data-feeds/changeset/solana/deploy_cache_test.go index a05b0e9bacc..fcfb1805a4d 100644 --- a/deployment/data-feeds/changeset/solana/deploy_cache_test.go +++ b/deployment/data-feeds/changeset/solana/deploy_cache_test.go @@ -30,7 +30,7 @@ const ( // TODO: This test is not working as expected, however this has been modified to work with the new // test engine environment. -func TestDeployCache(t *testing.T) { +func TestUnit_DeployCache(t *testing.T) { skipInCI(t) t.Parallel() @@ -100,7 +100,7 @@ func TestDeployCache(t *testing.T) { // TODO: This test is not working as expected, however this has been modified to work with the new // test engine environment. -func TestConfigureCache(t *testing.T) { +func TestUnit_ConfigureCache(t *testing.T) { skipInCI(t) t.Parallel() diff --git a/deployment/data-feeds/changeset/tron/deploy_aggregator_proxy_test.go b/deployment/data-feeds/changeset/tron/deploy_aggregator_proxy_test.go index 239e33c8cd9..983d4988549 100644 --- a/deployment/data-feeds/changeset/tron/deploy_aggregator_proxy_test.go +++ b/deployment/data-feeds/changeset/tron/deploy_aggregator_proxy_test.go @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) -func TestDeployAggregatorProxy(t *testing.T) { +func TestUnit_DeployAggregatorProxy(t *testing.T) { t.Parallel() selector := chain_selectors.TRON_DEVNET.Selector diff --git a/deployment/data-feeds/changeset/tron/deploy_cache_test.go b/deployment/data-feeds/changeset/tron/deploy_cache_test.go index d0c1de0cd54..9e6ba978c77 100644 --- a/deployment/data-feeds/changeset/tron/deploy_cache_test.go +++ b/deployment/data-feeds/changeset/tron/deploy_cache_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) -func TestDeployCache(t *testing.T) { +func TestUnit_DeployCache(t *testing.T) { t.Parallel() selector := chain_selectors.TRON_DEVNET.Selector diff --git a/deployment/data-feeds/changeset/tron/remove_dataid_proxy_mapping_test.go b/deployment/data-feeds/changeset/tron/remove_dataid_proxy_mapping_test.go index 9b2335a6549..b27c6c4ce9c 100644 --- a/deployment/data-feeds/changeset/tron/remove_dataid_proxy_mapping_test.go +++ b/deployment/data-feeds/changeset/tron/remove_dataid_proxy_mapping_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) -func TestRemoveDataIDProxyMapping(t *testing.T) { +func TestUnit_RemoveDataIDProxyMapping(t *testing.T) { t.Parallel() selector := chain_selectors.TRON_DEVNET.Selector diff --git a/deployment/data-feeds/changeset/tron/set_feed_admin_test.go b/deployment/data-feeds/changeset/tron/set_feed_admin_test.go index 79b5914b6ba..46a3b54cb38 100644 --- a/deployment/data-feeds/changeset/tron/set_feed_admin_test.go +++ b/deployment/data-feeds/changeset/tron/set_feed_admin_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) -func TestSetCacheAdmin(t *testing.T) { +func TestUnit_SetCacheAdmin(t *testing.T) { t.Parallel() selector := chain_selectors.TRON_DEVNET.Selector diff --git a/deployment/data-feeds/changeset/tron/set_feed_config_test.go b/deployment/data-feeds/changeset/tron/set_feed_config_test.go index 786815d146a..afbb101114d 100644 --- a/deployment/data-feeds/changeset/tron/set_feed_config_test.go +++ b/deployment/data-feeds/changeset/tron/set_feed_config_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) -func TestSetFeedConfig(t *testing.T) { +func TestUnit_SetFeedConfig(t *testing.T) { t.Parallel() selector := chain_selectors.TRON_DEVNET.Selector diff --git a/deployment/data-feeds/changeset/tron/update_data_id_proxy_test.go b/deployment/data-feeds/changeset/tron/update_data_id_proxy_test.go index 2fad7f05335..79d34c5c8bd 100644 --- a/deployment/data-feeds/changeset/tron/update_data_id_proxy_test.go +++ b/deployment/data-feeds/changeset/tron/update_data_id_proxy_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) -func TestUpdateDataIDProxy(t *testing.T) { +func TestUnit_UpdateDataIDProxy(t *testing.T) { t.Parallel() selector := chain_selectors.TRON_DEVNET.Selector diff --git a/deployment/data-feeds/changeset/update_data_id_proxy_test.go b/deployment/data-feeds/changeset/update_data_id_proxy_test.go index d73506706ee..82fc79d027e 100644 --- a/deployment/data-feeds/changeset/update_data_id_proxy_test.go +++ b/deployment/data-feeds/changeset/update_data_id_proxy_test.go @@ -22,7 +22,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) -func TestUpdateDataIDProxyMap(t *testing.T) { +func TestUnit_UpdateDataIDProxyMap(t *testing.T) { t.Parallel() selector := chain_selectors.TEST_90000001.Selector diff --git a/deployment/data-feeds/changeset/utils_test.go b/deployment/data-feeds/changeset/utils_test.go index 681f3a1e394..222eaad9770 100644 --- a/deployment/data-feeds/changeset/utils_test.go +++ b/deployment/data-feeds/changeset/utils_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestGetDecimalsFromFeedIDValidFeedID(t *testing.T) { +func TestUnit_GetDecimalsFromFeedIDValidFeedID(t *testing.T) { decimals, err := GetDecimalsFromFeedID("0x01d0fd1ef80003320000000000000000") // decimal 18 require.NoError(t, err) require.Equal(t, uint8(0x12), decimals) diff --git a/deployment/data-feeds/shared/validation_test.go b/deployment/data-feeds/shared/validation_test.go index 8c6788675c4..da822b63800 100644 --- a/deployment/data-feeds/shared/validation_test.go +++ b/deployment/data-feeds/shared/validation_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestValidateFeedID(t *testing.T) { +func TestUnit_ValidateFeedID(t *testing.T) { t.Parallel() tests := []struct { diff --git a/deployment/environment/crib/env_test.go b/deployment/environment/crib/env_test.go index 53a9e2b100a..c4f8798b14a 100644 --- a/deployment/environment/crib/env_test.go +++ b/deployment/environment/crib/env_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" ) -func TestShouldProvideEnvironmentConfig(t *testing.T) { +func TestUnit_ShouldProvideEnvironmentConfig(t *testing.T) { tests.SkipFlakey(t, "https://smartcontract-it.atlassian.net/browse/DX-291") t.Parallel() diff --git a/deployment/environment/crib/helpers_test.go b/deployment/environment/crib/helpers_test.go index 2d1a5daac5f..3cc9c08f434 100644 --- a/deployment/environment/crib/helpers_test.go +++ b/deployment/environment/crib/helpers_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" ) -func Test_getTierChainSelectors(t *testing.T) { +func TestUnit_getTierChainSelectors(t *testing.T) { otherSelectors := []uint64{909606746561742123, 5548718428018410741, 789068866484373046, 5721565186521185178, 964127714438319834} defaultSelectors := []uint64{3379446385462418246, 12463857294658392847, 12922642891491394802} //nolint:gocritic // append is used here to combine the two slices for testing purposes diff --git a/deployment/environment/crib/lane_config_test.go b/deployment/environment/crib/lane_config_test.go index 151e61ffac9..f6bb03c7fac 100644 --- a/deployment/environment/crib/lane_config_test.go +++ b/deployment/environment/crib/lane_config_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestGenerateBidirectionalRandomLanesWithMinConnectivity(t *testing.T) { +func TestUnit_GenerateBidirectionalRandomLanesWithMinConnectivity(t *testing.T) { tests := []struct { name string chains []uint64 @@ -49,7 +49,7 @@ func TestGenerateBidirectionalRandomLanesWithMinConnectivity(t *testing.T) { } } -func TestBidirectionalPairGeneration(t *testing.T) { +func TestUnit_BidirectionalPairGeneration(t *testing.T) { chains := []uint64{1, 2, 3, 4} numLanes := 12 // full connectivity @@ -196,7 +196,7 @@ func findBidirectionalPairs(lanes []LaneConfig) [][]LaneConfig { return pairs } -func TestLaneConfiguration_GenerateLanes_BidirectionalMode(t *testing.T) { +func TestUnit_LaneConfiguration_GenerateLanes_BidirectionalMode(t *testing.T) { tests := []struct { name string lc *LaneConfiguration @@ -280,7 +280,7 @@ func TestLaneConfiguration_GenerateLanes_BidirectionalMode(t *testing.T) { } } -func Test_generateChainTierLanes(t *testing.T) { +func TestUnit_generateChainTierLanes(t *testing.T) { chains := []uint64{3379446385462418246, 12463857294658392847, 12922642891491394802, 909606746561742123, 5548718428018410741} t.Run("happy path", func(t *testing.T) { diff --git a/deployment/environment/devenv/don_test.go b/deployment/environment/devenv/don_test.go index 57819db4861..d5ca09e3e54 100644 --- a/deployment/environment/devenv/don_test.go +++ b/deployment/environment/devenv/don_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestPtrVal(t *testing.T) { +func TestUnit_PtrVal(t *testing.T) { x := "hello" xptr := ptr(x) got := value(xptr) diff --git a/deployment/environment/devenv/rmn_test.go b/deployment/environment/devenv/rmn_test.go index 7d07670ff7d..d78d0bfee87 100644 --- a/deployment/environment/devenv/rmn_test.go +++ b/deployment/environment/devenv/rmn_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestExtractPeerID(t *testing.T) { +func TestUnit_ExtractPeerID(t *testing.T) { data := []byte("{\"Salt\":\"yAUVSNGPnY78hJwJwKDBmA==\",\"Nonce\":\"8p0vNKpnQH1P+7/cg2dM3vNlc60tzPl0\",\"Ciphertext\":\"VboRchQzDx/+zIVDWyTXIEwo4Ej0s7O6kQqmgCqW+A+HEXl6bI02W1Y2T88XuY0m44eC9DvSpBPhs/VLtgymj6nBcl+nzfJHLMp2pBMPjKHxgNsEk34mDgnmqYKTtIkgzv7hEyy7j0CAcR/RxkjfQNKpfWOlNtAFryFO+w==\",\"AdditionalData\":\"{\\\"PeerID\\\":\\\"12D3KooWNqugYSJw9thwwu1PC3aEpPsBxMZM2EdzpJXGesRG4E8n\\\"}\"}") peerID, err := extractPeerID(data) require.NoError(t, err) diff --git a/deployment/environment/nodeclient/chainlink_models_test.go b/deployment/environment/nodeclient/chainlink_models_test.go index c7cc4d37b04..5a1afbaf4f1 100644 --- a/deployment/environment/nodeclient/chainlink_models_test.go +++ b/deployment/environment/nodeclient/chainlink_models_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/job" ) -func TestOCR2TaskJobSpec_String(t *testing.T) { +func TestUnit_OCR2TaskJobSpec_String(t *testing.T) { for _, tt := range []struct { name string spec OCR2TaskJobSpec diff --git a/deployment/environment/test/jd_test.go b/deployment/environment/test/jd_test.go index 3a06dbc452f..34eac3c3484 100644 --- a/deployment/environment/test/jd_test.go +++ b/deployment/environment/test/jd_test.go @@ -19,7 +19,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) -func TestJDNodeService_GetNode(t *testing.T) { +func TestUnit_JDNodeService_GetNode(t *testing.T) { nodes := []deployment.Node{ { NodeID: "node1", @@ -70,7 +70,7 @@ func TestJDNodeService_GetNode(t *testing.T) { } } -func TestJDNodeService_ListNodes(t *testing.T) { +func TestUnit_JDNodeService_ListNodes(t *testing.T) { workflowKey1 := "workflow_key_1" workflowKey2 := "workflow_key_2" nodes := []deployment.Node{ @@ -157,7 +157,7 @@ func TestJDNodeService_ListNodes(t *testing.T) { } } -func TestJDNodeService_ListNodeChainConfigs(t *testing.T) { +func TestUnit_JDNodeService_ListNodeChainConfigs(t *testing.T) { nodes := []deployment.Node{ { NodeID: "node1", @@ -331,7 +331,7 @@ func TestJDNodeService_ListNodeChainConfigs(t *testing.T) { } } -func TestNewJDServiceFromListNodes(t *testing.T) { +func TestUnit_NewJDServiceFromListNodes(t *testing.T) { workflowKey1 := "workflow_key_1" workflowKey2 := "workflow_key_2" workflowKey3 := "workflow_key_3" diff --git a/deployment/environment/test/job_service_client_test.go b/deployment/environment/test/job_service_client_test.go index 67817f6de1f..1436dc98344 100644 --- a/deployment/environment/test/job_service_client_test.go +++ b/deployment/environment/test/job_service_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/feeds" ) -func TestNewJobServiceClient(t *testing.T) { +func TestUnit_NewJobServiceClient(t *testing.T) { t.Parallel() // Create a mock JobApprover getter @@ -39,7 +39,7 @@ func TestNewJobServiceClient(t *testing.T) { require.Equal(t, mockGetter, client.jobApproverStore) } -func TestBatchProposeJob(t *testing.T) { +func TestUnit_BatchProposeJob(t *testing.T) { t.Parallel() ctx := t.Context() @@ -119,7 +119,7 @@ func TestBatchProposeJob(t *testing.T) { }) } -func TestProposeJob(t *testing.T) { +func TestUnit_ProposeJob(t *testing.T) { t.Parallel() ctx := context.Background() @@ -237,7 +237,7 @@ name = "Test Job" }) } -func TestRevokeJob(t *testing.T) { +func TestUnit_RevokeJob(t *testing.T) { t.Parallel() mockGetter := &mockJobApproverGetter{ @@ -314,7 +314,7 @@ func TestRevokeJob(t *testing.T) { } } -func TestGetJob(t *testing.T) { +func TestUnit_GetJob(t *testing.T) { t.Parallel() ctx := context.Background() @@ -367,7 +367,7 @@ func TestGetJob(t *testing.T) { }) } -func TestGetProposal(t *testing.T) { +func TestUnit_GetProposal(t *testing.T) { t.Parallel() ctx := context.Background() @@ -419,7 +419,7 @@ func TestGetProposal(t *testing.T) { }) } -func TestListJobs(t *testing.T) { +func TestUnit_ListJobs(t *testing.T) { t.Parallel() ctx := context.Background() @@ -531,7 +531,7 @@ func TestListJobs(t *testing.T) { }) } -func TestListProposals(t *testing.T) { +func TestUnit_ListProposals(t *testing.T) { t.Parallel() ctx := context.Background() @@ -629,7 +629,7 @@ func TestListProposals(t *testing.T) { }) } -func TestMapJobStore(t *testing.T) { +func TestUnit_MapJobStore(t *testing.T) { t.Parallel() store := newMapJobStore() @@ -707,7 +707,7 @@ func TestMapJobStore(t *testing.T) { }) } -func TestMapProposalStore(t *testing.T) { +func TestUnit_MapProposalStore(t *testing.T) { t.Parallel() store := newMapProposalStore() @@ -773,7 +773,7 @@ func TestMapProposalStore(t *testing.T) { }) } -func TestMatchesSelectors(t *testing.T) { +func TestUnit_MatchesSelectors(t *testing.T) { t.Parallel() tests := []struct { diff --git a/deployment/environment/web/sdk/client/types_test.go b/deployment/environment/web/sdk/client/types_test.go index e96473dec23..d22988eb1bf 100644 --- a/deployment/environment/web/sdk/client/types_test.go +++ b/deployment/environment/web/sdk/client/types_test.go @@ -6,7 +6,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/environment/web/sdk/internal/generated" ) -func TestDecodeInput(t *testing.T) { +func TestUnit_DecodeInput(t *testing.T) { type args struct { in any out any diff --git a/deployment/environment_test.go b/deployment/environment_test.go index a1f61a1f589..0d2aee0c39b 100644 --- a/deployment/environment_test.go +++ b/deployment/environment_test.go @@ -19,7 +19,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) -func TestNode_OCRConfigForChainSelector(t *testing.T) { +func TestUnit_Node_OCRConfigForChainSelector(t *testing.T) { var m = map[chain_selectors.ChainDetails]OCRConfig{ { ChainSelector: chain_selectors.APTOS_TESTNET.Selector, @@ -102,7 +102,7 @@ func TestNode_OCRConfigForChainSelector(t *testing.T) { } } -func TestNode_ChainConfigs(t *testing.T) { +func TestUnit_Node_ChainConfigs(t *testing.T) { type fields struct { NodeID string SelToOCRConfig map[chain_selectors.ChainDetails]OCRConfig @@ -304,7 +304,7 @@ func hexFrom32Byte(t *testing.T, s string) string { return hex.EncodeToString(b[:]) } -func Test_isValidMultiAddr(t *testing.T) { +func TestUnit_isValidMultiAddr(t *testing.T) { // Generate a p2p piece using p2pkey.MustNewV2XXXTestingOnly() seed := big.NewInt(123) p2p := p2pkey.MustNewV2XXXTestingOnly(seed).PeerID().String() @@ -338,7 +338,7 @@ func Test_isValidMultiAddr(t *testing.T) { }) } } -func TestNewNodeFromJD(t *testing.T) { +func TestUnit_NewNodeFromJD(t *testing.T) { wk := "node-workflow-key" type args struct { jdNode *nodev1.Node diff --git a/deployment/evm_kmsclient_test.go b/deployment/evm_kmsclient_test.go index f4917722839..93f7caa3405 100644 --- a/deployment/evm_kmsclient_test.go +++ b/deployment/evm_kmsclient_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestKMSToEthSigConversion(t *testing.T) { +func TestUnit_KMSToEthSigConversion(t *testing.T) { kmsSigBytes, err := hex.DecodeString("304402206168865941bafcae3a8cf8b26edbb5693d62222b2e54d962c1aabbeaddf33b6802205edc7f597d2bf2d1eaa14fc514a6202bafcffe52b13ae3fec00674d92a874b73") require.NoError(t, err) ecdsaPublicKeyBytes, err := hex.DecodeString("04a735e9e3cb526f83be23b03f1f5ae7788a8654e3f0fcfb4f978290de07ebd47da30eeb72e904fdd4a81b46e320908ff4345e119148f89c1f04674c14a506e24b") diff --git a/deployment/helpers/maps_test.go b/deployment/helpers/maps_test.go index c78e77c56ce..ce173951e17 100644 --- a/deployment/helpers/maps_test.go +++ b/deployment/helpers/maps_test.go @@ -7,7 +7,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/helpers" ) -func TestAddValueToNestedMap(t *testing.T) { +func TestUnit_AddValueToNestedMap(t *testing.T) { tests := []struct { name string mapping map[string]map[string]int diff --git a/deployment/internal/jdtestutils/client_test.go b/deployment/internal/jdtestutils/client_test.go index 06f4da96d01..fce3e92d20b 100644 --- a/deployment/internal/jdtestutils/client_test.go +++ b/deployment/internal/jdtestutils/client_test.go @@ -20,7 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/utils/nodetestutils" ) -func TestJobClientProposeJob(t *testing.T) { +func TestIntegration_Shared_JobClientProposeJob(t *testing.T) { t.Parallel() ctx := t.Context() @@ -125,7 +125,7 @@ func TestJobClientProposeJob(t *testing.T) { } } -func TestJobClientJobAPI(t *testing.T) { +func TestIntegration_Shared_JobClientJobAPI(t *testing.T) { t.Parallel() ctx := t.Context() diff --git a/deployment/keystone/changeset/accept_ownership_test.go b/deployment/keystone/changeset/accept_ownership_test.go index 0d0d98a6fdc..c81091b026e 100644 --- a/deployment/keystone/changeset/accept_ownership_test.go +++ b/deployment/keystone/changeset/accept_ownership_test.go @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" ) -func TestAcceptAllOwnership(t *testing.T) { +func TestUnit_AcceptAllOwnership(t *testing.T) { t.Parallel() registrySel := chain_selectors.TEST_90000001.Selector diff --git a/deployment/keystone/changeset/add_capabilities_test.go b/deployment/keystone/changeset/add_capabilities_test.go index 63feda12998..6ccb856dcc3 100644 --- a/deployment/keystone/changeset/add_capabilities_test.go +++ b/deployment/keystone/changeset/add_capabilities_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" ) -func TestAddCapabilities(t *testing.T) { +func TestUnit_AddCapabilities(t *testing.T) { t.Parallel() capabilitiesToAdd := []kcr.CapabilitiesRegistryCapability{ @@ -80,7 +80,7 @@ func TestAddCapabilities(t *testing.T) { }) } -func TestAddCapabilitiesRequest_Validate_WriterCapability(t *testing.T) { +func TestUnit_AddCapabilitiesRequest_Validate_WriterCapability(t *testing.T) { t.Parallel() tests := []struct { diff --git a/deployment/keystone/changeset/add_dons_test.go b/deployment/keystone/changeset/add_dons_test.go index 205417e09df..7a9531e601e 100644 --- a/deployment/keystone/changeset/add_dons_test.go +++ b/deployment/keystone/changeset/add_dons_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) -func TestAddDONs(t *testing.T) { +func TestUnit_AddDONs(t *testing.T) { t.Parallel() var testCap = kcr.CapabilitiesRegistryCapability{ LabelledName: "cap1", diff --git a/deployment/keystone/changeset/add_nodes_test.go b/deployment/keystone/changeset/add_nodes_test.go index 4e57534c664..8c2b22136b8 100644 --- a/deployment/keystone/changeset/add_nodes_test.go +++ b/deployment/keystone/changeset/add_nodes_test.go @@ -22,7 +22,7 @@ type mcmsTestCase struct { mcmsConfig *changeset.MCMSConfig } -func TestAddNodes(t *testing.T) { +func TestUnit_AddNodes(t *testing.T) { t.Parallel() type input struct { diff --git a/deployment/keystone/changeset/add_nops_test.go b/deployment/keystone/changeset/add_nops_test.go index 33540b4490d..08ec59805d2 100644 --- a/deployment/keystone/changeset/add_nops_test.go +++ b/deployment/keystone/changeset/add_nops_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" ) -func TestAddNops(t *testing.T) { +func TestUnit_AddNops(t *testing.T) { t.Parallel() nops := []kcr.CapabilitiesRegistryNodeOperator{ diff --git a/deployment/keystone/changeset/append_node_capabilities_test.go b/deployment/keystone/changeset/append_node_capabilities_test.go index 2dac32a33e7..b8d9251bd3a 100644 --- a/deployment/keystone/changeset/append_node_capabilities_test.go +++ b/deployment/keystone/changeset/append_node_capabilities_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) -func TestAppendNodeCapabilities(t *testing.T) { +func TestUnit_AppendNodeCapabilities(t *testing.T) { t.Parallel() var ( diff --git a/deployment/keystone/changeset/deploy_balance_reader_test.go b/deployment/keystone/changeset/deploy_balance_reader_test.go index 1f68bc4cb31..cf9ffe0761b 100644 --- a/deployment/keystone/changeset/deploy_balance_reader_test.go +++ b/deployment/keystone/changeset/deploy_balance_reader_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" ) -func TestDeployBalanceReader(t *testing.T) { +func TestUnit_DeployBalanceReader(t *testing.T) { t.Parallel() registrySel := chain_selectors.TEST_90000001.Selector diff --git a/deployment/keystone/changeset/deploy_consumer_test.go b/deployment/keystone/changeset/deploy_consumer_test.go index 8c861738589..831e1eeb7de 100644 --- a/deployment/keystone/changeset/deploy_consumer_test.go +++ b/deployment/keystone/changeset/deploy_consumer_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" ) -func TestDeployFeedsConsumer(t *testing.T) { +func TestUnit_DeployFeedsConsumer(t *testing.T) { t.Parallel() registrySel := chain_selectors.TEST_90000001.Selector diff --git a/deployment/keystone/changeset/deploy_forwarder_test.go b/deployment/keystone/changeset/deploy_forwarder_test.go index b918233d55e..3e961ca23ff 100644 --- a/deployment/keystone/changeset/deploy_forwarder_test.go +++ b/deployment/keystone/changeset/deploy_forwarder_test.go @@ -22,7 +22,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" ) -func TestDeployForwarder(t *testing.T) { +func TestUnit_DeployForwarder(t *testing.T) { t.Parallel() registrySel := chain_selectors.TEST_90000001.Selector @@ -52,7 +52,7 @@ func TestDeployForwarder(t *testing.T) { }) } -func TestConfigureForwarders(t *testing.T) { +func TestUnit_ConfigureForwarders(t *testing.T) { t.Parallel() testCases := []struct { diff --git a/deployment/keystone/changeset/deploy_ocr3_test.go b/deployment/keystone/changeset/deploy_ocr3_test.go index 00b7351e9bc..d9ba81857ce 100644 --- a/deployment/keystone/changeset/deploy_ocr3_test.go +++ b/deployment/keystone/changeset/deploy_ocr3_test.go @@ -25,7 +25,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" ) -func TestDeployOCR3(t *testing.T) { +func TestUnit_DeployOCR3(t *testing.T) { t.Parallel() registrySel := chain_selectors.TEST_90000001.Selector @@ -59,7 +59,7 @@ func TestDeployOCR3(t *testing.T) { assert.Empty(t, oaddrs) } -func TestConfigureOCR3(t *testing.T) { +func TestUnit_ConfigureOCR3(t *testing.T) { t.Parallel() nWfNodes := 4 diff --git a/deployment/keystone/changeset/deploy_registry_test.go b/deployment/keystone/changeset/deploy_registry_test.go index 0a0b085e933..ccb46b6fd5d 100644 --- a/deployment/keystone/changeset/deploy_registry_test.go +++ b/deployment/keystone/changeset/deploy_registry_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" ) -func TestDeployCapabilityRegistry(t *testing.T) { +func TestUnit_DeployCapabilityRegistry(t *testing.T) { t.Parallel() registrySel := chain_selectors.TEST_90000001.Selector diff --git a/deployment/keystone/changeset/internal/append_node_capabilities_test.go b/deployment/keystone/changeset/internal/append_node_capabilities_test.go index ce2807b14b1..0b90f2a3a85 100644 --- a/deployment/keystone/changeset/internal/append_node_capabilities_test.go +++ b/deployment/keystone/changeset/internal/append_node_capabilities_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) -func TestAppendNodeCapabilities(t *testing.T) { +func TestUnit_AppendNodeCapabilities(t *testing.T) { var ( initialp2pToCapabilities = map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability{ testPeerID(t, "0x1"): { diff --git a/deployment/keystone/changeset/internal/deploy_test.go b/deployment/keystone/changeset/internal/deploy_test.go index 439d3b9eb40..3567a1f5df9 100644 --- a/deployment/keystone/changeset/internal/deploy_test.go +++ b/deployment/keystone/changeset/internal/deploy_test.go @@ -25,7 +25,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) -func Test_RegisterNOPS(t *testing.T) { +func TestUnit_RegisterNOPS(t *testing.T) { var ( useMCMS bool lggr = logger.Test(t) @@ -66,7 +66,7 @@ func Test_RegisterNOPS(t *testing.T) { }) } -func Test_AddCapabilities(t *testing.T) { +func TestUnit_AddCapabilities(t *testing.T) { var ( useMCMS bool lggr = logger.Test(t) @@ -140,7 +140,7 @@ func Test_AddCapabilities(t *testing.T) { }) } -func Test_RegisterNodes(t *testing.T) { +func TestUnit_RegisterNodes(t *testing.T) { var ( useMCMS bool lggr = logger.Test(t) @@ -394,7 +394,7 @@ func assertNodesExist(t *testing.T, registry *kcr.CapabilitiesRegistry, nodes .. } } -func Test_RegisterDons(t *testing.T) { +func TestUnit_RegisterDons(t *testing.T) { var ( useMCMS bool lggr = logger.Test(t) @@ -582,7 +582,7 @@ func Test_RegisterDons(t *testing.T) { }) } -func TestAddNodes(t *testing.T) { +func TestUnit_AddNodes(t *testing.T) { var ( lggr = logger.Test(t) existingNOP = testNop(t, "testNop") diff --git a/deployment/keystone/changeset/internal/remove_dons_test.go b/deployment/keystone/changeset/internal/remove_dons_test.go index 2608e571207..cdbc643135c 100644 --- a/deployment/keystone/changeset/internal/remove_dons_test.go +++ b/deployment/keystone/changeset/internal/remove_dons_test.go @@ -23,7 +23,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) -func Test_RemoveDONsRequest_validate(t *testing.T) { +func TestUnit_RemoveDONsRequest_validate(t *testing.T) { type fields struct { DONs []uint32 chain cldf_evm.Chain @@ -77,7 +77,7 @@ func Test_RemoveDONsRequest_validate(t *testing.T) { } // TestRemoveDONs tests the RemoveDONs function -func TestRemoveDONs(t *testing.T) { +func TestUnit_RemoveDONs(t *testing.T) { t.Parallel() lggr := logger.Test(t) diff --git a/deployment/keystone/changeset/internal/state_test.go b/deployment/keystone/changeset/internal/state_test.go index 8986f501af7..d8ebe908fb5 100644 --- a/deployment/keystone/changeset/internal/state_test.go +++ b/deployment/keystone/changeset/internal/state_test.go @@ -21,7 +21,7 @@ import ( "github.com/stretchr/testify/require" ) -func Test_GetContractSet(t *testing.T) { +func TestUnit_GetContractSet(t *testing.T) { type testCase struct { name string giveRequest *GetContractSetsRequest diff --git a/deployment/keystone/changeset/internal/update_don_test.go b/deployment/keystone/changeset/internal/update_don_test.go index b2733bb2d45..baa20bc090f 100644 --- a/deployment/keystone/changeset/internal/update_don_test.go +++ b/deployment/keystone/changeset/internal/update_don_test.go @@ -32,7 +32,7 @@ var ( registryChain = chainsel.TEST_90000001 ) -func TestUpdateDon(t *testing.T) { +func TestUnit_UpdateDon(t *testing.T) { var ( // nodes p2p1 = p2pkey.MustNewV2XXXTestingOnly(big.NewInt(100)) @@ -169,7 +169,7 @@ func TestUpdateDon(t *testing.T) { }) } -func TestUpdateDon_ChangeComposition(t *testing.T) { +func TestUnit_UpdateDon_ChangeComposition(t *testing.T) { var ( // Initial nodes (n1-n4) p2p1 = p2pkey.MustNewV2XXXTestingOnly(big.NewInt(100)) diff --git a/deployment/keystone/changeset/internal/update_node_capabilities_test.go b/deployment/keystone/changeset/internal/update_node_capabilities_test.go index 9b155cd19fa..44f33a619cd 100644 --- a/deployment/keystone/changeset/internal/update_node_capabilities_test.go +++ b/deployment/keystone/changeset/internal/update_node_capabilities_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) -func TestUpdateNodeCapabilities(t *testing.T) { +func TestUnit_UpdateNodeCapabilities(t *testing.T) { var ( initialp2pToCapabilities = map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability{ testPeerID(t, "0x1"): []kcr.CapabilitiesRegistryCapability{ diff --git a/deployment/keystone/changeset/internal/update_nodes_test.go b/deployment/keystone/changeset/internal/update_nodes_test.go index 8de084e6379..88e6edd0287 100644 --- a/deployment/keystone/changeset/internal/update_nodes_test.go +++ b/deployment/keystone/changeset/internal/update_nodes_test.go @@ -30,7 +30,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) -func Test_UpdateNodesRequest_validate(t *testing.T) { +func TestUnit_UpdateNodesRequest_validate(t *testing.T) { type fields struct { p2pToUpdates map[p2pkey.PeerID]internal.NodeUpdate nopToNodes map[kcr.CapabilitiesRegistryNodeOperator][]*internal.P2PSignerEnc @@ -102,7 +102,7 @@ func newEncryptionKey(t *testing.T) [32]byte { return [32]byte(key) } -func TestUpdateNodes(t *testing.T) { +func TestUnit_UpdateNodes(t *testing.T) { chain := testChain(t) require.NotNil(t, chain) lggr := logger.Test(t) @@ -618,7 +618,7 @@ func TestUpdateNodes(t *testing.T) { }) } -func TestAppendCapabilities(t *testing.T) { +func TestUnit_AppendCapabilities(t *testing.T) { var ( capMap = map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability{ testPeerID(t, "peerID_1"): []kcr.CapabilitiesRegistryCapability{ diff --git a/deployment/keystone/changeset/ocr3_job_test.go b/deployment/keystone/changeset/ocr3_job_test.go index 7c15eafd2bb..318978b1a4d 100644 --- a/deployment/keystone/changeset/ocr3_job_test.go +++ b/deployment/keystone/changeset/ocr3_job_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestResolveOCR3Job(t *testing.T) { +func TestUnit_ResolveOCR3Job(t *testing.T) { t.Parallel() type args struct { diff --git a/deployment/keystone/changeset/operations/contracts/add_capabilities_op_test.go b/deployment/keystone/changeset/operations/contracts/add_capabilities_op_test.go index 99d6b074eab..d331c0718fe 100644 --- a/deployment/keystone/changeset/operations/contracts/add_capabilities_op_test.go +++ b/deployment/keystone/changeset/operations/contracts/add_capabilities_op_test.go @@ -60,11 +60,11 @@ func doAppendCapabilitiesOp(t *testing.T, useMcms bool) { require.Len(t, opOutput.Output.MCMSTimelockProposals[0].Operations[0].Transactions, 2) // add capabilities, update nodes } } -func TestAppendCapabilitiesWithMCMS(t *testing.T) { +func TestUnit_AppendCapabilitiesWithMCMS(t *testing.T) { t.Parallel() doAppendCapabilitiesOp(t, true) } -func TestAppendCapabilitiesWithoutMCMS(t *testing.T) { +func TestUnit_AppendCapabilitiesWithoutMCMS(t *testing.T) { t.Parallel() doAppendCapabilitiesOp(t, false) } @@ -123,11 +123,11 @@ func doUpdateDonOp(t *testing.T, useMcms bool) { require.Len(t, opOutput.Output.MCMSTimelockProposals[0].Operations[0].Transactions, 3) } } -func TestUpdateDonOpWithMCMS(t *testing.T) { +func TestUnit_UpdateDonOpWithMCMS(t *testing.T) { t.Parallel() doUpdateDonOp(t, true) } -func TestUpdateDonOpWithoutMCMS(t *testing.T) { +func TestUnit_UpdateDonOpWithoutMCMS(t *testing.T) { t.Parallel() doUpdateDonOp(t, false) } diff --git a/deployment/keystone/changeset/operations/contracts/deploy_capability_registry_op_test.go b/deployment/keystone/changeset/operations/contracts/deploy_capability_registry_op_test.go index cec5e22e623..f159d2f6664 100644 --- a/deployment/keystone/changeset/operations/contracts/deploy_capability_registry_op_test.go +++ b/deployment/keystone/changeset/operations/contracts/deploy_capability_registry_op_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/operations/contracts" ) -func Test_DeployRegistryOp(t *testing.T) { +func TestUnit_DeployRegistryOp(t *testing.T) { t.Parallel() registrySel := chain_selectors.TEST_90000001.Selector diff --git a/deployment/keystone/changeset/operations/contracts/deploy_configure_forwarders_seq_test.go b/deployment/keystone/changeset/operations/contracts/deploy_configure_forwarders_seq_test.go index 852ff6ea6d8..b76494d533d 100644 --- a/deployment/keystone/changeset/operations/contracts/deploy_configure_forwarders_seq_test.go +++ b/deployment/keystone/changeset/operations/contracts/deploy_configure_forwarders_seq_test.go @@ -108,12 +108,12 @@ func doDeployConfigureForwardersSeq(t *testing.T, useMcms bool) { } } -func Test_DeployConfigureForwardersSeqWithoutMCMSSetup(t *testing.T) { +func TestUnit_DeployConfigureForwardersSeqWithoutMCMSSetup(t *testing.T) { t.Parallel() doDeployConfigureForwardersSeq(t, false) } -func Test_DeployConfigureForwardersSeqWithMCMSSetup(t *testing.T) { +func TestUnit_DeployConfigureForwardersSeqWithMCMSSetup(t *testing.T) { t.Parallel() doDeployConfigureForwardersSeq(t, true) } diff --git a/deployment/keystone/changeset/remove_dons_test.go b/deployment/keystone/changeset/remove_dons_test.go index b31cfcd8fa1..f78fc598284 100644 --- a/deployment/keystone/changeset/remove_dons_test.go +++ b/deployment/keystone/changeset/remove_dons_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" ) -func Test_RemoveDONsRequest_validate(t *testing.T) { +func TestUnit_RemoveDONsRequest_validate(t *testing.T) { t.Parallel() env := test.SetupContractTestEnv(t, test.EnvWrapperConfig{ @@ -76,7 +76,7 @@ func Test_RemoveDONsRequest_validate(t *testing.T) { } } -func TestRemoveDONs(t *testing.T) { +func TestUnit_RemoveDONs(t *testing.T) { t.Parallel() tests := []struct { diff --git a/deployment/keystone/changeset/solana/deploy_forwarder_test.go b/deployment/keystone/changeset/solana/deploy_forwarder_test.go index 4b479a73a98..2634123c7c3 100644 --- a/deployment/keystone/changeset/solana/deploy_forwarder_test.go +++ b/deployment/keystone/changeset/solana/deploy_forwarder_test.go @@ -34,7 +34,7 @@ const ( // Tests with transfer upgrade authority require downloading and building artifacts // from chainlink-solana // so we disable them in CI since it will take too long to run -func TestDeployForwarder(t *testing.T) { +func TestUnit_DeployForwarder(t *testing.T) { skipInCI(t) t.Parallel() @@ -84,7 +84,7 @@ func TestDeployForwarder(t *testing.T) { }) } -func TestConfigureForwarder(t *testing.T) { +func TestUnit_ConfigureForwarder(t *testing.T) { t.Parallel() // Setup the solana programs diff --git a/deployment/keystone/changeset/test/env_setup_test.go b/deployment/keystone/changeset/test/env_setup_test.go index a8098160b15..b9c2d1eb70e 100644 --- a/deployment/keystone/changeset/test/env_setup_test.go +++ b/deployment/keystone/changeset/test/env_setup_test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/node" ) -func TestSetupEnv(t *testing.T) { +func TestUnit_SetupEnv(t *testing.T) { t.Parallel() t.Run("test env with in memory nodes", func(t *testing.T) { diff --git a/deployment/keystone/changeset/tron/configure_forwarder_test.go b/deployment/keystone/changeset/tron/configure_forwarder_test.go index 0f375ac2a3f..fff3aa561fb 100644 --- a/deployment/keystone/changeset/tron/configure_forwarder_test.go +++ b/deployment/keystone/changeset/tron/configure_forwarder_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/tron" ) -func TestConfigureForwarder(t *testing.T) { +func TestUnit_ConfigureForwarder(t *testing.T) { t.Parallel() testCases := []struct { diff --git a/deployment/keystone/changeset/tron/deploy_forwarder_test.go b/deployment/keystone/changeset/tron/deploy_forwarder_test.go index 2972006d356..135baf63f7b 100644 --- a/deployment/keystone/changeset/tron/deploy_forwarder_test.go +++ b/deployment/keystone/changeset/tron/deploy_forwarder_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/tron" ) -func TestDeployForwarder(t *testing.T) { +func TestUnit_DeployForwarder(t *testing.T) { t.Parallel() registrySel := chain_selectors.TRON_DEVNET.Selector diff --git a/deployment/keystone/changeset/update_don_test.go b/deployment/keystone/changeset/update_don_test.go index b5565e90117..89b56d3d4e0 100644 --- a/deployment/keystone/changeset/update_don_test.go +++ b/deployment/keystone/changeset/update_don_test.go @@ -30,7 +30,7 @@ var ( caps = []kcr.CapabilitiesRegistryCapability{capA, capB} ) -func TestUpdateDon(t *testing.T) { +func TestUnit_UpdateDon(t *testing.T) { t.Parallel() capACfg, err := proto.Marshal(test.GetDefaultCapConfig(t, capA)) @@ -150,7 +150,7 @@ func TestUpdateDon(t *testing.T) { } } -func TestUpdateDon_ChangeComposition(t *testing.T) { +func TestUnit_UpdateDon_ChangeComposition(t *testing.T) { t.Parallel() // Test capability configurations diff --git a/deployment/keystone/changeset/update_node_capabilities_test.go b/deployment/keystone/changeset/update_node_capabilities_test.go index 6da6f2b5cfb..39012daf2fc 100644 --- a/deployment/keystone/changeset/update_node_capabilities_test.go +++ b/deployment/keystone/changeset/update_node_capabilities_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) -func TestUpdateNodeCapabilities(t *testing.T) { +func TestUnit_UpdateNodeCapabilities(t *testing.T) { t.Parallel() var ( diff --git a/deployment/keystone/changeset/update_nodes_test.go b/deployment/keystone/changeset/update_nodes_test.go index d9fdb7f1e27..38013b0fcc7 100644 --- a/deployment/keystone/changeset/update_nodes_test.go +++ b/deployment/keystone/changeset/update_nodes_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) -func TestUpdateNodes(t *testing.T) { +func TestUnit_UpdateNodes(t *testing.T) { t.Parallel() t.Run("no mcms", func(t *testing.T) { diff --git a/deployment/keystone/changeset/view_test.go b/deployment/keystone/changeset/view_test.go index 4161ee7249b..a545a090343 100644 --- a/deployment/keystone/changeset/view_test.go +++ b/deployment/keystone/changeset/view_test.go @@ -52,7 +52,7 @@ var oracleConfig = changeset.OracleConfig{ UniqueReports: true, } -func TestKeystoneView(t *testing.T) { +func TestUnit_KeystoneView(t *testing.T) { t.Parallel() env := test.SetupContractTestEnv(t, test.EnvWrapperConfig{ WFDonConfig: test.DonConfig{N: 4, Name: "wfDon"}, diff --git a/deployment/keystone/changeset/workflowregistry/deploy_test.go b/deployment/keystone/changeset/workflowregistry/deploy_test.go index a8baab55e88..93957a84025 100644 --- a/deployment/keystone/changeset/workflowregistry/deploy_test.go +++ b/deployment/keystone/changeset/workflowregistry/deploy_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/require" ) -func Test_Deploy(t *testing.T) { +func TestUnit_Deploy(t *testing.T) { t.Parallel() registrySel := chain_selectors.TEST_90000001.Selector diff --git a/deployment/keystone/changeset/workflowregistry/update_allowed_dons_test.go b/deployment/keystone/changeset/workflowregistry/update_allowed_dons_test.go index c50b2c1dca0..5447f572910 100644 --- a/deployment/keystone/changeset/workflowregistry/update_allowed_dons_test.go +++ b/deployment/keystone/changeset/workflowregistry/update_allowed_dons_test.go @@ -20,7 +20,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/workflowregistry" ) -func TestUpdateAllowedDons(t *testing.T) { +func TestUnit_UpdateAllowedDons(t *testing.T) { lggr := logger.Test(t) chainSel := chain_selectors.ETHEREUM_TESTNET_SEPOLIA.Selector @@ -73,7 +73,7 @@ func TestUpdateAllowedDons(t *testing.T) { assert.Empty(t, dons) } -func Test_UpdateAllowedDons_WithMCMS(t *testing.T) { +func TestUnit_UpdateAllowedDons_WithMCMS(t *testing.T) { te := test.SetupContractTestEnv(t, test.EnvWrapperConfig{ WFDonConfig: test.DonConfig{Name: "wfDon", N: 4}, AssetDonConfig: test.DonConfig{Name: "assetDon", N: 4}, diff --git a/deployment/keystone/changeset/workflowregistry/update_authorized_addresses_test.go b/deployment/keystone/changeset/workflowregistry/update_authorized_addresses_test.go index a6e5c5b63f9..202a707d52d 100644 --- a/deployment/keystone/changeset/workflowregistry/update_authorized_addresses_test.go +++ b/deployment/keystone/changeset/workflowregistry/update_authorized_addresses_test.go @@ -21,7 +21,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/workflowregistry" ) -func TestUpdateAuthorizedAddresses(t *testing.T) { +func TestUnit_UpdateAuthorizedAddresses(t *testing.T) { lggr := logger.Test(t) chainSel := chain_selectors.ETHEREUM_TESTNET_SEPOLIA.Selector @@ -75,7 +75,7 @@ func TestUpdateAuthorizedAddresses(t *testing.T) { assert.Empty(t, authorizedAddresses) } -func Test_UpdateAuthorizedAddresses_WithMCMS(t *testing.T) { +func TestUnit_UpdateAuthorizedAddresses_WithMCMS(t *testing.T) { te := test.SetupContractTestEnv(t, test.EnvWrapperConfig{ WFDonConfig: test.DonConfig{Name: "wfDon", N: 4}, AssetDonConfig: test.DonConfig{Name: "assetDon", N: 4}, diff --git a/deployment/keystone/test/changeset/capability_registry_test.go b/deployment/keystone/test/changeset/capability_registry_test.go index d64058c9054..85955106e46 100644 --- a/deployment/keystone/test/changeset/capability_registry_test.go +++ b/deployment/keystone/test/changeset/capability_registry_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/common/view/v1_0" ) -func TestHydrateCapabilityRegistry(t *testing.T) { +func TestUnit_HydrateCapabilityRegistry(t *testing.T) { b, err := os.ReadFile("testdata/capability_registry_view.json") require.NoError(t, err) require.NotEmpty(t, b) diff --git a/deployment/labeled_addresses_test.go b/deployment/labeled_addresses_test.go index c4c4fe0b2ab..ce726403bc6 100644 --- a/deployment/labeled_addresses_test.go +++ b/deployment/labeled_addresses_test.go @@ -9,7 +9,7 @@ import ( cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" ) -func TestLabeledAddresses_And(t *testing.T) { +func TestUnit_LabeledAddresses_And(t *testing.T) { tests := []struct { name string give LabeledAddresses diff --git a/deployment/tokens/changesets/deploy_evm_link_tokens_test.go b/deployment/tokens/changesets/deploy_evm_link_tokens_test.go index 4aeff3759ca..90476b73b2e 100644 --- a/deployment/tokens/changesets/deploy_evm_link_tokens_test.go +++ b/deployment/tokens/changesets/deploy_evm_link_tokens_test.go @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/tokens/internal/ops" ) -func Test_DeployEVMLinkTokens_VerifyPreconditions(t *testing.T) { +func TestUnit_DeployEVMLinkTokens_VerifyPreconditions(t *testing.T) { t.Parallel() var ( @@ -139,7 +139,7 @@ func Test_DeployEVMLinkTokens_VerifyPreconditions(t *testing.T) { } } -func Test_DeployEVMLinkTokens_Apply(t *testing.T) { +func TestUnit_DeployEVMLinkTokens_Apply(t *testing.T) { t.Parallel() tests := []struct { diff --git a/deployment/tokens/changesets/deploy_sol_link_tokens_test.go b/deployment/tokens/changesets/deploy_sol_link_tokens_test.go index 76826616861..866ca1ec361 100644 --- a/deployment/tokens/changesets/deploy_sol_link_tokens_test.go +++ b/deployment/tokens/changesets/deploy_sol_link_tokens_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/tokens/internal/ops" ) -func Test_DeploySolLinkTokens_VerifyPreconditions(t *testing.T) { +func TestUnit_DeploySolLinkTokens_VerifyPreconditions(t *testing.T) { t.Parallel() var ( @@ -138,7 +138,7 @@ func Test_DeploySolLinkTokens_VerifyPreconditions(t *testing.T) { } } -func Test_DeploySolLinkTokens_Apply(t *testing.T) { +func TestUnit_DeploySolLinkTokens_Apply(t *testing.T) { t.Parallel() tests := []struct { diff --git a/deployment/tokens/changesets/validate_test.go b/deployment/tokens/changesets/validate_test.go index e052c89760d..e37baf22d73 100644 --- a/deployment/tokens/changesets/validate_test.go +++ b/deployment/tokens/changesets/validate_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/tokens/internal/ops" ) -func Test_validateNoDupeSelectors(t *testing.T) { +func TestUnit_validateNoDupeSelectors(t *testing.T) { t.Parallel() tests := []struct { @@ -51,7 +51,7 @@ func Test_validateNoDupeSelectors(t *testing.T) { } } -func Test_validateNoExistingLinkToken(t *testing.T) { +func TestUnit_validateNoExistingLinkToken(t *testing.T) { var ( csel = chain_selectors.ETHEREUM_TESTNET_SEPOLIA.Selector ethAddr = "0xeC91988D7dD84d8adE801b739172ad15c860A700" @@ -147,7 +147,7 @@ func Test_validateNoExistingLinkToken(t *testing.T) { } } -func Test_validateChainSelectorsFamily(t *testing.T) { +func TestUnit_validateChainSelectorsFamily(t *testing.T) { t.Parallel() var ( diff --git a/deployment/tokens/internal/ops/ops_evm_test.go b/deployment/tokens/internal/ops/ops_evm_test.go index 62f3c1d43e0..d6ea266e1d3 100644 --- a/deployment/tokens/internal/ops/ops_evm_test.go +++ b/deployment/tokens/internal/ops/ops_evm_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/operations/optest" ) -func Test_OpEVMDeployLinkToken(t *testing.T) { +func TestUnit_OpEVMDeployLinkToken(t *testing.T) { t.Parallel() var ( diff --git a/deployment/tokens/internal/ops/ops_sol_test.go b/deployment/tokens/internal/ops/ops_sol_test.go index a3bc756f3b0..2bca4a6c66f 100644 --- a/deployment/tokens/internal/ops/ops_sol_test.go +++ b/deployment/tokens/internal/ops/ops_sol_test.go @@ -17,7 +17,7 @@ import ( // client, this is the best we can do for unit tests. // // This test is limited to verifying operation error handling. -func Test_OpSolDeployLinkToken(t *testing.T) { +func TestUnit_OpSolDeployLinkToken(t *testing.T) { t.Parallel() var ( diff --git a/deployment/tokens/internal/ops/ops_storage_test.go b/deployment/tokens/internal/ops/ops_storage_test.go index 87308c3f869..51d653e35c2 100644 --- a/deployment/tokens/internal/ops/ops_storage_test.go +++ b/deployment/tokens/internal/ops/ops_storage_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/operations/optest" ) -func Test_OpAddAddrBookRecord(t *testing.T) { +func TestUnit_OpAddAddrBookRecord(t *testing.T) { t.Parallel() var ( @@ -87,7 +87,7 @@ func Test_OpAddAddrBookRecord(t *testing.T) { } } -func Test_OpAddDatastoreAddrRef(t *testing.T) { +func TestUnit_OpAddDatastoreAddrRef(t *testing.T) { t.Parallel() var ( diff --git a/deployment/tokens/internal/seqs/seq_deploy_evm_tokens_test.go b/deployment/tokens/internal/seqs/seq_deploy_evm_tokens_test.go index ef5de99cdbb..fc3082df507 100644 --- a/deployment/tokens/internal/seqs/seq_deploy_evm_tokens_test.go +++ b/deployment/tokens/internal/seqs/seq_deploy_evm_tokens_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/operations/optest" ) -func Test_SeqDeployEVMTokens(t *testing.T) { +func TestUnit_SeqDeployEVMTokens(t *testing.T) { t.Parallel() var ( diff --git a/deployment/tokens/internal/seqs/seq_deploy_solana_tokens_test.go b/deployment/tokens/internal/seqs/seq_deploy_solana_tokens_test.go index b1c66be4782..e2104071812 100644 --- a/deployment/tokens/internal/seqs/seq_deploy_solana_tokens_test.go +++ b/deployment/tokens/internal/seqs/seq_deploy_solana_tokens_test.go @@ -18,7 +18,7 @@ import ( var once sync.Once -func Test_SeqDeploySolTokens(t *testing.T) { +func TestUnit_SeqDeploySolTokens(t *testing.T) { t.Parallel() var ( diff --git a/deployment/tokens/internal/seqs/seq_persist_address_test.go b/deployment/tokens/internal/seqs/seq_persist_address_test.go index 625978059ad..7aa13623de7 100644 --- a/deployment/tokens/internal/seqs/seq_persist_address_test.go +++ b/deployment/tokens/internal/seqs/seq_persist_address_test.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/operations/optest" ) -func Test_PersistAddress(t *testing.T) { +func TestUnit_PersistAddress(t *testing.T) { t.Parallel() var ( diff --git a/deployment/utils/nodetestutils/node_test.go b/deployment/utils/nodetestutils/node_test.go index 51d24744ddd..542d7e1eef3 100644 --- a/deployment/utils/nodetestutils/node_test.go +++ b/deployment/utils/nodetestutils/node_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/onchain" ) -func TestNode(t *testing.T) { +func TestIntegration_Shared_Node(t *testing.T) { evmchains, err := onchain.NewEVMSimLoaderWithConfig(onchain.EVMSimLoaderConfig{ NumAdditionalAccounts: 5, }).LoadN(t, 3) diff --git a/deployment/utils/solutils/artifacts_test.go b/deployment/utils/solutils/artifacts_test.go index ba1f43b8535..7b8e787e034 100644 --- a/deployment/utils/solutils/artifacts_test.go +++ b/deployment/utils/solutils/artifacts_test.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" ) -func TestDownloadProgramArtifacts(t *testing.T) { +func TestUnit_DownloadProgramArtifacts(t *testing.T) { tests := []struct { name string setupServer func() *httptest.Server @@ -159,7 +159,7 @@ func TestDownloadProgramArtifacts(t *testing.T) { } } -func TestDownloadProgramArtifacts_ContextCancellation(t *testing.T) { +func TestUnit_DownloadProgramArtifacts_ContextCancellation(t *testing.T) { // Create a server that delays response server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // Simulate a slow server @@ -181,14 +181,14 @@ func TestDownloadProgramArtifacts_ContextCancellation(t *testing.T) { require.ErrorContains(t, err, "context canceled") } -func TestDownloadProgramArtifacts_InvalidURL(t *testing.T) { +func TestUnit_DownloadProgramArtifacts_InvalidURL(t *testing.T) { tempDir := t.TempDir() err := downloadProgramArtifacts(t.Context(), "http://invalid-url", tempDir, logger.Test(t)) require.ErrorContains(t, err, "dial tcp: lookup invalid-url: no such host") } -func TestDownloadProgramArtifacts_NonExistentTargetDir(t *testing.T) { +func TestUnit_DownloadProgramArtifacts_NonExistentTargetDir(t *testing.T) { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/gzip") diff --git a/deployment/vault/changeset/batch_native_transfer_test.go b/deployment/vault/changeset/batch_native_transfer_test.go index 279a65f5c09..99207087781 100644 --- a/deployment/vault/changeset/batch_native_transfer_test.go +++ b/deployment/vault/changeset/batch_native_transfer_test.go @@ -35,7 +35,7 @@ var ( HundredETH = big.NewInt(0).Mul(OneETH, big.NewInt(100)) ) -func TestBatchNativeTransferValidation(t *testing.T) { +func TestUnit_BatchNativeTransferValidation(t *testing.T) { t.Parallel() env, err := environment.New(t.Context()) @@ -121,7 +121,7 @@ func TestBatchNativeTransferValidation(t *testing.T) { } } -func TestSetWhitelist(t *testing.T) { +func TestUnit_SetWhitelist(t *testing.T) { t.Parallel() rt, err := runtime.New(t.Context()) @@ -193,7 +193,7 @@ func TestSetWhitelist(t *testing.T) { require.Equal(t, []string{"partner", "approved"}, addressLabels[testAddr2]) } -func TestBatchNativeTransferIntegration(t *testing.T) { +func TestUnit_BatchNativeTransferIntegration(t *testing.T) { t.Parallel() t.Run("full workflow with MCMS setup", func(t *testing.T) { diff --git a/deployment/vault/changeset/fund_timelock_test.go b/deployment/vault/changeset/fund_timelock_test.go index 64dd8fe01e2..86b3925cd0d 100644 --- a/deployment/vault/changeset/fund_timelock_test.go +++ b/deployment/vault/changeset/fund_timelock_test.go @@ -17,7 +17,7 @@ var ( FiveETH = big.NewInt(0).Mul(OneETH, big.NewInt(5)) ) -func TestFundTimelockValidation(t *testing.T) { +func TestUnit_FundTimelockValidation(t *testing.T) { t.Parallel() selector := chainselectors.TEST_90000001.Selector @@ -100,7 +100,7 @@ func TestFundTimelockValidation(t *testing.T) { } } -func TestGetTimelockBalances(t *testing.T) { +func TestUnit_GetTimelockBalances(t *testing.T) { t.Parallel() selectors := []uint64{chainselectors.TEST_90000001.Selector, chainselectors.TEST_90000002.Selector} @@ -147,7 +147,7 @@ func TestGetTimelockBalances(t *testing.T) { }) } -func TestCalculateFundingRequirements(t *testing.T) { +func TestUnit_CalculateFundingRequirements(t *testing.T) { t.Parallel() selectors := []uint64{chainselectors.TEST_90000001.Selector, chainselectors.TEST_90000002.Selector} @@ -221,7 +221,7 @@ func TestCalculateFundingRequirements(t *testing.T) { }) } -func TestFundTimelockChangeset(t *testing.T) { +func TestUnit_FundTimelockChangeset(t *testing.T) { t.Parallel() selector1 := chainselectors.TEST_90000001.Selector diff --git a/deployment/vault/changeset/manage_whitelist_test.go b/deployment/vault/changeset/manage_whitelist_test.go index cf7614aff16..7dc3760c3e0 100644 --- a/deployment/vault/changeset/manage_whitelist_test.go +++ b/deployment/vault/changeset/manage_whitelist_test.go @@ -23,7 +23,7 @@ const ( whitelistTestAddr4 = "0x4444444444444444444444444444444444444444" ) -func TestSetWhitelistValidation(t *testing.T) { +func TestUnit_SetWhitelistValidation(t *testing.T) { t.Parallel() selector1 := chainselectors.TEST_90000001.Selector @@ -138,7 +138,7 @@ func TestSetWhitelistValidation(t *testing.T) { } } -func TestGetWhitelistedAddresses(t *testing.T) { +func TestUnit_GetWhitelistedAddresses(t *testing.T) { t.Parallel() selector1 := chainselectors.TEST_90000001.Selector @@ -254,7 +254,7 @@ func TestGetWhitelistedAddresses(t *testing.T) { } } -func TestValidateWhitelist(t *testing.T) { +func TestUnit_ValidateWhitelist(t *testing.T) { t.Parallel() env, err := environment.New(t.Context(), @@ -353,7 +353,7 @@ func TestValidateWhitelist(t *testing.T) { }) } -func TestGetChainWhitelist(t *testing.T) { +func TestUnit_GetChainWhitelist(t *testing.T) { t.Parallel() selector := chainselectors.TEST_90000001.Selector @@ -406,7 +406,7 @@ func TestGetChainWhitelist(t *testing.T) { }) } -func TestSetWhitelistChangeset(t *testing.T) { +func TestUnit_SetWhitelistChangeset(t *testing.T) { t.Parallel() var ( @@ -537,7 +537,7 @@ func TestSetWhitelistChangeset(t *testing.T) { }) } -func TestOverwriteWhitelistChangeset(t *testing.T) { +func TestUnit_OverwriteWhitelistChangeset(t *testing.T) { t.Parallel() var ( diff --git a/deployment/vault/view/view_test.go b/deployment/vault/view/view_test.go index 51410e9488a..688015a67ac 100644 --- a/deployment/vault/view/view_test.go +++ b/deployment/vault/view/view_test.go @@ -18,7 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/vault/changeset/types" ) -func TestVault_NoChains(t *testing.T) { +func TestUnit_Vault_NoChains(t *testing.T) { t.Parallel() env, err := environment.New(t.Context()) @@ -34,7 +34,7 @@ func TestVault_NoChains(t *testing.T) { require.Empty(t, view.MCMSWithTimelock) } -func TestGenerateVaultView_WithoutTimelock(t *testing.T) { +func TestUnit_GenerateVaultView_WithoutTimelock(t *testing.T) { t.Parallel() selectors := []uint64{chainselectors.TEST_90000001.Selector} @@ -57,7 +57,7 @@ func TestGenerateVaultView_WithoutTimelock(t *testing.T) { require.Empty(t, view.MCMSWithTimelock) } -func TestGenerateVaultView_WithMCMSAndWhitelist(t *testing.T) { +func TestUnit_GenerateVaultView_WithMCMSAndWhitelist(t *testing.T) { t.Parallel() selectors := []uint64{chainselectors.TEST_90000001.Selector, chainselectors.TEST_90000002.Selector} diff --git a/plugins/cmd_test.go b/plugins/cmd_test.go index 1535bc0bba7..39626e60320 100644 --- a/plugins/cmd_test.go +++ b/plugins/cmd_test.go @@ -8,7 +8,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/loop" ) -func TestNewCmdFactory_RegisterSuccess(t *testing.T) { +func TestUnit_NewCmdFactory_RegisterSuccess(t *testing.T) { mockRegister := func(id string) (*RegisteredLoop, error) { return &RegisteredLoop{EnvCfg: loop.EnvConfig{}}, nil } @@ -30,7 +30,7 @@ func TestNewCmdFactory_RegisterSuccess(t *testing.T) { } } -func TestNewCmdFactory_RegisterFail(t *testing.T) { +func TestUnit_NewCmdFactory_RegisterFail(t *testing.T) { mockRegister := func(id string) (*RegisteredLoop, error) { return nil, errors.New("registration failed") } diff --git a/plugins/env_test.go b/plugins/env_test.go index 6dd171b6cc0..54205eca2f3 100644 --- a/plugins/env_test.go +++ b/plugins/env_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestParseEnvFile(t *testing.T) { +func TestUnit_ParseEnvFile(t *testing.T) { t.Run("valid", func(t *testing.T) { got, err := ParseEnvFile("testdata/valid.env") require.NoError(t, err) diff --git a/plugins/loop_registry_test.go b/plugins/loop_registry_test.go index 322799bddc2..34da5f63ac8 100644 --- a/plugins/loop_registry_test.go +++ b/plugins/loop_registry_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/config" ) -func TestPluginPortManager(t *testing.T) { +func TestUnit_PluginPortManager(t *testing.T) { // register one m := NewTestLoopRegistry(logger.Test(t)) pFoo, err := m.Register("foo") @@ -165,7 +165,7 @@ func (t mockCfgTransmitter) ReaperFrequency() time.Duration { return time.Hour } func (t mockCfgTransmitter) ReaperMaxAge() time.Duration { return time.Minute } -func TestLoopRegistry_Register(t *testing.T) { +func TestUnit_LoopRegistry_Register(t *testing.T) { mockCfgDatabase := &mockCfgDatabase{} mockCfgMercury := &mockCfgMercury{} mockCfgTracing := &mockCfgTracing{} diff --git a/plugins/medianpoc/data_source_test.go b/plugins/medianpoc/data_source_test.go index c4d4043c091..26da8139580 100644 --- a/plugins/medianpoc/data_source_test.go +++ b/plugins/medianpoc/data_source_test.go @@ -32,7 +32,7 @@ func (m *mockPipelineRunner) ExecuteRun(ctx context.Context, spec string, vars c return m.results, m.err } -func TestDataSource(t *testing.T) { +func TestUnit_DataSource(t *testing.T) { lggr := logger.TestLogger(t) expect := jsonserializable.JSONSerializable{Val: int64(3), Valid: true} pr := &mockPipelineRunner{ @@ -69,7 +69,7 @@ func TestDataSource(t *testing.T) { assert.Equal(t, expectBN, ds.current.LatestAnswer) } -func TestDataSource_ResultErrors(t *testing.T) { +func TestUnit_DataSource_ResultErrors(t *testing.T) { lggr := logger.TestLogger(t) pr := &mockPipelineRunner{ results: core.TaskResults{ @@ -92,7 +92,7 @@ func TestDataSource_ResultErrors(t *testing.T) { assert.ErrorContains(t, err, "something went wrong") } -func TestDataSource_ResultNotAnInt(t *testing.T) { +func TestUnit_DataSource_ResultNotAnInt(t *testing.T) { lggr := logger.TestLogger(t) expect := jsonserializable.JSONSerializable{Val: "string-result", Valid: true} diff --git a/plugins/medianpoc/plugin_test.go b/plugins/medianpoc/plugin_test.go index 052fee1bca1..b290dd79e7e 100644 --- a/plugins/medianpoc/plugin_test.go +++ b/plugins/medianpoc/plugin_test.go @@ -79,7 +79,7 @@ func (p provider) Codec() types.Codec { return nil } -func TestNewPlugin(t *testing.T) { +func TestUnit_NewPlugin(t *testing.T) { lggr := logger.TestLogger(t) p := NewPlugin(lggr) diff --git a/tools/bin/go_core_ccip_deployment_tests b/tools/bin/go_core_ccip_deployment_tests index b453b1e17ec..5745457a62a 100755 --- a/tools/bin/go_core_ccip_deployment_tests +++ b/tools/bin/go_core_ccip_deployment_tests @@ -6,6 +6,7 @@ SCRIPT_PATH=`dirname "$0"`; SCRIPT_PATH=`eval "cd \"$SCRIPT_PATH\" && pwd"` OUTPUT_FILE=${OUTPUT_FILE:-"./output.txt"} JUNIT_FILE=${JUNIT_FILE:-"./junit.xml"} GO_TEST_TIMEOUT=${GO_TEST_TIMEOUT:-"15m"} +TEST_REGEX=${TEST_REGEX:-""} # Adjusting freeport port block size for tests. export CL_RESERVE_PORTS=128 @@ -17,11 +18,13 @@ PATH=$PATH:$(go env GOPATH)/bin export PATH echo "Running go_core_ccip_deployment_tests for event: $GITHUB_EVENT_NAME" -GO_TEST_FLAGS="-timeout=${GO_TEST_TIMEOUT}" + +GO_TEST_FLAGS=( "-timeout=${GO_TEST_TIMEOUT}" ) + if [[ "$GITHUB_EVENT_NAME" == 'push' ]]; then - GO_TEST_FLAGS="$GO_TEST_FLAGS -count=1" + GO_TEST_FLAGS+=( "-count=1" ) elif [[ "$GITHUB_EVENT_NAME" == 'schedule' ]]; then - GO_TEST_FLAGS="$GO_TEST_FLAGS -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt" + GO_TEST_FLAGS+=( "-covermode=atomic" "-coverpkg=./..." "-coverprofile=coverage.txt" ) elif [[ "$GITHUB_EVENT_NAME" == 'pull_request' || "$GITHUB_EVENT_NAME" == 'merge_group' ]]; then RERUN_FLAGS="" if [[ "$TRUNK_AUTO_QUARANTINE" != "true" ]]; then @@ -32,11 +35,17 @@ elif [[ "$GITHUB_EVENT_NAME" == 'pull_request' || "$GITHUB_EVENT_NAME" == 'merge fi fi +# Optionally filter tests by prefix +if [[ -n "$TEST_REGEX" ]]; then + echo "Using TEST_REGEX: $TEST_REGEX" + GO_TEST_FLAGS+=( "-run=$TEST_REGEX" ) +fi + if [[ "$PRODUCE_JUNIT_XML" == "true" ]]; then JUNIT_FLAG="--junitfile=$JUNIT_FILE" fi -echo "Using GO_TEST_FLAGS: $GO_TEST_FLAGS" +echo "Using GO_TEST_FLAGS: ${GO_TEST_FLAGS[*]}" echo "Using RERUN_FLAGS: $RERUN_FLAGS" echo "Using JUNIT_FLAG: $JUNIT_FLAG" @@ -52,7 +61,7 @@ gotestsum \ --packages='./...' \ --jsonfile "$OUTPUT_FILE" \ "$JUNIT_FLAG" \ - -- $GO_TEST_FLAGS + -- "${GO_TEST_FLAGS[@]}" EXITCODE=${PIPESTATUS[0]} diff --git a/tools/bin/go_core_tests b/tools/bin/go_core_tests index 3eaaaa2309e..645865640c4 100755 --- a/tools/bin/go_core_tests +++ b/tools/bin/go_core_tests @@ -6,6 +6,7 @@ SCRIPT_PATH=`dirname "$0"`; SCRIPT_PATH=`eval "cd \"$SCRIPT_PATH\" && pwd"` OUTPUT_FILE=${OUTPUT_FILE:-"./output.txt"} JUNIT_FILE=${JUNIT_FILE:-"./junit.xml"} GO_TEST_TIMEOUT=${GO_TEST_TIMEOUT:-"15m"} +TEST_REGEX=${TEST_REGEX:-""} echo "Installing gotestsum..." go install gotest.tools/gotestsum@v1.12.3 @@ -13,26 +14,35 @@ PATH=$PATH:$(go env GOPATH)/bin export PATH echo "Running go_core_tests for event: $GITHUB_EVENT_NAME" -GO_TEST_FLAGS="-timeout=${GO_TEST_TIMEOUT}" + +GO_TEST_FLAGS=( "-timeout=${GO_TEST_TIMEOUT}" ) + if [[ "$GITHUB_EVENT_NAME" == 'push' ]]; then - GO_TEST_FLAGS="$GO_TEST_FLAGS -count=1" + GO_TEST_FLAGS+=( "-count=1" ) elif [[ "$GITHUB_EVENT_NAME" == 'schedule' ]]; then - GO_TEST_FLAGS="$GO_TEST_FLAGS -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt" + GO_TEST_FLAGS+=( "-covermode=atomic" "-coverpkg=./..." "-coverprofile=coverage.txt" ) elif [[ "$GITHUB_EVENT_NAME" == 'pull_request' || "$GITHUB_EVENT_NAME" == 'merge_group' ]]; then RERUN_FLAGS="" if [[ "$TRUNK_AUTO_QUARANTINE" != "true" ]]; then echo "TRUNK_AUTO_QUARANTINE disabled, allowing for gotestsum to rerun failed tests" - RERUN_FLAGS="--rerun-fails-abort-on-data-race --rerun-fails=3" + # TODO: Change back to 3 + RERUN_FLAGS="--rerun-fails-abort-on-data-race --rerun-fails=0" else echo "TRUNK_AUTO_QUARANTINE enabled, gotestsum will not rerun failed tests" fi fi +# Optionally filter tests by prefix +if [[ -n "$TEST_REGEX" ]]; then + echo "Using TEST_REGEX: $TEST_REGEX" + GO_TEST_FLAGS+=( "-run=$TEST_REGEX" ) +fi + if [[ "$PRODUCE_JUNIT_XML" == "true" ]]; then JUNIT_FLAG="--junitfile=$JUNIT_FILE" fi -echo "Using GO_TEST_FLAGS: $GO_TEST_FLAGS" +echo "Using GO_TEST_FLAGS: ${GO_TEST_FLAGS[*]}" echo "Using RERUN_FLAGS: $RERUN_FLAGS" echo "Using JUNIT_FLAG: $JUNIT_FLAG" @@ -48,7 +58,7 @@ gotestsum \ --packages='./...' \ --jsonfile "$OUTPUT_FILE" \ "$JUNIT_FLAG" \ - -- $GO_TEST_FLAGS + -- "${GO_TEST_FLAGS[@]}" EXITCODE=${PIPESTATUS[0]} diff --git a/tools/flakeytests/reporter_test.go b/tools/flakeytests/reporter_test.go index 9f7ff427d70..06738ccb106 100644 --- a/tools/flakeytests/reporter_test.go +++ b/tools/flakeytests/reporter_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestMakeRequest_SingleTest(t *testing.T) { +func TestUnit_MakeRequest_SingleTest(t *testing.T) { now := time.Now() ts := strconv.FormatInt(now.UnixNano(), 10) r := &Report{ @@ -30,7 +30,7 @@ func TestMakeRequest_SingleTest(t *testing.T) { }) } -func TestMakeRequest_MultipleTests(t *testing.T) { +func TestUnit_MakeRequest_MultipleTests(t *testing.T) { now := time.Now() ts := strconv.FormatInt(now.UnixNano(), 10) r := &Report{ @@ -54,7 +54,7 @@ func TestMakeRequest_MultipleTests(t *testing.T) { }) } -func TestMakeRequest_NoTests(t *testing.T) { +func TestUnit_MakeRequest_NoTests(t *testing.T) { now := time.Now() ts := strconv.FormatInt(now.UnixNano(), 10) r := NewReport() @@ -68,7 +68,7 @@ func TestMakeRequest_NoTests(t *testing.T) { }) } -func TestMakeRequest_WithContext(t *testing.T) { +func TestUnit_MakeRequest_WithContext(t *testing.T) { now := time.Now() ts := strconv.FormatInt(now.UnixNano(), 10) r := NewReport() @@ -82,7 +82,7 @@ func TestMakeRequest_WithContext(t *testing.T) { }) } -func TestMakeRequest_Panics(t *testing.T) { +func TestUnit_MakeRequest_Panics(t *testing.T) { now := time.Now() ts := strconv.FormatInt(now.UnixNano(), 10) r := &Report{ @@ -108,7 +108,7 @@ func TestMakeRequest_Panics(t *testing.T) { }) } -func TestDedupeEntries(t *testing.T) { +func TestUnit_DedupeEntries(t *testing.T) { r := &Report{ tests: map[string]map[string]int{ "core/assets": map[string]int{ diff --git a/tools/flakeytests/runner_test.go b/tools/flakeytests/runner_test.go index dad4bf56c0b..adf8128a818 100644 --- a/tools/flakeytests/runner_test.go +++ b/tools/flakeytests/runner_test.go @@ -36,7 +36,7 @@ func newMockReporter() *mockReporter { return &mockReporter{report: NewReport()} } -func TestParser(t *testing.T) { +func TestUnit_Parser(t *testing.T) { output := `{"Time":"2023-09-07T15:39:46.378315+01:00","Action":"fail","Package":"github.com/smartcontractkit/chainlink-evm/pkg/assets","Test":"TestLink","Elapsed":0} ` @@ -50,7 +50,7 @@ func TestParser(t *testing.T) { assert.Equal(t, 1, ts["github.com/smartcontractkit/chainlink-evm/pkg/assets"]["TestLink"]) } -func TestParser_SkipsNonJSON(t *testing.T) { +func TestUnit_Parser_SkipsNonJSON(t *testing.T) { output := `Failed tests and panics: ------- {"Time":"2023-09-07T15:39:46.378315+01:00","Action":"fail","Package":"github.com/smartcontractkit/chainlink-evm/pkg/assets","Test":"TestLink","Elapsed":0} @@ -66,7 +66,7 @@ func TestParser_SkipsNonJSON(t *testing.T) { assert.Equal(t, 1, ts["github.com/smartcontractkit/chainlink-evm/pkg/assets"]["TestLink"]) } -func TestParser_PanicDueToLogging(t *testing.T) { +func TestUnit_Parser_PanicDueToLogging(t *testing.T) { output := ` {"Time":"2023-09-07T16:01:40.649849+01:00","Action":"output","Package":"github.com/smartcontractkit/chainlink-evm/pkg/assets","Test":"TestAssets_LinkScanValue","Output":"panic: foo\n"} ` @@ -81,7 +81,7 @@ func TestParser_PanicDueToLogging(t *testing.T) { assert.Equal(t, 1, ts["github.com/smartcontractkit/chainlink-evm/pkg/assets"]["TestAssets_LinkScanValue"]) } -func TestParser_SuccessfulOutput(t *testing.T) { +func TestUnit_Parser_SuccessfulOutput(t *testing.T) { output := ` {"Time":"2023-09-07T16:22:52.556853+01:00","Action":"start","Package":"github.com/smartcontractkit/chainlink-evm/pkg/assets"} {"Time":"2023-09-07T16:22:52.762353+01:00","Action":"run","Package":"github.com/smartcontractkit/chainlink-evm/pkg/assets","Test":"TestAssets_NewLinkAndString"} @@ -109,7 +109,7 @@ func (t testAdapter) test(pkg string, tests []string, out io.Writer) error { return t(pkg, tests, out) } -func TestRunner_WithFlake(t *testing.T) { +func TestUnit_Runner_WithFlake(t *testing.T) { initialOutput := `{"Time":"2023-09-07T15:39:46.378315+01:00","Action":"fail","Package":"github.com/smartcontractkit/chainlink-evm/pkg/assets","Test":"TestLink","Elapsed":0}` outputs := []string{ `{"Time":"2023-09-07T15:39:46.378315+01:00","Action":"fail","Package":"github.com/smartcontractkit/chainlink-evm/pkg/assets","Test":"TestLink","Elapsed":0}`, @@ -139,7 +139,7 @@ func TestRunner_WithFlake(t *testing.T) { assert.True(t, ok) } -func TestRunner_WithFailedPackage(t *testing.T) { +func TestUnit_Runner_WithFailedPackage(t *testing.T) { initialOutput := ` {"Time":"2023-09-07T15:39:46.378315+01:00","Action":"fail","Package":"github.com/smartcontractkit/chainlink-evm/pkg/assets","Test":"TestLink","Elapsed":0} {"Time":"2023-09-07T15:39:46.378315+01:00","Action":"fail","Package":"github.com/smartcontractkit/chainlink-evm/pkg/assets","Elapsed":0} @@ -174,7 +174,7 @@ func TestRunner_WithFailedPackage(t *testing.T) { assert.True(t, ok) } -func TestRunner_AllFailures(t *testing.T) { +func TestUnit_Runner_AllFailures(t *testing.T) { output := `{"Time":"2023-09-07T15:39:46.378315+01:00","Action":"fail","Package":"github.com/smartcontractkit/chainlink-evm/pkg/assets","Test":"TestLink","Elapsed":0}` rerunOutput := ` @@ -198,7 +198,7 @@ func TestRunner_AllFailures(t *testing.T) { assert.Empty(t, m.report.tests) } -func TestRunner_RerunSuccessful(t *testing.T) { +func TestUnit_Runner_RerunSuccessful(t *testing.T) { output := `{"Time":"2023-09-07T15:39:46.378315+01:00","Action":"fail","Package":"github.com/smartcontractkit/chainlink-evm/pkg/assets","Test":"TestLink","Elapsed":0}` rerunOutputs := []string{ @@ -225,7 +225,7 @@ func TestRunner_RerunSuccessful(t *testing.T) { assert.True(t, ok) } -func TestRunner_RootLevelTest(t *testing.T) { +func TestUnit_Runner_RootLevelTest(t *testing.T) { output := `{"Time":"2023-09-07T15:39:46.378315+01:00","Action":"fail","Package":"github.com/smartcontractkit/chainlink/v2/","Test":"TestConfigDocs","Elapsed":0}` rerunOutput := `` @@ -247,7 +247,7 @@ func TestRunner_RootLevelTest(t *testing.T) { assert.True(t, ok) } -func TestRunner_RerunFailsWithNonzeroExitCode(t *testing.T) { +func TestUnit_Runner_RerunFailsWithNonzeroExitCode(t *testing.T) { output := `{"Time":"2023-09-07T15:39:46.378315+01:00","Action":"fail","Package":"github.com/smartcontractkit/chainlink-evm/pkg/assets","Test":"TestLink","Elapsed":0}` rerunOutputs := []string{ @@ -274,7 +274,7 @@ func TestRunner_RerunFailsWithNonzeroExitCode(t *testing.T) { assert.True(t, ok) } -func TestRunner_RerunWithNonZeroExitCodeDoesntStopCommand(t *testing.T) { +func TestUnit_Runner_RerunWithNonZeroExitCodeDoesntStopCommand(t *testing.T) { outputs := []io.Reader{ strings.NewReader(` {"Time":"2023-09-07T15:39:46.378315+01:00","Action":"fail","Package":"github.com/smartcontractkit/chainlink-evm/pkg/assets","Test":"TestLink","Elapsed":0} @@ -315,7 +315,7 @@ func TestRunner_RerunWithNonZeroExitCodeDoesntStopCommand(t *testing.T) { } // Used for integration tests -func TestSkippedForTests_Subtests(t *testing.T) { +func TestUnit_SkippedForTests_Subtests(t *testing.T) { if skipIntegrationTestMode { t.Skip() } @@ -330,7 +330,7 @@ func TestSkippedForTests_Subtests(t *testing.T) { } // Used for integration tests -func TestSkippedForTests(t *testing.T) { +func TestUnit_SkippedForTests(t *testing.T) { if skipIntegrationTestMode { t.Skip() } @@ -341,7 +341,7 @@ func TestSkippedForTests(t *testing.T) { } // Used for integration tests -func TestSkippedForTests_Success(t *testing.T) { +func TestUnit_SkippedForTests_Success(t *testing.T) { if skipIntegrationTestMode { t.Skip() } @@ -420,7 +420,7 @@ func TestIntegration_ParsesPanics(t *testing.T) { assert.False(t, ok) } -func TestIntegration(t *testing.T) { +func TestUnit_Integration(t *testing.T) { if testing.Short() { t.Skip() } diff --git a/tools/flakeytests/utils_test.go b/tools/flakeytests/utils_test.go index e50222ba9f1..8cba5f13cde 100644 --- a/tools/flakeytests/utils_test.go +++ b/tools/flakeytests/utils_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestDigString(t *testing.T) { +func TestUnit_DigString(t *testing.T) { in := map[string]any{ "pull_request": map[string]any{ "url": "some-url", @@ -35,7 +35,7 @@ var prEventTemplate = ` } ` -func TestGetGithubMetadata(t *testing.T) { +func TestUnit_GetGithubMetadata(t *testing.T) { repo, eventName, sha, event, runID, runAttempt := "chainlink", "merge_group", "a-sha", `{}`, "1234", "1" expectedRunURL := fmt.Sprintf("github.com/%s/actions/runs/%s/attempts/%s", repo, runID, runAttempt) ctx := getGithubMetadata(repo, eventName, sha, strings.NewReader(event), runID, runAttempt) diff --git a/tools/gomod-local-update/internal/updater/config_test.go b/tools/gomod-local-update/internal/updater/config_test.go index 21b867aea8d..3a91610c67b 100644 --- a/tools/gomod-local-update/internal/updater/config_test.go +++ b/tools/gomod-local-update/internal/updater/config_test.go @@ -5,7 +5,7 @@ import ( "testing" ) -func TestConfig_Validate(t *testing.T) { +func TestUnit_Config_Validate(t *testing.T) { tests := []struct { name string config *Config @@ -96,7 +96,7 @@ func TestConfig_Validate(t *testing.T) { } } -func TestConfig_ValidateErrorType(t *testing.T) { +func TestUnit_Config_ValidateErrorType(t *testing.T) { cfg := &Config{ RepoRemote: "invalid*remote", BranchTrunk: "develop", @@ -115,7 +115,7 @@ func TestConfig_ValidateErrorType(t *testing.T) { } } -func TestParseFlags(t *testing.T) { +func TestUnit_ParseFlags(t *testing.T) { tests := []struct { name string args []string diff --git a/tools/gomod-local-update/internal/updater/updater_test.go b/tools/gomod-local-update/internal/updater/updater_test.go index ba17024dd37..df1aaa04d0c 100644 --- a/tools/gomod-local-update/internal/updater/updater_test.go +++ b/tools/gomod-local-update/internal/updater/updater_test.go @@ -74,7 +74,7 @@ func (m *mockSystemOperator) WriteFile(path string, data []byte, perm os.FileMod return nil } -func TestUpdater_Run(t *testing.T) { +func TestUnit_Updater_Run(t *testing.T) { testTime := time.Date(2024, 11, 22, 18, 21, 10, 0, time.UTC) // Use a full 40-character SHA testSHA := "ac7a7395feed" + strings.Repeat("0", 28) @@ -285,7 +285,7 @@ replace github.com/smartcontractkit/chainlink/v3 => ../ } } -func TestUpdater_FindLocalReplaceModules(t *testing.T) { +func TestUnit_Updater_FindLocalReplaceModules(t *testing.T) { sysOp := newMockSystemOperator() sysOp.files["go.mod"] = []byte(` module test diff --git a/tools/plugout/main_test.go b/tools/plugout/main_test.go index b4c99c447f1..0d08ca3f08e 100644 --- a/tools/plugout/main_test.go +++ b/tools/plugout/main_test.go @@ -61,7 +61,7 @@ func yamlMissingGitRefFor(module string) string { // unit tests: small helpers // ----------------------------- -func TestContains(t *testing.T) { +func TestUnit_Contains(t *testing.T) { if !contains([]string{"a", "b"}, "a") { t.Fatal("expected contains to find element") } @@ -70,7 +70,7 @@ func TestContains(t *testing.T) { } } -func TestModuleSubdir(t *testing.T) { +func TestUnit_ModuleSubdir(t *testing.T) { cases := map[string]string{ "github.com/org/repo": "", "github.com/org/repo/relayer": "relayer", @@ -88,7 +88,7 @@ func TestModuleSubdir(t *testing.T) { } } -func TestShaEqual(t *testing.T) { +func TestUnit_ShaEqual(t *testing.T) { cases := []struct { a, b string want bool @@ -107,7 +107,7 @@ func TestShaEqual(t *testing.T) { } } -func TestNormalizeVersion(t *testing.T) { +func TestUnit_NormalizeVersion(t *testing.T) { t.Run("plain tag", func(t *testing.T) { mv := normalizeVersion("v1.2.3") if mv.Tag != "v1.2.3" || mv.SHA != "" || mv.TagPrefix != "" || mv.Raw != "v1.2.3" { @@ -159,7 +159,7 @@ func TestNormalizeVersion(t *testing.T) { }) } -func TestDesiredYAMLRefForModule(t *testing.T) { +func TestUnit_DesiredYAMLRefForModule(t *testing.T) { cases := []struct { module string mv ModuleVersion @@ -181,7 +181,7 @@ func TestDesiredYAMLRefForModule(t *testing.T) { } } -func TestTagsMatchWithSubdir(t *testing.T) { +func TestUnit_TagsMatchWithSubdir(t *testing.T) { // root modules: tag equality only if !tagsMatchWithSubdir("github.com/example/repo", ModuleVersion{Tag: "v1.2.3", Raw: "v1.2.3"}, @@ -218,7 +218,7 @@ func TestTagsMatchWithSubdir(t *testing.T) { } } -func TestVersionsMatchForModule(t *testing.T) { +func TestUnit_VersionsMatchForModule(t *testing.T) { module := "github.com/example/repo/sub" t.Run("SHA equality (prefix)", func(t *testing.T) { @@ -258,7 +258,7 @@ func TestVersionsMatchForModule(t *testing.T) { // YAML discovery/update // ----------------------------- -func TestDiscoverPluginVersions(t *testing.T) { +func TestUnit_DiscoverPluginVersions(t *testing.T) { dir := t.TempDir() yamlPath := writeFile(t, dir, "plugins.yaml", samplePluginsYAML()) @@ -277,7 +277,7 @@ func TestDiscoverPluginVersions(t *testing.T) { } } -func TestUpdateGitRefInYAML_SuccessAndPreserveFormatting(t *testing.T) { +func TestUnit_UpdateGitRefInYAML_SuccessAndPreserveFormatting(t *testing.T) { dir := t.TempDir() yamlPath := writeFile(t, dir, "plugins.yaml", samplePluginsYAML()) @@ -304,7 +304,7 @@ func TestUpdateGitRefInYAML_SuccessAndPreserveFormatting(t *testing.T) { } } -func TestUpdateGitRefInYAML_ModuleNotFound(t *testing.T) { +func TestUnit_UpdateGitRefInYAML_ModuleNotFound(t *testing.T) { dir := t.TempDir() yamlPath := writeFile(t, dir, "plugins.yaml", samplePluginsYAML()) err := updateGitRefInYAML(yamlPath, "github.com/does/not/exist", ModuleVersion{Tag: "v0.1.0", Raw: "exist/v0.1.0"}) @@ -313,7 +313,7 @@ func TestUpdateGitRefInYAML_ModuleNotFound(t *testing.T) { } } -func TestUpdateGitRefInYAML_NoGitRefLineToReplace(t *testing.T) { +func TestUnit_UpdateGitRefInYAML_NoGitRefLineToReplace(t *testing.T) { dir := t.TempDir() mod := "github.com/example/repo" yamlPath := writeFile(t, dir, "plugins.yaml", yamlMissingGitRefFor(mod)) @@ -327,7 +327,7 @@ func TestUpdateGitRefInYAML_NoGitRefLineToReplace(t *testing.T) { // runSync end-to-end with seam // ----------------------------- -func TestRunSync_CheckMode_WithMismatch(t *testing.T) { +func TestUnit_RunSync_CheckMode_WithMismatch(t *testing.T) { dir := t.TempDir() // go.mod only needs to exist goMod := writeFile(t, dir, "go.mod", "module github.com/example/repo\n") @@ -362,7 +362,7 @@ func TestRunSync_CheckMode_WithMismatch(t *testing.T) { } } -func TestRunSync_UpdateMode_AppliesChanges(t *testing.T) { +func TestUnit_RunSync_UpdateMode_AppliesChanges(t *testing.T) { dir := t.TempDir() goMod := writeFile(t, dir, "go.mod", "module github.com/example/repo\n") plugins := writeFile(t, dir, "plugins.yaml", samplePluginsYAML()) @@ -403,7 +403,7 @@ func TestRunSync_UpdateMode_AppliesChanges(t *testing.T) { } } -func TestRunSync_IgnoreModules_SkipsChecks(t *testing.T) { +func TestUnit_RunSync_IgnoreModules_SkipsChecks(t *testing.T) { dir := t.TempDir() goMod := writeFile(t, dir, "go.mod", "module github.com/example/repo\n") plugins := writeFile(t, dir, "plugins.yaml", samplePluginsYAML()) @@ -429,7 +429,7 @@ func TestRunSync_IgnoreModules_SkipsChecks(t *testing.T) { } } -func TestRunSync_FileValidation(t *testing.T) { +func TestUnit_RunSync_FileValidation(t *testing.T) { dir := t.TempDir() // Missing go.mod _, err := runSync(Options{