-
Notifications
You must be signed in to change notification settings - Fork 53
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
Integration test and static main improvements #263
Conversation
d4a6495
to
f0428da
Compare
4a16a3a
to
f0a600f
Compare
kubernetes-static main has been migrated to the new backbone as well Signed-off-by: Roberto Santalla <[email protected]>
Signed-off-by: Roberto Santalla <[email protected]>
Asserter is a (hopefully) powerful tool to assert that all metrics defined in a SpecGroup are correctly captured. Signed-off-by: Roberto Santalla <[email protected]>
Signed-off-by: Roberto Santalla <[email protected]>
Signed-off-by: Roberto Santalla <[email protected]>
Signed-off-by: Roberto Santalla <[email protected]>
Signed-off-by: Roberto Santalla <[email protected]>
Signed-off-by: Roberto Santalla <[email protected]>
a1fd85d
to
9a20034
Compare
// AllVersions returns a list of versions we have test data for. | ||
func AllVersions() []Version { | ||
return []Version{ | ||
Testdata116, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add a comment saying to which KSM version corresponds to each of these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, this is something I though about. My plan is to overwrite all the static files so all of them use the KSM we support, but in the future we might want to have weirder versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add a comment explaining this, and in the future, when I write the script to generate these files, I will keep in midn to log the version used somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A nice improvement!
I would try to reduce as much as possible "hidden" behaviour to make obvious what we are testing and using which data so that in 6 months we are not confused :)
…pers with objects\ fixup! add namespaces
40392a5
to
d7fd3b6
Compare
I've added comments explaining how this works, which will hopefully improve readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing everything!
* test: new integration testing backbone kubernetes-static main has been migrated to the new backbone as well Signed-off-by: Roberto Santalla <[email protected]> * test/integration: make Version object return mocks Signed-off-by: Roberto Santalla <[email protected]> * test/integration: implement the Asserter Asserter is a (hopefully) powerful tool to assert that all metrics defined in a SpecGroup are correctly captured. Signed-off-by: Roberto Santalla <[email protected]> * test/integration: implement helper for building integrations Signed-off-by: Roberto Santalla <[email protected]> * test/asserter: log missing metric namespace Signed-off-by: Roberto Santalla <[email protected]> * test/asserter: make asserter fully thread-safe Signed-off-by: Roberto Santalla <[email protected]> * test/ksm: optimize asserter calls on test parallelization Signed-off-by: Roberto Santalla <[email protected]> * fixup! test/asserter: typos Signed-off-by: Roberto Santalla <[email protected]> * testutil: make LatestVersion rely on the order of AllVersions * testutil: do not wrap fake.NewSimpleClientset, but rather provide helpers with objects\ fixup! add namespaces * testutil/asserter: check if specGroups are empty and fail in that case * testutil/asserter: make Excluding copy-safe * test/ksm: share the asserter again I've added comments explaining how this works, which will hopefully improve readability.
* test: new integration testing backbone kubernetes-static main has been migrated to the new backbone as well Signed-off-by: Roberto Santalla <[email protected]> * test/integration: make Version object return mocks Signed-off-by: Roberto Santalla <[email protected]> * test/integration: implement the Asserter Asserter is a (hopefully) powerful tool to assert that all metrics defined in a SpecGroup are correctly captured. Signed-off-by: Roberto Santalla <[email protected]> * test/integration: implement helper for building integrations Signed-off-by: Roberto Santalla <[email protected]> * test/asserter: log missing metric namespace Signed-off-by: Roberto Santalla <[email protected]> * test/asserter: make asserter fully thread-safe Signed-off-by: Roberto Santalla <[email protected]> * test/ksm: optimize asserter calls on test parallelization Signed-off-by: Roberto Santalla <[email protected]> * fixup! test/asserter: typos Signed-off-by: Roberto Santalla <[email protected]> * testutil: make LatestVersion rely on the order of AllVersions * testutil: do not wrap fake.NewSimpleClientset, but rather provide helpers with objects\ fixup! add namespaces * testutil/asserter: check if specGroups are empty and fail in that case * testutil/asserter: make Excluding copy-safe * test/ksm: share the asserter again I've added comments explaining how this works, which will hopefully improve readability.
* test: new integration testing backbone kubernetes-static main has been migrated to the new backbone as well Signed-off-by: Roberto Santalla <[email protected]> * test/integration: make Version object return mocks Signed-off-by: Roberto Santalla <[email protected]> * test/integration: implement the Asserter Asserter is a (hopefully) powerful tool to assert that all metrics defined in a SpecGroup are correctly captured. Signed-off-by: Roberto Santalla <[email protected]> * test/integration: implement helper for building integrations Signed-off-by: Roberto Santalla <[email protected]> * test/asserter: log missing metric namespace Signed-off-by: Roberto Santalla <[email protected]> * test/asserter: make asserter fully thread-safe Signed-off-by: Roberto Santalla <[email protected]> * test/ksm: optimize asserter calls on test parallelization Signed-off-by: Roberto Santalla <[email protected]> * fixup! test/asserter: typos Signed-off-by: Roberto Santalla <[email protected]> * testutil: make LatestVersion rely on the order of AllVersions * testutil: do not wrap fake.NewSimpleClientset, but rather provide helpers with objects\ fixup! add namespaces * testutil/asserter: check if specGroups are empty and fail in that case * testutil/asserter: make Excluding copy-safe * test/ksm: share the asserter again I've added comments explaining how this works, which will hopefully improve readability.
This PR moves the test data from the
cmd/kubernetes-static
folder to aninternal/testutil
one, and adds some goodies on top. This newtestutil
package contains:httptest.Server
which exposes all the required metrics from services for a particular versionWith this, a
WIP
test for the newksm.Scraper
has been added as well.