Skip to content

Commit

Permalink
Continue work on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PineappleIOnic committed Jun 1, 2024
1 parent a8a195a commit eba675f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 27 deletions.
24 changes: 3 additions & 21 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,14 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Debug Cache
run: |
if [ -f /tmp/${{ env.IMAGE }}.tar ]; then
echo "Cache hit"
else
echo "Cache miss"
fi
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ env.CACHE_KEY }}-docker
restore-keys: |
${{ env.CACHE_KEY }}-docker
- name: Build Migrations
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
push: false
tags: ${{ env.IMAGE }}
load: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
outputs: type=docker,dest=/tmp/${{ env.IMAGE }}.tar
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Cache Docker Image
uses: actions/cache@v3
Expand Down
17 changes: 15 additions & 2 deletions tests/Migration/E2E/Sources/AppwriteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,32 @@ protected function setUp(): void
}

// Bootstrap Appwrite
$stdout = '';
$stderr = '';
Console::execute(
'appwrite-toolkit --endpoint http://appwrite/v1 --auto bootstrap --amount 1',
'',
''
$stdout,
$stderr
);

Console::info($stdout);
Console::error($stderr);

$stdout = '';
$stderr = '';

// Run Faker
Console::execute(
'appwrite-toolkit --endpoint http://appwrite/v1 --auto faker',
'',
''
$stdout,
$stderr
);

Console::info($stdout);
Console::error($stderr);

// Parse Faker JSON
$projects = json_decode(file_get_contents('projects.json'), true);
$project = $projects[0];
Expand Down
3 changes: 1 addition & 2 deletions tests/Migration/E2E/Sources/NHostTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

class NHostTest extends Base
{
protected ?NHost $source = null;

protected function setUp(): void
{
// Check DB is online and ready
Expand Down Expand Up @@ -64,6 +62,7 @@ protected function setUp(): void
'postgres',
'password'
);

$this->source->pdo = new \PDO('pgsql:host=nhost-db'.';port=5432;dbname=postgres', 'postgres', 'postgres');
$this->source->storageURL = 'http://nhost-storage';

Expand Down
2 changes: 0 additions & 2 deletions tests/Migration/E2E/Sources/SupabaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

class SupabaseTest extends Base
{
protected ?Supabase $source = null;

protected function setUp(): void
{
// Check DB is online and ready
Expand Down

0 comments on commit eba675f

Please sign in to comment.