Skip to content

Commit

Permalink
ci: test docker
Browse files Browse the repository at this point in the history
  • Loading branch information
chesedo committed Apr 26, 2023
1 parent 065588d commit 99150ac
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 12 deletions.
16 changes: 6 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ jobs:
executor:
name: win/server-2022
# size: medium
size: large
size: xlarge
shell: powershell.exe
environment:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
Expand Down Expand Up @@ -514,16 +514,12 @@ jobs:
# SHUTTLE_API: https://api.unstable.shuttle.rs
- run: git submodule sync
- run: git submodule update --init
- run:
name: Test WASM
command: ./.circleci/qa-wasm.ps1
# - run:
# name: "Install Docker"
# command: |
# brew install --cask docker
# - run:
# name: Test Docker
# command: ./.circleci/qa-docker.sh
# name: Test WASM
# command: ./.circleci/qa-wasm.ps1
- run:
name: Test Docker
command: ./.circleci/qa-docker.ps1

workflows:
# ci:
Expand Down
32 changes: 32 additions & 0 deletions .circleci/qa-docker.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Would actually like to error on all errors, but `Enable-ExperimentalFeature`
# does not work for this version of Windows
# https://github.com/PowerShell/PowerShell/issues/3415#issuecomment-1354457563
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"

# Add cargo to PATH
$env:Path += [IO.Path]::PathSeparator + "$env:USERPROFILE/.cargo/bin"

# Start locally
$job = Start-Job -Name "local-run" -ScriptBlock { cd examples/rocket/postgres; cargo shuttle run }
Start-Sleep -Seconds 300

echo "Testing local wasm endpoint"
$postParams = @{note='test'}
$output=curl http://localhost:8000/todo -Method Post -Body $postParams | Select-Object -ExpandProperty Content
if ( $output -ne '{"id":1,"note":"test"}')
{
echo "Did not expect POST output: $output"
exit 1
}

$output=curl http://localhost:8000/todo/1 | Select-Object -ExpandProperty Content
if ( $output -ne '{"id":1,"note":"test"}')
{
echo "Did not expect output: $output"
exit 1
}

Stop-Job $job

exit 0
2 changes: 0 additions & 2 deletions .circleci/qa.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env sh

# Would actually like to error on all errors, but `Enable-ExperimentalFeature`
# does not work for this version of Windows
# https://github.com/PowerShell/PowerShell/issues/3415#issuecomment-1354457563
Expand Down

0 comments on commit 99150ac

Please sign in to comment.