Skip to content

refactor(server/config): Implement checked access to server configuration, decoupled from SessionManager #4170

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ on: [push, pull_request]
permissions: read-all

jobs:
# Note: UI related linter tests will run in the gui job.
lint:
name: Linters (pylint, pycodestyle)

# Note: UI-related linters will run in the UI job(s).
name: Linters and Static Analysis
runs-on: ubuntu-20.04

steps:
Expand All @@ -19,9 +18,18 @@ jobs:
python-version: '3.8'
- name: Install dependencies
run: |
pip install $(grep -iE "pylint|pycodestyle" analyzer/requirements_py/dev/requirements.txt)
- name: Run tests
run: make pylint pycodestyle
pip install $(grep -iE \
"mypy|pycodestyle|pylint|types" \
analyzer/requirements_py/dev/requirements.txt) \
$(grep -iE \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you searching both of the requirements.txts:?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch updated codechecker_common's dev-requirements with new dependencies, and those new dependencies are needed to be installed for the static analysis to be run in this linting job. The "common tests" now runs only the unit tests for the new code added to codechecker_common. Having static analysis (mypy) run together with the other linters is more appropriate than making the hard test case checking fail because mypy overapproximated something.

"mypy|pycodestyle|pylint|types" \
codechecker_common/requirements_py/dev/requirements.txt)
- name: Run pylint & pycodestyle
run: make -k pycodestyle pylint

- name: Run codechecker_common mypy tests
working-directory: codechecker_common
run: make mypy

tools:
name: Tools (report-converter, etc.)
Expand Down Expand Up @@ -120,9 +128,8 @@ jobs:
run: |
pip install -r requirements_py/dev/requirements.txt

- name: Run mypy tests
working-directory: codechecker_common/tests
run: make mypy
- name: Run unit tests
run: make test_common

web:
name: Web
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.DS_Store

*.py[cod]
### Python ###
# Byte-compiled / optimized / DLL files.
__pycache__/
*.py[cdo]

build
build_dist
Expand Down
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,15 @@ pycodestyle:
pycodestyle_in_env:
$(ACTIVATE_DEV_VENV) && $(PYCODE_CMD)

test: test_analyzer test_web
test: test_common test_analyzer test_web

test_in_env: test_analyzer_in_env test_web_in_env
test_in_env: test_common_in_env test_analyzer_in_env test_web_in_env

test_common:
BUILD_DIR=$(BUILD_DIR) $(MAKE) -C $(CC_COMMON) test

test_commin_in_env:
$(MAKE) -C $(CC_COMMON) test_in_env

test_analyzer:
BUILD_DIR=$(BUILD_DIR) $(MAKE) -C $(CC_ANALYZER) test
Expand Down
1 change: 1 addition & 0 deletions codechecker_common/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include tests/Makefile
7 changes: 3 additions & 4 deletions codechecker_common/compatibility/multiprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
# pylint: disable=no-name-in-module
# pylint: disable=unused-import
if sys.platform in ["darwin", "win32"]:
from multiprocess import Pool # type: ignore
from multiprocess import cpu_count
from multiprocess import Pool, Process, cpu_count
else:
from concurrent.futures import ProcessPoolExecutor as Pool # type: ignore
from multiprocessing import cpu_count
from concurrent.futures import ProcessPoolExecutor as Pool
from multiprocessing import Process, cpu_count
Loading
Loading