-
Notifications
You must be signed in to change notification settings - Fork 79
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
Fix empty log lines parsing in parse_cassandra_log, add automated tes… #1424
Conversation
4884d7d
to
a081fa2
Compare
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.
Great that we could address that quickly.
Approved (pending the install issue, but you're already working on that).
@@ -346,6 +356,10 @@ cert-manager-multi: ## Install cert-manager to the clusters | |||
make cert-manager; \ | |||
done | |||
|
|||
.PHONY: vector-install | |||
vector-install: | |||
curl --proto '=https' --tlsv1.2 -sSfL https://sh.vector.dev | bash -s -- --prefix $(LOCALBIN) -y |
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 was going to comment that I'm getting an error on this, but I see that you have opened an issue with the Vector project :)
@@ -159,6 +159,15 @@ else | |||
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $(GO_FLAGS) ./apis/... ./pkg/... ./test/yq/... ./controllers/... -covermode=atomic -coverprofile coverage.out | |||
endif | |||
|
|||
.PHONY: vector-test | |||
vector-test: ## Run vector tests |
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.
[question] shouldn't this depend on vector-install
?
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 didn't want it to depend on the vector-install if some person (well, maybe just me?) has it installed through brew or other means. Also, since it was broken on some platforms like MacOS (the fix isn't merged yet), it would make running the tests difficult.
$(eval TMP := $(shell mktemp -d)) | ||
VECTOR_TEST_FILES=true OUTPUT_PATH=$(TMP) go test -v ./pkg/telemetry -run=TestGenerateTomlTestFiles | ||
@echo Running vector test files | ||
OUTPUT_PATH=$(TMP) VECTOR=$(VECTOR) scripts/run-vector-tests.sh |
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.
[thought] Couldn't we just run the vector
executable (and assert its return value) from within the Go test?
That way it would be a regular test, we wouldn't need a dedicated make target / script file / CI step to run it.
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.
We could do that also, but I don't think we've done that too often in our tests. It's an external program, so not really running go test code.
But would we really want Vector installation to be a dependency on running Go tests? make test
would require then vector to be always installed.
…prevent old versions from being in the path, change vector-test back to Makefile entirely for GHA
Quality Gate passedIssues Measures |
#1424) * Fix empty log lines parsing in parse_cassandra_log, add automated tests for Vector * Fix kustomize paths in tests, remove manual old kustomize install to prevent old versions from being in the path, change vector-test back to Makefile entirely for GHA
…ts for Vector
What this PR does:
Changes the rules to strip whitespace from logs, this removes empty loglines also (which cause a crash of Vector grok parsing).
Also, add tests that generate Vector files from our Telemetry rules and then run vector test against them.
Which issue(s) this PR fixes:
Fixes #1409
Fixes #1425
Checklist