GoogleCloudPlatform / prometheus-engine

Google Cloud Managed Service for Prometheus libraries and manifests.
https://g.co/cloud/managedprometheus
Apache License 2.0
195 stars 93 forks source link

fix: match exact test on e2e test matrix #821

Closed TheSpiritXIII closed 9 months ago

TheSpiritXIII commented 9 months ago

This fixes two issues:

  1. TEST_RUN takes in a regular expression. After the recent refactoring, this no longer works. This is because we create a kind cluster with a name based off of the TEST_RUN. If there any special characters (e.g. from regular expressions), this fails.
  2. If we add a new text that's a prefix or suffix of the same test, that test will be ran twice on GitHub. For example, if we have TestA and TestAVariant, then when GitHub runs TestA, it will run both tests within that runner and then it will run TestAVariant again in a separate runner. This is because Go takes in a regular expression when filtering tests and TestA matches both tests. We fix this by adding symbols for start and end of string, e.g. we run TestA with ^TestA$ to ensure it only runs TestA.
TheSpiritXIII commented 9 months ago

Thanks! To be fair, it used to be supported before the e2e test refactor. The fact that it is not anymore can be considered a regression.