diff --git a/README.md b/README.md index dc04481..0eb6977 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,11 @@ # Loggjafarthing This is the single-source-of-truth system for `althingi.is` data. It is a PHP 8 API with a MySQL database. +## Run for development +```sh + docker compose -f docker-compose.yml -f docker-compose.local.yml up run +``` + ## Environment variables: | name | default | Options | description | diff --git a/docker-compose.local.yml b/docker-compose.local.yml new file mode 100644 index 0000000..680c3aa --- /dev/null +++ b/docker-compose.local.yml @@ -0,0 +1,23 @@ +version: '3' + +services: + + run: + environment: + - LOG_LEVEL=WARNING + - BROKER=none + networks: + - x-althingi + + test: + volumes: + - ./vendor/:/var/www/vendor + + database: + networks: + - x-althingi + +networks: + x-althingi: + driver: bridge + diff --git a/docker-compose.yml b/docker-compose.yml index 1a29efe..6676182 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -39,9 +39,7 @@ services: - ./phpunit.xml.dist/:/var/www/phpunit.xml environment: - LOG_PATH=php://stdout - # - LOG_LEVEL=DEBUG - - LOG_LEVEL=WARNING - # INFO NOTICE WARNING ERROR CRITICAL ALERT EMERGENCY + - LOG_LEVEL=DEBUG # INFO NOTICE WARNING ERROR CRITICAL ALERT EMERGENCY - DB_HOST=database - DB_PORT=3306 @@ -49,16 +47,13 @@ services: - DB_USER=${ENV_DB_USER:-root} - DB_PASSWORD=${ENV_DB_PASSWORD:-example} - # - BROKER=${ENV_BROKER:-kafka} - - BROKER=none + - BROKER=${ENV_BROKER:-kafka} - BROKER_HOST=host.docker.internal:9092 - BROKER_CONFIG=all - DOCUMENT_SERVER=${ENV_DOCUMENT_SERVER:-localhost:7070} - DOCUMENT_DEFINITION=${ENV_DOCUMENT_DEFINITION:-/openapi} depends_on: - database - # networks: - # - x-althingi command: '/var/www/bin/wait-for-it.sh -h database -p 3306 -- /var/www/bin/start' # @@ -84,7 +79,6 @@ services: - ./composer.lock/:/var/www/composer.lock - ./coverage/:/var/www/coverage - ./config/:/var/www/config - # - ./vendor/:/var/www/vendor - ./src/:/var/www/src - ./public/:/var/www/public - ./tests/:/var/www/tests @@ -105,7 +99,6 @@ services: - DOCUMENT_SERVER=${ENV_DOCUMENT_SERVER:-localhost:8080} - DOCUMENT_DEFINITION=${ENV_DOCUMENT_DEFINITION:-/openapi} - depends_on: - database-test command: '/var/www/bin/wait-for-it.sh -h database-test -p 3306 -- /var/www/bin/test' @@ -126,8 +119,6 @@ services: - MYSQL_DATABASE=${ENV_DB_NAME:-althingi} volumes: - local-source-db-volume:/var/lib/mysql - # networks: - # - x-althingi command: --default-authentication-plugin=mysql_native_password database-test: @@ -141,10 +132,6 @@ services: - local-source-db-test-volume:/var/lib/mysql command: --default-authentication-plugin=mysql_native_password -# networks: -# x-althingi: -# driver: bridge - volumes: local-source-db-volume: local-source-db-test-volume: diff --git a/tests/Form/SpeechTest.php b/tests/Form/SpeechTest.php index 0063fe5..5e45174 100644 --- a/tests/Form/SpeechTest.php +++ b/tests/Form/SpeechTest.php @@ -32,5 +32,4 @@ public function validForm() $this->assertTrue($form->isValid()); } - } diff --git a/tests/Service/CommitteeDocumentTest.php b/tests/Service/CommitteeDocumentTest.php index 81d868f..fdd3712 100644 --- a/tests/Service/CommitteeDocumentTest.php +++ b/tests/Service/CommitteeDocumentTest.php @@ -21,7 +21,7 @@ public function getIdentifierSuccessfully() $expectedData = 100001; - $actualData = $committeeDocument->getIdentifier(1,1,1,Model\KindEnum::A,1,'part1'); + $actualData = $committeeDocument->getIdentifier(1, 1, 1, Model\KindEnum::A, 1, 'part1'); $this->assertEquals($expectedData, $actualData); } @@ -36,7 +36,8 @@ public function getIdentifierIsNullFailure() 12, 12, 12, - Model\KindEnum::A,1, + Model\KindEnum::A, + 1, 'part1' );