Skip to content

Commit 78ab16d

Browse files
authored
Coding guidelines: document use of internal/testutil module (#14219)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description This PR adds a coding guideline about when to use the `internal/testutil` module.
1 parent 0ad18e5 commit 78ab16d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/coding-guidelines.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ We use the following rules for some common situations where we split into separa
6868
it is part of the `config` folder, and `extensionauth` has `extension` as a prefix since it is
6969
part of the `extension` module.
7070
1. Testing helpers should be in a separate submodule with the suffix `test`. For example, if you
71-
have a module `component`, the helpers should be in `component/componenttest`.
71+
have a module `component`, the helpers should be in `component/componenttest`. Testing helpers
72+
that are used across multiple modules should be in the [`internal/testutil`](https://github.com/open-telemetry/opentelemetry-collector/tree/main/internal/testutil)
73+
module.
7274
1. Experimental packages that will later be added to another module should be in their own module,
7375
named as they will be after integration. For example, if adding a `pprofile` package to `pdata`,
7476
you should add a separate module `pdata/pprofile` for the experimental code.

0 commit comments

Comments
 (0)