hyperskill / hs-test-python

A framework that simplifies testing educational projects for Hyperskill.
15 stars 10 forks source link

Added library version validator #41

Closed polischuks closed 1 year ago

polischuks commented 1 year ago

Task: #HSPC-50

Reviewers

Description Validating the currently installed test library and the latest release.

aaaaaa2493 commented 1 year ago

I get that you want to be absolutely sure that users are using the latest library version all the time. But for the library that tries to be as most user friendly as possible that's not a good move to check if the library is up to date.

For the majority of users it doesn't matter if they are using slightly outdated version or the most recent. Python learners wouldn't gain much if we release new version with new language supported, say Bash or C#. Yet in this case every one of them should update the library.

I would suggest doing this with slightly less invasive way. Let's say we tested user's program and user's program passed the tests. Are the user required to update the library in this case? Probably not. Everything is working fine in this case without the update. And, in case something went wrong (WrongAnswer or other outcomes) let's add some text to the already generated feedback that suggest to the user's that this error might be because of outdated library version (in case it is really outdated). And the instruction to update the library.

This would be far less intrusive and more user friendly, and achieves the same purpose.

inuur commented 1 year ago

@polischuks that is what I exactly was doing here. It checks for the library version only if the tests didn't pass. Also, it caches the version, so it won't make a request to the GitHub on each failed attempt.

If the version of the library is outdated, it adds a message at the top of the feedback with instruction on how to update the library.