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

Workflow for testing exercises in development #1

Open
waseem-medhat opened this issue Oct 10, 2024 · 5 comments
Open

Workflow for testing exercises in development #1

waseem-medhat opened this issue Oct 10, 2024 · 5 comments
Assignees

Comments

@waseem-medhat
Copy link
Collaborator

waseem-medhat commented Oct 10, 2024

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:

  • This repo is more or less a "storage" place for these exercises
  • The directory structure is unidiomatic for a Mix project
  • Unlike typical Elixir projects, we won't compile the entire app to run the tests for a single module (others will be broken by design)

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.

@waseem-medhat waseem-medhat converted this from a draft issue Oct 10, 2024
@waseem-medhat waseem-medhat self-assigned this Oct 10, 2024
@nikfp
Copy link
Member

nikfp commented Oct 10, 2024

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
Copy link
Collaborator Author

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
Copy link
Member

nikfp commented Oct 10, 2024

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
Copy link
Member

nikfp commented Oct 16, 2024

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

@waseem-medhat
Copy link
Collaborator Author

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.

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

No branches or pull requests

2 participants