-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #438 from deNBI/feat/unittest
Feat/unittest
- Loading branch information
Showing
30 changed files
with
7,539 additions
and
612 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[run] | ||
omit = | ||
simple_vm_client/VirtualMachineService.py | ||
simple_vm_client/constants.py | ||
simple_vm_client/test_openstack_connector.py | ||
simple_vm_client/ttypes.py | ||
simple_vm_client/forc_connector/template/test_templates.py | ||
simple_vm_client/util/logger.py | ||
simple_vm_client/forc_connector/test_forc_connector.py | ||
simple_vm_client/VirtualMachineServer.py | ||
|
||
check_env.py | ||
|
||
[report] | ||
exclude_lines = | ||
pragma: no cover | ||
raise NotImplementedError | ||
if __name__ == .__main__.: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# This workflow will install dependencies, create coverage tests and run Pytest Coverage Comment | ||
# For more information see: https://github.com/MishaKav/pytest-coverage-comment/ | ||
name: pytest-coverage-comment | ||
on: | ||
pull_request: | ||
branches: | ||
- '*' | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 pytest pytest-cov | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Build coverage file | ||
run: | | ||
pytest --junitxml=pytest.xml | tee pytest-coverage.txt | ||
- name: Pytest coverage comment | ||
uses: MishaKav/pytest-coverage-comment@main | ||
with: | ||
pytest-coverage-path: ./pytest-coverage.txt | ||
junitxml-path: ./pytest.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,24 @@ | ||
FROM python:3.11.4-buster | ||
RUN apt-get update -y | ||
RUN apt-get install -y build-essential | ||
|
||
RUN apt-get update -y \ | ||
&& apt-get install -y build-essential \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /code | ||
ADD requirements.txt /code | ||
|
||
# Copy requirements and install them first to leverage Docker cache | ||
COPY requirements.txt /code | ||
RUN pip install -r requirements.txt | ||
ADD requirements.yml /code | ||
ADD ansible.cfg /etc/ansible/ | ||
|
||
COPY requirements.yml /code | ||
COPY ansible.cfg /etc/ansible/ | ||
RUN ansible-galaxy install -r requirements.yml | ||
ADD . /code | ||
|
||
# Copy the entire project | ||
COPY . /code | ||
|
||
# Set PYTHONPATH to include the project root | ||
ENV PYTHONPATH /code | ||
|
||
WORKDIR /code/simple_vm_client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# pytest.ini | ||
|
||
[pytest] | ||
addopts = --cov=. --cov-config=.coveragerc | ||
|
||
# Add other configuration options as needed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__all__ = ['ttypes', 'constants', 'VirtualMachineService'] | ||
__all__ = ["ttypes", "constants", "VirtualMachineService"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.