Skip to content

Conversation

@LujieDuan
Copy link
Contributor

@LujieDuan LujieDuan commented Sep 16, 2022

Description

We have added resourcedetector to read from GCE VM metadata server which is used by components such as the Prometheus receivers.
This PR added integration test for the resourcedetector:

  • We would like to test this package in the VMs that run Ops Agent. To achieve this, we created integration_test/cmd/run_resource_detector/run_resource_detector.go to call the package directly and print the results in JSON to stdout.
  • In order to have the run_resource_detector.go resolve the dependency of the resourcedetector package locally, we upload the source code of the package as well as go.sum and go.mod.

Related issue

b/246615284

How has this been tested?

  • Manually tested the integration test to make sure the test can fail with unexpected values;
  • Made sure all integration tests can pass without error.

Checklist:

  • Unit tests
    • Unit tests do not apply.
    • Unit tests have been added/modified and passed for this PR.
  • Integration tests
    • Integration tests do not apply.
    • Integration tests have been added/modified and passed for this PR.
  • Documentation
    • This PR introduces no user visible changes.
    • This PR introduces user visible changes and the corresponding documentation change has been made.
  • Minor version bump
    • This PR introduces no new features.
    • This PR introduces new features, and there is a separate PR to bump the minor version since the last release already.
    • This PR bumps the version.

@LujieDuan LujieDuan force-pushed the lujieduan-prometheus-metadata-integration-test branch 2 times, most recently from 760f35c to 6c7c0a2 Compare September 22, 2022 16:53
@LujieDuan LujieDuan force-pushed the lujieduan-prometheus-metadata-integration-test branch from 8d45892 to 2b39a1f Compare September 26, 2022 19:25
@LujieDuan LujieDuan marked this pull request as ready for review September 26, 2022 20:28
@LujieDuan LujieDuan changed the title Prometheus integration test experiment Add integration test for resourcedetector which read from VM metadata server Sep 26, 2022
@LujieDuan LujieDuan force-pushed the lujieduan-prometheus-metadata-integration-test branch from 2b39a1f to 6199718 Compare October 5, 2022 18:30
@LujieDuan LujieDuan force-pushed the lujieduan-prometheus-metadata-integration-test branch from 6199718 to 258933b Compare October 17, 2022 21:43
Copy link
Contributor

@ridwanmsharif ridwanmsharif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Left a couple comments but feel free to merge whenever

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may need to add the license here at the top. Also may be worth adding a comment on what this is used for.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[super nit] We should pull this out to a separate local method like runResourceDetectorCli and call it so the test code is more readable and just asserts the test data is accurate.

@LujieDuan LujieDuan force-pushed the lujieduan-prometheus-metadata-integration-test branch from 258933b to e718a05 Compare October 20, 2022 18:01
@LujieDuan LujieDuan force-pushed the lujieduan-prometheus-metadata-integration-test branch from e718a05 to 6a72b8d Compare November 9, 2022 15:06
@LujieDuan LujieDuan added the kokoro:force-run Forces kokoro to run integration tests on a CL label Nov 9, 2022
@stackdriver-instrumentation-release stackdriver-instrumentation-release removed the kokoro:force-run Forces kokoro to run integration tests on a CL label Nov 9, 2022
@LujieDuan LujieDuan force-pushed the lujieduan-prometheus-metadata-integration-test branch from 6a72b8d to 15ddeea Compare November 9, 2022 22:46
@LujieDuan LujieDuan added the kokoro:force-run Forces kokoro to run integration tests on a CL label Nov 10, 2022
@stackdriver-instrumentation-release stackdriver-instrumentation-release removed the kokoro:force-run Forces kokoro to run integration tests on a CL label Nov 10, 2022
@LujieDuan LujieDuan force-pushed the lujieduan-prometheus-metadata-integration-test branch 6 times, most recently from d17a78d to ae1d42e Compare November 17, 2022 18:50
@LujieDuan LujieDuan force-pushed the lujieduan-prometheus-metadata-integration-test branch from ae1d42e to 1d7d71b Compare November 17, 2022 21:08
@LujieDuan LujieDuan merged commit 30660b9 into master Nov 17, 2022
@LujieDuan LujieDuan deleted the lujieduan-prometheus-metadata-integration-test branch November 17, 2022 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants