Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(agw): 'nose' is replaced by 'pytest' for S1AP integration tests #13060

Merged
merged 2 commits into from
Jul 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions lte/gateway/python/integ_tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ $(PYTHON_BUILD)/setupinteg_env:
# TODO T21489739 - Don't sleep and don't stop after a failure
RESULTS_DIR := /var/tmp/test_results
ifdef enable-flaky-retry
FLAKY_CMD_ARGS := --with-flaky --force-flaky --no-flaky-report --max-runs=3 --min-passes=1
FLAKY_CMD_ARGS := --force-flaky --no-flaky-report --max-runs=3 --min-passes=1
else
FLAKY_CMD_ARGS :=
endif
define execute_test
echo "Running test: $(1)"
timeout --foreground -k 930s 900s sudo -E PATH=$(PATH) PYTHONPATH=$(PYTHONPATH):$(S1AP_TESTER_PYTHON_PATH) $(PYTHON_BUILD)/bin/nosetests $(FLAKY_CMD_ARGS) --with-xunit --xunit-file=$(RESULTS_DIR)/$(basename $(notdir $(1))).xml -x -s $(1) || (echo "fail" > $(MAGMA_ROOT)/test_status.txt && exit 1)
timeout --foreground -k 930s 900s sudo -E PATH=$(PATH) PYTHONPATH=$(PYTHONPATH):$(S1AP_TESTER_PYTHON_PATH) $(BIN)/pytest $(FLAKY_CMD_ARGS) --capture=tee-sys --junit-xml=$(RESULTS_DIR)/$(basename $(notdir $(1))).xml -x $(1) || (echo "fail" > $(MAGMA_ROOT)/test_status.txt && exit 1)
sleep 1
endef

.PHONY: precommit
precommit: $(PYTHON_BUILD)/setupinteg_env $(BIN)/nosetests
precommit: $(PYTHON_BUILD)/setupinteg_env $(BIN)/pytest
. $(PYTHON_BUILD)/bin/activate
ifdef TESTS
$(call execute_test,$(TESTS))
Expand All @@ -45,7 +45,7 @@ else
endif

.PHONY: integ_test
integ_test: $(PYTHON_BUILD)/setupinteg_env $(BIN)/nosetests
integ_test: $(PYTHON_BUILD)/setupinteg_env $(BIN)/pytest
. $(PYTHON_BUILD)/bin/activate
ifdef TESTS
$(call execute_test,$(TESTS))
Expand All @@ -55,7 +55,7 @@ else
endif

.PHONY: nonsanity
nonsanity: $(PYTHON_BUILD)/setupinteg_env $(BIN)/nosetests
nonsanity: $(PYTHON_BUILD)/setupinteg_env $(BIN)/pytest
. $(PYTHON_BUILD)/bin/activate
ifdef TESTS
$(call execute_test,$(TESTS))
Expand All @@ -66,4 +66,4 @@ endif
local_integ_test:
# check if magma services are running
systemctl is-active --quiet magma@magmad || (echo "Local integ tests should be run on access gw with magma services running"; exit 1)
. $(PYTHON_BUILD)/bin/activate; sudo $(BIN)/nosetests -s $(LOCAL_INTEG_TESTS)
. $(PYTHON_BUILD)/bin/activate; sudo $(BIN)/pytest -s $(LOCAL_INTEG_TESTS)
22 changes: 22 additions & 0 deletions lte/gateway/python/integ_tests/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2022 The Magma Authors.

# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

[pytest]
python_files =
*_test.py
*_tests.py
test_*.py
python_classes =
*Test
*Tests
Test*
python_functions = test*
junit_logging = system-out
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import s1ap_types
import s1ap_wrapper
from python.integ_tests.common.service303_utils import (
from integ_tests.common.service303_utils import (
MetricValue,
verify_gateway_metrics,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import s1ap_types
import s1ap_wrapper
from python.integ_tests.common.service303_utils import (
from integ_tests.common.service303_utils import (
MetricValue,
verify_gateway_metrics,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import s1ap_types
import s1ap_wrapper
from python.integ_tests.common.service303_utils import (
from integ_tests.common.service303_utils import (
MetricValue,
verify_gateway_metrics,
)
Expand Down