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

Implement stream specs #11685

Merged
merged 5 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix linter
  • Loading branch information
samsondav committed Jan 11, 2024
commit fe899c674f46e014ad030e999eb0357d748cc686
2 changes: 1 addition & 1 deletion core/services/streams/stream_registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (

"github.com/smartcontractkit/chainlink/v2/core/logger"
"github.com/smartcontractkit/chainlink/v2/core/services/pipeline"
"github.com/stretchr/testify/require"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

type mockStream struct {
Expand Down
20 changes: 13 additions & 7 deletions core/web/jobs_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
"github.com/smartcontractkit/chainlink/v2/core/services/job"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey"
"github.com/smartcontractkit/chainlink/v2/core/services/pg"
"github.com/smartcontractkit/chainlink/v2/core/testdata/testspecs"
"github.com/smartcontractkit/chainlink/v2/core/utils/tomlutils"
Expand Down Expand Up @@ -139,12 +140,17 @@ func TestJobController_Create_HappyPath(t *testing.T) {
app, client := setupJobsControllerTests(t)
b1, b2 := setupBridges(t, app.GetSqlxDB(), app.GetConfig().Database())
require.NoError(t, app.KeyStore.OCR().Add(cltest.DefaultOCRKey))
pks, err := app.KeyStore.VRF().GetAll()
require.NoError(t, err)
require.Len(t, pks, 1)
k, err := app.KeyStore.P2P().GetAll()
require.NoError(t, err)
require.Len(t, k, 1)
var pks []vrfkey.KeyV2
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I had to change this to keep the linter happy

var k []p2pkey.KeyV2
{
var err error
pks, err = app.KeyStore.VRF().GetAll()
require.NoError(t, err)
require.Len(t, pks, 1)
k, err = app.KeyStore.P2P().GetAll()
require.NoError(t, err)
require.Len(t, k, 1)
}

jorm := app.JobORM()
var tt = []struct {
Expand Down Expand Up @@ -369,7 +375,7 @@ func TestJobController_Create_HappyPath(t *testing.T) {
require.Equal(t, http.StatusOK, r.StatusCode)
resp := cltest.ParseResponseBody(t, r)
resource := presenters.JobResource{}
err = web.ParseJSONAPIResponse(resp, &resource)
err := web.ParseJSONAPIResponse(resp, &resource)
require.NoError(t, err)

jb, err := jorm.FindJob(testutils.Context(t), mustInt32FromString(t, resource.ID))
Expand Down
2 changes: 2 additions & 0 deletions core/web/presenters/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,8 @@ func NewJobResource(j job.Job) *JobResource {
resource.BootstrapSpec = NewBootstrapSpec(j.BootstrapSpec)
case job.Gateway:
resource.GatewaySpec = NewGatewaySpec(j.GatewaySpec)
case job.Stream:
// no spec; nothing to do
case job.LegacyGasStationServer, job.LegacyGasStationSidecar:
// unsupported
}
Expand Down