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

Dev shell tests with pytest #4062

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

Dev shell tests with pytest #4062

wants to merge 8 commits into from

Conversation

dougch
Copy link
Contributor

@dougch dougch commented Jun 16, 2023

Resolved issues:

possible solution to #4056

Description of changes:

Wait for sslyze resolution in #4373

Move the bash checks for devShell utilities into pytest, and run it at the start of every nix develop run.

Call-outs:

For tests that are platform specific, this sets up a pytest marker to skip if we're running on an unsupported platform.
Note: the pytest marker only applies to this nix test, but could be added to integrationv2 in a future pr.

Testing:

How is this change tested (unit tests, fuzz tests, etc.)? locally. CI nix jobs will run this update as well.

on x86:

 nix develop .#awslc                                                                                                                                                         [00:01:34 2024-01-18]
Setting up awslc environment from flake.nix...
nix/shell.sh: Entering a devShell...checking environment.
======================================================================================= test session starts ========================================================================================
platform linux -- Python 3.10.9, pytest-7.1.3, pluggy-1.0.0 -- /nix/store/d34dvggnx2qsa2kc23hzxgwn2bmh8fgg-python3-3.10.9-env/bin/python3.10
cachedir: .pytest_cache
rootdir: /home/dougch/gitrepos/s2n-tls/nix, configfile: pytest.ini
plugins: forked-1.4.0, xdist-2.5.0, rerunfailures-10.2
collected 10 items                                                                                                                                                                                 

nix/test_devshell.py::test_s2n_libcrypto[awslc] PASSED                                                                                                                                       [ 10%]
nix/test_devshell.py::test_s2n_libcrypto_uniq[awslc] PASSED                                                                                                                                  [ 20%]
nix/test_devshell.py::test_utility_versions[gnutls-serv-gnutls-serv 3.7---version] PASSED                                                                                                    [ 30%]
nix/test_devshell.py::test_utility_versions[gnutls-cli-gnutls-cli 3.7---version] PASSED                                                                                                      [ 40%]
nix/test_devshell.py::test_utility_versions[openssl-OpenSSL 1.1.1-version] PASSED                                                                                                            [ 50%]
nix/test_devshell.py::test_utility_versions[java-Corretto-17---version] PASSED                                                                                                               [ 60%]
nix/test_devshell.py::test_python PASSED                                                                                                                                                     [ 70%]
nix/test_devshell.py::test_pytest PASSED                                                                                                                                                     [ 80%]
nix/test_devshell.py::test_sslyze PASSED                                                                                                                                                     [ 90%]
nix/test_devshell.py::test_nassl PASSED                                                                                                                                                      [100%]

======================================================================================== 10 passed in 0.06s ========================================================================================
[nix awslc] dougch@devdesktop22:~/gitrepos/s2n-tls$ 

on aarch64, only the last two lines differ:

nix/test_env.py::test_sslyze SKIPPED (platform specific test; not running on aarch64)                                                                                                                          [ 90%]
nix/test_env.py::test_nassl SKIPPED (platform specific test; not running on aarch64)                                                                                                                           

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions bot added the s2n-core team label Jun 16, 2023
nix/test_devshell.py Fixed Show fixed Hide fixed
nix/test_devshell.py Fixed Show fixed Hide fixed
nix/test_devshell.py Fixed Show fixed Hide fixed
@dougch dougch requested review from goatgoose and lrstewart June 20, 2023 21:57
@dougch dougch marked this pull request as ready for review June 20, 2023 21:57
nix/conftest.py Outdated Show resolved Hide resolved
nix/shell.sh Outdated Show resolved Hide resolved
nix/test_devshell.py Outdated Show resolved Hide resolved
nix/test_devshell.py Outdated Show resolved Hide resolved
@dougch dougch requested a review from goatgoose June 27, 2023 21:16
nix/shell.sh Outdated Show resolved Hide resolved
nix/test_devshell.py Outdated Show resolved Hide resolved
@github-actions
Copy link

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@dougch dougch requested a review from goatgoose February 6, 2024 00:46
@dougch dougch marked this pull request as draft May 1, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants