-
Notifications
You must be signed in to change notification settings - Fork 872
chore: Export BASE_DIR
environment variable
#2045
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: master
Are you sure you want to change the base?
Conversation
I did search this project to find code, issues, etc concerning https://github.com/search?q=repo%3Aasdf-vm%2Fasdf%20BASE_DIR&type=code If I missed something obvious, apologies! |
Hi @lukebakken thanks for the PR. This behavior definitely needs to be fixed. With the recent rewrite in Go only the Go tests should be run directly. One of the Go test files should run the BATS tests, and it does set the BASE_DIR environment variable before running them - https://github.com/asdf-vm/asdf/blob/master/cmd/asdf/main_test.go#L127. I think we actually need to update (or remove) |
Yep, I sure missed that 😇 One advantage to being able to run the bats tests outside of go is that it allows running a subset of tests using |
6da34a8
to
2beda74
Compare
BASE_DIR
environment variableBASE_DIR
environment variable to ASDF_DEV_BASE_DIR
2beda74
to
630e5df
Compare
@Stratus3D thanks for your review. Let me know what you think about the latest set of changes. |
@lukebakken looks like you are now just renaming the environment variable. I don't think that's needed. |
I probably should have done two commits - rename, then this: That |
@lukebakken I would like the variable rename reverted as it feels like unnecessary code churn. The other change is good. |
630e5df
to
855b042
Compare
BASE_DIR
environment variable to ASDF_DEV_BASE_DIR
BASE_DIR
environment variable
855b042
to
36c9fda
Compare
@Stratus3D done, thanks for the reviews. |
Sorry for the delay here. Getting back to this. Is there any reason we'd not just delete this file? I typically use |
36c9fda
to
0a89bb7
Compare
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 modifies `scripts/test.bash` to correctly export `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 Add `PATH` to variables exported to `bats`, because the use of `Env` requires providing *all* necessary env vars. Otherwise, this is the result of running `make test`: $ make test go test -coverprofile=/tmp/coverage.out -bench= -race ./... --- FAIL: TestBatsTests (0.48s) --- FAIL: TestBatsTests/current_command (0.01s) main_test.go:23: stdout: main_test.go:23: stderr: error loading config: exec: "getent": executable file not found in $PATH
f44d47c
to
f4c6311
Compare
The file shows how to run the bats tests without using Go. This is helpful for someone like me who would like to contribute bats tests but may not immediately know the way to run them. I can look at the script, figure it out, and then add my tests, with the benefit of only running a single suite or single test within a suite. Running via I also just now fixed an issue with |
New users to
asdf
who wish to contribute will run into the followingerrors when running
./scripts/test.bash
: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 modifies
scripts/test.bash
to correctly exportBASE_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:
#2042