Skip to content

Commit

Permalink
[test] Add common tests to github actions and fix them
Browse files Browse the repository at this point in the history
  • Loading branch information
csordasmarton committed Jan 13, 2021
1 parent eee3477 commit 3f26628
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,25 @@ jobs:
working-directory: analyzer
run: make test_unit test_functional

common:
name: Common libraries
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.6'

- name: Install requirements
working-directory: codechecker_common
run: |
pip install -r requirements_py/dev/requirements.txt
- name: Run unit tests
working-directory: codechecker_common/tests
run: make -C unit test_unit

web:
name: Web
runs-on: ubuntu-18.04
Expand Down
2 changes: 2 additions & 0 deletions codechecker_common/requirements_py/dev/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nose==1.3.7
portalocker==1.7.0
18 changes: 9 additions & 9 deletions codechecker_common/tests/unit/test_gerrit_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_report_to_gerrit_conversion(self):
"""Conversion without directory path just the source filename."""

main = {
"location": {"file": "main.cpp", "line": 10, "col": 10},
"location": {"file": 0, "line": 10, "col": 10},
"description": "some description",
"check_name": "my_checker",
"issue_hash_content_of_line_in_context": "dummy_hash",
Expand Down Expand Up @@ -67,7 +67,7 @@ def test_report_to_gerrit_conversion_abs_filepath(self):

main = {
"location": {
"file": "/home/src/lib/main.cpp",
"file": 0,
"line": 10,
"col": 10,
},
Expand All @@ -78,7 +78,7 @@ def test_report_to_gerrit_conversion_abs_filepath(self):
"macro_expansions": [],
}
bugpath = {}
files = {0: "main.cpp"}
files = {0: "/home/src/lib/main.cpp"}
metadata = {}

report_to_convert = Report(main, bugpath, files, metadata)
Expand Down Expand Up @@ -110,7 +110,7 @@ def test_report_to_gerrit_conversion_repo_dir(self):

main = {
"location": {
"file": "/home/src/lib/main.cpp",
"file": 0,
"line": 10,
"col": 10,
},
Expand Down Expand Up @@ -156,7 +156,7 @@ def test_report_to_gerrit_conversion_report_url(self):

main = {
"location": {
"file": "/home/src/lib/main.cpp",
"file": 0,
"line": 10,
"col": 10,
},
Expand All @@ -167,7 +167,7 @@ def test_report_to_gerrit_conversion_report_url(self):
"macro_expansions": [],
}
bugpath = {}
files = {0: "main.cpp"}
files = {0: "/home/src/lib/main.cpp"}
metadata = {}

report_to_convert = Report(main, bugpath, files, metadata)
Expand Down Expand Up @@ -213,7 +213,7 @@ def test_report_to_gerrit_conversion_filter_changed_files(self):

main = {
"location": {
"file": "/home/src/lib/main.cpp",
"file": 0,
"line": 10,
"col": 10,
},
Expand All @@ -231,7 +231,7 @@ def test_report_to_gerrit_conversion_filter_changed_files(self):

main = {
"location": {
"file": "/home/src/lib/lib.cpp",
"file": 0,
"line": 10,
"col": 10,
},
Expand All @@ -248,7 +248,7 @@ def test_report_to_gerrit_conversion_filter_changed_files(self):

main = {
"location": {
"file": "/home/src/lib/other.cpp",
"file": 0,
"line": 10,
"col": 10,
},
Expand Down

0 comments on commit 3f26628

Please sign in to comment.