diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 844319f..f887bbd 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,12 +10,7 @@ jobs: strategy: matrix: python-version: - - '3.5' - - '3.6' - - '3.7' - '3.8' - - '3.9' - - 'pypy3' steps: - name: Checkout code diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1d52cf2..123b773 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,12 +17,12 @@ jobs: os: - 'ubuntu-latest' python-version: - - '3.5' - '3.6' - '3.7' - '3.8' - '3.9' - - 'pypy3' + - 'pypy-3.6' + - 'pypy-3.8' java-version: - '8' plantuml-server-version: @@ -99,7 +99,7 @@ jobs: PRIMARY_JAR_VERSION: ${{ matrix.plantuml-version }} ASSISTANT_JAR_VERSION: ${{ matrix.assistant-plantuml-version }} TEST_PLANTUML_HOST: http://localhost:18080 - WORKERS: 4 + TIMEOUT: '30' run: | source env.sh make unittest WORKERS=${WORKERS} diff --git a/Makefile b/Makefile index a6d98dd..8498c35 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ .PHONY: docs pdocs test unittest benchmark -WORKERS ?= -RERUN ?= +RERUN ?= +RERUN_DELAY ?= +TIMEOUT ?= PROJ_DIR := $(shell readlink -f ${CURDIR}) @@ -13,12 +14,20 @@ RANGE_DIR ?= . RANGE_TEST_DIR := ${TEST_DIR}/${RANGE_DIR} RANGE_SRC_DIR := ${SRC_DIR}/${RANGE_DIR} -CI_DEFAULT_RERUNS := 5 -CI_DEFAULT_RERUNS_DELAY := 10 -DEFAULT_RERUNS := 3 -DEFAULT_RERUNS_DELAY := 5 -RERUNS ?= $(if ${CI},${CI_DEFAULT_RERUNS},${DEFAULT_RERUNS}) -RERUNS_DELAY ?= $(if ${CI},${CI_DEFAULT_RERUNS_DELAY},${DEFAULT_RERUNS_DELAY}) +CI_DEFAULT_RERUN := 5 +LOCAL_DEFAULT_RERUN := 3 +DEFAULT_RERUN ?= $(if ${CI},${CI_DEFAULT_RERUN},${LOCAL_DEFAULT_RERUN}) +ACTUAL_RERUN := $(if ${RERUN},${RERUN},${DEFAULT_RERUN}) + +CI_DEFAULT_RERUN_DELAY := 10 +LOCAL_DEFAULT_RERUN_DELAY := 5 +DEFAULT_RERUN_DELAY ?= $(if ${CI},${CI_DEFAULT_RERUN_DELAY},${LOCAL_DEFAULT_RERUN_DELAY}) +ACTUAL_RERUN_DELAY := $(if ${RERUN_DELAY},${RERUN_DELAY},${DEFAULT_RERUN_DELAY}) + +CI_DEFAULT_TIMEOUT := 30 +LOCAL_DEFAULT_TIMEOUT := 15 +DEFAULT_TIMEOUT ?= $(if ${CI},${CI_DEFAULT_TIMEOUT},${LOCAL_DEFAULT_TIMEOUT}) +ACTUAL_TIMEOUT := $(if ${TIMEOUT},${TIMEOUT},${DEFAULT_TIMEOUT}) COV_TYPES ?= xml term-missing @@ -30,14 +39,14 @@ unittest: $(shell for type in ${COV_TYPES}; do echo "--cov-report=$$type"; done) \ --cov="${RANGE_SRC_DIR}" \ $(if ${MIN_COVERAGE},--cov-fail-under=${MIN_COVERAGE},) \ - $(if ${WORKERS},-n ${WORKERS},) \ --durations=10 \ - $(if ${CI}${RERUN},--reruns ${RERUNS} --reruns-delay ${RERUNS_DELAY},) + $(if ${CI}${ACTUAL_RERUN},--reruns ${ACTUAL_RERUN} --reruns-delay ${ACTUAL_RERUN_DELAY},) \ + $(if ${ACTUAL_TIMEOUT},--timeout=${ACTUAL_TIMEOUT},) benchmark: - pytest ${RANGE_TEST_DIR} -sv -m benchmark -n 1 --durations=0 + pytest ${RANGE_TEST_DIR} -sv -m benchmark --durations=0 docs: $(MAKE) -C "${DOC_DIR}" build pdocs: - $(MAKE) -C "${DOC_DIR}" prod \ No newline at end of file + $(MAKE) -C "${DOC_DIR}" prod diff --git a/README.md b/README.md index d49ab9a..7db3880 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ git clone https://github.com/HansBug/plantumlcli cd plantumlcli && pip install . ``` -Python 3.5+ is required, pypy is also tested to be okay. +Python 3.6+ is required, pypy is also tested to be okay. ## Using with cli diff --git a/requirements-doc.txt b/requirements-doc.txt index b9e7caf..c129058 100644 --- a/requirements-doc.txt +++ b/requirements-doc.txt @@ -2,7 +2,7 @@ sphinx~=3.2.0 sphinx_rtd_theme~=0.4.3 enum_tools sphinx-toolbox -plantumlcli>=0.0.2 +plantumlcli>=0.0.4 packaging sphinx-multiversion~=0.2.4 where~=1.0.2 diff --git a/requirements-test.txt b/requirements-test.txt index 4df6697..580eeb1 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,8 +1,7 @@ flake8~=3.5 -pytest~=5.1 -pytest-cov~=2.10 -pytest-mock~=3.3 -pytest-forked~=1.3 -pytest-xdist~=1.31 -pytest-rerunfailures~=9.0 -more-itertools>=7,<8 \ No newline at end of file +pytest~=6.2.5 +pytest-cov~=3.0.0 +pytest-mock~=3.6.1 +pytest-rerunfailures~=10.2 +pytest-timeout~=2.0.2 +more-itertools>=7,<8 diff --git a/setup.py b/setup.py index 69895a1..7a8690f 100644 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ def _load_req(file: str): url='https://github.com/HansBug/plantumlcli', # environment - python_requires=">=3.5", + python_requires=">=3.6", install_requires=requirements, tests_require=group_requirements['test'], extras_require=group_requirements, @@ -56,7 +56,6 @@ def _load_req(file: str): 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', diff --git a/test/entrance/test_cli.py b/test/entrance/test_cli.py index 91343a5..7d0b8f3 100644 --- a/test/entrance/test_cli.py +++ b/test/entrance/test_cli.py @@ -253,7 +253,7 @@ def test_url_error(self): assert result.exit_code != 0 @mark_select(_helloworld_condition) - def test_concurrency_error(self): + def test_concurrency(self): runner = CliRunner() result = runner.invoke(cli, args=['-u', '-n', '4', DEMO_HELLOWORLD_PUML, DEMO_HELLOWORLD_PUML, DEMO_HELLOWORLD_PUML, DEMO_HELLOWORLD_PUML])