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

Added new ID tests and README file for verify_test_type #1555

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

yugvajani
Copy link

@yugvajani yugvajani commented Dec 2, 2024

The tests are ID tests detected by NonDex.
Java Version - 17.0.13
Maven Version - 3.9.6

Ran the nondex command and the test command without nondex on the repository to find the new flaky tests.

The logs for the tests can be found at /home/yvajani2/openhab-core/openhab.txt

Have also added a README.md file which states the steps to run the verify_test_type.sh script locally.

@darko-marinov
Copy link
Contributor

Did you run tests individually to confirm them? Can you check how https://github.com/TestingResearchIllinois/idoft/tree/main/verify_test_type can help you confirm the type?

@yugvajani
Copy link
Author

I ran the mvn test -Dtest and the mvn edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest for each test individually. The logs for it can be found here /home/yvajani2/openhab-core/openhab.txt

@darko-marinov
Copy link
Contributor

Okay, great. Now try that verify_test_type and see if you need to improve its code or documentation.

@darko-marinov
Copy link
Contributor

You can run the checker locally before pushing some changes. You need not repeatedly find these failures on the CI.

@yugvajani
Copy link
Author

Yes now i will do it locally only thanks.

@darko-marinov
Copy link
Contributor

The checker passes now, thanks. What does verify_test_type report?

@yugvajani
Copy link
Author

I ran the verify_test_type command individually for all the tests. Below are the logs for each set of tests:

  • Tests 1-5 - /home/yvajani2/openhab-core/verify_test.txt
  • Tests 6-10 - /home/yvajani2/openhab-core/verify_test_1.txt
  • Tests 11-15 - /home/yvajani2/openhab-core/verify_test_2.txt
  • Tests 16-20 - /home/yvajani2/openhab-core/verify_test_3.txt
  • Tests 21-26 - /home/yvajani2/openhab-core/verify_test_4.txt

@yugvajani yugvajani changed the title Added new ID tests Added new ID tests and README file for verify_test_type Dec 4, 2024
Copy link
Contributor

@darko-marinov darko-marinov left a comment

Choose a reason for hiding this comment

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

Please address the comment on README


Go to the root directory of the repository which has the newly found flaky test.

#### 2. Download the script in your repository
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just git clone ...idoft, especially if you're already changing pr-data.csv or other files in the repo?

Copy link
Author

Choose a reason for hiding this comment

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

We only need the script file and not the entire repository so its better to just add the verify_test script to the repo.

Copy link
Contributor

Choose a reason for hiding this comment

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

But installing wget ends up more challenging than just git clone. Also, why include here instructions for downloading wget when people can download that file/script in any other way they want.

Copy link
Author

Choose a reason for hiding this comment

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

I will remove the wget and chmod commands, and instead mentioning that users can download that file/script in any way they want.

Run the script for a particular test using this command:

```
./verify_test_type.sh <module-name> <commit-hashcode> <test-name> <class-name>
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add some example invocation?

Copy link
Author

Choose a reason for hiding this comment

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

Added an example of invocation

Copy link
Contributor

@darko-marinov darko-marinov left a comment

Choose a reason for hiding this comment

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

Please see more reviews on the README now that I read it in detail.

@@ -0,0 +1,43 @@
<h1 align="center">Verify Test Type</h1>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why use HTML tags in a Markdown?

Copy link
Author

Choose a reason for hiding this comment

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

Since this was used for certain scripts in idoft for example in https://github.com/TestingResearchIllinois/idoft/blob/main/format_checker/README.md. Tried to make README consistent.

Copy link
Contributor

Choose a reason for hiding this comment

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

Change those READMEs (likely in a different PR).

Copy link
Author

Choose a reason for hiding this comment

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

So should i remove the html tags or not from the markdown in this README file?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, remove (rather replace with # and such) in this file in this PR. Then open another PR to remove from the other README files.

@@ -0,0 +1,43 @@
<h1 align="center">Verify Test Type</h1>

<p align="center">Script Purpose: Ensure the identification of the test type (e.g., ID, OD, NOD, etc.) for new tests discovered in a repository. </p>
Copy link
Contributor

Choose a reason for hiding this comment

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

Does Markdown support centering text?

Copy link
Author

Choose a reason for hiding this comment

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

Yes


Go to the root directory of the repository which has the newly found flaky test.

#### 2. Download the script in your repository
Copy link
Contributor

Choose a reason for hiding this comment

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

But installing wget ends up more challenging than just git clone. Also, why include here instructions for downloading wget when people can download that file/script in any other way they want.


#### 3. Make the script executable

Use this command to make the script executable:
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't need this for git clone (in fact, shouldn't need it if the file has the right permission in the repo, and if the file doesn't have, just open a PR for that).


Example of an invocation:
```
./verify_test_type.sh bundles/org.openhab.core.thing 660102e3f93f928473b66f56f2955090dfa3c30e testCreateChannelDescriptionChangedEventOnlyNewValue ThingEventFactoryTest
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you're provided repo and commit SHA here, what ensures that the exact commit is checked? Does the script clone the repo? Or does it assume that you've already cloned it? If the latter, does it check that the commit SHA matches git rev-parse HEAD?

Copy link
Author

Choose a reason for hiding this comment

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

The repository is forcefully reset to the exact commit SHA specified by $commit_hash. This guarantees that all operations performed by the script will use this specific state of the repository. It assumes the repository is already cloned.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good description. Please add it in README (on in the script), because the users won't be reading this PR discussion.

@yugvajani
Copy link
Author

I have updated the README with the description of script and have removed the HTML tags from it

@darko-marinov
Copy link
Contributor

Okay, let's declare victory for this PR, so you can review #1554

@darko-marinov darko-marinov merged commit f7aa809 into TestingResearchIllinois:main Dec 4, 2024
1 check passed
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.

2 participants