1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Fixes for tests

This commit is contained in:
David Bomba 2021-02-04 21:45:11 +11:00
parent 677090914d
commit e06403edba
3 changed files with 20 additions and 18 deletions

View File

@ -9,9 +9,13 @@ DB_CONNECTION=db-ninja-01
DB_DATABASE1=ninja
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

View File

@ -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

View File

@ -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'];
}
}
}