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

Create a test project to check new plugin rule in real environment #65

Closed
dedece35 opened this issue Mar 3, 2023 · 8 comments
Closed

Comments

@dedece35
Copy link
Member

dedece35 commented Mar 3, 2023

Is your feature request related to a problem? Please describe.
currently, when a developer create a new rule in the plugin, he can test it with unit tests but not on a real SonarQube environment.

Describe the solution you'd like
Create a new project / repository containing an example application (one by language ?) which can be used to push on local development SonarQube environment to check if the new rule is OK.
It would be an integration test.
Maybe we can use all current source files used in unit tests.

@dedece35 dedece35 self-assigned this Mar 3, 2023
@dedece35
Copy link
Member Author

dedece35 commented Mar 3, 2023

Hi @jhertout,
I've just added a new test-project for java-plugin : here is the commit.
I added all Java files found in src/test/files for unit tests of java-plugin.
What do you think about it ?

@jhertout
Copy link
Contributor

jhertout commented Mar 6, 2023

Hi @dedece35,

It the same for us, our test projects is almost like the unit tests. The only thing is that we add a comment at the end of a line that should trigger an issue like this :

params.screenBrightness = BRIGHTNESS_OVERRIDE_FULL; // Issue {Sobriety: Brightness Override}

This enable us to know if the rule is triggered on the good line without thinking and if it it is the rule we expect.
It is a good way to easily know if a rule triggers on a bad line too (a line without comment).

@dedece35
Copy link
Member Author

dedece35 commented Mar 6, 2023

Hi @jhertout,
indeed, good idea !
maybe plan a technical point to show me how this system works.

@utarwyn
Copy link
Member

utarwyn commented Mar 6, 2023

Hello, do you think we should put the test projects in another repository? It's just an idea in order not to overload this repository, maybe a bad one. It depends if we need them during the development phase or not.

@dedece35
Copy link
Member Author

The new repository is ready for Java language : https://github.com/green-code-initiative/ecoCode-java-test-project
are you ok @jhertout @utarwyn ?
if yes, I will create an issue for each other langugage to do the same (php, python)

@dedece35
Copy link
Member Author

dedece35 commented Mar 14, 2023

for python plugin, I created the new repo https://github.com/green-code-initiative/ecoCode-python-test-project
It help me to correct #64 and create the PR #77
you can review it if you want. I took into account the @jhertout 's review note above on java plugin

@jhertout
Copy link
Contributor

Hi @dedece35,
I looked the Python test project and it seems ok to me. We are working on some Python rules, so we will quickly have to work on it. We will see if all is ok!

@dedece35
Copy link
Member Author

Hi, all test projects are up and ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants