Skip to content

Fix output redirection and better handling of errors connecting to the db #1125

Fix output redirection and better handling of errors connecting to the db

Fix output redirection and better handling of errors connecting to the db #1125

Workflow file for this run

# This workflow will install Slips dependencies and run slips tests
name: CI-staging
on:
push:
branches:
# features will be added to this branch using PRs, no need to re-run the tests on push
- '!develop'
- '!master'
pull_request:
branches:
- 'develop'
- '!master'
jobs:
unit_tests:
# specify the host OS
runs-on: ubuntu-latest
# 2 hours timeout
timeout-minutes: 7200
# start a container using slips dependencies image
container:
image: stratosphereips/slips_dependencies:latest
strategy:
matrix:
test_name:
- flowalerts
- conn
- tunnel
- downloaded_file
- ssl
- ssh
- dns
- notice
- software
- smtp
- main
- whitelist
- arp
- blocking
- flowhandler
- horizontal_portscans
- http_analyzer
- vertical_portscans
- network_discovery
- evidence_structure
- virustotal
- updatemanager
- threat_intelligence
- slips_utils
- slips
- profiler
- leak_detector
- ip_info
- asn_info
- input
- output
- urlhaus
- set_evidence
- go_director
- progress_bar
- cesnet
- checker
- daemon
- base_model
- markov_chains
- notify
- trustdb
steps:
- uses: actions/checkout@v4
- name: Start redis server
run: redis-server --daemonize yes
- name: Run Unit Tests for ${{ matrix.test_name }}
run: |
coverage run --source=./ -m pytest tests/test_${{ matrix.test_name }}.py -p no:warnings -vv -s -n 5
coverage report --include="modules/${{ matrix.test_name }}/*"
coverage html --include="modules/${{ matrix.test_name }}/*" -d coverage_reports/${{ matrix.test_name }}
integration_tests:
# specify the host OS
runs-on: ubuntu-latest
# 1 hour timeout
timeout-minutes: 3600
# start a container using slips dependencies image
container:
image: stratosphereips/slips_dependencies:latest
strategy:
matrix:
test_name:
- dataset
- pcap_dataset
- zeek_dataset
- portscans
- config_files
steps:
- uses: actions/checkout@v4
- name: Start redis server
run: redis-server --daemonize yes
- name: Run Integration Tests for ${{ matrix.test_name }}
run: |
coverage run --source=./ -m pytest tests/integration_tests/test_${{ matrix.test_name }}.py -p no:warnings -vv -s -n 5
coverage report --include="modules/network_discovery/*"
coverage html --include="modules/network_discovery/*" -d coverage_reports/network_discovery
- name: Upload Artifacts
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.test_name }}_integration_tests_output
path: |
output/integration_tests