-
-
Notifications
You must be signed in to change notification settings - Fork 37
chore: Adds cli test infra to enabling testing bin invocation #573
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
base: main
Are you sure you want to change the base?
Conversation
| "typescript": "^3.9.9" | ||
| }, | ||
| "resolutions": { | ||
| "resolve-package-path": "^4.0.3" |
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.
Just out of curiosity, why is this necessary?
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.
There was a bug in version 3 of resolve-package-path that I fixed. That fix has not made it into fixturify-project yet, but is largely safe since it's just a change to the files that were published. I'm opening a PR right now to roll that into fixturify-project.
|
I've been letting this percolate over the holidays. I think I have a nice setup that will allow us to be able to create ad hoc migrations and target repos, and will also allow us to run full migration tests across those. I also think it'd be nice to provide test infra for migration authors to validate their migrations will run correctly. In that sense, decoupling the utils that allow you to generate fake target repos to run the migrations against would be useful to provide publicly to consumers. @nwalters512 - what do you think? |
Can you share a little more of what you have in mind? This could be useful, but I'd want to hear more details first. |
|
@nwalters512 let me work on getting test infra setup that allows us to generate target repos in our CLI tests. Once I've taken a stab at that, we can see if we like it and if we want to extend it past this PR (in a separate PR, of course). Sound good? At a high level, I'd like to:
We'd need to skip the interactions with the VCS, which we could accomplish by providing test-specific adapters that simple capture the commands we'd run that can be asserted on in tests. |
fabcd8e to
f8e1c8f
Compare
|
So I'm going to continue the work on this PR (sorry for the delay!). I'm going to narrow the focus of adding some functionality to simply test dynamically creating a migration and a target repo, and running through those tests. Subsequent PRs can add public test helper support to exercise testing a migration for migration authors. |
This PR adds basic bootstrapping of infra that will allow for CLI tests that directly invoke the bin. This can provide a path to end to end tests that will perform a complete migration.
Added:
execadevDependency for invoking the CLI (I know this project uses child-process, but I've found execa to be really nice for this use case. Happy to discuss whether or not to add this)fixturify-projectdevDependency for building out ad-hoc migration project directoriesshepherdutil that maps to the bin script, and tests the usage information is correctly printedThe tests are in the standard
__tests__jest directory, mainly because I wasn't sure where to add tests that weren't specifically unit tests (I suppose they could live next to the file itself, as the other tests do).TODO
shepherd.ymlto the migration directory