Commit Graph

12 Commits

Author SHA1 Message Date
Tim Hockin
2e2ae029c3
Fix instrumentation tests
1) Fail if we can't read critical env vars
2) Don't rely on KUBE_ROOT env var when `go list` works
3) Don't rely on GOOS env var when `go env` works
4) Don't quietly ignore "can't read" errors

Once we stop ignoring errors, some tests fail for real (and should
always have failed).

The "Imported k8s.io/staging constant" test seems to not be allowed at
all anymore.  Han said to nix it and he'd look async.

Oversall this test is dodgy.  You REALLY can't glue strings together and
expect valid Go module paths.  We should consider a deeper rework.
2024-02-29 22:07:41 -08:00
Han Kang
44f1c4dd94 fix duplicate metrics issue 2023-06-29 12:30:30 -07:00
Han Kang
bf7d65c15c clean up errors, ensure they log lines, improve documentation
Change-Id: Icf4da7410dc9ecfb3616511ea55339e1d0690c49
2022-11-08 12:18:08 -08:00
Han Kang
cefa194998 Update test/instrumentation/error.go
Co-authored-by: Damien Grisonnet <damien.grisonnet@epita.fr>
2022-07-26 15:31:25 -07:00
Han Kang
e452850ec3 Add support for summary metrics for stablity checks
Also add entrypoints for verifying and updating a test file for easier
debugging. This is considerably faster than running the stablity checks
against the entire Kubernetes codebase.

Change-Id: I5d5e5b3abf396ebf1317a44130f20771a09afb7f
2022-07-26 15:31:25 -07:00
Pat Christopher
f720c4fd44
hack/verify fixes 2021-07-28 19:26:44 -07:00
Pat Christopher
e75f3fb563
add happy path tests for two types of imports 2021-07-13 20:08:13 -07:00
Pat Christopher
bde2ef2a1a
review comments 2021-07-13 19:02:23 -07:00
Pat Christopher
ef3c344868
seems to work, needs tests and a lot of cleanup 2021-07-12 20:28:10 -07:00
Marek Siarkowicz
4dd546cf2c Allow usage of consts and variables for stable metrics in static analysis 2019-11-08 09:41:59 +01:00
Marek Siarkowicz
53fc6f9b58 Finish implementation of stable metrics static analysis
Handle "DeprecatedVersion" field
Fix kube metrics framework path
Implement handling prometheus util functions for generating buckets
2019-08-21 23:46:36 +02:00
Marek Siarkowicz
a5377a684c Implement stable metric validation and verification
Based on KEP:
https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/20190605-metrics-validation-and-verification.md

Add //test/instrumentation:stable_metric_test that compares metrics
in source code to those available in
"test/instrumentation/testdata/stable-metrics-list.yaml".
2019-08-12 12:01:35 +02:00