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

Problem invoking the test suite on macOS #343

Open
amotl opened this issue Oct 19, 2020 · 7 comments
Open

Problem invoking the test suite on macOS #343

amotl opened this issue Oct 19, 2020 · 7 comments

Comments

@amotl
Copy link
Member

amotl commented Oct 19, 2020

Hi there,

within #342, I found that I haven't been able to invoke the test suite right away. In order to find out about more details, I tried again and would like to report the outcome here.

While I believe the process hasn't been able to download CrateDB 4.2.0 on the first try, now I am seeing:

$ python -m unittest -vvvvv

[...] some OKs

HTTP: http://127.0.0.1:44209
./var/folders/06/w9pzygdj7vx53n_0l9q_lhph0000gn/T/tmp2k7qhukz/crate-4.2.0/bin/crate: line 129: /var/folders/06/w9pzygdj7vx53n_0l9q_lhph0000gn/T/tmp2k7qhukz/crate-4.2.0/jdk/Contents/Home/bin/java: No such file or directory
/var/folders/06/w9pzygdj7vx53n_0l9q_lhph0000gn/T/tmp2k7qhukz/crate-4.2.0/bin/crate: line 129: exec: /var/folders/06/w9pzygdj7vx53n_0l9q_lhph0000gn/T/tmp2k7qhukz/crate-4.2.0/jdk/Contents/Home/bin/java: cannot execute: No such file or directory

[...] some more OKs

ERROR: setUpModule (tests.test_integration)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/amo/dev/crate/sources/crash/tests/test_integration.py", line 46, in setUpModule
    node.start()
  File "/Users/amo/dev/crate/sources/crash/.venv/lib/python3.8/site-packages/crate/testing/layer.py", line 316, in start
    self._wait_for_start()
  File "/Users/amo/dev/crate/sources/crash/.venv/lib/python3.8/site-packages/crate/testing/layer.py", line 373, in _wait_for_start
    self._wait_for(validator)
  File "/Users/amo/dev/crate/sources/crash/.venv/lib/python3.8/site-packages/crate/testing/layer.py", line 352, in _wait_for
    raise SystemError('Failed to start Crate instance in time.')
SystemError: Failed to start Crate instance in time.

It is probably just a minor issue. I am working on macOS and invoked that within a dedicated virtualenv after installing the package into it with

pip install -U -e ".[test]"

With kind regards,
Andreas.

@mfussenegger
Copy link
Member

This is because of the test layer https://github.com/crate/crash/blob/master/tests/test_integration.py#L39 loading the linux CrateDB tarball.

Either we have to adapt that to use a system specific URL (See https://crate.io/releases.json for the urls) or we could consider using cr8 in the test layer which contains logic to resolve the right URL.

@amotl amotl changed the title Problem invoking the test suite Problem invoking the test suite on macOS Oct 19, 2020
@amotl
Copy link
Member Author

amotl commented Oct 19, 2020

we could consider using cr8 in the test layer

Sounds good. So, shall this be implemented using an alternative factory method for creating a CrateLayer besides CrateLayer.from_uri(...) like CrateLayer.from_version(...)?

@mfussenegger
Copy link
Member

we could consider using cr8 in the test layer

Sounds good. So, shall this be implemented using an alternative factory method for creating a CrateLayer besides CrateLayer.from_uri(...) like CrateLayer.from_version(...)?

https://github.com/mfussenegger/cr8/blob/8ec6f3b144f33f2d325f3fe2b2bc364e6f9dc540/cr8/run_crate.py#L688-L695 is almost a drop-in replacement.

@amotl
Copy link
Member Author

amotl commented Oct 19, 2020

create_node() is almost a drop-in replacement.

Thanks. So let's just wrap that into / invoke from a new CrateLayer.from_version()?

@mfussenegger
Copy link
Member

create_node() is almost a drop-in replacement.

Thanks. So let's just wrap that into / invoke from a new CrateLayer.from_version()?

CrateLayer is from crate-python. I'd replace the whole CrateLayer.from_version with create_node from cr8.

@amotl
Copy link
Member Author

amotl commented Oct 19, 2020

So, the test suite of crate-python would also only work on Linux then? I thought about letting the tower of turtles stand like it is and just swapping out one for another.

In other words: Wouldn't it also be good for crate-python to have the possibility there in order to be able to invoke its test suite on other systems than Linux?

@amotl
Copy link
Member Author

amotl commented Oct 19, 2020

Coming back from a short out-of-band discussion with @mfussenegger we decided to bring the already solid integration layer from cr8 to both crash and crate-python within one of the next iterations. See also [1,2].

[1] https://github.com/mfussenegger/cr8/blob/0.20.1/cr8/run_crate.py
[2] https://github.com/mfussenegger/cr8/blob/0.20.1/tests/test_integration.py

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

No branches or pull requests

2 participants