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

RF extensions github action to centralize configuration for extensions etc, use pytest for crawler #6914

Merged
merged 4 commits into from
Aug 5, 2022

Conversation

yarikoptic
Copy link
Member

Also adjusted condition, since anything which is != something, could be anything else
to match so no need for that hirni comparison afaik

Also adjusted condition, since anything which is != something, could be anything else
to match so no need for that hirni comparison afaik
@yarikoptic yarikoptic added the semver-internal Changes only affect the internal API label Aug 3, 2022
@yarikoptic
Copy link
Member Author

damn it --how did I miss that in crawler own CI... will need to figure out/account for

__________________ ERROR collecting nodes/tests/test_annex.py __________________
/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/datalad_crawler/nodes/tests/test_annex.py:17: in <module>
    from ..annex import initiate_dataset
/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/datalad_crawler/nodes/annex.py:28: in <module>
    from datalad.version import __version__
../datalad/version.py:[20](https://github.com/datalad/datalad/runs/7661038459?check_suite_focus=true#step:14:21): in <module>
    DeprecationWarning)
E   DeprecationWarning: datalad.version module will be removed in 0.16. Please use datalad.__version__ (no other __*_version__ variables are to be provided).

@codecov
Copy link

codecov bot commented Aug 4, 2022

Codecov Report

Merging #6914 (ec409f1) into maint (f4726d8) will increase coverage by 0.92%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##            maint    #6914      +/-   ##
==========================================
+ Coverage   90.15%   91.07%   +0.92%     
==========================================
  Files         354      354              
  Lines       46221    46232      +11     
  Branches        0     6595    +6595     
==========================================
+ Hits        41670    42107     +437     
+ Misses       4551     4109     -442     
- Partials        0       16      +16     
Impacted Files Coverage Δ
datalad/version.py 0.00% <0.00%> (-100.00%) ⬇️
datalad/tests/test_archives.py 91.91% <0.00%> (-2.75%) ⬇️
datalad/support/s3.py 42.26% <0.00%> (-1.14%) ⬇️
datalad/support/network.py 90.15% <0.00%> (-1.10%) ⬇️
datalad/downloaders/http.py 78.12% <0.00%> (-1.05%) ⬇️
datalad/downloaders/providers.py 95.33% <0.00%> (-0.85%) ⬇️
datalad/downloaders/s3.py 57.36% <0.00%> (-0.51%) ⬇️
datalad/_version.py 45.68% <0.00%> (-0.28%) ⬇️
datalad/support/gitrepo.py 92.66% <0.00%> (-0.16%) ⬇️
datalad/utils.py 88.07% <0.00%> (-0.09%) ⬇️
... and 13 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@yarikoptic
Copy link
Member Author

ok -- getting there

  • neuroimaging -- need to look why those fail here (and presumably not in prior setup) - look like 2 legit test fails
  • pytest testing of metalad works! which is odd since:
  • pytest testing of crawler errors out with Couldn't read 'tox.ini' as a config file suggesting that coverage looks for it in curdir and not using it from ../__extension__/tox.ini as I have provided. But how come it works for metalad. @jwodder -- any hidden knowledge or something obvious I am missing?
full output from the run for crawler
cd __testhome__
  python -m pytest -c ../__extension__/tox.ini -s -v --cov=datalad --pyargs ${DL_PACKAGE}
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/[3](https://github.com/datalad/datalad/runs/7674076733?check_suite_focus=true#step:13:3).7.13/x6[4](https://github.com/datalad/datalad/runs/7674076733?check_suite_focus=true#step:13:4)
    DL_PIP_INSTALLS: mock
    DL_REPO: datalad/datalad-crawler
    DL_TESTER: pytest
    DL_NEED_SINGULARITY: 
    DL_PACKAGE: datalad_crawler
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/runpy.py", line 8[5](https://github.com/datalad/datalad/runs/7674076733?check_suite_focus=true#step:13:5), in _run_code
    exec(code, run_globals)
  File "/opt/hostedtoolcache/Python/3.7.13/x[6](https://github.com/datalad/datalad/runs/7674076733?check_suite_focus=true#step:13:6)4/lib/python3.[7](https://github.com/datalad/datalad/runs/7674076733?check_suite_focus=true#step:13:7)/site-packages/pytest/__main__.py", line 5, in <module>
    raise SystemExit(pytest.console_main())
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/_pytest/config/__init__.py", line 1[8](https://github.com/datalad/datalad/runs/7674076733?check_suite_focus=true#step:13:8)7, in console_main
    code = main()
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/_pytest/config/__init__.py", line 145, in main
    config = _prepareconfig(args, plugins)
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/_pytest/config/__init__.py", line 325, in _prepareconfig
    pluginmanager=pluginmanager, args=args
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/pluggy/_callers.py", line 55, in _multicall
    gen.send(outcome)
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/_pytest/helpconfig.py", line 102, in pytest_cmdline_parse
    config: Config = outcome.get_result()
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/pluggy/_callers.py", line 3[9](https://github.com/datalad/datalad/runs/7674076733?check_suite_focus=true#step:13:9), in _multicall
    res = hook_impl.function(*args)
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/_pytest/config/__init__.py", line [10](https://github.com/datalad/datalad/runs/7674076733?check_suite_focus=true#step:13:10)16, in pytest_cmdline_parse
    self.parse(args)
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/_pytest/config/__init__.py", line 1304, in parse
    self._preparse(args, addopts=addopts)
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/_pytest/config/__init__.py", line [12](https://github.com/datalad/datalad/runs/7674076733?check_suite_focus=true#step:13:13)07, in _preparse
    early_config=self, args=args, parser=self._parser
  File "/opt/hostedtoolcache/Python/3.7.[13](https://github.com/datalad/datalad/runs/7674076733?check_suite_focus=true#step:13:14)/x64/lib/python3.7/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/pluggy/_callers.py", line 60, in _multicall
    return outcome.get_result()
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/pytest_cov/plugin.py", line [14](https://github.com/datalad/datalad/runs/7674076733?check_suite_focus=true#step:13:15)9, in pytest_load_initial_conftests
    plugin = CovPlugin(options, early_config.pluginmanager)
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/pytest_cov/plugin.py", line [20](https://github.com/datalad/datalad/runs/7674076733?check_suite_focus=true#step:13:21)0, in __init__
    self.start(engine.Central)
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/pytest_cov/plugin.py", line 222, in start
    self.cov_controller.start()
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/pytest_cov/engine.py", line 44, in ensure_topdir_wrapper
    return meth(self, *args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/pytest_cov/engine.py", line [21](https://github.com/datalad/datalad/runs/7674076733?check_suite_focus=true#step:13:22)2, in start
    config_file=self.cov_config)
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/coverage/control.py", line [25](https://github.com/datalad/datalad/runs/7674076733?check_suite_focus=true#step:13:26)2, in __init__
    concurrency=concurrency, context=context,
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/coverage/config.py", line [56](https://github.com/datalad/datalad/runs/7674076733?check_suite_focus=true#step:13:57)5, in read_coverage_config
    raise ConfigError(f"Couldn't read {fname!r} as a config file")
coverage.exceptions.ConfigError: Couldn't read 'tox.ini' as a config file
Error: Process completed with exit code 1.

@jwodder
Copy link
Member

jwodder commented Aug 4, 2022

@yarikoptic Based on the traceback, it looks like coverage (not pytest) is unable to find any coverage-specific configuration in tox.ini for the failing extension.

@yarikoptic
Copy link
Member Author

@yarikoptic Based on the traceback, it looks like coverage (not pytest) is unable to find any coverage-specific configuration in tox.ini for the failing extension.

ok. But why it is even looking into absent tox.ini locally...? anyways -- it seems it gets worked around by symlinking extension's tox.ini into that directory and using that one. Now I just need to address neuroimaging failing tests I guess.

@yarikoptic
Copy link
Member Author

actually to resolve mystery -- the reason is due to use of that relative path within tox.ini of the -crawler extension for coverage!

(git)lena:~datalad/datalad-crawler[no-deprecated]git
$> grep -B4 tox.ini tox.ini
addopts =
    --cov=datalad_crawler
    # Explicitly setting the path to the coverage config file is necessary due
    # to some tests spawning subprocesses with changed working directories.
    --cov-config=tox.ini

wil test now using ={toxinidir}/tox.ini!

@yarikoptic yarikoptic changed the title Adjust github actions for the fact that crawler is now using pytest RF extensions github action to centralize configuration for extensions etc, use pytest for crawler Aug 4, 2022
@yarikoptic yarikoptic force-pushed the rf-test-crawler branch 2 times, most recently from aed5034 to 868bb48 Compare August 4, 2022 18:55
…on"s own tox.ini

Original form started to accumulate heavy "if" statements and hard to
follow logic because of them.  Also now we need to refactor to install
not from master.zip but to have a clone of the repository so we can
get access to extension"s tox.ini.

In proposed form I use bash case/esac since it provides best flexibility
IMHO to define extension specific settings to be reused in the next
steps.
Now that we install .[devel] requirements for extensions, we managed
to install heudiconv for neuroimaging, and then testing which was previously
skipped started to error out due to absent dcm2niix
@yarikoptic
Copy link
Member Author

ok, tox magic didn't help but we reached green state, so i rewrote for shorter history and now without TEMP commits -- ready for review/merge!

@yarikoptic
Copy link
Member Author

I would like to bring CI into totally green/legit setup, so will proceed with this merge, and prepare merge of maint into master. Comments would still be welcome if someone comes from a vacation ;)

@yarikoptic yarikoptic merged commit 06f50e0 into datalad:maint Aug 5, 2022
@yarikoptic yarikoptic deleted the rf-test-crawler branch October 14, 2022 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-internal Changes only affect the internal API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants