PracticeCraft / spirit-exercises

Exercise bank for Spirit
1 stars 3 forks source link

Workflow for testing exercises in development #1

Open waseem-medhat opened 1 month ago

waseem-medhat commented 1 month ago

Since the exercises are in a repo that is separate from when they actually run, I figured we'd need a way to quickly test the exercises (and associated tests) while they are being developed.

I am still strongly leaning towards not making this repo configured like an app with Mix for the following reasons:

So, my suggestion is to have a script that is simply called from the shell (e.g., elixir run_tests.exs basic_types), and it only compiled the two files inside, i.e., compiles the module code and runs its tests.

nikfp commented 1 month ago

I gave this some thought as well. Something that came to mind for me, is to have a flag on spirit.gen that allows use of a local path, so exercise developers can point to a local clone of the exercises repo. Same injection, and ability to overwrite if it already exists, but just .... local.

Thinking about it though, that's more integration testing and not local testing of the exercises. So maybe both ways are needed?

waseem-medhat commented 1 month ago

I think it tackles both integration testing and local testing, and honestly I can't complain.

Only thing that might be a bit cumbersome is having to jump between 2 projects during such testing. But maybe that could be better automated by having the script (in the exercises project) generate a fresh project and run the mix task. Should be significantly less smelly than the approach I tried at first, which was trying to "manually" compile modules/run tests in the script.

Regardless, I like this idea. But that means we'll have to wait for the mix task code to be done (at least an initial version that gets merged into the main branch).

nikfp commented 1 month ago

I'm hoping to have more time to get the generator task functional from github later tonight. At the very least I'll focus on adding a flag for an gh repo of I can't get the file system version working.

nikfp commented 1 month ago

@waseem-medhat is this still open and underway or does it warrant closing?

waseem-medhat commented 1 month ago

I thought to leave it open for future experimentation as I do want to revisit again after we settled on the structure of both repos.