Closed sahinakkaya closed 4 years ago
That was a backward-incompatibility sloppiness on my part, I guess. The reason for testers still using "return" might be due the calico version installed on our university servers being old, although I haven't checked it. Nice work, thanks!
Re: ignoring keywords silently. IIRC, there was a sanity checker in the code that validated the yaml file. I can't verify this at the moment, I'll have to get back to it.
Moreover, they avoid writing programs which returns 1 ...
I finally found the related test file, it was this and was used to evaluate our assignments. However, it seems that the keyword was return
by that time so I don't have any idea why they choose 0
to signify an error :)
In response to your comments, currently calico 1.1.2 is installed at ITU's servers and it uses exit
keyword since version 1.0. I think the reason why testers use return
is because they are copy pasting from older test files whenever they want to write new tests. Considering this, #9 might be still a good idea. I will send a PR when I have time.
I recently realized that calico doesn't use
return
keyword to specify exit status of the program.The keyword wasThe keyword was changed toexit
since the beginning and it has never changedexit
in this commit but the testers keep usingreturn
for some reason(the reason is obvious actually). Including myself, the testers were unaware thatreturn: 0
actually does nothing because it is ignored by calico and the exit status of test case defaults to0
whenexit
keyword is not present. Moreover, they avoid writing programs which returns 1 because when they try to test it, they were seeingexit status: 1 (expected 0)
even though they writereturn: 1
in the test specification.I don't know if ignoring unknown keywords silently has some purpose so I didn't want to touch that part. Instead, I modified related parts of code to support
return
keyword so that it can be used as intended.I run the tests with Python3.8 and only the ones that are related with system calico have been failed because I don't have calico installed.