Skip to content

Commit

Permalink
Closes #3639: Add multi-dimensional testing to the CI (#3640)
Browse files Browse the repository at this point in the history
Co-authored-by: Amanda Potts <ajpotts@users.noreply.github.com>
  • Loading branch information
ajpotts and ajpotts committed Aug 13, 2024
1 parent 352d4cc commit bc34f65
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 6 deletions.
15 changes: 15 additions & 0 deletions .configs/registration-config-multi-dim.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"parameter_classes": {
"array": {
"nd": [1,2,3],
"dtype": [
"int",
"uint",
"uint(8)",
"real",
"bool",
"bigint"
]
}
}
}
18 changes: 18 additions & 0 deletions .configs/serverConfig-multi-dim.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"max_array_dims": 3,
"supported_scalar_types": {
"uint8": true,
"uint16": false,
"uint32": false,
"uint64": true,
"int8": false,
"int16": false,
"int32": false,
"int64": true,
"float32": false,
"float64": true,
"complex64": false,
"complex128": false,
"bool": true
}
}
35 changes: 35 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,41 @@ jobs:
run: |
make test-python-proto size=100
arkouda_proto_multi-dim:
runs-on: ubuntu-latest
strategy:
matrix:
chpl-version: ['2.0.0']
container:
image: chapel/chapel:${{matrix.chpl-version}}
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
apt-get update && apt-get install -y -V ca-certificates lsb-release wget
wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
apt-get install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
apt-get update && apt-get install -y libhdf5-dev hdf5-tools libzmq3-dev python3-pip libarrow-dev libparquet-dev libcurl4-openssl-dev libidn2-dev
make install-iconv
echo "\$(eval \$(call add-path,/usr/lib/x86_64-linux-gnu/hdf5/serial/))" >> Makefile.paths
- name: Check chpl version
run: |
chpl --version
- name: Install Chapel frontend bindings
run: |
(cd $CHPL_HOME/tools/chapel-py && python3 -m pip install .)
- name: Use MultiDim Configs
run: |
cp .configs/serverConfig-multi-dim.json serverConfig.json
cp .configs/registration-config-multi-dim.json registration-config.json
- name: Build/Install Arkouda
run: |
make
python3 -m pip install -e .[dev]
- name: Arkouda unit tests
run: |
make test-python-proto size=100
arkouda_proto_tests_linux:
runs-on: ubuntu-latest
strategy:
Expand Down
19 changes: 13 additions & 6 deletions PROTO_tests/tests/client_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,15 @@ def test_client_get_config(self):
assert "arkoudaVersion" in config
assert "INFO" == config["logLevel"]

try:
mar = ak.client.get_max_array_rank()
assert mar == 1
except Exception as e:
raise AssertionError(e)
import json

def get_server_max_array_dims():
try:
return json.load(open("serverConfig.json", "r"))["max_array_dims"]
except (ValueError, FileNotFoundError, TypeError, KeyError):
return 1

assert get_server_max_array_dims() == ak.client.get_max_array_rank()

def test_get_mem_used(self):
"""
Expand Down Expand Up @@ -155,7 +159,10 @@ def test_client_array_dim_cmd_error(self):
with pytest.raises(RuntimeError) as cm:
resp = generic_msg("reduce10D")

err_msg = "Error: Command 'reduce10D' is not supported with the current server configuration as the maximum array dimensionality is 1. Please recompile with support for at least 10D arrays"
err_msg = (
f"Error: Command 'reduce10D' is not supported with the current server configuration as the maximum array dimensionality is {ak.client.get_max_array_rank()}. "
f"Please recompile with support for at least 10D arrays"
)
cm.match(err_msg) # Asserts the error msg matches the expected value

def test_client_nd_unimplemented_error(self):
Expand Down

0 comments on commit bc34f65

Please sign in to comment.