-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Move txdb and dialects to chainlink-common/pkg/pg #15064
base: develop
Are you sure you want to change the base?
Conversation
6d01bb7
to
14cfd46
Compare
AER Report: CI Coreaer_workflow , commit , Detect Changes , Scheduled Run Frequency , Clean Go Tidy & Generate , Flakeguard Root Project / Get Tests To Run , lint , Core Tests (go_core_tests) , Core Tests (go_core_tests_integration) , Core Tests (go_core_ccip_deployment_tests) , Core Tests (go_core_race_tests) , Core Tests (go_core_fuzz) , Flakeguard Deployment Project / Get Tests To Run , Flakeguard Deployment Project / Run Tests , Flakeguard Deployment Project / Report , Flakeguard Root Project / Run Tests (github.com/smartcontractkit/chainlink/v2/core/cmd,github.com/smartcontractkit/chainlin... , Flakeguard Root Project / Run Tests (github.com/smartcontractkit/chainlink/v2/core/services/fluxmonitorv2,github.com/smartc... , Flakeguard Root Project / Run Tests (github.com/smartcontractkit/chainlink/v2/core/services/directrequest,github.com/smartc... , Flakeguard Root Project / Run Tests (github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper,github.... , Flakeguard Root Project / Run Tests (github.com/smartcontractkit/chainlink/v2/core/services/pipeline,github.com/smartcontra... , Flakeguard Root Project / Run Tests (github.com/smartcontractkit/chainlink/v2/core/chains/evm/log,github.com/smartcontractk... , Flakeguard Root Project / Run Tests (github.com/smartcontractkit/chainlink/v2/core/services/periodicbackup,github.com/smart... , Flakeguard Root Project / Run Tests (github.com/smartcontractkit/chainlink/v2/core/services/vrf/v2, ubuntu-latest) , Flakey Test Detection , SonarQube Scan , Flakeguard Root Project / Report 1. Test_disallowReplica failed due to missing import[A 1 <= 10 words sentence that describes the error]:[job id where the error happened] Source of Error:connection_test.go:71:
Error Trace: /home/runner/work/chainlink/chainlink/core/services/pg/connection_test.go:71
Error: Received unexpected error:
sql: unknown driver "txdb" (forgotten import?)
Test: Test_disallowReplica Suggested fix: Ensure that the 2. Linting issues found[A 1 <= 10 words sentence that describes the error]:[job id where the error happened] Source of Error:core/services/chainlink/config_database_test.go:39:2: expected-actual: need to reverse actual and expected values (testifylint)
assert.Equal(t, db.Dialect(), pgcommon.Postgres)
^ Suggested fix: Correct the import formatting to comply with 3. Ensure clean after generate failed[A 1 <= 10 words sentence that describes the error]:[job id where the error happened] Source of Error:core/chains/evm/types/internal/blocks/internal_types_codecgen.go | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-) Suggested fix: Commit the changes in the generated files or ensure that code generation does not produce any changes. AER Report: Operator UI CI ran successfully ✅ |
af2bde1
to
b622cb9
Compare
b622cb9
to
ebe3258
Compare
Flaky Test Detector for
|
Along with that: - Replace dialects imports with pgcommon - Replace testutils.Skip* with tests.Skip* - Call RegisterTxDb from NewConnection - Run goimports (somehow there were a few files on develop which were improperly formatted?)
1043e2c
to
45e582e
Compare
45e582e
to
e335649
Compare
NONEVM-739
Requires
smartcontractkit/chainlink-common#910
Description
This mostly just moves
chainlink/core/internal/testutils/pgtest/txdb.go
andchainlink/core/store/dialects/dialects.go
into a new common packagechainlink-common/pkg/pg
, updating imports accordingly.The purpose of this is so that it can be imported and used by
chainlink-solana
for unit testing Solana ORM's.Since
txdb.go
was a bit of a mess, it has been cleaned up a bit.init()
function invoked on package load has been replaced withRegisterTxDb()
which accepts a dbUrl as a param instead of automatically reading it from theCL_DATABASE
env var. Since there are only two places in the codebase which depend on our customtxdb
dialect of sql being registered, this can simply be called in both of those places (insideNewSqlxDb()
andNewConnection()
) instead of relying on the globalinit()
.sql.Register()
more than once ifRegisterTxDb()
is called more than once (callingsql.Register()
more than once with the same driver name will result in an error).context.Background
to queries with passing of a new context which gets cancelled if the context originally passed toNewSqlxDb
is cancelled.