Skip to content

Commit 9d3510e

Browse files
authored
Merge pull request #31 from renatomefi/build/new-versions
Build new versions
2 parents fff8b9d + 912f2b2 commit 9d3510e

File tree

7 files changed

+42
-8
lines changed

7 files changed

+42
-8
lines changed

.circleci/config.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ default_workflow_jobs: &default_workflow_jobs
1212
requires:
1313
- lint
1414
- test-7.3:
15+
requires:
16+
- lint
17+
- test-7.4:
1518
requires:
1619
- lint
1720

@@ -31,7 +34,7 @@ jobs:
3134
steps:
3235
- checkout
3336
- run: make test-image IMAGE="php:fpm-alpine" DOCKERFILE="alpine"
34-
- run: make test-image IMAGE="php:fpm-stretch" DOCKERFILE="stretch"
37+
- run: make test-image IMAGE="php:fpm-buster" DOCKERFILE="stretch"
3538

3639
test-7.1:
3740
machine: true
@@ -53,5 +56,16 @@ jobs:
5356
machine: true
5457
steps:
5558
- checkout
56-
- run: make test-image IMAGE="php:7.3-rc-fpm-alpine3.8" DOCKERFILE="alpine"
57-
- run: make test-image IMAGE="php:7.3-rc-fpm-stretch" DOCKERFILE="stretch"
59+
- run: make test-image IMAGE="php:7.3-fpm-alpine3.8" DOCKERFILE="alpine"
60+
- run: make test-image IMAGE="php:7.3-fpm-alpine3.9" DOCKERFILE="alpine"
61+
- run: make test-image IMAGE="php:7.3-fpm-alpine3.10" DOCKERFILE="alpine"
62+
- run: make test-image IMAGE="php:7.3-fpm-alpine3.11" DOCKERFILE="alpine"
63+
- run: make test-image IMAGE="php:7.3-fpm-stretch" DOCKERFILE="stretch"
64+
65+
test-7.4:
66+
machine: true
67+
steps:
68+
- checkout
69+
- run: make test-image IMAGE="php:7.4-fpm-alpine3.10" DOCKERFILE="alpine"
70+
- run: make test-image IMAGE="php:7.4-fpm-alpine3.11" DOCKERFILE="alpine"
71+
- run: make test-image IMAGE="php:7.4-fpm-buster" DOCKERFILE="stretch"

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,19 @@ lint: php-fpm-healthcheck ## Lint code
1111

1212
test: ## Test code in multiple images
1313
$(MAKE) test-image IMAGE="php:fpm-alpine" DOCKERFILE="alpine"
14+
$(MAKE) test-image IMAGE="php:fpm-buster" DOCKERFILE="buster"
1415
$(MAKE) test-image IMAGE="php:7.1-fpm-alpine3.7" DOCKERFILE="alpine"
1516
$(MAKE) test-image IMAGE="php:7.1-fpm-alpine3.8" DOCKERFILE="alpine"
1617
$(MAKE) test-image IMAGE="php:7.2-fpm-alpine3.7" DOCKERFILE="alpine"
1718
$(MAKE) test-image IMAGE="php:7.2-fpm-alpine3.8" DOCKERFILE="alpine"
1819
$(MAKE) test-image IMAGE="php:7.3-fpm-alpine3.8" DOCKERFILE="alpine"
1920
$(MAKE) test-image IMAGE="php:7.3-fpm-alpine3.9" DOCKERFILE="alpine"
21+
$(MAKE) test-image IMAGE="php:7.4-fpm-alpine3.10" DOCKERFILE="alpine"
22+
$(MAKE) test-image IMAGE="php:7.4-fpm-alpine3.11" DOCKERFILE="alpine"
2023
$(MAKE) test-image IMAGE="php:7.1-fpm-stretch" DOCKERFILE="stretch"
2124
$(MAKE) test-image IMAGE="php:7.2-fpm-stretch" DOCKERFILE="stretch"
2225
$(MAKE) test-image IMAGE="php:7.3-fpm-stretch" DOCKERFILE="stretch"
26+
$(MAKE) test-image IMAGE="php:7.4-fpm-buster" DOCKERFILE="buster"
2327

2428
test-image:
2529
./test/docker.sh ${DOCKERFILE} ${IMAGE}

test/Dockerfile-buster

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM php:7.4-fpm-buster
2+
3+
# Required software
4+
RUN set -x \
5+
&& apt-get update \
6+
&& apt-get install -y libfcgi-bin
7+
8+
# Enable php fpm status page
9+
RUN set -xe && echo "pm.status_path = /status" >> /usr/local/etc/php-fpm.d/zz-docker.conf
10+
11+
COPY ./php-fpm-healthcheck /usr/local/bin/

test/docker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set -eEuo pipefail
1111
function cleanup {
1212
docker stop "$CONTAINER" 1> /dev/null
1313
echo "container $CONTAINER: stopped"
14-
docker rmi -f "$DOCKER_TAG_TEMPORARY"
14+
docker rmi -f "$DOCKER_TAG_TEMPORARY"
1515
}
1616
trap cleanup EXIT
1717

test/pytest.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
[pytest]
22
python_files = testinfra/test_*.py
3+
# OS markers are necessary as there are minor differences between fpm and cgi binaries
4+
markers =
5+
php_fpm: All php-fpm tests
6+
alpine: Tests compatible with Alpine images
7+
stretch: Tests compatible with Debian Stretch images

test/testinfra/test_fpm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ def test_fpm_on_socket_with_huge_env(host, setup_fpm_to_default_fixture):
5050
@pytest.mark.alpine
5151
def test_exit_when_fpm_is_not_reachable_apk(host, setup_fpm_to_default_fixture):
5252
cmd = host.run("FCGI_CONNECT=localhost:9001 php-fpm-healthcheck -v")
53-
assert cmd.rc == 9
53+
assert cmd.rc in (111, 9)
5454
assert "Trying to connect to php-fpm via: localhost:9001" in cmd.stdout
5555

5656
@pytest.mark.alpine
5757
def test_exit_when_fpm_is_invalid_host_apk(host, setup_fpm_to_default_fixture):
5858
cmd = host.run("FCGI_CONNECT=abc php-fpm-healthcheck -v")
59-
assert cmd.rc == 9
59+
assert cmd.rc in (2, 9)
6060
assert "Trying to connect to php-fpm via: abc" in cmd.stdout
6161

6262
@pytest.mark.stretch

test/testinfra/test_metrics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ def test_metric_accepted_conn(host):
2525

2626
@pytest.mark.php_fpm
2727
def test_listen_queue_len_and_listen_queue_vars_are_parsed_correctly(host):
28-
cmd = host.run("php-fpm-healthcheck --verbose --listen-queue=5 --listen-queue-len=256")
28+
cmd = host.run("php-fpm-healthcheck --verbose --listen-queue=5 --max-listen-queue=1024")
2929
assert cmd.rc == 0
3030
assert "Trying to connect to php-fpm via:" in cmd.stdout
3131
assert "'listen queue' value '0' and expected is less than '5" in cmd.stdout
32-
assert "'listen queue len' value '128' and expected is less than '256'" in cmd.stdout
32+
assert "'max listen queue' value '0' and expected is less than '1024'" in cmd.stdout

0 commit comments

Comments
 (0)