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

Write automated tests for shell completions #2042

Open
Stratus3D opened this issue Mar 25, 2025 · 0 comments
Open

Write automated tests for shell completions #2042

Stratus3D opened this issue Mar 25, 2025 · 0 comments

Comments

@Stratus3D
Copy link
Member

Is your feature request related to a problem? Please describe

We often receive reports of broken shell completions, and I've accidentally shipped bad changes to shell completions a couple times.

Describe the proposed solution

I would like automated tests for our shell completions scripts as described here: #1933 (comment)

Describe similar asdf features and why they are not sufficient

Describe other workarounds you've considered

lukebakken added a commit to lukebakken/asdf that referenced this issue Mar 29, 2025
New users to `asdf` who wish to contribute will run into the following
errors when running `./scripts/test.bash`:

```
 ✗ help should show dummy plugin help specific to version when version is present [7]
   (from function `setup_asdf_dir' in file test/test_helpers.bash, line 16,
    from function `setup' in test file test/help_command.bats, line 6)
     `setup_asdf_dir' failed
   mkdir: cannot create directory ‘/w spacetest_help_should_show_dummy_plugin_help_specific_to_version_when_version_is_present’: Permission denied
```

This is due to paths within the various test suites relying on the
`BASE_DIR` environment variable, which is not set by default.

This pull request adds the following:
* Some documentation of the `BASE_DIR` env var.
* A `direnv` `.envrc` file that will set that variable.

Note: I am a long-time asdf user, who would like to contribute to the
project and noticed this while setting up my dev environment on an
up-to-date Arch Linux system. My intention is to work on this issue:

asdf-vm#2042
lukebakken added a commit to lukebakken/asdf that referenced this issue Apr 9, 2025
New users to `asdf` who wish to contribute will run into the following
errors when running `./scripts/test.bash`:

```
 ✗ help should show dummy plugin help specific to version when version is present [7]
   (from function `setup_asdf_dir' in file test/test_helpers.bash, line 16,
    from function `setup' in test file test/help_command.bats, line 6)
     `setup_asdf_dir' failed
   mkdir: cannot create directory ‘/w spacetest_help_should_show_dummy_plugin_help_specific_to_version_when_version_is_present’: Permission denied
```

This is due to paths within the various test suites relying on the
`BASE_DIR` environment variable, which is not set by default.

This pull request adds the following:
* Renames `BASE_DIR` to `ASDF_DEV_BASE_DIR` to clarify intent of the
  variable.
* Modifies `scripts/test.bash` to correctly export `ASDF_DEV_BASE_DIR`

Note: I am a long-time asdf user, who would like to contribute to the
project and noticed this while setting up my dev environment on an
up-to-date Arch Linux system. My intention is to work on this issue:

asdf-vm#2042

* Rename `BASE_DIR` to `ASDF_DEV_BASE_DIR` to clarify intent of variable.
* Modify `test.bash` to export `ASDF_DEV_BASE_DIR`
lukebakken added a commit to lukebakken/asdf that referenced this issue Apr 9, 2025
New users to `asdf` who wish to contribute will run into the following
errors when running `./scripts/test.bash`:

```
 ✗ help should show dummy plugin help specific to version when version is present [7]
   (from function `setup_asdf_dir' in file test/test_helpers.bash, line 16,
    from function `setup' in test file test/help_command.bats, line 6)
     `setup_asdf_dir' failed
   mkdir: cannot create directory ‘/w spacetest_help_should_show_dummy_plugin_help_specific_to_version_when_version_is_present’: Permission denied
```

This is due to paths within the various test suites relying on the
`BASE_DIR` environment variable, which is not set by default.

This pull request adds the following:
* Renames `BASE_DIR` to `ASDF_DEV_BASE_DIR` to clarify intent of the
  variable.
* Modifies `scripts/test.bash` to correctly export `ASDF_DEV_BASE_DIR`

Note: I am a long-time asdf user, who would like to contribute to the
project and noticed this while setting up my dev environment on an
up-to-date Arch Linux system. My intention is to work on this issue:

asdf-vm#2042

* Rename `BASE_DIR` to `ASDF_DEV_BASE_DIR` to clarify intent of variable.
* Modify `test.bash` to export `ASDF_DEV_BASE_DIR`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant