Skip to content

Commit b14e43f

Browse files
authored
Merge pull request #29 from Gozzim/tests
feat: Add Tests
2 parents 06016a9 + c8ea732 commit b14e43f

File tree

18 files changed

+1122
-1
lines changed

18 files changed

+1122
-1
lines changed

.github/workflows/ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
services:
14+
clickhouse:
15+
image: clickhouse/clickhouse-server:23.8
16+
ports:
17+
- 9000:9000
18+
options: >-
19+
--health-cmd "clickhouse-client --query 'SELECT 1'" --health-interval 10s --health-timeout 5s --health-retries 5
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
24+
- name: Set up Python 3.12
25+
uses: actions/setup-python@v3
26+
with:
27+
python-version: "3.12"
28+
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
# Install versions of these packages compatible with Python 3.12
33+
pip install "numpy>=1.26.0" "pandas>=2.1.0" "scipy>=1.11.0"
34+
# Create a temporary requirements file without the upgraded packages
35+
grep -vE "numpy|pandas|scipy" requirements.txt > temp_requirements.txt
36+
# Install the remaining requirements
37+
pip install -r temp_requirements.txt
38+
pip install -r requirements-dev.txt
39+
40+
- name: Run tests and generate coverage report
41+
env:
42+
CLICKHOUSE_HOST: 127.0.0.1
43+
run: |
44+
pytest --cov=analyzer_lib --cov-report=xml
45+
46+
- name: Generate coverage badge
47+
run: |
48+
genbadge coverage -i coverage.xml -o coverage.svg
49+
50+
- name: Commit coverage badge
51+
if: github.ref == 'refs/heads/master'
52+
uses: EndBug/add-and-commit@v9
53+
with:
54+
author_name: 'github-actions[bot]'
55+
author_email: 'github-actions[bot]@users.noreply.github.com'
56+
message: 'chore: Update coverage badge'
57+
add: 'coverage.svg'

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Traceroute Data Analyzer and Anomaly Detector
22

33
[![CodeFactor](https://www.codefactor.io/repository/github/gozzim/ripe-atlas-traceroute-analysis/badge?s=23796f0031a238400a38e22d0679ee1bc5682d46)](https://www.codefactor.io/repository/github/gozzim/ripe-atlas-traceroute-analysis)
4+
[![CI](https://github.com/Gozzim/RIPE-Atlas-Traceroute-Analysis/actions/workflows/ci.yml/badge.svg)](https://github.com/Gozzim/RIPE-Atlas-Traceroute-Analysis/actions/workflows/ci.yml)
5+
[![Coverage Status](coverage.svg)](https://github.com/Gozzim/RIPE-Atlas-Traceroute-Analysis/actions/workflows/ci.yml)
46

57
This project provides a comprehensive framework for analyzing RIPE Atlas traceroute data to detect network performance and routing anomalies. It can process large datasets from local files or a ClickHouse database, establish performance baselines, and compare current data against those baselines to identify significant deviations.
68

coverage.svg

Lines changed: 1 addition & 0 deletions
Loading

data/example.bz2

41.4 KB
Binary file not shown.

data/example.json

Lines changed: 200 additions & 0 deletions
Large diffs are not rendered by default.

data/example2.bz2

164 KB
Binary file not shown.

out/.gitkeep

Whitespace-only changes.

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@ ignore = ["E501"]
1616
quote-style = "double"
1717
indent-style = "space"
1818
skip-magic-trailing-comma = false
19-
line-ending = "lf"
19+
line-ending = "lf"
20+
21+
[tool.pytest.ini_options]
22+
markers = [
23+
"integration: marks tests as integration tests",
24+
]

requirements-dev.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
ruff~=0.5.5
2+
pytest~=8.3.2
3+
pytest-cov~=5.0.0
4+
genbadge[all]~=1.1.0

tests/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)