{"id":28644818,"url":"https://github.com/cryptaliagy/iti1121-grading","last_synced_at":"2025-06-13T00:12:21.817Z","repository":{"id":297112728,"uuid":"995694430","full_name":"cryptaliagy/iti1121-grading","owner":"cryptaliagy","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-03T22:18:25.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-04T06:39:27.183Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/cryptaliagy.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,"zenodo":null}},"created_at":"2025-06-03T21:53:57.000Z","updated_at":"2025-06-03T22:18:27.000Z","dependencies_parsed_at":"2025-06-04T06:39:31.610Z","dependency_job_id":"01cf434c-39e6-49e7-90fc-762b27b4f7ac","html_url":"https://github.com/cryptaliagy/iti1121-grading","commit_stats":null,"previous_names":["cryptaliagy/iti1121-grading"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cryptaliagy/iti1121-grading","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptaliagy%2Fiti1121-grading","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptaliagy%2Fiti1121-grading/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptaliagy%2Fiti1121-grading/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptaliagy%2Fiti1121-grading/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cryptaliagy","download_url":"https://codeload.github.com/cryptaliagy/iti1121-grading/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptaliagy%2Fiti1121-grading/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259553141,"owners_count":22875617,"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":[],"created_at":"2025-06-13T00:12:04.564Z","updated_at":"2025-06-13T00:12:21.804Z","avatar_url":"https://github.com/cryptaliagy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java Test Runner for ITI 1121\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)\n\nA CLI tool for automating the process of running Java tests for ITI 1121 assignments at the University of Ottawa. This tool finds Java test files with a specified prefix, copies them to a target directory, compiles them, and runs the tests.\n\n## Dependencies\n\n- Python 3.10 or higher\n- Java Development Kit (JDK) installed and available in the system PATH\n- `javac` and `java` commands available in the system PATH\n- `Typer` for command-line interface\n- `rich` for rich text output in the terminal\n- (Optional) `pipx` for isolated Python environments\n- (Optional) All Java libraries/JAR files required for the tests should be available in the user's CLASSPATH variable.\n\n## Features\n\n- Quickly compile and run Java test files\n- Automatically find test files with a specific prefix\n- Copy test files to a target directory, replacing existing files if necessary\n- Support for additional classpath entries\n- Detailed output at each step of the process\n\n## Installation\n\nFirst, clone the repository:\n\n```bash\ngit clone https://github.com/cryptaliagy/iti1121-grading.git\ncd iti1121-grading\n```\n\n### Using pipx (Recommended)\n\n[pipx](https://pypa.github.io/pipx/) is recommended for command-line tools as it installs each package in its own isolated environment:\n\n```bash\npipx install .\n```\n\n### Using Poetry (Useful for development)\n\n```bash\npoetry install\n```\n\nIf installing with Poetry, you can run the tool using:\n\n```bash\npoetry run grader\n```\n\nIf following along with the usage example below, replace `grader` with `poetry run grader`.\n\n### Using pip (Not recommended)\n\n```bash\npip install .\n```\n\nFor development installation:\n\n```bash\npip install -e .\n```\n\n## Usage\n\n### Basic Usage\n\nTo run the grader, you need to provide:\n\n- The directory containing the test files\n- A prefix for the test files\n\n```bash\ngrader --test-dir path/to/tests --prefix TestL1\n```\n\nOr using the short options:\n\n```bash\ngrader -t path/to/tests -p TestL1\n```\n\nYou can also run it as a Python module:\n\n```bash\npython -m grader --test-dir path/to/tests --prefix TestL1\n```\n\nThe CLI also supports some directory shortcuts:\n\n- `.` for the current directory\n- `..` for the parent directory\n- `~` for the user's home directory\n\nSo, if you have your tests in a directory called `tests` in your home directory, you can run:\n\n```bash\ngrader --test-dir ~/tests --prefix TestL1\n```\n\n### Specifying the Code Directory\n\nBy default, the tool uses the current directory as the target for copying test files. You can specify a different directory:\n\n```bash\ngrader --test-dir path/to/tests --prefix TestL1 --code-dir path/to/code\n```\n\nOr:\n\n```bash\ngrader -t path/to/tests -p TestL1 -c path/to/code\n```\n\n### Adding Classpath Entries\n\nIf your tests need additional libraries or classpath entries, you can specify them:\n\n```bash\ngrader --test-dir path/to/tests --prefix TestL1 --classpath path/to/lib1.jar --classpath path/to/lib2.jar\n```\n\nOr:\n\n```bash\ngrader -t path/to/tests -p TestL1 -cp path/to/lib1.jar -cp path/to/lib2.jar\n```\n\n## How It Works\n\n1. **Finding Test Files**: The tool searches for all `.java` files with the specified prefix in the test directory. It ensures that there's at least one file exactly matching the prefix (e.g., `TestL1.java` for prefix `TestL1`). It also copies `TestUtils.java` if it exists in the test directory.\n\n2. **Copying Test Files**: All matching test files are copied to the target code directory. If any files with the same names already exist in the target directory, they are deleted first.\n\n3. **Compiling Tests**: The tool compiles the main test file (the one exactly matching the prefix) using the `javac` command. If classpath entries are provided, they are included in the compilation command.\n\n4. **Running Tests**: If compilation succeeds, the tool runs the compiled test using the `java` command.\n\n## Examples\n\n### Running Tests without Classpath\n\n```bash\n# Copy all TestL1*.java files from tests/ to the current directory and run TestL1\ngrader -t tests -p TestL1\n\n# Copy tests to a specific directory\ngrader -t /path/to/assignment/tests -p Lab2 -c /path/to/student/submission\n```\n\n### Running Tests with Classpath\n\n```bash\n# Include JUnit in the classpath\ngrader -t tests -p TestL1 -cp lib/junit-4.13.jar -cp lib/hamcrest-core-1.3.jar\n\n# Multiple libraries and a custom code directory\ngrader -t assignment/tests -p Assignment1Test -c student/code -cp lib/junit.jar -cp lib/commons-io.jar\n```\n\n## Error Handling\n\nThe tool provides clear error messages for common issues:\n\n- Missing test directories\n- No matching test files\n- Missing main test file\n- Compilation errors\n- Test execution failures\n- Permission issues when copying files\n\nIt will also attempt to resolve issues where it can.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Author\n\nNatalia Maximo - \u003cnatalia.maximo@uottawa.ca\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcryptaliagy%2Fiti1121-grading","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcryptaliagy%2Fiti1121-grading","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcryptaliagy%2Fiti1121-grading/lists"}