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

Improve coverage of dpctl.__init__ file and other service functions #563

Merged
merged 2 commits into from
Sep 2, 2021

Conversation

oleksandr-pavlyk
Copy link
Collaborator

Added tests to check DPCTLService_GetDPCPPVersion, dpctl.get_include, and dpctl.__version__.

@coveralls
Copy link
Collaborator

coveralls commented Sep 1, 2021

Coverage Status

Coverage increased (+0.7%) to 67.33% when pulling 0c499ec on coverage-init into 33031a2 on master.

@oleksandr-pavlyk
Copy link
Collaborator Author

@PokhodenkoSA Any idea why this test is failing

    def test___version__():
        dpctl_ver = getattr(dpctl, "__version__", None)
        assert type(dpctl_ver) is str
>       assert "unknown" not in dpctl_ver
E       AssertionError: assert 'unknown' not in '0+unknown'
E         'unknown' is contained here:
E           0+unknown

/usr/share/miniconda/lib/python3.8/site-packages/dpctl/tests/test_service.py:88: AssertionError
=========================== short test summary info ============================
FAILED tests/test_service.py::test___version__ - AssertionError: assert 'unkn...
================= 1 failed, 785 passed, 1051 skipped in 2.56s ==================
Error: Process completed with exit code 1.

I think the expectation for it to not contain "unknown" is reasonable, and addition of this test has caught an actual issue.

@oleksandr-pavlyk
Copy link
Collaborator Author

@PokhodenkoSA Any idea why this test is failing

I think the expectation for it to not contain "unknown" is reasonable, and addition of this test has caught an actual issue.

This is likely caused by using limited depth cloning, specifically use of - fetch_depth: 0 in workflows.

If we rely on git tags for deducing versions of the product, we should do a full checkout.

Custom build_py written to enable support for multi-versioned DPCLSyclInterface
on Linux need to inherit from versioneer's version of build_py, rather than
from setuptools' one to incorporate the step where dpctl/_version.py
is overwritten with rendered result based on source tree.
@oleksandr-pavlyk
Copy link
Collaborator Author

Turns out this has been a regression I introduced nearly at the beginning of 0.9 development cycle. Now fixed, tests should start passing.

@oleksandr-pavlyk oleksandr-pavlyk merged commit 4eac023 into master Sep 2, 2021
@oleksandr-pavlyk oleksandr-pavlyk deleted the coverage-init branch September 2, 2021 00:24
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.

2 participants