Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: CI

on:
push:
pull_request:

env:
Expand Down
21 changes: 11 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
PHP_IMAGE = gustavofreze/php:8.3
DOCKER_RUN = docker run -u root --rm -it --network=tiny-blocks --name test-lib \
-v ${PWD}:/app \
-v ${PWD}/tests/Integration/Database/Migrations:/test-adm-migrations \
-v /var/run/docker.sock:/var/run/docker.sock \
-w /app gustavofreze/php:8.3
-w /app ${PHP_IMAGE}

.PHONY: configure test unit-test test-no-coverage create-volume create-network review show-reports clean
.PHONY: configure test unit-test test-no-coverage configure-test-environment review show-reports clean

configure:
configure: configure-test-environment
@${DOCKER_RUN} composer update --optimize-autoloader

test: create-volume
test: configure-test-environment
@${DOCKER_RUN} composer tests

unit-test:
@${DOCKER_RUN} composer run unit-test

test-no-coverage: create-volume
test-no-coverage: configure-test-environment
@${DOCKER_RUN} composer tests-no-coverage

create-network:
@docker network create tiny-blocks

create-volume:
@docker volume create test-adm-migrations
configure-test-environment:
@if ! docker network inspect tiny-blocks > /dev/null 2>&1; then \
docker network create tiny-blocks > /dev/null 2>&1; \
fi
@docker volume create test-adm-migrations > /dev/null 2>&1

review:
@${DOCKER_RUN} composer review
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@
"ext-pdo": "*"
},
"scripts": {
"test": "phpunit -d memory_limit=2G --configuration phpunit.xml tests",
"phpcs": "phpcs --standard=PSR12 --extensions=php ./src",
"phpmd": "phpmd ./src text phpmd.xml --suffixes php --ignore-violations-on-exit",
"phpstan": "phpstan analyse -c phpstan.neon.dist --quiet --no-progress",
"test": "phpunit --log-junit=report/coverage/junit.xml --coverage-xml=report/coverage/coverage-xml --coverage-html=report/coverage/coverage-html tests",
"unit-test": "phpunit --no-coverage -c phpunit.xml --testsuite unit",
"test-no-coverage": "phpunit --no-coverage",
"unit-test": "phpunit --no-coverage --configuration phpunit.xml --testsuite unit",
"test-no-coverage": "phpunit --configuration phpunit.xml --no-coverage tests",
"review": [
"@phpcs",
"@phpmd",
Expand Down
5 changes: 3 additions & 2 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@

<coverage>
<report>
<xml outputDirectory="report/coverage/coverage-xml"/>
<html outputDirectory="report/coverage/coverage-html"/>
<text outputFile="report/coverage.txt"/>
<html outputDirectory="report/html/"/>
<clover outputFile="report/coverage-clover.xml"/>
</report>
</coverage>

<logging>
<junit outputFile="report/execution-result.xml"/>
<junit outputFile="report/coverage/junit.xml"/>
</logging>

</phpunit>
2 changes: 1 addition & 1 deletion src/Internal/Containers/Models/Address/Ports.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace TinyBlocks\DockerContainer\Internal\Containers\Models\Address;

use TinyBlocks\Collection\Collection;
use TinyBlocks\Collection\Internal\Operations\Transform\PreserveKeys;
use TinyBlocks\Collection\PreserveKeys;
use TinyBlocks\DockerContainer\Contracts\Ports as ContainerPorts;

final readonly class Ports implements ContainerPorts
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/DockerContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function testMultipleContainersAreRunSuccessfully(): void
/** @When the Flyway container runs the migration commands */
$flywayContainer = $flywayContainer->run(
commands: ['-connectRetries=15', 'clean', 'migrate'],
waitAfterStarted: ContainerWaitForTime::forSeconds(seconds: 5)
waitAfterStarted: ContainerWaitForTime::forSeconds(seconds: 7)
);

self::assertNotEmpty($flywayContainer->getName());
Expand Down
Loading