Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
6
Merge Requests
6
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
slapos.buildout
Commits
a82a8025
Commit
a82a8025
authored
May 15, 2020
by
Godefroid Chapelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: coverage not run on CI
Solution: run coverage in containers on GH and Travis
parent
49ea5ae6
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
46 additions
and
11 deletions
+46
-11
.github/workflows/Dockerfile
.github/workflows/Dockerfile
+2
-2
.github/workflows/Dockerfile-debian
.github/workflows/Dockerfile-debian
+2
-2
.github/workflows/centos.yml
.github/workflows/centos.yml
+1
-1
.github/workflows/debian.yml
.github/workflows/debian.yml
+1
-1
.travis.yml
.travis.yml
+1
-1
Makefile
Makefile
+20
-3
buildout.cfg
buildout.cfg
+2
-1
dev.py
dev.py
+17
-0
No files found.
.github/workflows/Dockerfile
View file @
a82a8025
FROM
centos as centos-python
RUN
yum
install
-y
make gcc openssl-devel libffi-devel
RUN
yum
install
-y
make gcc openssl-devel libffi-devel
sqlite-devel
ARG
PYTHON_VER
ENV
LC_CTYPE="en_US.UTF-8"
RUN
mkdir
buildout
...
...
@@ -12,5 +12,5 @@ ARG PYTHON_VER
COPY
doc /buildout/doc
COPY
src /buildout/src
COPY
zc.recipe.egg_ /buildout/zc.recipe.egg_
COPY
setup.* dev.py *.rst *.txt buildout.cfg /buildout/
COPY
setup.* dev.py *.rst *.txt buildout.cfg
.coveragerc
/buildout/
RUN
make
PYTHON_VER
=
${
PYTHON_VER
}
build
.github/workflows/Dockerfile-debian
View file @
a82a8025
FROM debian:stable-slim as debian-python
RUN apt-get update
RUN apt-get install -y make gcc openssl libffi-dev curl zlib1g-dev libssl-dev
RUN apt-get install -y make gcc openssl libffi-dev curl zlib1g-dev libssl-dev
libsqlite3-dev
ARG PYTHON_VER
ENV LANG C.UTF-8
RUN mkdir buildout
...
...
@@ -13,5 +13,5 @@ ARG PYTHON_VER
COPY doc /buildout/doc
COPY src /buildout/src
COPY zc.recipe.egg_ /buildout/zc.recipe.egg_
COPY setup.* dev.py *.rst *.txt buildout.cfg /buildout/
COPY setup.* dev.py *.rst *.txt buildout.cfg
.coveragerc
/buildout/
RUN make PYTHON_VER=${PYTHON_VER} build
.github/workflows/centos.yml
View file @
a82a8025
...
...
@@ -22,4 +22,4 @@ jobs:
env
:
PYTHON_VER
:
${{matrix.python-version}}
run
:
|
docker run centos_buildout:python${PYTHON_VER} /b
uildout/bin/test -c -vvv
docker run centos_buildout:python${PYTHON_VER} /b
in/bash -c 'RUN_COVERAGE= COVERAGE_REPORT= /buildout/bin/test -c -vvv'
.github/workflows/debian.yml
View file @
a82a8025
...
...
@@ -22,4 +22,4 @@ jobs:
env
:
PYTHON_VER
:
${{matrix.python-version}}
run
:
|
docker run debian_buildout:python${PYTHON_VER} /b
uildout/bin/test -c -vvv
docker run debian_buildout:python${PYTHON_VER} /b
in/bash -c 'RUN_COVERAGE= COVERAGE_REPORT= /buildout/bin/test -c -vvv'
.travis.yml
View file @
a82a8025
...
...
@@ -17,4 +17,4 @@ install:
-
docker build -f .github/workflows/Dockerfile --tag centos_buildout:python${PYTHON_VER} --build-arg PYTHON_VER=${PYTHON_VER} .
script
:
-
docker run centos_buildout:python${PYTHON_VER} /b
uildout/bin/test -c -vvv
-
docker run centos_buildout:python${PYTHON_VER} /b
in/bash -c 'RUN_COVERAGE= COVERAGE_REPORT= /buildout/bin/test -c -vvv'
Makefile
View file @
a82a8025
...
...
@@ -45,7 +45,7 @@ PYTHON_DOWNLOAD = $(PYTHON_BUILD_DIR)/$(PYTHON_ARCHIVE).tgz
BUILD_DIRS
=
$(PYTHON_PATH)
bin build develop-eggs eggs parts
all
:
all_test
.PHONY
:
all download_python python build test
docker clean all_pythons all_test
.PHONY
:
all download_python python build test
coverage docker docker_deb all_pythons all_test all_coverage
# setup python from source
$(PYTHON_DOWNLOAD)
:
...
...
@@ -75,7 +75,7 @@ build: python
$(PYTHON_PATH)
/bin/
$(PYTHON_EXE)
dev.py
# copy to virtualenvs
ROOT_FILES
:=
$(HERE)
/setup.py
$(HERE)
/setup.cfg
$(HERE)
/dev.py
$(HERE)
/README.rst
$(HERE)
/CHANGES.rst
$(HERE)
/buildout.cfg
ROOT_FILES
:=
$(HERE)
/setup.py
$(HERE)
/setup.cfg
$(HERE)
/dev.py
$(HERE)
/README.rst
$(HERE)
/CHANGES.rst
$(HERE)
/buildout.cfg
$(HERE)
/.coveragerc
SRC_FILES
:=
$(
shell
find
$(HERE)
/src
!
-path
'*egg-info*'
\(
-name
'*.py'
-o
-name
'*.txt'
-o
-name
'*.test'
\)
)
RCP_FILES
:=
$(
shell
find
$(HERE)
/zc.recipe.egg_
!
-path
'*egg-info*'
\(
-name
'*.py'
-o
-name
'*.txt'
-o
-name
'*.rst'
-o
-name
'*.cfg'
-o
-name
'*.in'
\)
)
DOC_FILES
:=
$(
shell
find
$(HERE)
/doc
-name
'*.rst'
-o
-name
'*.txt'
)
...
...
@@ -96,6 +96,12 @@ $(VENV)/bin/$(PYTHON_EXE): $(PYTHON_PATH)/bin/$(PYTHON_EXE)
$(VENV)/bin/test
:
$(VENV)/bin/$(PYTHON_EXE) $(ALL_COPY)
cd
$(VENV)
&&
bin/
$(PYTHON_EXE)
dev.py
--no-clean
$(VENV)/bin/coverage
:
$(VENV)/bin/$(PYTHON_EXE)
$(VENV)
/bin/pip
install
coverage
coverage
:
$(VENV)/bin/coverage $(VENV)/bin/test
COVERAGE_REPORT
=
RUN_COVERAGE
=
$(VENV)
/bin/test
$(testargs)
test
:
$(VENV)/bin/test
$(VENV)
/bin/test
-c
-vvv
$(testargs)
...
...
@@ -106,6 +112,13 @@ all_pythons:
$(MAKE)
PYTHON_VER
=
3.7 python
$(MAKE)
PYTHON_VER
=
3.8 python
all_coverage
:
$(MAKE)
PYTHON_VER
=
2.7 coverage
$(MAKE)
PYTHON_VER
=
3.5 coverage
$(MAKE)
PYTHON_VER
=
3.6 coverage
$(MAKE)
PYTHON_VER
=
3.7 coverage
$(MAKE)
PYTHON_VER
=
3.8 coverage
all_test
:
$(MAKE)
PYTHON_VER
=
2.7
test
$(MAKE)
PYTHON_VER
=
3.5
test
...
...
@@ -115,7 +128,11 @@ all_test:
docker
:
docker build
-f
.github/workflows/Dockerfile
--tag
centos_buildout:python
${PYTHON_VER}
--build-arg
PYTHON_VER
=
${PYTHON_VER}
.
docker run centos_buildout:python
${PYTHON_VER}
/buildout/bin/test
-c
-vvv
-t
abi
docker run centos_buildout:python
${PYTHON_VER}
/bin/bash
-c
'RUN_COVERAGE= COVERAGE_REPORT= /buildout/bin/test -c -vvv -t abi'
docker_deb
:
docker build
-f
.github/workflows/Dockerfile-debian
--tag
debian_buildout:python
${PYTHON_VER}
--build-arg
PYTHON_VER
=
${PYTHON_VER}
.
docker run debian_buildout:python
${PYTHON_VER}
/bin/bash
-c
'RUN_COVERAGE= COVERAGE_REPORT= /buildout/bin/test -c -vvv -t abi'
clean
:
rm
-rf
$(VENVS)
$(PYTHON_BUILD_DIR)
$(HERE)
/pythons
buildout.cfg
View file @
a82a8025
...
...
@@ -8,7 +8,7 @@ zope.interface = 4.1.3
zope.exceptions = 4.0.8
zc.recipe.testrunner = 2.0.0
zope.testing = 4.5.0
coverage =
4.4
.1
coverage =
5
.1
[py]
recipe = zc.recipe.egg
...
...
@@ -23,6 +23,7 @@ eggs =
zc.buildout[test]
zc.recipe.egg
coverage
defaults = ['-s', 'zc.buildout']
initialization =
import os.path
from zc.buildout.testing import setup_coverage
...
...
dev.py
View file @
a82a8025
...
...
@@ -120,6 +120,23 @@ import zc.buildout.easy_install
zc
.
buildout
.
easy_install
.
scripts
(
[
'zc.buildout'
],
pkg_resources
.
working_set
,
sys
.
executable
,
'bin'
)
######################################################################
def
install_coverage
():
print
(
''
)
print
(
'Install coverage'
)
print
(
''
)
bin_pip
=
os
.
path
.
join
(
'bin'
,
'pip'
)
if
subprocess
.
call
(
[
sys
.
executable
]
+
[
'-m'
,
'pip'
,
'install'
,
'coverage'
],
):
raise
RuntimeError
(
"coverage install failed."
)
try
:
import
coverage
except
ImportError
:
install_coverage
()
######################################################################
print
(
''
)
print
(
'Run buildout'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment