Skip to content

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

Merged
oleksandr-pavlyk merged 2 commits into
masterfrom
coverage-init
Sep 2, 2021
Merged

oleksandr-pavlyk merged 2 commits into
masterfrom
coverage-init

Conversation

@oleksandr-pavlyk

Copy link
Copy Markdown
Contributor

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

@coveralls

coveralls commented Sep 1, 2021 •

Copy link
Copy Markdown
Collaborator

Coverage Status

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

@oleksandr-pavlyk

Copy link
Copy Markdown
Contributor 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
Copy Markdown
Contributor 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
Copy Markdown
Contributor 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