Skip to content

Commit

Permalink
Do not skip the oracledb discovery test (#5784)
Browse files Browse the repository at this point in the history
* Do not skip the oracledb discovery test

* extend timeout

* relax test constraint
  • Loading branch information
atoulme authored Jan 13, 2025
1 parent 1b67fcd commit 048974a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ jobs:
id: get-matrix
run: |
includes=""
for service in "apache" "jmx/cassandra" "kafkametrics" "mongodb" "nginx" "envoy"; do
for service in "apache" "jmx/cassandra" "kafkametrics" "mongodb" "nginx" "envoy" "oracledb"; do
for arch in "amd64" "arm64"; do
if [ "$service" = "mongodb" ]; then
# tests for mongo "6.0" and "7.0" are flaky, skipping for now
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ integration-test-envoy-discovery:
integration-test-nginx-discovery:
@set -e; cd tests && $(GOTEST_SERIAL) $(BUILD_INFO_TESTS) --tags=discovery_integration_nginx -v -timeout 5m -count 1 ./...

.PHONY: integration-test-oracledb-discovery
integration-test-oracledb-discovery:
@set -e; cd tests && $(GOTEST_SERIAL) $(BUILD_INFO_TESTS) --tags=discovery_integration_oracledb -v -timeout 5m -count 1 ./...


.PHONY: smartagent-integration-test
smartagent-integration-test:
@set -e; cd tests && $(GOTEST_SERIAL) $(BUILD_INFO_TESTS) --tags=smartagent_integration -v -timeout 5m -count 1 ./...
Expand Down
1 change: 1 addition & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ services:
image: quay.io/splunko11ytest/oracle:latest
profiles:
- integration
- integration-test-oracledb-discovery
build: ./oracle
ports:
- "1521:1521"
Expand Down
19 changes: 10 additions & 9 deletions tests/receivers/oracledb/bundled_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,37 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build integration
//go:build discovery_integration_oracledb

package tests

import (
"fmt"
"runtime"
"testing"

"github.com/stretchr/testify/require"

"github.com/signalfx/splunk-otel-collector/tests/testutils"
)

func TestOracledbDockerObserver(t *testing.T) {
t.Skip("Redis data points are also discovered since Redis runs, making this test fail.")
testutils.SkipIfNotContainerTest(t)
if runtime.GOOS == "darwin" {
t.Skip("unable to share sockets between mac and d4m vm: https://github.com/docker/for-mac/issues/483#issuecomment-758836836")
}
dockerSocket := testutils.CreateDockerSocketProxy(t)
require.NoError(t, dockerSocket.Start())
t.Cleanup(func() {
dockerSocket.Stop()
})

testutils.AssertAllMetricsReceived(t, "bundled.yaml", "otlp_exporter.yaml",
nil, []testutils.CollectorBuilder{
func(c testutils.Collector) testutils.Collector {
cc := c.(*testutils.CollectorContainer)
cc.Container = cc.Container.WithBinds("/var/run/docker.sock:/var/run/docker.sock:ro")
cc.Container = cc.Container.WillWaitForLogs("Discovering for next")
cc.Container = cc.Container.WithUser(fmt.Sprintf("999:%d", testutils.GetDockerGID(t)))
return cc
},
func(collector testutils.Collector) testutils.Collector {
return collector.WithEnv(map[string]string{
"SPLUNK_DISCOVERY_DURATION": "10s",
"SPLUNK_DISCOVERY_DURATION": "20s",
// confirm that debug logging doesn't affect runtime
"SPLUNK_DISCOVERY_LOG_LEVEL": "debug",
"ORACLE_PASSWORD": "password",
Expand All @@ -53,6 +53,7 @@ func TestOracledbDockerObserver(t *testing.T) {
"--set", "splunk.discovery.receivers.oracledb.config.service=XE",
"--set", `splunk.discovery.extensions.k8s_observer.enabled=false`,
"--set", `splunk.discovery.extensions.host_observer.enabled=false`,
"--set", fmt.Sprintf("splunk.discovery.extensions.docker_observer.config.endpoint=tcp://%s", dockerSocket.ContainerEndpoint),
)
},
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource_metrics:
- attributes:
container.image.name: <ANY>
container.name: oracledb
container.name: <ANY>
oracledb.instance.name: <ANY>
scope_metrics:
- instrumentation_scope:
Expand Down

0 comments on commit 048974a

Please sign in to comment.