Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BCF-3200] Make sure short tests are actually passing #12989

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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