exercism / vimscript

Exercism exercises in Vim script.
https://exercism.org/tracks/vimscript
MIT License
20 stars 24 forks source link

Update CI to run example.vim in isolation #182

Closed BNAndras closed 6 months ago

BNAndras commented 11 months ago

Related to #177, the CI loops over each example.vim and sources just that file before running the associated Vader file. Previously, it sourced all the example.vim files and then ran the Vader files, leading to the namespace collision in the other PR. An unfortunate side effect of opening Vim up multiple times is the CI log has a lot of redundant info from Vim's startup. Maybe there's a clean way of keeping the first set and then removing additional instances

kotp commented 11 months ago

One way to help with this would be to undefine what is added by each "library file", so keeping track of what is new, for that run, and then removing those afterward, would help to keep the isolation.

I have also converted this to "draft" so that it does not accidentally get pulled in until you are ready for it.

But it looks good as a draft.

BNAndras commented 11 months ago

Right, thanks. I'll need to do some more research on that workflow and come back to this.

BNAndras commented 10 months ago

Right, so what I'm thinking is we run vim once but we extend the commands in vim -c "source $example_file | Vader! $vader_file" so it sequentially lists groups of example files and Vader files for each exercise, built from our looping through the practice exercises subfolder.

It'd look something like vim -c "source .\atbash-cipher\.meta\example.vim | Vader! .\atbash-cipher\atbash_cipher.vim | source .\beer-song \.meta\example.vim | ... and so on ....

A repeat binding like with darts and scrabble-score would be fine since darts comes first and uses its score code. Then we replace the darts score code with the scrabble-score one when it's time to run that exercise.

kotp commented 10 months ago

Sounds like a plan.

BNAndras commented 10 months ago

Vader quits Vim after running the test suite so that's possibly the reason for the original set up where the CI sources every example.vim and then run every Vader test suite sequentially in a single go. So I'm thinking we go back to my original proposed solution (run Vim once per exercise) and then remove anything not specific to Vader.

BNAndras commented 6 months ago

Boo, I forgot about replacing the dashes in the exercise slugs with underscores. I'll fix that tomorrow.

BNAndras commented 6 months ago

Alright, I think we're good here now.