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

Make BATS work with npm dev setup on Windows #4542

Open
Tracked by #3026
jandubois opened this issue Apr 24, 2023 · 3 comments
Open
Tracked by #3026

Make BATS work with npm dev setup on Windows #4542

jandubois opened this issue Apr 24, 2023 · 3 comments
Assignees
Labels
component/bats BATS tests kind/story Work item that is linked from a kind/epic platform/windows

Comments

@jandubois
Copy link
Member

jandubois commented Apr 24, 2023

To speed up dev cycles we want to make bats work with npm run dev.

  • Introduce RD_USE_NPM variable to control this.

  • Set the resources path to ../resources/... to locate rdctl and other bundled utilities.

  • Modify factory_reset to stop the app first before running rdctl factory-reset.

  • Use (cd ..; npm run dev) instead of rdctl start. Figure out how to pass parameters.

@jandubois jandubois added kind/story Work item that is linked from a kind/epic component/bats BATS tests labels Apr 24, 2023
@jandubois jandubois added this to the 1.9 milestone Apr 24, 2023
@mook-as
Copy link
Contributor

mook-as commented Apr 24, 2023

Generally speaking, there's three or four places we would look for the RD install:

  • System-wide installation (/opt, /Applications, C:\Program Files, depending on OS)
  • User-wide install (Windows only, ~/AppData/Local)
  • Locally built (dist/*-unpacked)
  • We're adding unbuilt (npm run dev).

It might be good to have the environment variable cover picking a particular one out of those cases.

P.S. npm run dev -- --set foo.bar=true should work fine.

@jandubois
Copy link
Member Author

Generally speaking, there's three or four places we would look for the RD install:

  • System-wide installation (/opt, /Applications, C:\Program Files, depending on OS)
  • User-wide install (Windows only, ~/AppData/Local)

Also on macOS at ~/Applications.

  • Locally built (dist/*-unpacked)
  • We're adding unbuilt (npm run dev).

It might be good to have the environment variable cover picking a particular one out of those cases.

I've implemented the basic mechanism in #4573, but further work is needed to make support for npm run dev more robust on macOS/Linux (shutdown/factory-reset), or implement it at all on Windows.

P.S. npm run dev -- --set foo.bar=true should work fine.

It does, but takes different form of parameters than rdctl start (see #4569). It is not possible to recreate the API name of the parameter from the rdctl version (because acronyms), so we should generate a translation function from the schema.

@jandubois jandubois changed the title Make BATS work with npm dev setup Make BATS work with npm dev setup on Windows May 15, 2023
@jandubois jandubois modified the milestones: 1.9, 1.10 May 15, 2023
@jandubois
Copy link
Member Author

This is working completely on macOS (and should work the same way on Linux), but the shutdown / factory-reset logic still needs to be implemented for Windows.

@gaktive gaktive removed this from the 1.10 milestone Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/bats BATS tests kind/story Work item that is linked from a kind/epic platform/windows
Projects
None yet
Development

No branches or pull requests

3 participants