Skip to content
  •  
  •  
  •  
93 changes: 23 additions & 70 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand All @@ -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' }}
Expand All @@ -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
Expand All @@ -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' }}

Expand All @@ -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
Expand Down
167 changes: 167 additions & 0 deletions .github/workflows/ci-integration.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion .github/workflows/integration-in-memory-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion config_docs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
8 changes: 4 additions & 4 deletions core/bridges/bridge_type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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{})
Expand Down Expand Up @@ -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())
Expand All @@ -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 {
Expand Down
Loading
Loading