omise / omise-woocommerce

Omise WooCommerce Plugin
https://docs.opn.ooo/woocommerce-plugin
MIT License
47 stars 27 forks source link

[ENGA3-431] : Code Coverage Integration with Sonarcloud #337

Closed ajzkk closed 1 year ago

ajzkk commented 1 year ago

1. Objective

Code Coverage Integration with Sonarcloud

ENGA3-431

2. Description of change

Update pipeline to generate code coverage and sent report to sonarcloud

3. Quality assurance

Report link (3% after merge)

4. Impact of the change

N/A

5. Priority of change

Normal

6. Additional Notes

N/A

aashishgurung commented 1 year ago

The code coverage workflow works for now but it will not work in the future when we begin testing files containing Wordpress and WooCommerce's core functions like add_action and others.

We did a few tweaks to setup for Magento unit test workflow due to similar reasons. Running the unit test with just plugin code didn't work because it didn't found the core Magento classes. We solved it by adding packages that installs Mangeto code while running Github action to test. Setting up unit test in WP is a bit more complicated than Magento.

For reference:

ajzkk commented 1 year ago

The code coverage workflow works for now but it will not work in the future when we begin testing files containing Wordpress and WooCommerce's core functions like add_action and others.

We did a few tweaks to setup for Magento unit test workflow due to similar reasons. Running the unit test with just plugin code didn't work because it didn't found the core Magento classes. We solved it by adding packages that installs Mangeto code while running Github action to test. Setting up unit test in WP is a bit more complicated than Magento.

For reference:

Yes, I am aware of that and this ticket is just for integration with sonarcloud. We can have new ticket for proper unit test.

aashishgurung commented 1 year ago

It's alright. Moving forward, lets start integrating with Sonarcloud only if we have proper unit test setup first.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication