Skip to content

Commit

Permalink
[chore] Docs/seed docs folder with some testing information (open-tel…
Browse files Browse the repository at this point in the history
…emetry#30172)

**Description:** Adds some documentation around test targets to a new
(to this project) `docs` folder, similar to what we have in
`opentelemetry-collector` (upstream)

**Link to tracking Issue:**
[`30166`](open-telemetry#30166)

**Testing:** N/A

**Documentation:** Adds documentation to `docs` folder but not linked to
`CONTRIBUTORS.md` until we get some discussion rolling about how to
potentially reorganize such

---------

Co-authored-by: bryan-aguilar <[email protected]>
  • Loading branch information
hughesjj and bryan-aguilar committed Jan 10, 2024
1 parent aa2e9f7 commit 7dcc7a0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

## Testing your components

- `scraperint` is a wrapper around testcontainers and the golang testing api for use with receivers only (at least, today). See docs in [`scraperinttest`](../internal/coreinternal/scraperinttest/README.md) for information on usage.
- Add the `integration` [build constraint](#constraining-build-targets) for longer-running, comprehensive tests. These will be run via github actions when submitting a PR.

## Constraining build targets

This project uses golang [build-constraints](https://pkg.go.dev/cmd/go#hdr-Build_constraints) to tag build targets. Guidance on using existing targets

- `e2e` should be used for end-to-end tests. These are currently manually configured to be run in `.github/workflows` on a per-component basis.
- `integration` should be used for integration tests (able to be run on local hardware but not require any credentials or environmental infrastructure). You can run this with `make integration-test` or `cd componentclass/yourcomponent && make mod-integration-test`
- Restrict builds for varying platforms or processor architectures with their relevant platform names. See [documentation](https://pkg.go.dev/cmd/go#hdr-Build_constraints) on `GOOS` and `GOOARCH` for how these are set.
- Add other build tags as needed, such as has been done for `tools` and `race`. Please document any needed commands here and ensure to get consensus with the otel collector working group before introducing build constraints.

0 comments on commit 7dcc7a0

Please sign in to comment.