-
Notifications
You must be signed in to change notification settings - Fork 11
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
Unit test #55
Conversation
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 see a lot of changes not related to your PR.
Yes, I have to ensure that the unit test can be successful, and all the changes are some points that can't be passed. |
@@ -539,7 +539,7 @@ func (processor *IndexDiffProcessor) generateTextReport() { | |||
} | |||
|
|||
if leftBuilder.Len() == 0 && rightBuilder.Len() == 0 && bothBuilder.Len() == 0 { | |||
fmt.Println("Congratulations, the two clusters are consistent!\n") | |||
fmt.Println("Congratulations, the two clusters are consistent.") |
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.
this is not necessary change.
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.
It needs to be modified, which will cause the test to fail.
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.
why?
What does this PR do
This pull request includes several changes to the codebase, primarily focusing on adding a new unit test workflow, fixing minor bugs, and improving code readability. The most important changes include the addition of a new GitHub Actions workflow for running unit tests, minor bug fixes in various files, and some code cleanup.
New GitHub Actions Workflow:
.github/workflows/unit_test.yml
: Added a new workflow configuration for running unit tests on pull requests targeting themain
branch. This includes setting up the environment, caching dependencies, and running the tests.Bug Fixes:
common/flow.go
: Fixed a panic condition in theJoinFilter
method by improving the nil check for thefilter
parameter.proxy/output/http/http.go
: Corrected the error message format in theforward
method to include thehost
value. [1] [2]Code Cleanup:
common/flow.go
: Reorganized import statements to follow standard conventions.proxy/filters/security/ldap/ldap_test.go
: Skipped theTestLDAPFunctions
test and made minor formatting improvements. [1] [2] [3]Minor Changes:
cmd/anomalyzer/anomalyze_test.go
: Updated the test data in theTestAnomalyzer
test function to use a different value.pipeline/index_diff/index_diff.go
: Simplified the success message in thegenerateTextReport
method.Rationale for this change
Standards checklist