Skip to content

Commit

Permalink
test: generate unit tests for cpu and cuda (#2938)
Browse files Browse the repository at this point in the history
* feat: generate unit tests for cuda

* feat: complete the function

* refactor: remove data variable

* style: pre-commit fixes

* fix: dtypes order

* refactor: add status to unit-tests

* tests: generate cpu unit tests and skip cuda tests for now

* style: pre-commit fixes

* tests: remove out of bound tests

* fix: output values

* ci: add tests-cpu-kernels-explicit

* refactor: change name of tests

* fix: CuPy dtype

* refactor: correct variable name

* don't track auto-generated tests in git

* refactor: remove kernel tests from awkward-cpp .gitignore

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jim Pivarski <[email protected]>
  • Loading branch information
3 people authored Jan 19, 2024
1 parent 2b80da6 commit f9a29ef
Show file tree
Hide file tree
Showing 8 changed files with 428 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ jobs:
- name: Test CPU kernels
run: python -m pytest -vv -rs awkward-cpp/tests-cpu-kernels

- name: Test CPU kernels with explicitly defined values
run: python -m pytest -vv -rs awkward-cpp/tests-cpu-kernels-explicit

- name: Test non-kernels
run: >-
python -m pytest -vv -rs tests --cov=awkward --cov-report=term
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ src/awkward/_connect/header-only
src/awkward/_version.py

# Kernel tests
awkward-cpp/tests-cpu-kernels
awkward-cpp/tests-cpu-kernels-explicit
awkward-cpp/tests-spec
awkward-cpp/tests-spec-explicit
tests-cuda-kernels
tests-cuda-kernels-explicit

# to use all-contributors-cli without adding it to the project
node_modules
Expand Down
5 changes: 0 additions & 5 deletions awkward-cpp/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,4 @@ header-only
include/awkward/kernels.h
src/awkward_cpp/_kernel_signatures.py

# Kernel tests
tests-spec
tests-spec-explicit
tests-cpu-kernels

dist
3 changes: 2 additions & 1 deletion awkward-cpp/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,6 @@ sdist.include = [
"src/awkward_cpp/_kernel_signatures.py",
"tests-spec",
"tests-spec-explicit",
"tests-cpu-kernels"
"tests-cpu-kernels",
"tests-cpu-kernels-explicit"
]
1 change: 1 addition & 0 deletions cibuildwheel.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ test-requires = ["pytest>=6", "."]
test-command = """
pytest {project}/tests \
{package}/tests-cpu-kernels \
{package}/tests-cpu-kernels-explicit \
{package}/tests-spec \
{package}/tests-spec-explicit
"""
Expand Down
Loading

0 comments on commit f9a29ef

Please sign in to comment.