Skip to content

Commit

Permalink
running PowerShell for Windows to do integration CLI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jwoertink committed Oct 12, 2024
1 parent 2b04239 commit ffdd473
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,14 @@ jobs:
crystal: ${{matrix.crystal_version}}
- name: Install shards
run: SHARDS_OVERRIDE=${{ matrix.shard_file }} shards install
- name: Run integration test
- name: Run integration test (Linux)
run: ./script/integration_test
if: matrix.os == 'ubuntu-latest'
env:
DATABASE_URL: postgres://lucky:developer@localhost:5432/avram_dev
- name: Run integration test (Windows)
run: .\script\integration_test.ps1
if: matrix.os == 'windows-latest'
env:
DATABASE_URL: postgres://lucky:developer@localhost:5432/avram_dev
- name: Run tests
Expand Down
23 changes: 23 additions & 0 deletions script/integration_test.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Exit if any subcommand fails
$ErrorActionPreferences = "Stop"

Write-Host "\nRunning tasks\n\n"

crystal tasks.cr db.drop
crystal tasks.cr db.create
crystal tasks.cr db.migrate

# If there were no errors, continue the test
if ($?) {
# Integration test various tasks
Write-Host "\nRolling back to 20180802180356\n"
crystal tasks.cr db.rollback_to 20180802180356
crystal tasks.cr db.migrations.status
Write-Host "\nRolling back remainder\n"
crystal tasks.cr db.rollback_all
crystal tasks.cr db.migrate.one
crystal tasks.cr db.migrate
crystal tasks.cr db.reset
crystal tasks.cr db.drop
crystal tasks.cr db.setup
}

0 comments on commit ffdd473

Please sign in to comment.