Skip to content

Conversation

Farber98
Copy link
Contributor

@Farber98 Farber98 commented Aug 14, 2024

solana ref: BCI-3989-cr-methods-error-when-unstarted
core ref: BCI-3989-cr-methods-error-when-unstarted

Task Description:

We only want GetLatestValue, BatchGetLatestValue and QueryKey to be called when CR service is in Started state. If CR is not started yet, we should return an error.

This PR:

Ticket:

Unblocks:

Merging flow:

  1. merge common (point to solana and core for CI to pass)
  2. Then merge Solana by pointing to merged common
  3. Finally merge core after changing Solana and common refs

Comment on lines 302 to 303
require.NoError(t, it.impl.Start(context.Background()))
t.Cleanup(func() { require.NoError(t, it.impl.Close()) })
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use servicetest.Run. Notice it uses assert during cleanup.

…rted"

This reverts commit 54d7016, reversing
changes made to 4e67d8d.
)

type ChainComponentsInterfaceTester[T TestingT[T]] interface {
type ChainComponentsTester[T any] interface {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • defined ChainComponentsTester so we use the Setup(t T, startCR bool) only for chainComponents tests
  • defined chainComponentsTestcase so we use the startCR testcase flag only for chainComponents testcases
  • defined runChainComponentsTests to execute chainComponents specific tests using the ChainComponentsTester interface with Setup(t T, startCR bool)

TestOn string
}

type codecTestcase[T any] struct {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • defined CodecTester so we use the Setup(t T) without the startCR flag for the codec
  • defined codecTestcase so we don't use the startCR testcase flag for codec testcases
  • defined runCodecTests to execute codec specific tests using the CodecTester interface with Setup(t T)

fake.stored = []TestStruct{}

if startCR {
servicetest.Run(t, it.impl)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

added servicetest.Run(t, it.impl)

Copy link
Contributor

@ilija42 ilija42 left a comment

Choose a reason for hiding this comment

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

Wdyt about this solution

#777
smartcontractkit/chainlink#14480

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.

4 participants