diff --git a/.env.ci b/.env.ci index a03f48a667..486d20cfd0 100644 --- a/.env.ci +++ b/.env.ci @@ -7,12 +7,16 @@ MULTI_DB_ENABLED=false # database DB_CONNECTION=db-ninja-01 DB_DATABASE1=ninja -DB_USERNAME1=root +DB_USERNAME1=root DB_PASSWORD1=ninja +DB_HOST1=127.0.0.1 +DB_PORT1=32768 +DB_PORT=32768 DB_DATABASE=ninja DB_USERNAME=root DB_PASSWORD=ninja +DB_HOST=127.0.0.1 NINJA_ENVIRONMENT=hosted COMPOSER_AUTH='{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}' TRAVIS=true -API_SECRET=superdoopersecrethere +API_SECRET=superdoopersecrethere \ No newline at end of file diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 97c7ffa78c..c89ece0d3c 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -18,12 +18,13 @@ jobs: env: DB_DATABASE1: ninja - DB_USERNAME1: ninja + DB_USERNAME1: root DB_PASSWORD1: ninja + DB_HOST1: '127.0.0.1' DB_DATABASE: ninja - DB_USERNAME: ninja + DB_USERNAME: root DB_PASSWORD: ninja - DB_PORT: 32574 + DB_HOST: '127.0.0.1' BROADCAST_DRIVER: log CACHE_DRIVER: file QUEUE_CONNECTION: sync @@ -38,7 +39,7 @@ jobs: mariadb: image: mariadb:latest ports: - - 32574:3306 + - 3306 env: MYSQL_ALLOW_EMPTY_PASSWORD: yes MYSQL_USER: ninja @@ -48,11 +49,9 @@ jobs: options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 steps: - - name: Start mysql service run: | sudo /etc/init.d/mysql start - - name: Verify MariaDB connection env: DB_PORT: ${{ job.services.mariadb.ports[3306] }} @@ -62,11 +61,6 @@ jobs: while ! mysqladmin ping -h"127.0.0.1" -P"$DB_PORT" --silent; do sleep 1 done - - - name: Verify MySQL connection from container - run: | - mysql -h"localhost" --port 32574 -uninja -pninja -e "SHOW DATABASES" - - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -88,10 +82,13 @@ jobs: - name: Prepare Laravel Application run: | php artisan key:generate + php artisan optimize php artisan cache:clear php artisan config:cache - php artisan optimize - + - name: Create DB and schemas + run: | + mkdir -p database + touch database/database.sqlite - name: Migrate Database run: | php artisan migrate:fresh --seed --force && php artisan db:seed --force @@ -108,4 +105,4 @@ jobs: - name: Run php-cs-fixer run: | - vendor/bin/php-cs-fixer fix + vendor/bin/php-cs-fixer fix \ No newline at end of file diff --git a/app/Jobs/Util/Import.php b/app/Jobs/Util/Import.php index b100e45771..fdb5e32890 100644 --- a/app/Jobs/Util/Import.php +++ b/app/Jobs/Util/Import.php @@ -897,8 +897,9 @@ class Import implements ShouldQueue if ($this->tryTransformingId('invoices', $invoice['invoice_id'])) { $modified['invoices'][$key]['invoice_id'] = $this->transformId('invoices', $invoice['invoice_id']); } else { - $modified['credits'][$key]['credit_id'] = $this->transformId('credits', $invoice['invoice_id']); - $modified['credits'][$key]['amount'] = $modified['invoices'][$key]['amount']; + nlog($modified['invoices']); + // $modified['credits'][$key]['credit_id'] = $this->transformId('credits', $invoice['invoice_id']); + // $modified['credits'][$key]['amount'] = $modified['invoices'][$key]['amount']; } } }