From d19d27cd18565e6d4ff76266426ef9ad529ce46e Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 1 Jun 2023 02:01:08 +0200 Subject: [PATCH 01/11] Create pylint.yml --- .github/workflows/pylint.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/pylint.yml diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml new file mode 100644 index 0000000..82a44f7 --- /dev/null +++ b/.github/workflows/pylint.yml @@ -0,0 +1,26 @@ +name: Pylint + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9"] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pylint + apt install sqlite3 + pip install -r requirements.txt + pip install -r test-requirements.txt + - name: Analysing the code with pylint + run: | + pytest --cov=proxmox_api --cov-report term-missing --cov-report xml:./coverage_out_report.xml --junitxml=report.xml From 9bf56711e20beeeef9b6c4bec2352aad1f0d26e3 Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 1 Jun 2023 02:02:58 +0200 Subject: [PATCH 02/11] Update pylint.yml --- .github/workflows/pylint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 82a44f7..1c49a78 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -18,7 +18,7 @@ jobs: run: | python -m pip install --upgrade pip pip install pylint - apt install sqlite3 + sudo apt install sqlite3 pip install -r requirements.txt pip install -r test-requirements.txt - name: Analysing the code with pylint From ec9018231f456cbd53627e70ce9f1f55e5c440be Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 1 Jun 2023 02:05:50 +0200 Subject: [PATCH 03/11] Change directory --- .github/workflows/pylint.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 1c49a78..f8d400f 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -18,9 +18,9 @@ jobs: run: | python -m pip install --upgrade pip pip install pylint - sudo apt install sqlite3 - pip install -r requirements.txt - pip install -r test-requirements.txt + pip install -r backend/requirements.txt + pip install -r backend/test-requirements.txt - name: Analysing the code with pylint run: | + cd backend/ pytest --cov=proxmox_api --cov-report term-missing --cov-report xml:./coverage_out_report.xml --junitxml=report.xml From a5824c02d4ddc69a463259550cc517eabe4099b3 Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 1 Jun 2023 02:07:33 +0200 Subject: [PATCH 04/11] Change pythonpath --- .github/workflows/pylint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index f8d400f..2af1f83 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -22,5 +22,6 @@ jobs: pip install -r backend/test-requirements.txt - name: Analysing the code with pylint run: | + export PYTHONPATH=$(pwd) cd backend/ pytest --cov=proxmox_api --cov-report term-missing --cov-report xml:./coverage_out_report.xml --junitxml=report.xml From 8ce8b69f013d570e94e719b015f830de580de51b Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 1 Jun 2023 02:07:53 +0200 Subject: [PATCH 05/11] Change python path --- .github/workflows/pylint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 2af1f83..656d646 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -22,6 +22,6 @@ jobs: pip install -r backend/test-requirements.txt - name: Analysing the code with pylint run: | - export PYTHONPATH=$(pwd) cd backend/ + export PYTHONPATH=$(pwd) pytest --cov=proxmox_api --cov-report term-missing --cov-report xml:./coverage_out_report.xml --junitxml=report.xml From 19cd3dd8f9c5c4ecffba698c87de4d78d9e66b26 Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 1 Jun 2023 02:15:15 +0200 Subject: [PATCH 06/11] Add env var --- .github/workflows/pylint.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 656d646..542d794 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -20,6 +20,12 @@ jobs: pip install pylint pip install -r backend/requirements.txt pip install -r backend/test-requirements.txt + export ENVIRONMENT='TEST' + export KEYRING_DNS_SECRET=$KEYRING_DNS_SECRET + export PROXMOX_API_KEY_NAME=$PROXMOX_API_KEY_NAME + export PROXMOX_API_KEY=$PROXMOX_API_KEY + export PROXMOX_BACK_DB_DEV=$PROXMOX_BACK_DB_DEV + export ADH6_API_KEY=$ADH6_API_KEY - name: Analysing the code with pylint run: | cd backend/ From 6f67575333b19fe170292c955f6d8fe0bf815b90 Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 1 Jun 2023 02:18:54 +0200 Subject: [PATCH 07/11] use github secret --- .github/workflows/pylint.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 542d794..b5667b0 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -20,13 +20,13 @@ jobs: pip install pylint pip install -r backend/requirements.txt pip install -r backend/test-requirements.txt - export ENVIRONMENT='TEST' - export KEYRING_DNS_SECRET=$KEYRING_DNS_SECRET - export PROXMOX_API_KEY_NAME=$PROXMOX_API_KEY_NAME - export PROXMOX_API_KEY=$PROXMOX_API_KEY - export PROXMOX_BACK_DB_DEV=$PROXMOX_BACK_DB_DEV - export ADH6_API_KEY=$ADH6_API_KEY - name: Analysing the code with pylint + env: + KEYRING_DNS_SECRET: ${{ secrets.KEYRING_DNS_SECRET }} + PROXMOX_API_KEY_NAME: ${{ secrets.PROXMOX_API_KEY_NAME }} + PROXMOX_API_KEY: ${{ secrets.PROXMOX_API_KEY }} + PROXMOX_BACK_DB_DEV: ${{ secrets.PROXMOX_BACK_DB_DEV }} + ADH6_API_KEY: ${{ secrets.ADH6_API_KEY }} run: | cd backend/ export PYTHONPATH=$(pwd) From d7611a0c0676305208ace94b3814e16e00f73e52 Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 1 Jun 2023 02:20:33 +0200 Subject: [PATCH 08/11] User TEST env --- .github/workflows/pylint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index b5667b0..7228852 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -30,4 +30,5 @@ jobs: run: | cd backend/ export PYTHONPATH=$(pwd) + export ENVIRONMENT='TEST' pytest --cov=proxmox_api --cov-report term-missing --cov-report xml:./coverage_out_report.xml --junitxml=report.xml From 544be0fcd2c401ee21787f01fdf41839b264972a Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 1 Jun 2023 02:29:14 +0200 Subject: [PATCH 09/11] ignore integrations test --- .github/workflows/pylint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 7228852..f1aa912 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -31,4 +31,4 @@ jobs: cd backend/ export PYTHONPATH=$(pwd) export ENVIRONMENT='TEST' - pytest --cov=proxmox_api --cov-report term-missing --cov-report xml:./coverage_out_report.xml --junitxml=report.xml + pytest --cov=proxmox_api --cov-report term-missing --cov-report xml:./coverage_out_report.xml --junitxml=report.xml --ignore=integration From cd7f9775714d958340e3be15ace72ec1eae9ce99 Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 1 Jun 2023 02:34:46 +0200 Subject: [PATCH 10/11] exclude integration test manually --- .github/workflows/pylint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index f1aa912..4ac3dfa 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -31,4 +31,4 @@ jobs: cd backend/ export PYTHONPATH=$(pwd) export ENVIRONMENT='TEST' - pytest --cov=proxmox_api --cov-report term-missing --cov-report xml:./coverage_out_report.xml --junitxml=report.xml --ignore=integration + pytest --cov=proxmox_api --cov-report term-missing --cov-report xml:./coverage_out_report.xml --junitxml=report.xml --ignore-patterns="test_vm_life_?0G.py" From 5ffb939e59943b62d7a3c694026bcef501f7c7e1 Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 1 Jun 2023 02:36:58 +0200 Subject: [PATCH 11/11] Update pylint.yml --- .github/workflows/pylint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 4ac3dfa..7e672ca 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -31,4 +31,4 @@ jobs: cd backend/ export PYTHONPATH=$(pwd) export ENVIRONMENT='TEST' - pytest --cov=proxmox_api --cov-report term-missing --cov-report xml:./coverage_out_report.xml --junitxml=report.xml --ignore-patterns="test_vm_life_?0G.py" + pytest --cov=proxmox_api --cov-report term-missing --cov-report xml:./coverage_out_report.xml --junitxml=report.xml --ignore=test/integration