{"id":19055855,"url":"https://github.com/danny02/junit-timelimit-extension","last_synced_at":"2026-04-18T05:34:02.037Z","repository":{"id":144774493,"uuid":"134063776","full_name":"Danny02/junit-timelimit-extension","owner":"Danny02","description":"Annotate your tests with time limits and check if they behaved accordantly","archived":false,"fork":false,"pushed_at":"2018-05-20T20:13:56.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-22T01:27:48.995Z","etag":null,"topics":["java","junit","junit-extension","junit5","test","timeout"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Danny02.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,"publiccode":null,"codemeta":null}},"created_at":"2018-05-19T13:20:29.000Z","updated_at":"2018-05-20T20:13:57.000Z","dependencies_parsed_at":"2023-07-25T02:30:49.194Z","dependency_job_id":null,"html_url":"https://github.com/Danny02/junit-timelimit-extension","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Danny02/junit-timelimit-extension","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Danny02%2Fjunit-timelimit-extension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Danny02%2Fjunit-timelimit-extension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Danny02%2Fjunit-timelimit-extension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Danny02%2Fjunit-timelimit-extension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Danny02","download_url":"https://codeload.github.com/Danny02/junit-timelimit-extension/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Danny02%2Fjunit-timelimit-extension/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31957646,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["java","junit","junit-extension","junit5","test","timeout"],"created_at":"2024-11-08T23:47:13.289Z","updated_at":"2026-04-18T05:34:02.016Z","avatar_url":"https://github.com/Danny02.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JUnit Time Limits [![Build Status](https://travis-ci.com/Danny02/junit-timelimit-extension.svg?branch=master)](https://travis-ci.com/Danny02/junit-timelimit-extension) [![Test Coverage](https://api.codeclimate.com/v1/badges/39d3af77356397728dfd/test_coverage)](https://codeclimate.com/github/Danny02/junit-timelimit-extension/test_coverage)\n\nIt is common to categorize unit test by how quickly they execute. This for example \nenables enables one to execute only test which run in a very short amount of time.\n\nThis could be used for i.e. :\n- a background process which test on each file save\n- a git pre commit hook\n- as a first testing stage of the CI pipeline\n\nThe problem one faces is, that these categories need to be curated by hand. This is \nespecially error prone to changes over time.\n\nThis Extension gives you [annotations](src/main/java/com/github/danny02/annotation) to categorize your tests in how quick they run\nand also checks the execution time of each categorized test.\n\nThe current categories are:\n\n|Name|Time Limit|\n|-|-:|\n|[@Short](src/main/java/com/github/danny02/annotation/Short.java)|0 - 100ms|\n|[@Medium](src/main/java/com/github/danny02/annotation/Medium.java)|80 - 500ms|\n|[@Long](src/main/java/com/github/danny02/annotation/Long.java)|400 - 1500ms|\n|[@Eternal](src/main/java/com/github/danny02/annotation/Eternal.java)|over 1500ms|\n|[@TimeLimit](src/main/java/com/github/danny02/annotation/TimeLimit.java)|configurable|\n \nBesides using the [annotations](src/main/java/com/github/danny02/annotation), \nyou need to enable the [Extension](src/main/java/com/github/danny02/extension/TimeLimitExtension.java).\nTake a look at the [JUnit documentation](https://junit.org/junit5/docs/current/user-guide/#extensions-registration)\non how to do it, the prefered way is to register it [automatically](https://junit.org/junit5/docs/current/user-guide/#extensions-registration-automatic) .\n\n## Configuration\n\nYou can configure own time limit categories or overwrite defaults by using \n[JUnit Parameters](https://junit.org/junit5/docs/current/user-guide/#running-tests-config-params).\n\nJust set the following properties:\n````properties\ncom.github.danny02.timeout.categoryname.lower=300\ncom.github.danny02.timeout.categoryname.upper=750\n````\n\n\n## Credits\nInspired by [Bazel Test Timeouts](https://docs.bazel.build/versions/master/test-encyclopedia.html)\n\nImplementation Idea from [Sam Brannen](https://github.com/sbrannen) see \n[Stackoverflow post](https://stackoverflow.com/questions/50229133/how-to-enable-a-global-timeout-for-junit-testcase-runs/50233807#50233807)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanny02%2Fjunit-timelimit-extension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanny02%2Fjunit-timelimit-extension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanny02%2Fjunit-timelimit-extension/lists"}