-
-
Notifications
You must be signed in to change notification settings - Fork 139
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
Test generator, step 1 #638
Conversation
Note that for a CLI Application it is not necessary to boot a full symfony framework: https://symfony.com/doc/current/components/console/single_command_tool.html php-representer is a single command application: https://github.com/exercism/php-representer/blob/main/main.php and https://github.com/exercism/php-representer/blob/main/src/Application.php |
Thanks for mentioning that. I am currently not sure if I want to make it a single command app or add some "update" command to ease syncing against problem specs. So I left it as is. I currently focus on functionality, to get experience with the approach. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a good start. I do not really know the goal of this Pull Request.
Is it to provide a fully working implementation for some existing exercises ?
Is it to just provide the basis for the generator and iterate on it later ?
The goal is to have a next step from POC to MVP. So we can discuss on direction and possible alternatives. And also to have something to experiment with and help with adding further exercises. |
05f3890
to
8b9e4c3
Compare
No changes, only removed composer.lock
Will use configlet to get path to the canonical data cache.
Generating the exercise with configlet makes sure the cached is filled.
When running configlet with detailed output (-v d) and a command that requires problem specification data (e.g. info), it prints the location of the cache as the first line. To avoid an HTTP call, use the offline mode (-o). Pipe the output through 'head' to get the first line only, then 'cut' the 5th field to get the path only. configlet may fail when there is no cached data (offline mode), which tells us, that the exercise hasn't been generated before (the cache is required for that, too). Assemble the cache directory with the exercise location and if that's not there, we don't have a usable exercise slug or no access rights.
The test creation will move to its own class. Right now it is not used.
The flag `--no-configuration` is explicitly used in 'bin/tests.sh'. Running a test directly for making a new exercise works fine, too.
This is the first step towards #631
contribution/generator
, so it is not installed in CIconfiglet
cached problem specification repository as information source/exercises/practice/${slug}/{PascalCaseSlug}.php
There are still many TODOs marked in the code, especially making things more failsafe. But it can currently be used with most missing practice exercise, as far as have looked into.