mirror of
				https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
				synced 2025-11-04 02:24:24 +00:00 
			
		
		
		
	.gitlab-ci.yml: Run tests with coverage on gitlab
Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
		
							parent
							
								
									28953b2224
								
							
						
					
					
						commit
						3d076d9bb0
					
				@ -1,10 +1,21 @@
 | 
			
		||||
#tests-stretch:
 | 
			
		||||
#  image: debian:stretch
 | 
			
		||||
#  script: debian/run-ci
 | 
			
		||||
tests-stretch:
 | 
			
		||||
  stage: test
 | 
			
		||||
  image: debian:stretch
 | 
			
		||||
  script:
 | 
			
		||||
    - apt-get update
 | 
			
		||||
    - apt-get install -y python3 python3-apt python3-yaml python3-pytest git rsync libclass-accessor-perl libdpkg-perl
 | 
			
		||||
    - ci/gitlab-ci-runner
 | 
			
		||||
 | 
			
		||||
#tests-sid:
 | 
			
		||||
#  image: debian:sid
 | 
			
		||||
#  script: debian/run-ci
 | 
			
		||||
tests-sid:
 | 
			
		||||
  stage: test
 | 
			
		||||
  image: debian:sid
 | 
			
		||||
  script:
 | 
			
		||||
    - apt-get update
 | 
			
		||||
    - apt-get install -y python3 python3-apt python3-yaml python3-coverage python3-pytest python3-pytest-cov git rsync libclass-accessor-perl libdpkg-perl
 | 
			
		||||
    - ci/gitlab-ci-runner --with-coverage
 | 
			
		||||
  artifacts:
 | 
			
		||||
    paths:
 | 
			
		||||
     - coverage
 | 
			
		||||
 | 
			
		||||
docs:
 | 
			
		||||
  stage: test
 | 
			
		||||
@ -22,10 +33,12 @@ pages:
 | 
			
		||||
  stage: deploy
 | 
			
		||||
  dependencies:
 | 
			
		||||
    - docs
 | 
			
		||||
    - tests-sid
 | 
			
		||||
  script:
 | 
			
		||||
    - rm -fr public
 | 
			
		||||
    - mkdir public
 | 
			
		||||
    - mv docs public/docs
 | 
			
		||||
    - mv coverage public/coverage
 | 
			
		||||
  artifacts:
 | 
			
		||||
    paths:
 | 
			
		||||
      - public
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										26
									
								
								ci/gitlab-ci-runner
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										26
									
								
								ci/gitlab-ci-runner
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,26 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
 | 
			
		||||
set -e
 | 
			
		||||
 | 
			
		||||
err=0
 | 
			
		||||
 | 
			
		||||
PYTEST_COV_OPTIONS=
 | 
			
		||||
BRITNEY=./britney.py
 | 
			
		||||
 | 
			
		||||
git clone https://salsa.debian.org/debian/britney2-tests.git britney2-tests
 | 
			
		||||
 | 
			
		||||
if [ "x$1" = "x--with-coverage" ]; then
 | 
			
		||||
    PYTEST_COV_OPTIONS="--cov-branch --cov --cov-report="
 | 
			
		||||
    BRITNEY=./ci/britney-coverage.sh
 | 
			
		||||
fi
 | 
			
		||||
py.test-3 -v $PYTEST_COV_OPTIONS || err=$?
 | 
			
		||||
echo
 | 
			
		||||
britney2-tests/bin/runtests "$BRITNEY" britney2-tests/t test-out || err=$?
 | 
			
		||||
 | 
			
		||||
if [ $err = 0 ] && [ "x$1" = "x--with-coverage" ]; then
 | 
			
		||||
    python3-coverage report -m
 | 
			
		||||
    echo
 | 
			
		||||
    python3-coverage html -d coverage
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
exit $err
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user