Skip to content

Commit

Permalink
move local tests to docker
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-h-strachan committed Jan 15, 2025
1 parent 02a0dae commit 1b542e3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 17 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ test-direct-mode-multi-sdk:
./testing/test.sh ./testing/direct-mode-multi-sdk.env

test-pr-mode:
./testing/test.sh ./testing/pr-mode.env
docker-compose run --rm main ./testing/test.sh ./testing/pr-mode.env

test-push-code-samples-only:
./testing/test.sh ./testing/push-code-samples-only.env
docker-compose run --rm main ./testing/test.sh ./testing/push-code-samples-only.env

test-release-mode:
./testing/test.sh ./testing/release-mode.env
docker-compose run --rm main ./testing/test.sh ./testing/release-mode.env

test-release-mode-multi-sdk:
./testing/test.sh ./testing/release-mode-multi-sdk.env
docker-compose run --rm main ./testing/test.sh ./testing/release-mode-multi-sdk.env

test-validate-action:
./testing/test.sh ./testing/validate-action.env
docker-compose run --rm main ./testing/test.sh ./testing/validate-action.env

test-overlay:
./testing/test.sh ./testing/overlay-test.env
docker-compose run --rm main ./testing/test.sh ./testing/overlay-test.env
23 changes: 23 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: "3.9"

services:
main:
build:
context: .
container_name: main_container
stdin_open: true # Keep stdin open for interactive processes
tty: true # Allocate a pseudo-TTY
environment:
- INPUT_DEBUG=true
- INPUT_GITHUB_ACCESS_TOKEN=${GITHUB_TOKEN}
- GITHUB_SERVER_URL=https://github.com
- GITHUB_REPOSITORY=speakeasy-api/sdk-generation-action-test-repo
- GITHUB_REPOSITORY_OWNER=speakeasy-api
- GITHUB_REF=refs/heads/main
- GITHUB_OUTPUT=./output.txt
- GITHUB_WORKFLOW=test
- GITHUB_WORKSPACE=${PWD}
- GITHUB_RUN_ID=1
- GITHUB_RUN_ATTEMPT=1
- SPEAKEASY_ENVIRONMENT=local
- SPEAKEASY_API_KEY=${SPEAKEASY_API_KEY}
12 changes: 1 addition & 11 deletions testing/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,7 @@ function run_action() {
}

# Default environment variables not subject to change by different tests
export INPUT_DEBUG=true
export INPUT_GITHUB_ACCESS_TOKEN=${GITHUB_ACCESS_TOKEN}
#export INPUT_SPEAKEASY_VERSION="v1.240.0" # Uncomment to test specific versions otherwise uses latest
export GITHUB_SERVER_URL="https://github.com"
export GITHUB_REPOSITORY_OWNER="speakeasy-api"
export GITHUB_REF="refs/heads/main"
export GITHUB_OUTPUT="./output.txt"
export GITHUB_WORKFLOW="test"
export GITHUB_WORKSPACE=$(pwd)
export GITHUB_RUN_ID="1"
export GITHUB_RUN_ATTEMPT="1"
#INPUT_SPEAKEASY_VERSION="v1.240.0" # Uncomment to test specific versions otherwise uses latest

if [ "$RUN_FINALIZE" = "true" ]; then
BRANCH_NAME=$(go run testing/getoutput.go -output branch_name)
Expand Down

0 comments on commit 1b542e3

Please sign in to comment.