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

Unpin & upgrade cwl-utils version #40

Merged
merged 2 commits into from
May 26, 2023
Merged

Unpin & upgrade cwl-utils version #40

merged 2 commits into from
May 26, 2023

Conversation

mr-c
Copy link
Contributor

@mr-c mr-c commented May 25, 2023

Fixes #39

@mr-c mr-c force-pushed the cwl_utils_newer branch from e0676c4 to f3c55a9 Compare May 26, 2023 11:57
@mr-c mr-c changed the title Unpin cwl-utils version Unpin & upgrade cwl-utils version May 26, 2023
@mr-c mr-c force-pushed the cwl_utils_newer branch from f3c55a9 to 02d8a1c Compare May 26, 2023 12:01
@codecov
Copy link

codecov bot commented May 26, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (b1c02bb) 97.25% compared to head (e1a51b3) 97.26%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #40   +/-   ##
=======================================
  Coverage   97.25%   97.26%           
=======================================
  Files          11       11           
  Lines        1786     1790    +4     
=======================================
+ Hits         1737     1741    +4     
  Misses         49       49           
Impacted Files Coverage Δ
src/runcrate/convert.py 97.57% <100.00%> (+<0.01%) ⬆️
tests/test_cwlprov_crate_builder.py 99.87% <100.00%> (+<0.01%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mr-c mr-c requested a review from simleo May 26, 2023 12:05
@simleo
Copy link
Collaborator

simleo commented May 26, 2023

Thanks for this @mr-c! There's one weird thing that puzzles me: if I set up a local environment like this:

python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install wheel
pip install -e .
pip install pytest
pytest tests/

Then three tests fail:

============================================================================ test session starts ============================================================================
platform linux -- Python 3.8.10, pytest-7.3.1, pluggy-1.0.0
rootdir: /tmp/runcrate
collected 27 items                                                                                                                                                          

tests/test_cli.py .......FFF                                                                                                                                          [ 37%]
tests/test_cwlprov_crate_builder.py ...............                                                                                                                   [ 92%]
tests/test_step_mapping.py ..                                                                                                                                         [100%]

================================================================================= FAILURES ==================================================================================
_______________________________________________________________________________ test_cli_run ________________________________________________________________________________

data_dir = PosixPath('/tmp/runcrate/tests/data'), tmpdir = PosixPath('/tmp/pytest-of-simleo/pytest-14/test_cli_run0')
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7ff314d00d30>

    def test_cli_run(data_dir, tmpdir, monkeypatch):
        crate_dir = data_dir / "type-zoo-run-1-crate"
        runner = CliRunner()
        args = ["run", str(crate_dir)]
        monkeypatch.chdir(str(tmpdir))
        result = runner.invoke(cli, args)
>       assert result.exit_code == 0
E       AssertionError: assert 1 == 0
E        +  where 1 = <Result FileNotFoundError(2, 'No such file or directory')>.exit_code

/tmp/runcrate/tests/test_cli.py:120: AssertionError
__________________________________________________________________________ test_cli_run_dir_array ___________________________________________________________________________

data_dir = PosixPath('/tmp/runcrate/tests/data'), tmpdir = PosixPath('/tmp/pytest-of-simleo/pytest-14/test_cli_run_dir_array0')
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7ff314d00ca0>

    def test_cli_run_dir_array(data_dir, tmpdir, monkeypatch):
        crate_dir = data_dir / "dirarray-run-1-crate"
        runner = CliRunner()
        args = ["run", str(crate_dir)]
        monkeypatch.chdir(str(tmpdir))
        result = runner.invoke(cli, args)
>       assert result.exit_code == 0
E       AssertionError: assert 1 == 0
E        +  where 1 = <Result FileNotFoundError(2, 'No such file or directory')>.exit_code

/tmp/runcrate/tests/test_cli.py:133: AssertionError
__________________________________________________________________________ test_cli_run_file_array __________________________________________________________________________

data_dir = PosixPath('/tmp/runcrate/tests/data'), tmpdir = PosixPath('/tmp/pytest-of-simleo/pytest-14/test_cli_run_file_array0')
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7ff314d0b730>

    def test_cli_run_file_array(data_dir, tmpdir, monkeypatch):
        crate_dir = data_dir / "no-output-run-1-crate"
        runner = CliRunner()
        args = ["run", str(crate_dir)]
        monkeypatch.chdir(str(tmpdir))
        result = runner.invoke(cli, args)
>       assert result.exit_code == 0
E       AssertionError: assert 1 == 0
E        +  where 1 = <Result FileNotFoundError(2, 'No such file or directory')>.exit_code

/tmp/runcrate/tests/test_cli.py:142: AssertionError
========================================================================== short test summary info ==========================================================================
FAILED tests/test_cli.py::test_cli_run - AssertionError: assert 1 == 0
FAILED tests/test_cli.py::test_cli_run_dir_array - AssertionError: assert 1 == 0
FAILED tests/test_cli.py::test_cli_run_file_array - AssertionError: assert 1 == 0
======================================================================= 3 failed, 24 passed in 1.40s ========================================================================

However, if I run tox -e test, all tests pass! Can you reproduce this? Do you have any clue as to why it might be happening?

@simleo
Copy link
Collaborator

simleo commented May 26, 2023

@mr-c on a different note, please add your copyright statement to the top of convert.py and your info to the authors section of CITATION.cff

@simleo
Copy link
Collaborator

simleo commented May 26, 2023

However, if I run tox -e test, all tests pass! Can you reproduce this? Do you have any clue as to why it might be happening?

@mr-c Sorry about this, I forgot that cwlref-runner is an additional requirement for the tests.

@mr-c
Copy link
Contributor Author

mr-c commented May 26, 2023

Thanks for this @mr-c! There's one weird thing that puzzles me: if I set up a local environment like this:

python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install wheel
pip install -e .
pip install pytest
pytest tests/

Then three tests fail:

You'll need cwlref-runner as well, yeah?

  File "/home/michael/src/runcrate/src/runcrate/run.py", line 212, in run_crate
    subprocess.check_call(args)
  File "/usr/lib/python3.11/subprocess.py", line 408, in check_call
    retcode = call(*popenargs, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 389, in call
    with Popen(*popenargs, **kwargs) as p:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1024, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1901, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'cwl-runner'

@mr-c mr-c force-pushed the cwl_utils_newer branch from 02d8a1c to e8cf399 Compare May 26, 2023 13:19
@simleo
Copy link
Collaborator

simleo commented May 26, 2023

You'll need cwlref-runner as well, yeah?

Yes, thank you

@mr-c
Copy link
Contributor Author

mr-c commented May 26, 2023

@mr-c on a different note, please add your copyright statement to the top of convert.py and your info to the authors section of CITATION.cff

Done! Shall I merge?

@simleo simleo merged commit 5b93a2e into main May 26, 2023
@simleo simleo deleted the cwl_utils_newer branch May 26, 2023 14:01
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.

schema_salad.exceptions.ValidationException tried...
2 participants