Skip to content

Commit

Permalink
Closes Bears-R-Us#3646: Config changes for make test-proto (Bears-R…
Browse files Browse the repository at this point in the history
…-Us#3647)

This PR closes Bears-R-Us#3646. I was digging into the proto tests to see how we fared with a multi-locale server with runtime checks enabled. While investigating this, I found a few small errors and some quality of life changes

Co-authored-by: Tess Hayes <stress-tess@users.noreply.github.com>
  • Loading branch information
stress-tess and stress-tess authored Aug 14, 2024
1 parent 015b139 commit 483223b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ print-%:

size=100
test-python-proto:
python3 -m pytest -c pytest_PROTO.ini PROTO_tests/ --size=$(size) $(ARKOUDA_PYTEST_OPTIONS)
python3 -m pytest -c pytest.ini --size=$(size) $(ARKOUDA_PYTEST_OPTIONS)

CLEAN_TARGETS += test-clean
.PHONY: test-clean
Expand Down
3 changes: 2 additions & 1 deletion PROTO_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,12 @@ def pytest_configure(config):
pytest.nl = _get_test_locales(config)
pytest.seed = None if config.getoption("seed") == "" else eval(config.getoption("seed"))
pytest.prob_size = [eval(x) for x in config.getoption("size").split(",")]
pytest.test_running_mode = TestRunningMode(os.getenv("ARKOUDA_RUNNING_MODE", "CLASS_SERVER"))


@pytest.fixture(scope="session", autouse=True)
def startup_teardown():
test_running_mode = TestRunningMode(os.getenv("ARKOUDA_RUNNING_MODE", "CLASS_SERVER"))
test_running_mode = pytest.test_running_mode

if not importlib.util.find_spec("pytest") or not importlib.util.find_spec("pytest_env"):
raise EnvironmentError("pytest and pytest-env must be installed")
Expand Down
2 changes: 1 addition & 1 deletion PROTO_tests/tests/categorical_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from arkouda.categorical import Categorical
from arkouda.testing import assert_categorical_equal


@pytest.fixture
def df_test_base_tmp(request):
df_test_base_tmp = "{}/.categorical_test".format(os.getcwd())
Expand Down Expand Up @@ -127,7 +128,6 @@ def test_creation_from_categorical(self, size):
expected_cat = ak.Categorical(strings1)
assert_categorical_equal(ak_cat2, expected_cat)


def test_substring_search(self):
cat = self.create_basic_categorical()
# update to use regex flag once #2714 is resolved
Expand Down
6 changes: 5 additions & 1 deletion PROTO_tests/tests/client_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import arkouda as ak
from arkouda.client import generic_msg
from server_util.test.server_test_util import start_arkouda_server
from server_util.test.server_test_util import TestRunningMode, start_arkouda_server


class TestClient:
Expand Down Expand Up @@ -42,6 +42,10 @@ def test_disconnect_on_disconnected_client(self):
ak.disconnect()
ak.connect(server=pytest.server, port=pytest.port)

@pytest.mark.skipif(
pytest.test_running_mode == TestRunningMode.CLIENT,
reason="start_arkouda_server won't restart if running mode is client",
)
def test_shutdown(self):
"""
Tests the ak.shutdown() method
Expand Down
2 changes: 1 addition & 1 deletion pytest_PROTO.ini → pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ testpaths =
PROTO_tests/tests/bigint_agg_test.py
PROTO_tests/tests/bitops_test.py
PROTO_tests/tests/categorical_test.py
PROTO_tests/tests/check.py
PROTO_tests/tests/check.py
PROTO_tests/tests/client_dtypes_test.py
PROTO_tests/tests/client_test.py
PROTO_tests/tests/coargsort_test.py
Expand Down

0 comments on commit 483223b

Please sign in to comment.