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

Add better CLI #455

Merged
merged 1 commit into from
Nov 13, 2023
Merged

Add better CLI #455

merged 1 commit into from
Nov 13, 2023

Conversation

niknetniko
Copy link
Member

Add a better way to run TESTed from the command line, by introducing a "CLI" mode:

$ python -m tested.cli --help
usage: cli.py [-h] -e EXERCISE [-s SUBMISSION] [-t TESTSUITE] [-f] [-p PROGRAMMING_LANGUAGE]

Simple CLI for TESTed

options:
  -h, --help            show this help message and exit
  -e EXERCISE, --exercise EXERCISE
                        Path to a directory containing an exercise
  -s SUBMISSION, --submission SUBMISSION
                        Path to a submission to evaluate
  -t TESTSUITE, --testsuite TESTSUITE
                        Path to a test suite
  -f, --full            If the output should be shown in full (default: false)
  -p PROGRAMMING_LANGUAGE, --programming_language PROGRAMMING_LANGUAGE
                        The programming language to use

additional information: The CLI only looks at a config.json file in the exercise directory. It does not look in folders above the exercise directory.

This should make it easier to run TESTed on an exercise locally. Note that this is in addition to the two existing ways of running TESTed (with the main script, python -m tested for production and python -m tested.manual for working on TESTed itself).

Also link to the Dodona docs from the readme.

Closes #453.

if args.submission is not None:
return Path(args.submission)
# Attempt to determine the programming language of this exercise.
considered = []

Check notice

Code scanning / CodeQL

Unused local variable Note test

Variable considered is not used.
@niknetniko niknetniko merged commit f6bda2e into master Nov 13, 2023
6 of 7 checks passed
@niknetniko niknetniko deleted the enhance/cli branch November 13, 2023 13:41
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.

Allow running local exercise by using path to exercise folder
1 participant