-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(smoke): register multiple job distributors (#14327)
Now that we are supporting multiple job distributors per node, I want to have a smoke test that verifies this behaviour. We do need to enable the `MultiFeedsManagers` feature tag.
- Loading branch information
1 parent
01b6405
commit 340d0dd
Showing
6 changed files
with
145 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package smoke | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/smartcontractkit/chainlink-testing-framework/lib/logging" | ||
"github.com/smartcontractkit/chainlink/integration-tests/actions" | ||
"github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" | ||
tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" | ||
graphqlClient "github.com/smartcontractkit/chainlink/integration-tests/web/sdk/client" | ||
) | ||
|
||
func TestRegisteringMultipleJobDistributor(t *testing.T) { | ||
t.Parallel() | ||
|
||
l := logging.GetTestLogger(t) | ||
|
||
config, err := tc.GetConfig([]string{"Smoke"}, "job_distributor") | ||
require.NoError(t, err, "Error getting config") | ||
|
||
privateNetwork, err := actions.EthereumNetworkConfigFromConfig(l, &config) | ||
require.NoError(t, err, "Error building ethereum network config") | ||
|
||
env, err := test_env.NewCLTestEnvBuilder(). | ||
WithTestConfig(&config). | ||
WithTestInstance(t). | ||
WithStandardCleanup(). | ||
WithPrivateEthereumNetwork(privateNetwork.EthereumNetworkConfig). | ||
WithCLNodes(1). | ||
WithStandardCleanup(). | ||
Build() | ||
require.NoError(t, err) | ||
|
||
ctx := context.Background() | ||
err = env.ClCluster.Nodes[0].GraphqlAPI.CreateJobDistributor(ctx, graphqlClient.FeedsManagerInput{ | ||
Name: "job-distributor-1", | ||
Uri: "http://job-distributor-1:8080", | ||
PublicKey: "54227538d9352e0a24550a80ab6a7af6e4f1ffbb8a604e913cbb81c484a7f97d", | ||
}) | ||
require.NoError(t, err, "Creating first job distributor in chainlink node shouldn't fail") | ||
|
||
err = env.ClCluster.Nodes[0].GraphqlAPI.CreateJobDistributor(ctx, graphqlClient.FeedsManagerInput{ | ||
Name: "job-distributor-2", | ||
Uri: "http://job-distributor-2:8080", | ||
PublicKey: "37346b7ea98af21e1309847e00f772826ac3689fe990b1920d01efc58ad2f250", | ||
}) | ||
require.NoError(t, err, "Creating second job distributor in chainlink node shouldn't fail") | ||
|
||
distributors, err := env.ClCluster.Nodes[0].GraphqlAPI.ListJobDistributors(ctx) | ||
require.NoError(t, err, "Listing job distributors in chainlink node shouldn't fail") | ||
require.Len(t, distributors.FeedsManagers.Results, 2, "There should be 2 job distributors") | ||
|
||
assert.Equal(t, "job-distributor-1", distributors.FeedsManagers.Results[0].Name) | ||
assert.Equal(t, "job-distributor-2", distributors.FeedsManagers.Results[1].Name) | ||
} |
46 changes: 46 additions & 0 deletions
46
integration-tests/testconfig/job_distributor/job_distributor.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[NodeConfig] | ||
BaseConfigTOML = """ | ||
[Feature] | ||
FeedsManager = true | ||
LogPoller = true | ||
UICSAKeys = true | ||
MultiFeedsManagers = true | ||
[Log] | ||
Level = 'debug' | ||
JSONConsole = true | ||
[Log.File] | ||
MaxSize = '0b' | ||
[WebServer] | ||
AllowOrigins = '*' | ||
HTTPPort = 6688 | ||
SecureCookies = false | ||
HTTPWriteTimeout = '3m' | ||
SessionTimeout = '999h0m0s' | ||
[WebServer.RateLimit] | ||
Authenticated = 2000 | ||
Unauthenticated = 1000 | ||
[WebServer.TLS] | ||
HTTPSPort = 0 | ||
[Database] | ||
MaxIdleConns = 20 | ||
MaxOpenConns = 40 | ||
MigrateOnStartup = true | ||
[OCR] | ||
Enabled = true | ||
DefaultTransactionQueueDepth = 0 | ||
[P2P] | ||
[P2P.V2] | ||
Enabled = true | ||
ListenAddresses = ['0.0.0.0:6690'] | ||
AnnounceAddresses = ['0.0.0.0:6690'] | ||
DeltaDial = '500ms' | ||
DeltaReconcile = '5s' | ||
""" |