Skip to content

refactor: clean up dead testing code #121

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

Merged
merged 1 commit into from
Oct 31, 2024
Merged

Conversation

obs-gh-enricogiorio
Copy link
Collaborator

@obs-gh-enricogiorio obs-gh-enricogiorio commented Oct 31, 2024

Improve the testing logic to allow each testcase to specify which part of the logRecord the jmespath query should be executed, rather than deciding it once for all testcases of the test function.

Remove unused fields + logic that allowed testing w/ custom functions, since we can do everything with jmespath

Comment on lines 324 to 326
if !exists {
kep.logger.Error("no facets map in observe_transform", zap.Error(err))
continue
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a functional change and not just a refactor, right? Now if there is an observe_transform attribute with no facets, it will error and ignore rather than defaulting to empty. Is this what we want?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually I made a mistake here, I should have left it as it was. This is dangerous, will revert this bit.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because I thought that observe_transform could only be created here (and so we can assume that facets will be here as well).
But actually, this could be created in helm as well.
But the catch here is that if observe_transform is present, then facets is also present inside it

Improve the testing logic to allow each testcase to specify which part
of the logRecord the jmespath query should be executed, rather than
deciding it once for all testcases of the test function.

Remove unused fields + logic that allowed testing w/ custom functions,
since we can do everything with jmespath
@obs-gh-enricogiorio obs-gh-enricogiorio merged commit 2016541 into main Oct 31, 2024
8 checks passed
@obs-gh-enricogiorio obs-gh-enricogiorio deleted the enrico/refactorTest branch November 4, 2024 19:51
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.

2 participants