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

Errors when running bats test locally #634

Closed
Stratus3D opened this issue Jan 6, 2020 · 14 comments · Fixed by #644 or #649
Closed

Errors when running bats test locally #634

Stratus3D opened this issue Jan 6, 2020 · 14 comments · Fixed by #644 or #649

Comments

@Stratus3D
Copy link
Member

Steps to reproduce

On OSX run:

bats test

Expected behavior

Tests should pass as they were before.

Actual behavior

Many failing tests are encountered. And some tests hang indefinitely. An example error I captured from a single test:

/Users/trevorbrown/.asdf/bin/asdf: line 82: /var/folders/7m/9bq62tmj60zf14d788w0lk8c0000gp/T/asdf.XXXX.ed4MwuLg/home/.asdf/lib/commands/command-help: No such file or directory

Environment

OS: 10.15.1
asdf version: v0.7.6-bde7ae5

@Stratus3D
Copy link
Member Author

@vic do you know what is going on? I've been running bats test for years and I'm not sure why I'm seeing so many failures now.

@Stratus3D
Copy link
Member Author

The asdf update is a noop for non-git repos test hangs indefinitely.

@klane
Copy link
Contributor

klane commented Jan 8, 2020

I am having the same issue, which makes debugging #633 challenging. Manually running asdf with my changes seems to work as expected.

@Stratus3D
Copy link
Member Author

On tag v0.7.5 I only get one failure:

 ✗ get_config returns default when config file does not exist
   (in test file test/get_asdf_config_value.bats, line 29)
     `[ "$result" = "no" ]' failed

On tag v0.7.6 I get 65 failures before it reaches the asdf update is a noop for non-git repos test and it hangs indefinitely.

@Stratus3D
Copy link
Member Author

I get the exact same failures and hanging test on my Ubuntu laptop as well.

@vic
Copy link
Contributor

vic commented Jan 9, 2020

Try using https://github.com/bats-core/bats-core (just like our CI is doing) and not https://github.com/sstephenson/bats, the later has not been updated in years.

@Stratus3D
Copy link
Member Author

@vic I am using bats-core version 1.1.0. I don't think the bats version is the issue.

@Stratus3D
Copy link
Member Author

Do test pass for you @vic ? What OS are you on?

@vic
Copy link
Contributor

vic commented Jan 11, 2020

Yep, all green here. 212 test, 0 failures.

Also green in CI macos catalina / ubuntu.
https://github.com/asdf-vm/asdf/runs/375715344#step:7:219

I'm using Mac OS Catalina.
bats-core 1.2.0-dev (commit 87b16eb8ec381beca7f05d028e4ad7cf3f647a0f)

git --version
git version 2.21.0 (Apple Git-122)

@Stratus3D
Copy link
Member Author

I ran git bisect with the failing tests (git bisect run bats test/current_command.bats) and got:

e968fe6142d121d1da11aeada21b0338b62b9b16 is the first bad commit
commit e968fe6142d121d1da11aeada21b0338b62b9b16
Author: Victor Hugo Borja <vborja@apache.org>
Date:   Wed Nov 27 02:24:29 2019 -0600

    Subcommand-aware command line interface.

This is a very large commit, and it's not immediately clear what the problem is, but I am continuing to dig.

@lahwran
Copy link

lahwran commented Jan 29, 2020

CI seems to be failing as well, and has been since November. Any idea what's going on there? Is that a separate issue or the same one?

@vic
Copy link
Contributor

vic commented Jan 29, 2020

@lahwran The only failing check is the Appveyor one, it's still a work in progress (we have never been successful in running tests under Windows). Maybe we should remove the appveyor check until it's stable.

Screen Shot 2020-01-28 at 21 05 02

@Stratus3D
Copy link
Member Author

I found the problem! Because I'm running asdf on my computer ASDF_DIR was already set and was interfering with the tests. By unsetting the variable all tests pass:

unset ASDF_DIR
bats test

The asdf update is a noop for non-git repos test is still hanging for me. I'm guessing it is caused by a similar issue. Will investigate later.

@Stratus3D
Copy link
Member Author

I created #644 to fix that hanging test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants