Skip to content

Commit

Permalink
Merge branch 'open-telemetry:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
jackgopack4 authored Aug 2, 2024
2 parents 9338f3b + 685625a commit 5f04c20
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 23 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,6 @@ jobs:
runs-on: ${{ matrix.runner }}
needs: [setup-environment]
steps:
- name: Set up arkade
uses: alexellis/setup-arkade@b1816384b2260cfd2c023c6798d26075786cfc7f # v3
- name: Install vmmeter
run: |
sudo -E arkade oci install ghcr.io/openfaasltd/vmmeter:latest --path /usr/local/bin/
- name: Run vmmeter
uses: self-actuated/vmmeter-action@c7e2162e39294a810cab647cacc215ecd68a44f6 # v1
- name: Checkout Repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup Go
Expand Down
77 changes: 61 additions & 16 deletions service/internal/graph/graph_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,43 @@ func TestConnectorPipelinesGraph(t *testing.T) {
expectedPerExporter: 1,
},
{
name: "pipelines_conn_matrix.yaml",
name: "pipelines_conn_matrix_immutable.yaml",
pipelineConfigs: pipelines.Config{
component.MustNewIDWithName("traces", "in"): {
Receivers: []component.ID{component.MustNewID("examplereceiver")},
Processors: []component.ID{component.MustNewID("exampleprocessor")},
Exporters: []component.ID{component.MustNewID("exampleconnector")},
},
component.MustNewIDWithName("metrics", "in"): {
Receivers: []component.ID{component.MustNewID("examplereceiver")},
Processors: []component.ID{component.MustNewID("exampleprocessor")},
Exporters: []component.ID{component.MustNewID("exampleconnector")},
},
component.MustNewIDWithName("logs", "in"): {
Receivers: []component.ID{component.MustNewID("examplereceiver")},
Processors: []component.ID{component.MustNewID("exampleprocessor")},
Exporters: []component.ID{component.MustNewID("exampleconnector")},
},
component.MustNewIDWithName("traces", "out"): {
Receivers: []component.ID{component.MustNewID("exampleconnector")},
Processors: []component.ID{component.MustNewID("exampleprocessor")},
Exporters: []component.ID{component.MustNewID("exampleexporter")},
},
component.MustNewIDWithName("metrics", "out"): {
Receivers: []component.ID{component.MustNewID("exampleconnector")},
Processors: []component.ID{component.MustNewID("exampleprocessor")},
Exporters: []component.ID{component.MustNewID("exampleexporter")},
},
component.MustNewIDWithName("logs", "out"): {
Receivers: []component.ID{component.MustNewID("exampleconnector")},
Processors: []component.ID{component.MustNewID("exampleprocessor")},
Exporters: []component.ID{component.MustNewID("exampleexporter")},
},
},
expectedPerExporter: 3,
},
{
name: "pipelines_conn_matrix_mutable.yaml",
pipelineConfigs: pipelines.Config{
component.MustNewIDWithName("traces", "in"): {
Receivers: []component.ID{component.MustNewID("examplereceiver")},
Expand Down Expand Up @@ -949,34 +985,43 @@ func TestConnectorPipelinesGraph(t *testing.T) {
for _, e := range allExporters[component.DataTypeTraces] {
tracesExporter := e.(*testcomponents.ExampleExporter)
assert.Equal(t, test.expectedPerExporter, len(tracesExporter.Traces))
expected := testdata.GenerateTraces(1)
if len(allExporters[component.DataTypeTraces]) > 1 {
expected.MarkReadOnly() // multiple read-only exporters should get read-only pdata
}
expectedMutable := testdata.GenerateTraces(1)
expectedReadOnly := testdata.GenerateTraces(1)
expectedReadOnly.MarkReadOnly()
for i := 0; i < test.expectedPerExporter; i++ {
assert.EqualValues(t, expected, tracesExporter.Traces[i])
if tracesExporter.Traces[i].IsReadOnly() {
assert.EqualValues(t, expectedReadOnly, tracesExporter.Traces[i])
} else {
assert.EqualValues(t, expectedMutable, tracesExporter.Traces[i])
}
}
}
for _, e := range allExporters[component.DataTypeMetrics] {
metricsExporter := e.(*testcomponents.ExampleExporter)
assert.Equal(t, test.expectedPerExporter, len(metricsExporter.Metrics))
expected := testdata.GenerateMetrics(1)
if len(allExporters[component.DataTypeMetrics]) > 1 {
expected.MarkReadOnly() // multiple read-only exporters should get read-only pdata
}
expectedMutable := testdata.GenerateMetrics(1)
expectedReadOnly := testdata.GenerateMetrics(1)
expectedReadOnly.MarkReadOnly()
for i := 0; i < test.expectedPerExporter; i++ {
assert.EqualValues(t, expected, metricsExporter.Metrics[i])
if metricsExporter.Metrics[i].IsReadOnly() {
assert.EqualValues(t, expectedReadOnly, metricsExporter.Metrics[i])
} else {
assert.EqualValues(t, expectedMutable, metricsExporter.Metrics[i])
}
}
}
for _, e := range allExporters[component.DataTypeLogs] {
logsExporter := e.(*testcomponents.ExampleExporter)
assert.Equal(t, test.expectedPerExporter, len(logsExporter.Logs))
expected := testdata.GenerateLogs(1)
if len(allExporters[component.DataTypeLogs]) > 1 {
expected.MarkReadOnly() // multiple read-only exporters should get read-only pdata
}
expectedMutable := testdata.GenerateLogs(1)
expectedReadOnly := testdata.GenerateLogs(1)
expectedReadOnly.MarkReadOnly()
for i := 0; i < test.expectedPerExporter; i++ {
assert.EqualValues(t, expected, logsExporter.Logs[i])
if logsExporter.Logs[i].IsReadOnly() {
assert.EqualValues(t, expectedReadOnly, logsExporter.Logs[i])
} else {
assert.EqualValues(t, expectedMutable, logsExporter.Logs[i])
}
}
}
})
Expand Down

0 comments on commit 5f04c20

Please sign in to comment.