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

Fix DumpExporter if a user test didn't compile #1184

Merged
merged 1 commit into from
Jun 2, 2021

Conversation

fagu
Copy link
Contributor

@fagu fagu commented Jun 1, 2021

@magula noticed that cmsDumpExporter fails with the following error if there's a user test that didn't compile:

Traceback (most recent call last):
  File "[...]/virtualenv/bin/cmsDumpExporter", line 33, in <module>
    sys.exit(load_entry_point('cms==1.5.dev0', 'console_scripts', 'cmsDumpExporter')())
  File "[...]/virtualenv/lib/python3.9/site-packages/cms-1.5.dev0-py3.9.egg/cmscontrib/DumpExporter.py", line 416, in main
    success = exporter.do_export()
  File "[...]/virtualenv/lib/python3.9/site-packages/cms-1.5.dev0-py3.9.egg/cmscontrib/DumpExporter.py", line 215, in do_export
    os.path.join(files_dir,
  File "/usr/lib/python3.9/posixpath.py", line 90, in join
    genericpath._check_arg_types('join', a, *p)
  File "/usr/lib/python3.9/genericpath.py", line 152, in _check_arg_types
    raise TypeError(f'{funcname}() argument must be str, bytes, or '
TypeError: join() argument must be str, bytes, or os.PathLike object, not 'NoneType'

We should have enumerate_files return the output of a user test only if it's not None.

@fagu fagu changed the title Fix DumpExporter if a unit test didn't compile Fix DumpExporter if a user test didn't compile Jun 1, 2021
@codecov
Copy link

codecov bot commented Jun 1, 2021

Codecov Report

Merging #1184 (52492cb) into master (dbd6645) will decrease coverage by 0.05%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1184      +/-   ##
==========================================
- Coverage   63.48%   63.42%   -0.06%     
==========================================
  Files         232      232              
  Lines       17046    17046              
==========================================
- Hits        10821    10812       -9     
- Misses       6225     6234       +9     
Flag Coverage Δ
functionaltests 47.43% <ø> (-0.04%) ⬇️
unittests 44.05% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cms/db/util.py 53.33% <ø> (-2.23%) ⬇️
cms/service/ProxyService.py 67.17% <0.00%> (-2.03%) ⬇️
cmscontrib/AddSubmission.py 73.73% <0.00%> (-1.02%) ⬇️
cms/server/admin/handlers/base.py 68.97% <0.00%> (-1.00%) ⬇️
cms/grading/Job.py 89.28% <0.00%> (-0.90%) ⬇️
cms/service/EvaluationService.py 74.62% <0.00%> (-0.75%) ⬇️
cms/db/filecacher.py 77.09% <0.00%> (ø)
cms/service/workerpool.py 65.55% <0.00%> (ø)
cms/io/service.py 72.12% <0.00%> (+0.60%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dbd6645...52492cb. Read the comment docs.

@andreyv
Copy link
Member

andreyv commented Jun 2, 2021

Thanks, reproduced here and tested the fix.

@andreyv andreyv merged commit f617bf9 into cms-dev:master Jun 2, 2021
@fagu fagu deleted the export-outputless-user-test branch June 2, 2021 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants