diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index ff5c7e62..7bb9c795 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -13,7 +13,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: 3.11.2 - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1fe28729..9352bf39 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,9 +11,9 @@ test-onair: image: aetd-dockerlab.gsfc.nasa.gov/spar-lab/onair/onair-meta stage: test script: - - python3.9 -m pip install -r requirements_pip.txt + - python3.11 -m pip install -r requirements_pip.txt - pwd - - python3.9 driver.py -t + - python3.11 driver.py -t - coverage report - coverage xml coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/' diff --git a/test/onair/data_handling/test_redis_adapter.py b/test/onair/data_handling/test_redis_adapter.py index ace74af6..a183094d 100644 --- a/test/onair/data_handling/test_redis_adapter.py +++ b/test/onair/data_handling/test_redis_adapter.py @@ -116,7 +116,7 @@ def test_redis_adapter_DataSource_fails_to_connect_to_server(mocker): # subscribe_message tests def test_redis_adapter_DataSource_subscribe_subscribes_to_each_given_subscription_and_starts_listening_when_server_available(mocker): # Arrange - arg_subscriptions = [MagicMock()] * pytest.gen.randint(0, 10) # 0 to 10 arbitrary + arg_subscriptions = [MagicMock()] * pytest.gen.randint(1, 10) # 1 to 10 arbitrary fake_server = MagicMock() fake_pubsub = MagicMock() @@ -362,7 +362,7 @@ def test_redis_adapter_DataSource_message_listener_loads_message_info_when_recei num_fake_data = pytest.gen.randint(1,10) for i in range(num_fake_data): - fake_data_header = str(MagicMock()) + fake_data_header = str(i) fake_data_value = MagicMock() fake_data[fake_data_header] = fake_data_value expected_data_headers.append(fake_data_header) diff --git a/test/onair/src/data_driven_components/test_data_driven_learning.py b/test/onair/src/data_driven_components/test_data_driven_learning.py index e39d89e1..d0054cc3 100644 --- a/test/onair/src/data_driven_components/test_data_driven_learning.py +++ b/test/onair/src/data_driven_components/test_data_driven_learning.py @@ -60,7 +60,7 @@ def test_DataDrivenLearning__init__sets_instance_ai_constructs_to_a_list_of_the_ arg_headers.append(MagicMock()) num_fake_ai_plugins = pytest.gen.randint(1, 10) # arbitrary, from 1 to 10 (0 has own test) for i in range(num_fake_ai_plugins): - arg__ai_plugins[str(MagicMock())] = str(MagicMock()) + arg__ai_plugins[str(i)] = str(MagicMock()) fake_spec_list.append(MagicMock()) fake_module_list.append(MagicMock()) diff --git a/test/onair/utils/test_tlm_json_converter.py b/test/onair/utils/test_tlm_json_converter.py index e0b706fc..b86a4614 100644 --- a/test/onair/utils/test_tlm_json_converter.py +++ b/test/onair/utils/test_tlm_json_converter.py @@ -552,7 +552,7 @@ def test_tlm_json_converter_mergeDicts_when_args_contain_shared_keys(mocker): for i in range(len(base_dicts)): dict_len = pytest.gen.randint(0, 10) # arbitrary, from 0 to 10 for j in range(dict_len): - key, value = str(MagicMock()), str(MagicMock()) + key, value = (str(i) + str(j)), pytest.gen.randint(0,1000) # arbitrary, 0 to 1000 base_dicts[i][key] = value merged_dict[key] = value