-
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.
[BCF-2463] Add generic job type for lightweight OCR plugins (#10665)
* [BCF-2463] Add generic job type for lightweight OCR plugins * [chore] Refactor ErrJobSpecNoRelayer; add ErrRelayerNotEnabled * [feedback] Move validation of PluginConfig to ocr2/validate/validate.go * Add tests for pluginConfig * Sensible defaults for command
- Loading branch information
1 parent
f7e868e
commit a08b705
Showing
9 changed files
with
334 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package generic | ||
|
||
import "github.com/smartcontractkit/libocr/commontypes" | ||
|
||
func (t *TelemetryAdapter) Endpoints() map[[4]string]commontypes.MonitoringEndpoint { | ||
return t.endpoints | ||
} |
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,32 @@ | ||
package generic | ||
|
||
import ( | ||
"reflect" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestMerge(t *testing.T) { | ||
vars := map[string]interface{}{ | ||
"jb": map[string]interface{}{ | ||
"databaseID": "some-job-id", | ||
}, | ||
} | ||
addedVars := map[string]interface{}{ | ||
"jb": map[string]interface{}{ | ||
"some-other-var": "foo", | ||
}, | ||
"val": 0, | ||
} | ||
|
||
merge(vars, addedVars) | ||
|
||
assert.True(t, reflect.DeepEqual(vars, map[string]interface{}{ | ||
"jb": map[string]interface{}{ | ||
"databaseID": "some-job-id", | ||
"some-other-var": "foo", | ||
}, | ||
"val": 0, | ||
}), vars) | ||
} |
Oops, something went wrong.