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

chore(cre-deployment): lightweight changeset tests #16322

Merged
merged 16 commits into from
Feb 13, 2025

Conversation

krehermann
Copy link
Contributor

@krehermann krehermann commented Feb 11, 2025

CRE-299

Enable lighter weight ChangeSet testing. 5x speed up of go test deployment/keystone/... b/c the majority of our tests don't need real in memory nodes

Fleshing out the test.JDNodeService will also let us write tests in the CLD repo without relying on phony in memory nodes nor the real JD instances

Requires

Supports

Copy link
Contributor

Flakeguard Summary

Ran new or updated tests between develop and 1b36669 (cre/contract-only-test-env).

View Flaky Detector Details | Compare Changes

Found Flaky Tests ❌

2 Results
Name Pass Ratio Panicked? Timed Out? Race? Runs Successes Failures Skips Package Package Panicked? Avg Duration Code Owners
TestConfigureOCR3 0% false false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment/keystone/changeset false 6.713333333s @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation
TestConfigureOCR3/fails_multiple_OCR3_contracts_but_unspecified_address 0% false false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment/keystone/changeset false 263.333333ms @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation

Artifacts

For detailed logs of the failed tests, please refer to the artifact failed-test-results-with-logs.json.

Copy link
Contributor

github-actions bot commented Feb 11, 2025

AER Report: CI Core ran successfully ✅

aer_workflow , commit

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

Copy link
Contributor

Flakeguard Summary

Ran new or updated tests between develop and b1da8bf (cre/contract-only-test-env).

View Flaky Detector Details | Compare Changes

Found Flaky Tests ❌

2 Results
Name Pass Ratio Panicked? Timed Out? Race? Runs Successes Failures Skips Package Package Panicked? Avg Duration Code Owners
TestConfigureOCR3 0% false false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment/keystone/changeset false 7.943333333s @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation
TestConfigureOCR3/fails_multiple_OCR3_contracts_but_unspecified_address 0% false false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment/keystone/changeset false 396.666666ms @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation

Artifacts

For detailed logs of the failed tests, please refer to the artifact failed-test-results-with-logs.json.

Copy link
Contributor

Flakeguard Summary

Ran new or updated tests between develop and 2140beb (cre/contract-only-test-env).

View Flaky Detector Details | Compare Changes

Found Flaky Tests ❌

2 Results
Name Pass Ratio Panicked? Timed Out? Race? Runs Successes Failures Skips Package Package Panicked? Avg Duration Code Owners
TestConfigureOCR3 0% false false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment/keystone/changeset false 7.406666666s @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation
TestConfigureOCR3/fails_multiple_OCR3_contracts_but_unspecified_address 0% false false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment/keystone/changeset false 296.666666ms @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation

Artifacts

For detailed logs of the failed tests, please refer to the artifact failed-test-results-with-logs.json.

@krehermann krehermann marked this pull request as ready for review February 11, 2025 21:37
@krehermann krehermann requested review from a team as code owners February 11, 2025 21:37
@@ -275,6 +284,14 @@ func (n Nodes) DefaultF() uint8 {
return uint8(len(n) / 3)
}

func (n Nodes) IDs() []string {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convience

nodev1 "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/node"
"github.com/smartcontractkit/chainlink/deployment"
"github.com/smartcontractkit/chainlink/deployment/environment/memory"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey"
)

var _ node.NodeServiceServer = (*JDNodeService)(nil)
var _ nodev1.NodeServiceClient = (*JDNodeService)(nil)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implement the entire OffchainClient interface so we can use this in an Environment for tests

Name() string
}

var _ testDon = (*memoryDon)(nil)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these interface impls are the basic reason we can support either in-memory nodes or 'view-only' nodes

AssetDonConfig: test.DonConfig{N: 4},
WriterDonConfig: test.DonConfig{N: 4},
te := test.SetupContractTestEnv(t, test.EnvWrapperConfig{
WFDonConfig: test.DonConfig{Name: "wfDon", N: 4},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these all got a Name so the test framewok can be antagonistic to the details of the don in the new Get method

validateNodes(t, gotRegistry, cwNodes, expectedHashedCapabilities(t, gotRegistry, cwDon))
validateNodes(t, gotRegistry, assetNodes, expectedHashedCapabilities(t, gotRegistry, assetDon))
require.Len(t, gotNodes, len(dons.P2PIDs()))
validateNodes(t, gotRegistry, dons.Get(c.WFDonConfig.Name), expectedHashedCapabilities(t, gotRegistry, wfDonCapabilities))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all these call changed so we can provide the dons interface rather than directly access state about the kind of test env we have in our hands

@krehermann krehermann changed the title chore(cre-deployment): contract only changeset tests chore(cre-deployment): lightweight changeset tests Feb 11, 2025
chains,
nil,
dons.NodeList().IDs(),
envtest.NewJDService(dons.NodeList()),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is where we are using the new JD test impl

CSAKey: n.Keys.CSA.ID(),
PeerID: n.Keys.PeerID,
AdminAddr: admin,
MultiAddr: n.Addr.String(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this multiaddress correct? Should it not be node's p2p listen address?

PeerId: n.Keys.PeerID.String(),
},
OcrKeyBundle: keyBundle,
Multiaddr: n.Addr.String(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question

},
OcrKeyBundle: keyBundle,
Multiaddr: n.Addr.String(),
Plugins: nil,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay to have nil plugins here? For CCIP I know in real node we have commit execute plugin enabled

@krehermann krehermann requested a review from AnieeG February 12, 2025 23:41
@krehermann krehermann force-pushed the cre/contract-only-test-env branch from 60d68b7 to 39b7cba Compare February 13, 2025 02:20
@krehermann krehermann force-pushed the cre/contract-only-test-env branch from 39b7cba to 04cb25e Compare February 13, 2025 03:16
@krehermann krehermann enabled auto-merge February 13, 2025 17:53
@krehermann krehermann added this pull request to the merge queue Feb 13, 2025
Merged via the queue into develop with commit ab8e8fa Feb 13, 2025
184 checks passed
@krehermann krehermann deleted the cre/contract-only-test-env branch February 13, 2025 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants