Skip to content

Commit

Permalink
Add test coverage on the main page of albs-sign-node repository
Browse files Browse the repository at this point in the history
  • Loading branch information
maccelf committed Feb 6, 2024
1 parent 74221e6 commit e3908d2
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: pytest
on:
pull_request:
branches:
- "**"
push:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
name: Check out repository
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Add node config file
run: |
mkdir node-config
touch ./node-config/sign_node.yml
echo --- >> ./node-config/sign_node.yml
echo development_mode: yes >> ./node-config/sign_node.yml
- uses: isbang/[email protected]
name: Run docker-compose
with:
# Use this if you change something in Dockerfile
# up-flags: --build --no-deps
up-flags: "--pull always --no-build --no-deps"
down-flags: "--volumes"
- name: Run unit tests (pytest)
run: docker-compose run -v /tmp:/tmp --no-deps sign_node bash -o pipefail -c 'source
env/bin/activate && pip3 install -r requirements.txt &&
pytest -vv --cov-report term-missing:skip-covered
--cov-report xml:/tmp/coverage.xml --junitxml=/tmp/pytest.xml --cov=sign_node
tests/ | tee /tmp/pytest-coverage.txt'
- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
id: coverageComment
with:
pytest-coverage-path: /tmp/pytest-coverage.txt
pytest-xml-coverage-path: /tmp/coverage.xml
title: Coverage report for changed files
badge-title: Total coverage
hide-badge: false
hide-report: false
report-only-changed-files: true
hide-comment: false
remove-link-from-badge: false
junitxml-path: /tmp/pytest.xml
- name: Create the Badge
if: ${{ github.ref == 'refs/heads/master' && steps.coverageComment.outputs.coverage }}
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 7d2552a0fbf81edbaa7d3deb001e142b
filename: sign-node-badge__master.json
label: Test Coverage
message: ${{ steps.coverageComment.outputs.coverage }}
color: ${{ steps.coverageComment.outputs.color }}
namedLogo: pytest
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# System Overview

[![badges](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/maccelf/7d2552a0fbf81edbaa7d3deb001e142b/raw/sign-node-badge__master.json)](https://github.com/AlmaLinux/albs-sign-node/blob/master/README.md)

AlmaLinux Build System Sing Node is designed to sign build packages.

Sign Node sends a request to the [Web-Server](https://github.com/AlmaLinux/albs-web-server) and receives back a task to sign packages.
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ websocket-client==0.59.0
# https://jasonralph.org/?p=997
cryptography==37.0.4
pgpy==0.5.4
pytest-cov==4.1.0
git+https://github.com/AlmaLinux/[email protected]#egg=immudb_wrapper
Empty file added tests/__init__.py
Empty file.
Empty file added tests/sign_node/__init__.py
Empty file.
6 changes: 6 additions & 0 deletions tests/sign_node/test_signer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from sign_node.signer import Signer


class TestSigner:
def test_example(self):
pass

0 comments on commit e3908d2

Please sign in to comment.