Skip to content

[runtime env] use pytest tmp_path, os.path.sep, and unskip most tests for windows - #22342

Merged
edoakes merged 2 commits into
ray-project:masterfrom
mattip:test_runtime_env_packaging
Feb 14, 2022
Merged

edoakes merged 2 commits into
ray-project:masterfrom
mattip:test_runtime_env_packaging

Conversation

@mattip

@mattip mattip commented Feb 13, 2022

Copy link
Copy Markdown
Contributor

Why are these changes needed?

Complements #22186 to enable runtime tests on windows. This refactors the tests to use the pytest tmp_path fixture, replaces '/' with os.path.sep and unskips almost all the tests on windows. One failing test is still skipped, I propose leaving this for a future PR.

Related issue number

Checks

@mattip
mattip force-pushed the test_runtime_env_packaging branch from 6099c19 to 8358d90 Compare February 13, 2022 14:23
@architkulkarni architkulkarni self-assigned this Feb 14, 2022
def construct(path, excluded=False, depth=0):
nonlocal item_num
path.mkdir(parents=True)
@pytest.mark.skipif(sys.platform == "win32", reason="Fails on windows")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, what's the failure here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test builds a zipfile and then checks that the zipfile matches a directory structure. It fails to compare correctly. I couldn't work out exactly why:

        _dir_travel(root, [exclude_spec], handler)
>       assert file_paths == visited_file_paths
E       AssertionError: assert {('C:\\Users\..., '189'), ...} == {('C:\\Users\..., '873'), ...}
E         Extra items in the right set:
E         ('C:\\Users\\Matti\\AppData\\Local\\Temp\\pytest-of-Matti\\pytest-30\\test_travel0\\test\\d2a82d2d\\d6f1019f\\ec0710f8\\58bc1d91\\269b1bb0\\25e4388a\\14429db7\\1a513f03\\11108c51', '567')
E         ('C:\\Users\\Matti\\AppData\\Local\\Temp\\pytest-of-Matti\\pytest-30\\test_travel0\\test\\d2a82d2d\\d6f1019f\\ec0710f8\\58bc1d91\\269b1bb0\\25e4388a\\471b4ca3\\faf55b19\\492be4f2', '186')
E         ('C:\\Users\\Matti\\AppData\\Local\\Temp\\pytest-of-Matti\\pytest-30\\test_travel0\\test\\d2a82d2d\\d6f1019f\\ec0710f8\\58bc1d91\\269b1bb0\\25e4388a\\14429db7\\1a513f03\\950...
E
E         ...Full output truncated (94 lines hidden), use '-vv' to show

python\ray\tests\test_runtime_env_packaging.py:332: AssertionError

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks for the details! How odd...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think leaving this for a future PR makes sense.

@architkulkarni

Copy link
Copy Markdown
Contributor

https://buildkite.com/ray-project/ray-builders-pr/builds/24407#7f55c47f-465a-4f40-9a91-f222715f0718/3219-3295
//python/ray/tests:test_runtime_env PASSED in 4.3s

Just to double check, does this running time look correct compared to running locally? I think it's plausible since it's not starting any Ray clusters.

@architkulkarni architkulkarni left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@architkulkarni

Copy link
Copy Markdown
Contributor

Mac wheel build flaky on master, and //python/ray/tests:test_basic_2_client_mode flaky on master.

@mattip

mattip commented Feb 14, 2022

Copy link
Copy Markdown
Contributor Author

Just to double check, does this running time look correct compared to running locally?

Yes. Most of the tests are quite fast since they don't actually run ray.init

@architkulkarni architkulkarni changed the title use pytest tmp_path, os.path.sep, and unskip most tests for windows [runtime env] use pytest tmp_path, os.path.sep, and unskip most tests for windows Feb 14, 2022
@edoakes
edoakes merged commit 845861f into ray-project:master Feb 14, 2022
simonsays1980 pushed a commit to simonsays1980/ray that referenced this pull request Feb 27, 2022
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.

3 participants