Skip to content

Conversation

@gsanchezgavier
Copy link
Contributor

@gsanchezgavier gsanchezgavier commented Aug 3, 2022

Executes the e2e test action using the Tilt environment and checks for expected metrics that are in the test environment.

  • Static
    Pending on future PRs
  • Pods
  • Endpoints
  • OpenMetrics

@gsanchezgavier gsanchezgavier marked this pull request as draft August 3, 2022 16:34
@gsanchezgavier gsanchezgavier force-pushed the test-e2e branch 2 times, most recently from 7d7a16b to 79f55c2 Compare August 4, 2022 07:41
@gsanchezgavier gsanchezgavier changed the title add e2e test based on local environment [WIP] Add e2e tests Aug 4, 2022
@gsanchezgavier gsanchezgavier changed the title [WIP] Add e2e tests Add e2e tests for static targets Aug 4, 2022
@gsanchezgavier gsanchezgavier marked this pull request as ready for review August 4, 2022 08:06
@gsanchezgavier gsanchezgavier requested a review from a team August 4, 2022 08:06
Copy link
Contributor

@marcsanmi marcsanmi left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +25 to +26
t.Setenv(configurator.LicenseKeyEnvKey, "")
t.Setenv(configurator.DataSourceNameEnvKey, "")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was hitting an error since i configured the env vars to run the Tilt environment.

Copy link
Member

@paologallinaharbur paologallinaharbur Aug 4, 2022

Choose a reason for hiding this comment

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

not sure I am following, are they colliding?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this test also covers the code where these env vars are expanded, if you have them in the session you are execute them , the test will fail (because of the expectations are checking other values for these).
I realize this "week" isolation because I exported this envars to run the e2e locally.

scenarios:
- description: Scrape test environment metrics
before:
- cd ../../ && NR_PROM_LICENSE_KEY=${LICENSE_KEY} NR_PROM_CLUSTER=${SCENARIO_TAG} make tilt-ci
Copy link
Member

Choose a reason for hiding this comment

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

oh, this is not that nice, could it be a step of the pipeline? How nri-kubernetes works without this?

Copy link
Member

Choose a reason for hiding this comment

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

I mean the cd ../../ &&

Copy link
Member

Choose a reason for hiding this comment

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

also below tilt down is way more clear and simple

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agree is ugly, but is not complex i would say, is the simpler and clear solution i came up to actually re-use the make target and not duplicate bash scripts all over the repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

looks like there is another way but i found it more obscure WDYT
https://superuser.com/questions/370575/how-to-run-make-file-from-any-directory

Copy link
Member

@paologallinaharbur paologallinaharbur left a comment

Choose a reason for hiding this comment

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

just some doubts regarding the parser_test

@gsanchezgavier
Copy link
Contributor Author

golangci-lint is failing because the just released 1.48 version deprecated the allow-leading-space
All this lint issues will be fixed in #33 .
newrelic/newrelic-infra-checkers#9

@gsanchezgavier gsanchezgavier merged commit 7c7b784 into main Aug 5, 2022
@gsanchezgavier gsanchezgavier deleted the test-e2e branch August 5, 2022 08:44
alvarocabanas pushed a commit that referenced this pull request Oct 24, 2022
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