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

appveyor.yml: Add support for Windows #451

Merged
merged 1 commit into from
Nov 2, 2019

Conversation

abhishalya
Copy link
Contributor

Summary

This adds support for windows through Appveyor CI.

Closes #450

@abhishalya
Copy link
Contributor Author

abhishalya commented Jan 31, 2019

I ran it, you can have a look at https://ci.appveyor.com/project/abhishalya/asdf

I guess the failure is because of something mentioned here and here. Any workarounds?

@jayvdb
Copy link

jayvdb commented Jan 31, 2019

Everyone there is saying migrate to https://github.com/bats-core/bats-core . It should be compatible, so you could try just using that instead here.

If you find it isnt ompatible, create a new PR to upgrade the test suite to bats-core, then return to this after it is merged.

@abhishalya abhishalya force-pushed the appveyorCI branch 2 times, most recently from 18a3703 to 36e5cf5 Compare February 1, 2019 06:29
@abhishalya
Copy link
Contributor Author

abhishalya commented Feb 1, 2019

@jayvdb The bats seems to be working now, but the tests fail unfortunately.

Lots of tests are lost in making the CI green.

@abhishalya abhishalya force-pushed the appveyorCI branch 2 times, most recently from 66a6d42 to 64ab0ff Compare February 1, 2019 13:02
@jayvdb
Copy link

jayvdb commented Feb 2, 2019

I've done a build without the rm's at https://ci.appveyor.com/project/jayvdb/asdf/builds/22070158

  • install_command.bats : 5/11 errors, 2 being caused by ../.asdf/shims/dummy: No such file or directory
  • plugin_list_all_command.bats : 1/1 not ok
  • remove_command.bats: 1/6 not ok
  • reshim_command.bats: 4/4 not ok
  • uninstall_command.bats: 4/7 not ok
  • update_command.bats: 4/6 not ok
  • utils.bats: 3/34 not ok
  • version_commands.bats: 4/27 not ok
  • which_command.bats 5/5 not ok

Therefore the best cost:benefit for getting more tests operation is in debugging failures in utils.bats and version_commands.bats .

One of the biggest problems which is easy to fix is that in your test environment find is /c/Windows/system32/find, so these two lines are probably failing:

> git grep 'find ' lib
lib/commands/which.sh:        location=$(find -L "$full_executable_path" -maxdepth 4 -name "$command" -type f -perm -u+x | sed -e 's|//|/|g')
lib/utils.sh:  find_result=$(find "$update_file_dir" -name "$update_file_name" -type f -mtime +1 -print)

So set up your test environment so find is a GNU find. Probably similar problems exist with other executables.

appveyor.yml Outdated Show resolved Hide resolved
@abhishalya
Copy link
Contributor Author

@jayvdb I tried to debug all failing tests, I found that some asdf commands don't work properly on windows. For ex, the which command doesn't recognize the plugin installed and gives command not found error. Some other issues involve where ideally some file has to be created isin't created and gives file not found error.

The ideal way to make CI green would be to fix the commands such that they work on windows as well as on linux. Since there are lot of failing tests, we need to work step by step.

Let me know your thoughts.

@abhishalya
Copy link
Contributor Author

abhishalya commented Feb 13, 2019

I used cygwin bash, and a lot of tests pass which were not passing earlier. But still, there are failing tests which I verified on WSL. So, WSL is not completely supported yet, I'll try to find out the cause of the failures and will update this then.

You can have a look at log here.

@abhishalya
Copy link
Contributor Author

@jayvdb Just one test failing now.

@Stratus3D
Copy link
Member

@abhishalya thanks for all your work on this. I've fallen behind when it comes to reviewing PRs recently. I think it would be nice to be able to support Windows, at least to some degree.

I just updated our build to use the bats-core/bats-core fork of BATS, version 1.1.0. Feel free to rebase your branch onto master if you think that would be helpful.

@Stratus3D
Copy link
Member

Sorry, I guess rebasing wouldn't help since I only changed the Travis build for Linux and OSX. Disregard that part of my last comment.

@abhishalya
Copy link
Contributor Author

@Stratus3D Can you have a look at the build log, there was just one failing test. Maybe you can help me fill the environment difference between the Linux and Windows.

not ok 55 asdf exec should pass all arguments to executable even if shim is not in PATH
# (in test file test/shim_exec.bats, line 42)
#   `[ "$output" == "" ]' failed

@Stratus3D
Copy link
Member

I see the failure. I will look at that test tonight and see if I can figure out what it's doing differently. I remember coming across an invalid test when working on #520.

@abhishalya
Copy link
Contributor Author

@Stratus3D Can you have a look at this again :)

This runs the tests on Appveyor CI (basically windows)
so as to keep it from breaking.

Closes asdf-vm#450
@Stratus3D
Copy link
Member

@abhishalya sorry for the late reply. I'm going to go ahead and merge this PR so we can get this config on the master branch. We may still have some issues to work through, but I think it's good to have builds running on windows. Thanks for all your work on this!

@Stratus3D Stratus3D merged commit 0bc07dd into asdf-vm:master Nov 2, 2019
@jayvdb
Copy link

jayvdb commented Nov 3, 2019

Well done @abhishalya !

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.

Windows support? Docs & tests for WSL2
3 participants