Skip to content

Commit

Permalink
Merge branch 'develop' into tt_922_automation_seth
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofel committed Apr 30, 2024
2 parents 939eab9 + c304997 commit f7edc0f
Show file tree
Hide file tree
Showing 16 changed files with 847 additions and 194 deletions.
5 changes: 5 additions & 0 deletions .changeset/fast-students-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#internal Optimize workflow engine tests
9 changes: 7 additions & 2 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ jobs:
slack-message: "golangci-lint failed: ${{ job.html_url }}\n${{ format('https://github.com/smartcontractkit/chainlink/actions/runs/{0}', github.run_id) }}"

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:
Expand All @@ -92,8 +96,6 @@ jobs:
if: github.actor != 'dependabot[bot]'
needs: [filter]
runs-on: ubuntu-latest-64cores-256GB
env:
CL_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable
steps:
- name: Checkout the repo
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
Expand Down Expand Up @@ -136,6 +138,8 @@ jobs:
- name: Setup DB
if: ${{ needs.filter.outputs.changes == 'true' }}
run: ./chainlink.test local db preparetest
env:
CL_DATABASE_URL: ${{ env.DB_URL }}
- name: Install LOOP Plugins
if: ${{ needs.filter.outputs.changes == 'true' }}
run: |
Expand Down Expand Up @@ -165,6 +169,7 @@ jobs:
env:
OUTPUT_FILE: ./output.txt
USE_TEE: false
CL_DATABASE_URL: ${{ env.DB_URL }}
run: ./tools/bin/${{ matrix.type.cmd }} ./...
- name: Print Filtered Test Results
if: ${{ failure() && matrix.type.cmd == 'go_core_tests' && needs.filter.outputs.changes == 'true' }}
Expand Down
28 changes: 27 additions & 1 deletion .github/workflows/cicd-changesets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
permissions:
id-token: write
contents: read
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
Expand All @@ -28,6 +29,31 @@ jobs:
core-changeset:
- added: '.changeset/**'
- name: Setup pnpm
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
if: steps.changeset-added.outputs.core-changeset == 'true'
with:
version: ^8.0.0

- name: Setup node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
if: steps.changeset-added.outputs.core-changeset == 'true'
with:
node-version: 20
cache: pnpm
cache-dependency-path: ./pnpm-lock.yaml

- name: Run changeset version
run: pnpm install && pnpm changeset version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: steps.changeset-added.outputs.core-changeset == 'true'

- name: Get release version
if: steps.changeset-added.outputs.core-changeset == 'true'
id: get-release-version
run: echo "version=$(jq -r '.version' package.json)" >> $GITHUB_OUTPUT

- name: cicd-changesets
if: steps.changeset-added.outputs.core-changeset == 'true'
uses: smartcontractkit/.github/actions/cicd-changesets@6da79c7b9f14bec077df2c1ad40d53823b409d9c # [email protected]
Expand All @@ -37,7 +63,7 @@ jobs:
git-email: app-token-issuer-releng[bot]@users.noreply.github.com
pnpm-use-cache: false
pr-draft: true
pr-title: "[DO NOT MERGE] Release Preview - Changeset"
pr-title: "[DO NOT MERGE] Changeset Release Preview - v${{ steps.get-release-version.outputs.version }}"
# aws inputs
aws-region: ${{ secrets.AWS_REGION }}
aws-role-arn: ${{ secrets.AWS_OIDC_CHAINLINK_CI_AUTO_PR_TOKEN_ISSUER_ROLE_ARN }}
Expand Down
2 changes: 2 additions & 0 deletions core/chains/evm/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest"
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils/evmtest"
"github.com/smartcontractkit/chainlink/v2/core/services/chainlink"
"github.com/smartcontractkit/chainlink/v2/core/store/models"
)

func TestChainScopedConfig(t *testing.T) {
Expand Down Expand Up @@ -380,6 +381,7 @@ func TestChainScopedConfig_HeadTracker(t *testing.T) {
func Test_chainScopedConfig_Validate(t *testing.T) {
configWithChains := func(t *testing.T, id int64, chains ...*toml.Chain) config.AppConfig {
return configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) {
s.Database.URL = models.MustSecretURL("postgresql://doesnotexist:justtopassvalidationtests@localhost:5432/chainlink_na_test")
chainID := ubig.NewI(id)
c.EVM[0] = &toml.EVMConfig{ChainID: chainID, Enabled: ptr(true), Chain: toml.Defaults(chainID, chains...),
Nodes: toml.EVMNodes{{
Expand Down
2 changes: 2 additions & 0 deletions core/services/chainlink/config_database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (
func TestDatabaseConfig(t *testing.T) {
opts := GeneralConfigOpts{
ConfigStrings: []string{fullTOML},
SecretsStrings: []string{`[Database]
URL = "postgresql://doesnotexist:justtopassvalidationtests@localhost:5432/chainlink_na_test"`},
}
cfg, err := opts.New()
require.NoError(t, err)
Expand Down
Loading

0 comments on commit f7edc0f

Please sign in to comment.