Compare commits

...

3 Commits

Author SHA1 Message Date
Alex Zorin
87d2da4c01 try call compose plugin cli directly 2022-10-19 16:36:44 +11:00
Brad Warren
a82dc945aa simplify testing & debugging 2022-10-17 17:41:58 -07:00
Brad Warren
b288518b9e remove docker-compose dependency 2022-10-17 17:16:44 -07:00
5 changed files with 11 additions and 31 deletions

View File

@@ -8,18 +8,6 @@ jobs:
- group: certbot-common
strategy:
matrix:
linux-py38:
PYTHON_VERSION: 3.8
TOXENV: py38
linux-py39:
PYTHON_VERSION: 3.9
TOXENV: py39
linux-py37-nopin:
PYTHON_VERSION: 3.7
TOXENV: py37
CERTBOT_NO_PIN: 1
linux-external-mock:
TOXENV: external-mock
linux-boulder-v2-integration-certbot-oldest:
PYTHON_VERSION: 3.7
TOXENV: integration-certbot-oldest
@@ -44,20 +32,10 @@ jobs:
PYTHON_VERSION: 3.10
TOXENV: integration
ACME_SERVER: boulder-v2
nginx-compat:
TOXENV: nginx_compat
linux-integration-rfc2136:
IMAGE_NAME: ubuntu-22.04
PYTHON_VERSION: 3.8
TOXENV: integration-dns-rfc2136
docker-dev:
TOXENV: docker_dev
le-modification:
IMAGE_NAME: ubuntu-22.04
TOXENV: modification
farmtest-apache2:
PYTHON_VERSION: 3.8
TOXENV: test-farm-apache2
pool:
vmImage: $(IMAGE_NAME)
steps:

View File

@@ -1,6 +1,4 @@
stages:
- stage: TestAndPackage
jobs:
- template: ../jobs/standard-tests-jobs.yml
- template: ../jobs/extended-tests-jobs.yml
- template: ../jobs/packaging-jobs.yml

View File

@@ -60,7 +60,8 @@ class ACMEServer:
self._proxy = http_proxy
self._workspace = tempfile.mkdtemp()
self._processes: List[subprocess.Popen] = []
self._stdout = sys.stdout if stdout else open(os.devnull, 'w') # pylint: disable=consider-using-with
# Always use sys.stdout for now for debugging purposes
self._stdout = sys.stdout # if stdout else open(os.devnull, 'w') # pylint: disable=consider-using-with
self._dns_server = dns_server
self._http_01_port = http_01_port
if http_01_port != DEFAULT_HTTP_01_PORT:
@@ -94,7 +95,7 @@ class ACMEServer:
if e.errno != errno.ESRCH:
raise
for process in self._processes:
process.wait()
process.wait(300)
if os.path.exists(os.path.join(self._workspace, 'boulder')):
# Boulder docker generates build artifacts owned by root with 0o744 permissions.
@@ -104,7 +105,7 @@ class ACMEServer:
process = self._launch_process(['docker', 'run', '--rm', '-v',
'{0}:/workspace'.format(self._workspace),
'alpine', 'rm', '-rf', '/workspace/boulder'])
process.wait()
process.wait(300)
finally:
if os.path.exists(self._workspace):
shutil.rmtree(self._workspace)
@@ -204,7 +205,8 @@ class ACMEServer:
try:
# Launch the Boulder server
self._launch_process(['docker-compose', 'up', '--force-recreate'], cwd=instance_path)
self._launch_process(
[self._find_docker_compose(), 'up', '--force-recreate'], cwd=instance_path)
# Wait for the ACME CA server to be up.
print('=> Waiting for boulder instance to respond...')
@@ -222,7 +224,7 @@ class ACMEServer:
# If we failed to set up boulder, print its logs.
print('=> Boulder setup failed. Boulder logs are:')
process = self._launch_process([
'docker-compose', 'logs'], cwd=instance_path, force_stderr=True
self._find_docker_compose(), 'logs'], cwd=instance_path, force_stderr=True
)
process.wait()
raise
@@ -253,6 +255,9 @@ class ACMEServer:
self._processes.append(process)
return process
def _find_docker_compose(self) -> str:
return "/usr/libexec/docker/cli-plugins/docker-compose"
def main() -> None:
# pylint: disable=missing-function-docstring

View File

@@ -15,7 +15,6 @@ if parse_version(setuptools_version) < parse_version(min_setuptools_version):
install_requires = [
'coverage',
'cryptography',
'docker-compose',
'pyopenssl',
'pytest',
'pytest-cov',

View File

@@ -41,7 +41,7 @@ commands =
# https://github.com/certbot/certbot/issues/7745.
recreate = true
setenv =
PYTEST_ADDOPTS = {env:PYTEST_ADDOPTS:--numprocesses auto}
PYTEST_ADDOPTS = {env:PYTEST_ADDOPTS:-s -vvv}
PYTHONHASHSEED = 0
[testenv:oldest]