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

Bug: Files don't get updated on exercism download ... if submitted #847

Open
sshine opened this issue Sep 30, 2019 · 1 comment
Open

Bug: Files don't get updated on exercism download ... if submitted #847

sshine opened this issue Sep 30, 2019 · 1 comment
Labels

Comments

@sshine
Copy link
Contributor

sshine commented Sep 30, 2019

The main purpose of this issue is to document a usability bug caused by the way exercism download ... currently updates exercises on the Haskell track. It seems that there are some situations where exercise version migrations cause problems, and this issue describes three such edge cases.

A similar but not equivalent problem is experienced exercism/ocaml#368.

If users return to an exercise that has been updated in the meantime, and they click the website button that forwards their solution to the latest version, and they type exercism download --exercise=... --track=haskell, all the files that were updated are downloaded, except the ones the student once ran exercism submit ... on.

This causes the following problems on the Haskell track:

  1. The solution file itself cannot be overriden by a stub, since that would mean that the student loses their solution. But if the stub has breaking changes, such as changes to a type signature, or an exported data type, the old solution may no longer successfully compile against test/Tests.hs, and there may not be any clear hint on how to proceed: While the stub file does contain the most recent type signatures or data types, they are often deliberately inferred in the test suite -- for example to allow for overloaded solutions. So the student has a solution that won't compile and no clear indication of what is missing to make it compile.

  2. The project file, package.yaml may have been submitted so that the solution can compile on the mentor's or the automated mentoring system's machine. So if the student submitted a package.yaml, and a later update to the exercise depends on packages that are neither listed in the previous version or the student version of package.yaml, the solution may no longer successfully compile against test/Tests.hs, and the error messages will report of modules that don't exist, but not necessarily suggest what packages should be added to make these modules available.

  3. The test file, test/Tests.hs may have been submitted because the student has enabled a commented-out test, or supplied a test of their own, to show the mentor that it passes this. For example, the Diamond exercise received a property-based test suite in Diamond: Implement property-based tests #843 that would seem ideal for the student to improve on, since the README essentially contains recipes for more properties. But if the student submits improved properties, they will never receive updates to the ones handed out.

@sshine sshine added the bug label Sep 30, 2019
@sshine sshine changed the title Problem updating exercise: package.yaml, test/Tests.hs don't get updated if submitted Bug: Files don't get updated on exercism download ... if submitted Sep 30, 2019
sshine pushed a commit that referenced this issue Oct 1, 2019
Diamond's test suite is extended with a set of property-based tests.

These are in part inspired by the list of properties from README.md, and in
part by Mark Seemann's blog post on property-based checks for exactly this
exercise:

    https://blog.ploeh.dk/2015/01/10/diamond-kata-with-fscheck/

Only a subset of the properties mentioned are implemented.  This leaves room
for students to extend the test suite further, although exercism/exercism#5052
and #847 indicate that we may not wish to encourage this in the near future.

Because @barrymoo's property-based tests uncovered a bug in the example
solution, the example solution is replaced with one that passes current tests.
@petertseng
Copy link
Member

Investigate whether exercism/website#2049 helps with this. Supposedly now all editor.files are included in the important files which calculate whether an exercise has changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants