AntelopeIO / DUNES

Docker Utilities for Node Execution
Other
26 stars 20 forks source link

Add windows-latest to CI and fix tests on Windows #186

Closed mikelik closed 1 year ago

mikelik commented 1 year ago

If I run pytest tests on Windows I get 5 failing test cases:

Removing TEST_APP_DIR:  C:\Users\mikel\repo\DUNE\tests/test_app
execut cat wallet
done -execut cat wallet
================================================================= short test summary info ==================================================================
FAILED tests/test_help.py::test_help - assert b'optional arguments:' in b'usage: dune [-h] [-s NODE] [-c CONFIG_DIR] [--stop NODE] [--remove NODE]\r\n            [--list] [--simple-list] [--....
FAILED tests/test_list_features.py::test_list_features - AssertionError: assert b'execut cat ...IGNATURES\r\n' == b'GET_CODE_HA..._SIGNATURES\n'
FAILED tests/test_nodes.py::test_nodes - subprocess.CalledProcessError: Command '['C:\\Users\\mikel\\repo\\DUNE\\dune.bat', '--remove', 'done -execut cat wallet\r']' returned non-zero exit stat...
FAILED tests/test_project.py::test_create_cmake_app - AssertionError: assert ['C:\\Users\\...app.hpp', ...] == ['C:\\Users\\...app.hpp', ...]
FAILED tests/test_project.py::test_create_bare_app - AssertionError: assert ['C:\\Users\\...test_app.hpp'] == ['C:\\Users\\...test_app.hpp']
=================================================== 5 failed, 14 passed, 1 skipped in 208.45s (0:03:28) ====================================================
  1. Fix those tests
  2. Add Windows to CI Add to https://github.com/AntelopeIO/DUNE/blob/main/.github/workflows/run-tests.yml that it should be also executed on Windows (I think this might work: runs-on: [ubuntu-latest, windows-latest]

Tested on main. At least this commit has to be merged to main: https://github.com/AntelopeIO/DUNE/pull/185/commits/dcf2dd1db71a0123208a2ae55904ae78974795a4 to start at least some tests to pass.

stephenpdeos commented 1 year ago

Related to https://github.com/AntelopeIO/DUNE/issues/202

ScottBailey commented 1 year ago

While working another PR, I noticed quite a few path issues in the tests. Enough that I felt it was out of scope to include the changes. So I added them in this branch. For the most part, it's changing "str1" + "/str2" to os.path.join("str1","str2").

mikelik commented 1 year ago

After extensive research I found it will be not possible to create dunes docker image on windows VM in github. Issue explained: https://github.com/orgs/community/discussions/25491?sort=new#discussioncomment-3248089

I am thinking that maybe Linux could create and push Docker image and later Windows VM could run tests against it - I will verify if this is possible.

mikelik commented 1 year ago

Unfortunately it is also not possible to run Linux containers on Windows VM in github because of the same reasons. Error is:

08f2f58: Pulling from antelopeio/dunes
image operating system "linux" cannot be used on this platform: operating system is not supported

Issue described in: https://github.com/actions/runner-images/issues/1143

In this issue I will update Windows tests so they are passing, but there will be no Windows CI 😢