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

Add functional test (PoC) #14

Closed
wants to merge 1 commit into from
Closed

Add functional test (PoC) #14

wants to merge 1 commit into from

Conversation

pleshakov
Copy link
Contributor

Proposed changes

Functional test uses a OTel collector deployed in a container and configured via provided relay.yaml

I include two approaches on how to deal with Docker:

To run locally:
go test -v ./tests

Note: the TestContainers runs an additional container https://golang.testcontainers.org/features/garbage_collector/#ryuk

•2024/02/16 15:23:08 github.com/testcontainers/testcontainers-go - Connected to docker:
  Server Version: 24.0.5
  API Version: 1.43
  Operating System: Docker Desktop
  Total Memory: 7851 MB
  Resolved Docker Host: unix:///Users/<REDACTED>/.docker/run/docker.sock
  Resolved Docker Socket Path: /var/run/docker.sock
  Test SessionID: 608c6fc97809c2ab6ad833b50fa3e7d9636c70d5ebbe1337b406179f44e47f32
  Test ProcessID: c59a4d57-e59d-4d3a-8abd-0d6135a9403f
2024/02/16 15:37:23 🐳 Creating container for image testcontainers/ryuk:0.6.0
2024/02/16 15:37:23 ✅ Container created: c500cbc0e657
2024/02/16 15:37:23 🐳 Starting container: c500cbc0e657
2024/02/16 15:37:23 ✅ Container started: c500cbc0e657
2024/02/16 15:37:23 🚧 Waiting for container id c500cbc0e657 image: testcontainers/ryuk:0.6.0. Waiting for: &{Port:8080/tcp timeout:<nil> PollInterval:100ms}
2024/02/16 15:37:23 🔔 Container is ready: c500cbc0e657
2024/02/16 15:37:23 🐳 Creating container for image otel/opentelemetry-collector-contrib:0.88.0
2024/02/16 15:37:23 ✅ Container created: 94a67c1ab239
2024/02/16 15:37:23 🐳 Starting container: 94a67c1ab239
2024/02/16 15:37:24 ✅ Container started: 94a67c1ab239
2024/02/16 15:37:24 🚧 Waiting for container id 94a67c1ab239 image: otel/opentelemetry-collector-contrib:0.88.0. Waiting for: &{timeout:<nil> Log:Everything is ready. Begin running and processing data. IsRegexp:false Occurrence:1 PollInterval:100ms}
2024/02/16 15:37:24 🔔 Container is ready: 94a67c1ab239

Closes #7

Which approach would you prefer?

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING
    guide
  • I have proven my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have ensured the README is up to date
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch on my own fork

Functional test uses a OTel collector deployed in a container
and configured via provided relay.yaml

I include two approaches on how to deal with Docker:
- Using Docker cli go sdk https://docs.docker.com/engine/api/sdk/examples/
- Using https://golang.testcontainers.org/

To run locally:
go test -v ./tests

Note: the TestContainers runs an additional container
https://golang.testcontainers.org/features/garbage_collector/#ryuk

•2024/02/16 15:23:08 github.com/testcontainers/testcontainers-go - Connected to docker:
  Server Version: 24.0.5
  API Version: 1.43
  Operating System: Docker Desktop
  Total Memory: 7851 MB
  Resolved Docker Host: unix:///Users/<REDACTED>/.docker/run/docker.sock
  Resolved Docker Socket Path: /var/run/docker.sock
  Test SessionID: 608c6fc97809c2ab6ad833b50fa3e7d9636c70d5ebbe1337b406179f44e47f32
  Test ProcessID: c59a4d57-e59d-4d3a-8abd-0d6135a9403f
2024/02/16 15:23:08 🐳 Creating container for image testcontainers/ryuk:0.6.0
2024/02/16 15:23:08 ✅ Container created: d34d1f0a58e9
2024/02/16 15:23:08 🐳 Starting container: d34d1f0a58e9
2024/02/16 15:23:08 ✅ Container started: d34d1f0a58e9
2024/02/16 15:23:08 🚧 Waiting for container id d34d1f0a58e9 image: testcontainers/ryuk:0.6.0. Waiting for: &{Port:8080/tcp timeout:<nil> PollInterval:100ms}
2024/02/16 15:23:09 🔔 Container is ready: d34d1f0a58e9
2024/02/16 15:23:09 🐳 Creating container for image otel/opentelemetry-collector-contrib:0.88.0
2024/02/16 15:23:09 ✅ Container created: a6bd9d6293bb
2024/02/16 15:23:09 🐳 Starting container: a6bd9d6293bb
2024/02/16 15:23:09 ✅ Container started: a6bd9d6293bb
2024/02/16 15:23:09 🚧 Waiting for container id a6bd9d6293bb image: otel/opentelemetry-collector-contrib:0.88.0. Waiting for: &{timeout:<nil> Log:Everything is ready. Begin running and processing data. IsRegexp:false Occurrence:1 PollInterval:100ms}
2024/02/16 15:23:09 🔔 Container is ready: a6bd9d6293bb
•
@github-actions github-actions bot added dependencies Pull requests that update a dependency file tests Pull requests that update tests labels Feb 16, 2024
Copy link

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ❌ 1 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 7 package(s) with unknown licenses.
See the Details below.

License Issues

go.mod

PackageVersionLicenseIssue Type
github.com/shoenig/go-m1cpu0.1.6MPL-2.0Incompatible License
github.com/morikuni/aec1.0.0NullUnknown License
github.com/pkg/errors0.9.1NullUnknown License
golang.org/x/exp0.0.0-20230510235704-dd950f8aeaeaNullUnknown License
github.com/gogo/protobuf1.3.2NullUnknown License
github.com/klauspost/compress1.16.0NullUnknown License
github.com/opencontainers/go-digest1.0.0NullUnknown License
github.com/shirou/gopsutil/v33.23.12NullUnknown License
Allowed Licenses: Apache-1.1, Apache-2.0, BSD-2-Clause, BSD-3-Clause, BSL-1.0, ISC, MIT, NCSA, OpenSSL, Python-2.0, X11

Scanned Manifest Files

go.mod

@pleshakov
Copy link
Contributor Author

Interesting.
@lucacome just to confirm, we don't allow MPL-2.0 license?

Well, using the approach with Docker cli only doesn't cause any license issues -- #15

@lucacome
Copy link
Member

lucacome commented Feb 16, 2024

@pleshakov it's one of the licenses that can be used but needs to be reviewed case by case.

@sjberman
Copy link
Contributor

I like the container approach better, cleaner look.

@kate-osborn
Copy link

I like the container approach better, cleaner look.

Same. Looks easier to work with

@ciarams87
Copy link
Member

Same, I like the container approach.

@vepatel
Copy link

vepatel commented Feb 22, 2024

+1 to the container approach, just easier!

@pleshakov
Copy link
Contributor Author

thanks for the feedback. We;ll go with the test containers approach

@pleshakov pleshakov closed this Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file tests Pull requests that update tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add functional test
6 participants