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

Refactor shell scripts and add Docker-based integration tests #395

Merged
merged 5 commits into from
Oct 18, 2023
Merged

Refactor shell scripts and add Docker-based integration tests #395

merged 5 commits into from
Oct 18, 2023

Conversation

zachallaun
Copy link
Collaborator

  • Add bin/activate_version_manager.sh

This script encapsulates detecting, finding, and activating a version manager. Currently asdf and rtx are supported, though more work likely needs to be done to make sure that they can be found/activated in more cases.

  • Refactor bin/start_lexical.sh

This script now uses activate_version_manager.sh to activate the version manager. It additionally ensures that it exits with an error code if any commands run exit non-zero.

  • bin/boot.exs halts after booting Lexical if LX_HALT_AFTER_BOOT is set

  • Begin using shellcheck and shfmt for script linting and formatting

Both of these tools can be installed using asdf/rtx and have editor support through plugins. CI is not currently enforcing that these be used; we can decide on that later.

  • Add integration/ dir and integration tests for booting Lexical

Currently, these test system installations of elixir, asdf, and rtx, all using bash and running in a Docker container. I'd like to add tests using different shells (zsh/fish/etc.) at some point as well.

These tests are not currently running in CI. That will be added in a later commit.

Copy link
Collaborator

@Blond11516 Blond11516 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, works great!

This is really good stuff, it will make working on the boot process much easier (and less scary).

integration/Dockerfile Outdated Show resolved Hide resolved
integration/Dockerfile Show resolved Hide resolved
integration/test.sh Show resolved Hide resolved
@zachallaun zachallaun marked this pull request as ready for review October 12, 2023 17:33
* Add `bin/activate_version_manager.sh`

This script encapsulates detecting, finding, and activating a version
manager. Currently asdf and rtx are supported, though more work likely
needs to be done to make sure that they can be found/activated in more
cases.

* Refactor `bin/start_lexical.sh`

This script now uses `activate_version_manager.sh` to activate the
version manager. It additionally ensures that it exits with an error
code if any commands run exit non-zero.

* `bin/boot.exs` halts after booting Lexical if `LX_HALT_AFTER_BOOT` is set

* Begin using `shellcheck` and `shfmt` for script linting and formatting

Both of these tools can be installed using asdf/rtx and have editor
support through plugins. CI is not currently enforcing that these be used;
we can decide on that later.

* Add `integration/` dir and integration tests for booting Lexical

Currently, these test system installations of elixir, asdf, and rtx,
all using bash and running in a Docker container. I'd like to add tests
using different shells (zsh/fish/etc.) at some point as well.

These tests are not currently running in CI. That will be added in a
later commit.
@zachallaun
Copy link
Collaborator Author

This branch fixes a bug that's currently on main that prevents certain environments using rtx from starting the remote node.

@zachallaun zachallaun changed the title Refactor start_lexical.sh and add Docker-based integration tests Refactor shell scripts and add Docker-based integration tests Oct 17, 2023
Since `RemoteControl` already resolves the correct Elixir executable and
sets up the env, there's no need to do additional version manager setup
in port_wrapper.sh.
@zachallaun zachallaun merged commit 20511ab into lexical-lsp:main Oct 18, 2023
@zachallaun zachallaun deleted the za-shell-scripts branch October 18, 2023 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants