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

Kbauer/add tf based bare metal test #178

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kb-newrelic
Copy link
Contributor

@kb-newrelic kb-newrelic commented Jan 8, 2025

Summary

  • Add EC2 instance running ubuntu 24.04 to nightly test infra. Using latest collector until we have a nightly version
  • Add NRQL-based tests that assert that nightly test infra produces expected hostmetrics
    • system.paging.usage: requires a swapfile to be allocated, added it for EC2 but skip this test for k8s as the overhead of creating an AMI for k8s nodes to use seems to much to support this test case.
    • system.cpu.load_average.15m: drops to 0 in idle for the EC2, so after running long enough this test would fail, thus I changed it to >=0. Alternative would be to add a load-generating script.

Misc

Hostname changes

  • Previous PR added OTEL_RESOURCE_ATTRIBUTES specifier to force predictable hostnames to be reported to NR. Added some structure to those names to enforce consistency across different test environments (local-dev1, local-dev2, ci, nightly) and host machines (k8s-node1, k8s-node2, ec2-ubuntu,...)
    • Appended the node name to k8s nodes as the daemonset deploys the collector to multiple/different nodes, so using the same hostname doesn't make sense and also causes issues in the UI because two entities with the same hostname got created

Removal of TestMain

  • No longer use TestMain for test setup as test tagging/filtering should be the first logic to run to avoid errors due to missing env vars that are not necessary for the subsets of tests run, e.g. NR_INGEST_KEY not required for nightly tests. testing.M doesn't provide an API to skip a test, so it can't be used in the testutil package.

Test

  • Nightly tests specified in this PR don't pass yet because a) ec2 is not deployed yet and b) the eks node collector still uses the old host name. To ensure the tests do work, I temporarily deployed the EC2 for a few hours and ran the tests using the old k8s hostname using the following patch:
    nightly-test.patch

@kb-newrelic kb-newrelic requested a review from a team as a code owner January 8, 2025 00:40
@kb-newrelic kb-newrelic force-pushed the kbauer/add-tf-based-bare-metal-test branch from 93486cb to 2645ca6 Compare January 8, 2025 18:56
@kb-newrelic kb-newrelic force-pushed the kbauer/add-tf-based-bare-metal-test branch from 2645ca6 to 8e567e7 Compare January 8, 2025 19:00
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.

1 participant