Skip to content

Commit

Permalink
Fixes to test cases and ci.
Browse files Browse the repository at this point in the history
  • Loading branch information
DC3-DCCI authored and DC3-DCCI committed May 26, 2022
1 parent eba1c5d commit a5ac632
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5,066 deletions.
36 changes: 14 additions & 22 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,40 @@
# - Access to the internet for installation of dependencies during the build step.
# - If there's a proxy behind which the runner needs to be configured, set the PYPI_PROXY_URL environment variable.

default:
tags:
- rke

image: python:2.7

stages:
- Lint
- Test
- Build

image: python:2.7

before_script:
- >
if [[ ${PYPI_PROXY_URL} != "" ]]; then
echo "Setting PyPi proxy to be ${PYPI_PROXY_URL}"
export http_proxy=${PYPI_PROXY_URL}
export https_proxy=${PYPI_PROXY_URL}
fi
- pip config set global.index-url ${PIP_URL}
- pip config set global.trusted-host ${ARTIFACTORY_HOST_NAME}
- pip config set search.index ${PIP_URL}
- python -m pip -q install --upgrade pip

FlakeLint:
stage: Lint
allow_failure: false
script:
- python -m pip -q install --upgrade pip
- python setup.py -q install
- pip install .
- pip install -q flake8
# stop the build if there are Python syntax errors or undefined names
- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
tags:
- docker

PyTest:
stage: Test
allow_failure: false
script:
- python -m pip -q install --upgrade pip
- python setup.py -q install
- mkdir output
- pip install .
- pip -q install pytest pytest-cov
# Run the test with coverage
- pytest --cov-report term-missing --cov-report html --cov=sqlite_dissect --cov-config=.coveragerc --junitxml=report.xml
Expand All @@ -50,8 +49,6 @@ PyTest:
junit: report.xml
paths:
- htmlcov/*
tags:
- docker

BuildDocs:
stage: Build
Expand All @@ -63,15 +60,12 @@ BuildDocs:
artifacts:
paths:
- ./docs/build/*
tags:
- docker

BuildWheel:
stage: Build
allow_failure: false
script:
- python -m pip install --upgrade pip
- python setup.py install
- pip install .
- pip install build twine wheel
# Build the wheel
- python setup.py sdist bdist_wheel
Expand All @@ -82,5 +76,3 @@ BuildWheel:
artifacts:
paths:
- dist/*
tags:
- docker
5 changes: 3 additions & 2 deletions sqlite_dissect/tests/case_export_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TestCASEExport(unittest.TestCase):
def test_case_output(self):
# Get the full path to avoid any nested issues
base_path = join(dirname(abspath(__file__)), '..', '..')
input_path = join(DB_FILES, 'chinook.db')
input_path = join(DB_FILES, 'chinook.sqlite')
output_path = join(base_path, 'output')
case_path = join(output_path, 'case.json')

Expand All @@ -24,7 +24,8 @@ def test_case_output(self):
'log_level': 'debug',
'export': ['case', 'text'],
'directory': output_path,
'sqlite_file': input_path
'sqlite_file': input_path,
'no_journal': True
}

# Convert the dictionary to a dot-accessible object for the main parsing
Expand Down
Loading

0 comments on commit a5ac632

Please sign in to comment.