Skip to content

Single exercise option #491

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

Merged
merged 5 commits into from
Nov 14, 2017
Merged

Single exercise option #491

merged 5 commits into from
Nov 14, 2017

Conversation

ErikSchierboom
Copy link
Member

This PR adds functionality to fix #434 (show status of all exercises). When running the test generator, all the track's exercises are checked to see what to do. There are four options:

  1. There is no canonical data for the exercise. A warning is printed.
  2. There is canonical data and no generator is available. An error is printed (just for display purposes, as it makes it easier to discern between the various types).
  3. There is canonical data and a generator is available. The generator is run.
  4. There is canonical data and a generator is available, but the generator inherits from CustomExercise. In this case, we assume that the tests are crafter manually and don't run a generator.

I've also added an option to filter on the above mentioned statuses, which you can do by providing a command-line option. For example, dotnet run -s Unimplemented would show only those exercises with canonical data but without a generator.

namespace Generators.Exercises
{
public class Diamond : CustomExercise
{
Copy link
Contributor

Choose a reason for hiding this comment

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

It's probably worth adding a comment here on why we decided not to follow the canonical data for this exercise (here's it's because we wanted to do property based testing). That way if something changes in the future and we want to revisit that decision we have the info here without digging through the issues.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. I've updated the PR.


Log.Information("{Exercise}: tests generated", exercise.Name);
break;
case UnimplementedExercise _:
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't you remove the underscores here since they're not used?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope, unfortunately not. I tried that at first, but then it isn't a valid pattern match anymore.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm ok I thought you could, thanks for checking!

@robkeim
Copy link
Contributor

robkeim commented Nov 13, 2017

Awesome work @ErikSchierboom... you took what I had in mind even a step further that's great! I added a couple of minor comments, but feel free to merge yourself even if you make changes for my comments as they're minor.

@robkeim robkeim merged commit fb3ffd6 into exercism:master Nov 14, 2017
@robkeim
Copy link
Contributor

robkeim commented Nov 14, 2017

Thanks @ErikSchierboom!

@ErikSchierboom ErikSchierboom deleted the single-exercise-option branch May 5, 2018 13:44
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.

Add the exercises without canonical data to test generator
2 participants