Skip to content
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

Merged
merged 11 commits into from
Jan 10, 2025
Merged

Unit test #55

merged 11 commits into from
Jan 10, 2025

Conversation

luohoufu
Copy link
Contributor

@luohoufu luohoufu commented Jan 6, 2025

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 the main branch. This includes setting up the environment, caching dependencies, and running the tests.

Bug Fixes:

  • common/flow.go: Fixed a panic condition in the JoinFilter method by improving the nil check for the filter parameter.
  • proxy/output/http/http.go: Corrected the error message format in the forward method to include the host value. [1] [2]

Code Cleanup:

Minor Changes:

Rationale for this change

Standards checklist

  • The PR title is descriptive
  • The commit messages are semantic
  • Necessary tests are added
  • Updated the release notes
  • Necessary documents have been added if this is a new feature
  • Performance tests checked, no obvious performance degradation

@luohoufu luohoufu requested a review from medcl January 6, 2025 02:44
Copy link
Member

@medcl medcl left a 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.

@luohoufu
Copy link
Contributor Author

luohoufu commented Jan 6, 2025

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.

common/flow.go Show resolved Hide resolved
@@ -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.")
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

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

why?

@luohoufu luohoufu requested a review from medcl January 6, 2025 15:07
@medcl medcl merged commit 63f98b4 into main Jan 10, 2025
3 checks passed
@medcl medcl deleted the unit_test branch January 10, 2025 07:11
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.

3 participants