{"id":18426177,"url":"https://github.com/clevertap/supertest-maven-plugin","last_synced_at":"2025-07-12T22:34:46.067Z","repository":{"id":42667356,"uuid":"457316814","full_name":"CleverTap/supertest-maven-plugin","owner":"CleverTap","description":"A wrapper for Maven's Surefire Plugin, with advanced re-run capabilities.","archived":false,"fork":false,"pushed_at":"2024-08-31T15:34:11.000Z","size":80,"stargazers_count":6,"open_issues_count":5,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-07T12:56:33.007Z","etag":null,"topics":["maven","rerun","supertest","surefire"],"latest_commit_sha":null,"homepage":"https://clevertap.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CleverTap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-02-09T10:46:13.000Z","updated_at":"2024-02-13T10:39:50.000Z","dependencies_parsed_at":"2024-02-13T12:49:49.583Z","dependency_job_id":"ff3ee30e-a20b-44cf-a747-d928e54d829e","html_url":"https://github.com/CleverTap/supertest-maven-plugin","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/CleverTap/supertest-maven-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleverTap%2Fsupertest-maven-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleverTap%2Fsupertest-maven-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleverTap%2Fsupertest-maven-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleverTap%2Fsupertest-maven-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CleverTap","download_url":"https://codeload.github.com/CleverTap/supertest-maven-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleverTap%2Fsupertest-maven-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265066197,"owners_count":23706063,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["maven","rerun","supertest","surefire"],"created_at":"2024-11-06T05:07:08.568Z","updated_at":"2025-07-12T22:34:46.045Z","avatar_url":"https://github.com/CleverTap.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SuperTest Maven Plugin\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=CleverTap_supertest-maven-plugin\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=CleverTap_supertest-maven-plugin)\n\nA wrapper for [Maven's Surefire Plugin](https://maven.apache.org/surefire/maven-surefire-plugin/),\nwith advanced re-run capabilities.\n\n## Goals\n- Shorten the PR iteration time\n- Re-run failed tests with a special profile such that they're isolated, instead of running \n  all tests optimistically again\n\n## Motivation\nMaven's Surefire is great, but lacks certain retry control mechanisms. Imagine a Maven project\nwith thousands of tests, which all use some sort of harness to run, which is shared amongst each\ntest (one test harness per fork). If a single test pollutes that harness (say changing some static\nstate within that harness), another test depending on that state will fail. Specifying Surefire's\n`rerunFailingTestsCount` wouldn't help here, since the failing test is retried within the same fork.\nThe obvious solution would be to disable fork reuse, however, doing so would increase the total time\ntaken to run thousands of tests, since setting up the harness required is expensive.\n\nTherefore, instead of letting Surefire retry the same test over and over again in the same fork,\nSuperTest discovers failed tests from Surefire's report directory, and re-runs the failed ones.\nHere's where things get interesting: this time, for the few tests that have failed, run them in\npure isolation - set Surefire's `reuseForks` option to `false`. Now, if these tests fail again,\nwe know for sure that they didn't fail due to pollution in the test harness by other tests.\n\n## Example\nA classic example to illustrate this problem is:\n\n```java\npublic class MyState {\n    public static boolean activateFeatureFoo = false;\n}\n\npublic class BadTest {\n    \n    @Test\n    public void test() {\n        MyState.activateFeatureFoo = true;\n        // Do something.\n        // MyState#activateFeatureFoo wasn't reset! Bad test!\n    }\n}\n\npublic class AnotherTest {\n    \n    @Test\n    public void test() {\n        assertFalse(MyState.activateFeatureFoo); // Fails! If BadTest and AnotherTest run within the same fork, AnotherTest will ALWAYS fail.\n    }\n}\n```\n\nWith SuperTest, if `AnotherTest` fails (if it ran after `BadTest`), only `AnotherTest` would be \nrerun, and not all the other tests, thereby saving time (especially when modules take an upwards\nof 10+ minutes to run thousands of tests).\n\n## Installation\n\nTo use SuperTest within your Maven project, ensure that the `mvn` executable is in the \n`PATH` of the original `mvn` invocation. Then, add the plugin to your `pom.xml`:\n\n```xml\n\u003cbuild\u003e\n    \u003cplugins\u003e\n        \u003cplugin\u003e\n            \u003cgroupId\u003ecom.clevertap\u003c/groupId\u003e\n            \u003cartifactId\u003esupertest-maven-plugin\u003c/artifactId\u003e\n            \u003cversion\u003e1.3-SNAPSHOT\u003c/version\u003e\n            \u003cconfiguration\u003e\n                \u003c!-- Optional profile to activate during a re-run;\n                     Example: Activate a profile which disables fork reuse --\u003e\n                \u003crerunProfile\u003edontReuseForks\u003c/rerunProfile\u003e\n                \u003c!-- Optional, defaults to 1 if not specified --\u003e\n                \u003cretryRunCount\u003e5\u003c/retryRunCount\u003e\n                \u003c!-- Optional, additional parameters to pass to the mvn command invocation --\u003e\n                \u003cmvnTestOpts\u003e-P jacoco -fae\u003c/mvnTestOpts\u003e\n            \u003c/configuration\u003e\n        \u003c/plugin\u003e\n    \u003c/plugins\u003e\n\u003c/build\u003e\n\n\u003c!-- Optional profile, but recommended for test isolation --\u003e\n\u003cprofiles\u003e\n    \u003cprofile\u003e\n        \u003cid\u003edontReuseForks\u003c/id\u003e\n        \u003cbuild\u003e\n            \u003cplugins\u003e\n                \u003cplugin\u003e\n                    \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n                    \u003cartifactId\u003emaven-surefire-plugin\u003c/artifactId\u003e\n                    \u003cconfiguration\u003e\n                        \u003creuseForks\u003efalse\u003c/reuseForks\u003e\n                    \u003c/configuration\u003e\n                \u003c/plugin\u003e\n            \u003c/plugins\u003e\n        \u003c/build\u003e\n    \u003c/profile\u003e\n\u003c/profiles\u003e\n```\n\nNote: The configuration parameters may also be specified directly when invoking `mvn` from the CLI:\n```shell\n$ mvn supertest:supertest -DrerunProfile=dontReuseForks -DretryRunCount=5 -DmvnTestOpts=\"-P jacoco -fae\"\n```\n\n## Development\nAfter making changes to the plugin, update the version in `pom.xml`, run `mvn install` from\nthe project root, and update the version of the plugin where SuperTest is being used.\n\n## Maintainers\nSuperTest Maven Plugin is maintained by the CleverTap Labs team, with contributions\nfrom the entire engineering team.\n\n## License\nSuperTest Maven Plugin is licensed under the MIT License. Please see LICENSE\nunder the root directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclevertap%2Fsupertest-maven-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclevertap%2Fsupertest-maven-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclevertap%2Fsupertest-maven-plugin/lists"}