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

Comma separated part numbers for run-tests.py #66

Merged
merged 1 commit into from
Jan 14, 2024

Conversation

armanbm177
Copy link
Contributor

Enabled multiple part nums to be run in sequence for run-tests.py. Inspired by the lab 4 part 3 exploit, that doesn't require a working part 2 to get a majority of part 3 points.

Example terminal commands:
./run-tests.py -l 4 -p 2,3

Copy link
Owner

@emichael emichael left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this!

The only problem I can see is that this is incompatible with the testNum option. Look at DSLabsTestCore:220. I think you need to only allow non-fully-qualified test numbers when there is exactly one part specified.

That is -l 1 -p 2 -n 4 should work, but -l 1 -p 2,3 -n 4 should not.

The other possibility is for the second command to work and choose test 4 in parts 2 and 3, but I don't think you'd ever want to do that.

parser.add_argument('-p', '--part', type=int,
help="part number for tests to run")

parser.add_argument('-p', '--part', type=str,
Copy link
Owner

Choose a reason for hiding this comment

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

str is the default type, no need to specify it

Also, please make a note in the help string about what kinds of inputs this can take now. Look at --test-num

@wilcoxjay
Copy link
Contributor

you need to only allow non-fully-qualified test numbers when there is exactly one part specified.

That is -l 1 -p 2 -n 4 should work, but -l 1 -p 2,3 -n 4 should not.

This makes sense to me. Is it ok to only put this check in the python script, or do we enforce these things in both python and java?

@emichael
Copy link
Owner

Either/both is fine. There could be more input validation and better error messages for the student facing scripts in general :-)

@emichael emichael merged commit dfd6988 into emichael:master Jan 14, 2024
5 checks 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.

3 participants