File: run_tests.sh

package info (click to toggle)
prometheus-flask-exporter 0.23.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 896 kB
  • sloc: python: 2,889; sh: 709; makefile: 4
file content (20 lines) | stat: -rwxr-xr-x 412 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

cd "$(dirname "$0")"

_fail() {
    docker logs pytest-sample
    docker rm -f pytest-sample > /dev/null 2>&1
    exit 1
}

docker build -f Dockerfile -t pytest-sample ../../. > /dev/null || _fail
docker run --rm --name pytest-sample pytest-sample py.test test

if [ "$?" != "0" ]; then
    echo 'Failed to execute the tests'
    _fail
fi

docker rm -f pytest-sample > /dev/null
echo 'OK, all done'