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

#896 test for tax module #909

Merged
merged 29 commits into from
Aug 26, 2024
Merged

#896 test for tax module #909

merged 29 commits into from
Aug 26, 2024

Conversation

hnd14
Copy link
Contributor

@hnd14 hnd14 commented Aug 19, 2024

Notes for pull request:

  • This pull request includes:
    • Add integration test dependencies to parent pom
    • Remove integration test dependencies from children poms
    • Config to parent pom to add src/it/java and src/it/resources to maven testSourcePath and maven testResourcePath according to discussion in 22/08 daily meeting
    • Add failsafe plugin execution and config to run integration tests from src/it/java to parent pom
    • Tests for module tax as proof of concept
  • This pull request does not include:
    • Refactor test folder structures of existing test code (this should be done in a separate pull request)
  • Current test config:
    • All test file end with Test.java will be run by maven-surefire-plugin (So you should name your unit test with Test at the end for maven to pick it up)
    • All test file end with IT.java will be run by maven-failsafe-plugin (So you should name your integration test with IT at the end for maven to pick it up)
    • Both plugins will run in test phase of maven build cycle

Copy link

github-actions bot commented Aug 19, 2024

Tax Coverage Report

Overall Project 83.21% 🍏
Files changed 100% 🍏

File Coverage
TaxClassController.java 100% 🍏

@hnd14 hnd14 marked this pull request as ready for review August 19, 2024 15:56
@hnd14 hnd14 linked an issue Aug 20, 2024 that may be closed by this pull request
tax/pom.xml Outdated Show resolved Hide resolved
Copy link

Media Coverage Report

Overall Project 0%

There is no coverage information present for the Files changed

Copy link

Payment Paypal Coverage Report

Overall Project 0%

There is no coverage information present for the Files changed

Copy link

Storefront BFF Coverage Report

Overall Project NaN% NaN% 🍏

There is no coverage information present for the Files changed

Copy link

Cart Coverage Report

Overall Project 20.17%

There is no coverage information present for the Files changed

Copy link

Search Coverage Report

Overall Project 0%

There is no coverage information present for the Files changed

Copy link

Customer Coverage Report

Overall Project 0%

There is no coverage information present for the Files changed

Copy link

github-actions bot commented Aug 20, 2024

Webhook Coverage Report

Overall Project 20.48%

There is no coverage information present for the Files changed

@minhtridn2001
Copy link
Contributor

Hi, @hnd14
I have a few generic comments. Please take a look and bring to discussion if needed.

  • We should discuss and agree with Team on whether a shared library for common test support should be created. There is a lot of duplicate code in the tests across services.
  • Unit tests and Integration tests:
    • Start with Unit tests to cover every component.
    • Integration test is expensive and slow. So, use them for specific scenarions involving critical/key interactions only. For example, convert TaxRateRepositoryIntegrationTest to Unit test with in-memory database (using @DataJpaTest) instead of PostgreSQL container)
  • Avoid hard-coding. Extract commonly used values, such as API paths - .get("/v1/backoffice/tax-classes") , into constants. It would help avoid issues if the API path changes.

@hnd14
Copy link
Contributor Author

hnd14 commented Aug 23, 2024

Notes for pull request:

  • This pull request includes:
    • Add integration test dependencies to parent pom
    • Remove integration test dependencies from children poms
    • Config to parent pom to add src/it/java and src/it/resources to maven testSourcePath and maven testResourcePath according to discussion in 22/08 daily meeting
    • Add failsafe plugin execution and config to run integration tests from src/it/java to parent pom
    • Tests for module tax as proof of concept
  • This pull request does not include:
    • Refactor test folder structures of existing test code (this should be done in a separate pull request)
  • Current test config:
    • All test file end with Test.java will be run by maven-surefire-plugin (So you should name your unit test with Test at the end for maven to pick it up)
    • All test file end with IT.java will be run by maven-failsafe-plugin (So you should name your integration test with IT at the end for maven to pick it up)
    • Both plugins will run in test phase of maven build cycle

Copy link

sonarcloud bot commented Aug 26, 2024

Copy link

sonarcloud bot commented Aug 26, 2024

Copy link

sonarcloud bot commented Aug 26, 2024

Copy link

sonarcloud bot commented Aug 26, 2024

Copy link

sonarcloud bot commented Aug 26, 2024

Copy link

sonarcloud bot commented Aug 26, 2024

Copy link

sonarcloud bot commented Aug 26, 2024

Copy link

sonarcloud bot commented Aug 26, 2024

Copy link

sonarcloud bot commented Aug 26, 2024

Copy link

sonarcloud bot commented Aug 26, 2024

Copy link

sonarcloud bot commented Aug 26, 2024

Copy link

sonarcloud bot commented Aug 26, 2024

Copy link

sonarcloud bot commented Aug 26, 2024

Copy link

sonarcloud bot commented Aug 26, 2024

Copy link

sonarcloud bot commented Aug 26, 2024

Copy link

sonarcloud bot commented Aug 26, 2024

Copy link

sonarcloud bot commented Aug 26, 2024

@thiennn thiennn merged commit 1f68528 into main Aug 26, 2024
52 checks passed
@thiennn thiennn deleted the #896-test-for-tax-module branch August 26, 2024 04:42
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.

[Tax] Test for module tax
4 participants