-
Notifications
You must be signed in to change notification settings - Fork 10
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
all: Add integration testing harness and some tests #37
Conversation
edc3c8d
to
c9eb5b8
Compare
c9eb5b8
to
30f6437
Compare
This commit adds an integration test harness to the repository. Individual tests consist of a directory under _integration-tests/tests which contains a go program and a file, validation.json. The go program will be instrumented by orchestrion, then run. The traces output by that program go to a fake agent, which records the traces. The validation.json file describes the expected structure of the traces which should be produced by each test. This includes things like name, resource, service, metadata and metrics. Once the traces are recorded and the test program shuts down, the traces recorded by the fake agent are checked against the expected ones described in validation.json to ensure the test produced exactly what we expected, in terms of the number of traces, the structure of those traces, and the fields in the spans of the traces.
c2b2f06
to
0772417
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good! Let's add a some docs in a readme file under _integration-tests
with instruction on how to run them locally.
@knusbaum I've a similar set of comments that @ahmed-mez already wrote, so I won't duplicate them. My only addition would be: could it be interesting to document any specifics about these integration tests when adding new contribs? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Let's add a some docs in a readme file under _integration-tests with instruction on how to run them locally.
@ahmed-mez @darccio I also cleaned up the github action. I ended up removing the explicit cache since it looks like the setup-go cache is mostly working, and it simplifies the setup. Ready to merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this PR do?
This commit adds an integration test harness to the repository.
Individual tests consist of a directory under _integration-tests/tests
which contains a go program and a file, validation.json.
The go program will be instrumented by orchestrion, then run. The traces
output by that program go to a fake agent, which records the traces.
The validation.json file describes the expected structure of the traces
which should be produced by each test. This includes things like name,
resource, service, metadata and metrics.
Once the traces are recorded and the test program shuts down, the traces
recorded by the fake agent are checked against the expected ones
described in validation.json to ensure the test produced exactly what we
expected, in terms of the number of traces, the structure of those
traces, and the fields in the spans of the traces.
Motivation
Reviewer's Checklist