diff --git a/docker-bake.hcl b/docker-bake.hcl index a5600dc0..a345b98a 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -112,6 +112,8 @@ target "php-test" { context = "php" target = "tested" contexts = { + # replaces the stage that does `git clone` and ensures we get a fresh version + cck = "https://github.com/cucumber/compatibility-kit.git#main:devkit", schema-codegen = "target:php-codegen", } } diff --git a/php/Dockerfile b/php/Dockerfile index d3ceee5d..67af39bb 100644 --- a/php/Dockerfile +++ b/php/Dockerfile @@ -9,6 +9,15 @@ WORKDIR /cucumber FROM scratch AS schema-codegen +# Stage to download the CCK data, overridden in main build but included here in case building in the subfolder +# NB - when buildkit 1.5 is released this can be replaced with an ADD from the git URL +FROM bitnami/git AS cck +RUN git clone https://github.com/cucumber/compatibility-kit.git \ + && cd compatibility-kit \ + && git checkout main \ + && cp -R ./devkit/samples /samples + + FROM php AS with-dependencies COPY --link composer.json . @@ -23,6 +32,7 @@ FROM php AS tested COPY --link . . COPY --link --from=with-dependencies /cucumber/vendor vendor COPY --link --from=schema-codegen / src-generated +COPY --link --from=cck /samples/ ./tests/cck-samples RUN vendor/bin/php-cs-fixer --dry-run --diff fix RUN vendor/bin/psalm --no-cache RUN vendor/bin/phpunit diff --git a/php/composer.json b/php/composer.json index 8349570d..cda2780f 100644 --- a/php/composer.json +++ b/php/composer.json @@ -28,7 +28,8 @@ "Cucumber\\Messages\\": [ "src", "src-generated", - "tests" + "tests", + "tests/unit" ] } } diff --git a/php/phpunit.xml b/php/phpunit.xml index fd5e5582..ea739e52 100644 --- a/php/phpunit.xml +++ b/php/phpunit.xml @@ -12,8 +12,11 @@ failOnWarning="true" verbose="true"> - - tests + + tests/unit + + + tests/CckTest.php diff --git a/php/tests/AcceptanceTest.php b/php/tests/CckTest.php similarity index 84% rename from php/tests/AcceptanceTest.php rename to php/tests/CckTest.php index a3ce4ca4..151af1c7 100644 --- a/php/tests/AcceptanceTest.php +++ b/php/tests/CckTest.php @@ -1,11 +1,14 @@