mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-04-25 11:48:22 -05:00
tests: compat testing (#3144)
* tests: compat testing * fix: new engine old sdk * feat: ruby ts * fix: namespaced tests, conditions * chore: lint ts * fix: python compat * chore: lint * fix: warn on version mismatch * chore: lint * fix: child spawn * refactor: address review * chore: lint * chore: lint * chore: lint * refactor: address reviews * chore: lint * fix: typeguard * tests: docker-compose * fix: docker compose * fix: labels? * chore: skip new tests * fix: backwards compat * fix: grpc proxy
This commit is contained in:
@@ -160,6 +160,216 @@ jobs:
|
||||
name: ${{ env.HATCHET_CLIENT_NAMESPACE }}-opt-${{ matrix.optimistic-scheduling }}-api-logs
|
||||
path: api.log
|
||||
|
||||
old-engine-new-sdk:
|
||||
runs-on: ubicloud-standard-4
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
|
||||
with:
|
||||
go-version: "1.25"
|
||||
|
||||
- name: Start Docker dependencies
|
||||
working-directory: .
|
||||
run: docker compose up -d
|
||||
|
||||
- name: Determine latest stable release tag
|
||||
working-directory: .
|
||||
run: |
|
||||
LATEST_TAG=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -1)
|
||||
if [ -z "$LATEST_TAG" ]; then
|
||||
echo "ERROR: No stable release tag found"
|
||||
exit 1
|
||||
fi
|
||||
echo "Latest stable tag: $LATEST_TAG"
|
||||
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
|
||||
|
||||
- name: Pull release images
|
||||
working-directory: .
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.release.yml pull hatchet-migrate hatchet-admin hatchet-engine hatchet-api
|
||||
|
||||
- name: Run migrations
|
||||
working-directory: .
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.release.yml run --rm hatchet-migrate
|
||||
|
||||
- name: Setup config and seed database
|
||||
working-directory: .
|
||||
run: |
|
||||
mkdir -p generated
|
||||
docker compose -f docker-compose.yml -f docker-compose.release.yml run --rm \
|
||||
hatchet-admin /hatchet/hatchet-admin quickstart --skip certs --generated-config-dir /hatchet/generated
|
||||
|
||||
- name: Generate API token
|
||||
working-directory: .
|
||||
run: |
|
||||
TOKEN=$(docker compose -f docker-compose.yml -f docker-compose.release.yml run -T --rm \
|
||||
hatchet-admin /hatchet/hatchet-admin token create --config /hatchet/generated --tenant-id 707d0855-80ab-4e1f-a156-f1c4546cbf52)
|
||||
echo "HATCHET_CLIENT_TOKEN=$TOKEN" >> $GITHUB_ENV
|
||||
|
||||
- name: Start engine and API
|
||||
working-directory: .
|
||||
run: |
|
||||
docker compose -f docker-compose.yml -f docker-compose.release.yml up -d hatchet-engine hatchet-api
|
||||
sleep 30
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
||||
with:
|
||||
python-version: '3.14'
|
||||
|
||||
- name: Install Poetry
|
||||
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
|
||||
with:
|
||||
version: 1.5.1
|
||||
virtualenvs-create: true
|
||||
virtualenvs-in-project: true
|
||||
|
||||
- name: Install dependencies
|
||||
run: poetry install --no-interaction --all-extras
|
||||
|
||||
- name: Set HATCHET_CLIENT_NAMESPACE
|
||||
run: |
|
||||
SHORT_SHA=$(git rev-parse --short HEAD)
|
||||
echo "HATCHET_CLIENT_NAMESPACE=old-engine-new-sdk-${SHORT_SHA}" >> $GITHUB_ENV
|
||||
|
||||
- name: Run pytest
|
||||
env:
|
||||
HATCHET_CLIENT_TLS_STRATEGY: none
|
||||
HATCHET_CLIENT_WORKER_HEALTHCHECK_ENABLED: "True"
|
||||
run: |
|
||||
echo "Testing current SDK against engine ${{ env.LATEST_TAG }}"
|
||||
echo "Using HATCHET_CLIENT_NAMESPACE: $HATCHET_CLIENT_NAMESPACE"
|
||||
poetry run pytest -s -vvv --maxfail=5 --capture=no --retries 3 --retry-delay 2 -n auto
|
||||
|
||||
- name: Collect engine logs
|
||||
if: always()
|
||||
working-directory: .
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.release.yml logs hatchet-engine > /tmp/engine.log 2>&1 || true
|
||||
|
||||
- name: Upload engine logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: ${{ env.HATCHET_CLIENT_NAMESPACE }}-engine-logs
|
||||
path: /tmp/engine.log
|
||||
|
||||
- name: Collect API logs
|
||||
if: always()
|
||||
working-directory: .
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.release.yml logs hatchet-api > /tmp/api.log 2>&1 || true
|
||||
|
||||
- name: Upload API logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: ${{ env.HATCHET_CLIENT_NAMESPACE }}-api-logs
|
||||
path: /tmp/api.log
|
||||
|
||||
- name: Teardown
|
||||
if: always()
|
||||
working-directory: .
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.release.yml down
|
||||
|
||||
new-engine-old-sdk:
|
||||
runs-on: ubicloud-standard-4
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
|
||||
with:
|
||||
go-version: "1.25"
|
||||
|
||||
- name: Start Docker dependencies
|
||||
working-directory: .
|
||||
run: docker compose up -d
|
||||
|
||||
- name: Run migrations
|
||||
working-directory: .
|
||||
run: |
|
||||
export DATABASE_URL="postgresql://hatchet:hatchet@127.0.0.1:5431/hatchet"
|
||||
go run ./cmd/hatchet-migrate
|
||||
|
||||
- name: Setup and start engine
|
||||
working-directory: .
|
||||
run: |
|
||||
export SEED_DEVELOPMENT=true
|
||||
export SERVER_PORT=8080
|
||||
export SERVER_URL=http://localhost:8080
|
||||
export SERVER_AUTH_COOKIE_DOMAIN=localhost
|
||||
export SERVER_AUTH_COOKIE_INSECURE=true
|
||||
export SERVER_DEFAULT_ENGINE_VERSION=V1
|
||||
export SERVER_MSGQUEUE_RABBITMQ_URL="amqp://user:password@localhost:5672/"
|
||||
|
||||
go run ./cmd/hatchet-admin quickstart
|
||||
|
||||
go run ./cmd/hatchet-engine --config ./generated/ > engine.log 2>&1 &
|
||||
go run ./cmd/hatchet-api --config ./generated/ > api.log 2>&1 &
|
||||
|
||||
sleep 30
|
||||
|
||||
- name: Generate API token
|
||||
working-directory: .
|
||||
run: |
|
||||
echo "HATCHET_CLIENT_TOKEN=$(go run ./cmd/hatchet-admin token create --config ./generated/ --tenant-id 707d0855-80ab-4e1f-a156-f1c4546cbf52)" >> $GITHUB_ENV
|
||||
echo "HATCHET_CLIENT_TLS_ROOT_CA_FILE=${{ github.workspace }}/certs/ca.cert" >> $GITHUB_ENV
|
||||
echo "HATCHET_CLIENT_WORKER_HEALTHCHECK_ENABLED=True" >> $GITHUB_ENV
|
||||
|
||||
- name: Clone main SDK source
|
||||
run: |
|
||||
git clone --depth=1 --branch main https://github.com/hatchet-dev/hatchet.git /tmp/old-sdk
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
||||
with:
|
||||
python-version: '3.14'
|
||||
|
||||
- name: Install Poetry
|
||||
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
|
||||
with:
|
||||
version: 1.5.1
|
||||
virtualenvs-create: true
|
||||
virtualenvs-in-project: true
|
||||
|
||||
- name: Install SDK and test dependencies
|
||||
working-directory: /tmp/old-sdk/sdks/python
|
||||
run: poetry install --no-interaction --all-extras
|
||||
|
||||
- name: Set HATCHET_CLIENT_NAMESPACE
|
||||
run: |
|
||||
SHORT_SHA=$(git rev-parse --short HEAD)
|
||||
echo "HATCHET_CLIENT_NAMESPACE=new-engine-old-sdk-${SHORT_SHA}" >> $GITHUB_ENV
|
||||
|
||||
- name: Run pytest against new engine
|
||||
working-directory: /tmp/old-sdk/sdks/python
|
||||
run: |
|
||||
echo "Testing main SDK against current engine"
|
||||
echo "Using HATCHET_CLIENT_NAMESPACE: $HATCHET_CLIENT_NAMESPACE"
|
||||
poetry run pytest -s -vvv --maxfail=5 --capture=no --retries 3 --retry-delay 2 -n auto
|
||||
|
||||
- name: Upload engine logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: ${{ env.HATCHET_CLIENT_NAMESPACE }}-engine-logs
|
||||
path: engine.log
|
||||
|
||||
- name: Upload API logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: ${{ env.HATCHET_CLIENT_NAMESPACE }}-api-logs
|
||||
path: api.log
|
||||
|
||||
publish:
|
||||
runs-on: ubicloud-standard-4
|
||||
needs: [lint, test]
|
||||
|
||||
@@ -224,6 +224,280 @@ jobs:
|
||||
name: ${{ env.HATCHET_CLIENT_NAMESPACE }}-opt-${{ matrix.optimistic-scheduling }}-api-logs
|
||||
path: api.log
|
||||
|
||||
old-engine-new-sdk:
|
||||
runs-on: ubicloud-standard-4
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
|
||||
- name: Start Docker dependencies
|
||||
working-directory: .
|
||||
run: docker compose up -d
|
||||
|
||||
- name: Determine latest stable release tag
|
||||
working-directory: .
|
||||
run: |
|
||||
LATEST_TAG=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -1)
|
||||
if [ -z "$LATEST_TAG" ]; then
|
||||
echo "ERROR: No stable release tag found"
|
||||
exit 1
|
||||
fi
|
||||
echo "Latest stable tag: $LATEST_TAG"
|
||||
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
|
||||
|
||||
- name: Pull release images
|
||||
working-directory: .
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.release.yml pull hatchet-migrate hatchet-admin hatchet-engine hatchet-api
|
||||
|
||||
- name: Run migrations
|
||||
working-directory: .
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.release.yml run --rm hatchet-migrate
|
||||
|
||||
- name: Setup config and seed database
|
||||
working-directory: .
|
||||
run: |
|
||||
mkdir -p generated
|
||||
docker compose -f docker-compose.yml -f docker-compose.release.yml run --rm \
|
||||
hatchet-admin /hatchet/hatchet-admin quickstart --skip certs --generated-config-dir /hatchet/generated
|
||||
|
||||
- name: Generate API token
|
||||
working-directory: .
|
||||
run: |
|
||||
TOKEN=$(docker compose -f docker-compose.yml -f docker-compose.release.yml run -T --rm \
|
||||
hatchet-admin /hatchet/hatchet-admin token create --config /hatchet/generated --tenant-id 707d0855-80ab-4e1f-a156-f1c4546cbf52)
|
||||
echo "HATCHET_CLIENT_TOKEN=$TOKEN" >> $GITHUB_ENV
|
||||
|
||||
- name: Start engine and API
|
||||
working-directory: .
|
||||
run: |
|
||||
docker compose -f docker-compose.yml -f docker-compose.release.yml up -d hatchet-engine hatchet-api
|
||||
sleep 30
|
||||
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
|
||||
with:
|
||||
ruby-version: "3.2"
|
||||
bundler-cache: true
|
||||
working-directory: ./sdks/ruby/src
|
||||
|
||||
- name: Set HATCHET_CLIENT_NAMESPACE
|
||||
run: |
|
||||
SHORT_SHA=$(git rev-parse --short HEAD)
|
||||
echo "HATCHET_CLIENT_NAMESPACE=old-engine-new-sdk-rb-${SHORT_SHA}" >> $GITHUB_ENV
|
||||
|
||||
- name: Run unit tests
|
||||
env:
|
||||
HATCHET_CLIENT_TLS_STRATEGY: none
|
||||
HATCHET_CLIENT_WORKER_HEALTHCHECK_ENABLED: "true"
|
||||
run: |
|
||||
echo "Testing current SDK against engine ${{ env.LATEST_TAG }}"
|
||||
echo "Using HATCHET_CLIENT_NAMESPACE: $HATCHET_CLIENT_NAMESPACE"
|
||||
bundle exec rspec --format documentation --tag ~integration
|
||||
|
||||
- name: Run integration tests
|
||||
env:
|
||||
HATCHET_CLIENT_TLS_STRATEGY: none
|
||||
HATCHET_CLIENT_WORKER_HEALTHCHECK_ENABLED: "true"
|
||||
run: bundle exec rspec spec/integration/ --format documentation --tag integration
|
||||
|
||||
- name: Set up Ruby for examples
|
||||
uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
|
||||
with:
|
||||
ruby-version: "3.2"
|
||||
bundler-cache: true
|
||||
working-directory: ./sdks/ruby/examples
|
||||
|
||||
- name: Start example worker
|
||||
working-directory: ./sdks/ruby/examples
|
||||
env:
|
||||
HATCHET_CLIENT_TLS_STRATEGY: none
|
||||
HATCHET_CLIENT_WORKER_HEALTHCHECK_ENABLED: "true"
|
||||
run: bundle exec ruby worker.rb > worker.log 2>&1 &
|
||||
|
||||
- name: Wait for worker health
|
||||
working-directory: .
|
||||
run: |
|
||||
for i in $(seq 1 60); do
|
||||
if curl -s http://localhost:8001/health > /dev/null 2>&1; then
|
||||
echo "Worker is healthy after ${i}s"
|
||||
exit 0
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
echo "Worker failed to start within 60s"
|
||||
cat ./sdks/ruby/examples/worker.log || true
|
||||
exit 1
|
||||
|
||||
- name: Run e2e tests
|
||||
working-directory: ./sdks/ruby/examples
|
||||
env:
|
||||
HATCHET_CLIENT_TLS_STRATEGY: none
|
||||
HATCHET_CLIENT_WORKER_HEALTHCHECK_ENABLED: "true"
|
||||
run: bundle exec rspec -f d --fail-fast
|
||||
|
||||
- name: Upload worker logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: ${{ env.HATCHET_CLIENT_NAMESPACE }}-worker-logs
|
||||
path: ./sdks/ruby/examples/worker.log
|
||||
|
||||
- name: Collect engine logs
|
||||
if: always()
|
||||
working-directory: .
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.release.yml logs hatchet-engine > /tmp/engine.log 2>&1 || true
|
||||
|
||||
- name: Upload engine logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: ${{ env.HATCHET_CLIENT_NAMESPACE }}-engine-logs
|
||||
path: /tmp/engine.log
|
||||
|
||||
- name: Collect API logs
|
||||
if: always()
|
||||
working-directory: .
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.release.yml logs hatchet-api > /tmp/api.log 2>&1 || true
|
||||
|
||||
- name: Upload API logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: ${{ env.HATCHET_CLIENT_NAMESPACE }}-api-logs
|
||||
path: /tmp/api.log
|
||||
|
||||
- name: Teardown
|
||||
if: always()
|
||||
working-directory: .
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.release.yml down
|
||||
|
||||
new-engine-old-sdk:
|
||||
runs-on: ubicloud-standard-4
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
|
||||
with:
|
||||
go-version: "1.25"
|
||||
|
||||
- name: Start Docker dependencies
|
||||
working-directory: .
|
||||
run: docker compose up -d
|
||||
|
||||
- name: Run migrations
|
||||
working-directory: .
|
||||
run: |
|
||||
export DATABASE_URL="postgresql://hatchet:hatchet@127.0.0.1:5431/hatchet"
|
||||
go run ./cmd/hatchet-migrate
|
||||
|
||||
- name: Setup and start engine
|
||||
working-directory: .
|
||||
run: |
|
||||
export SEED_DEVELOPMENT=true
|
||||
export SERVER_PORT=8080
|
||||
export SERVER_URL=http://localhost:8080
|
||||
export SERVER_AUTH_COOKIE_DOMAIN=localhost
|
||||
export SERVER_AUTH_COOKIE_INSECURE=true
|
||||
export SERVER_DEFAULT_ENGINE_VERSION=V1
|
||||
export SERVER_MSGQUEUE_RABBITMQ_URL="amqp://user:password@localhost:5672/"
|
||||
|
||||
go run ./cmd/hatchet-admin quickstart
|
||||
|
||||
go run ./cmd/hatchet-engine --config ./generated/ > engine.log 2>&1 &
|
||||
go run ./cmd/hatchet-api --config ./generated/ > api.log 2>&1 &
|
||||
|
||||
sleep 30
|
||||
|
||||
- name: Generate API token
|
||||
working-directory: .
|
||||
run: |
|
||||
echo "HATCHET_CLIENT_TOKEN=$(go run ./cmd/hatchet-admin token create --config ./generated/ --tenant-id 707d0855-80ab-4e1f-a156-f1c4546cbf52)" >> $GITHUB_ENV
|
||||
echo "HATCHET_CLIENT_TLS_ROOT_CA_FILE=${{ github.workspace }}/certs/ca.cert" >> $GITHUB_ENV
|
||||
echo "HATCHET_CLIENT_WORKER_HEALTHCHECK_ENABLED=true" >> $GITHUB_ENV
|
||||
|
||||
- name: Clone main SDK source
|
||||
working-directory: .
|
||||
run: |
|
||||
git clone --depth=1 --branch main https://github.com/hatchet-dev/hatchet.git /tmp/old-sdk
|
||||
|
||||
- name: Set up Ruby for old SDK
|
||||
uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
|
||||
with:
|
||||
ruby-version: "3.2"
|
||||
bundler-cache: true
|
||||
working-directory: /tmp/old-sdk/sdks/ruby/src
|
||||
|
||||
- name: Set HATCHET_CLIENT_NAMESPACE
|
||||
run: |
|
||||
SHORT_SHA=$(git rev-parse --short HEAD)
|
||||
echo "HATCHET_CLIENT_NAMESPACE=new-engine-old-sdk-rb-${SHORT_SHA}" >> $GITHUB_ENV
|
||||
|
||||
- name: Run unit tests
|
||||
working-directory: /tmp/old-sdk/sdks/ruby/src
|
||||
run: |
|
||||
echo "Testing main SDK against current engine"
|
||||
echo "Using HATCHET_CLIENT_NAMESPACE: $HATCHET_CLIENT_NAMESPACE"
|
||||
bundle exec rspec --format documentation --tag ~integration
|
||||
|
||||
- name: Run integration tests
|
||||
working-directory: /tmp/old-sdk/sdks/ruby/src
|
||||
run: bundle exec rspec spec/integration/ --format documentation --tag integration
|
||||
|
||||
- name: Set up Ruby for old examples
|
||||
uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
|
||||
with:
|
||||
ruby-version: "3.2"
|
||||
bundler-cache: true
|
||||
working-directory: /tmp/old-sdk/sdks/ruby/examples
|
||||
|
||||
- name: Start example worker
|
||||
working-directory: /tmp/old-sdk/sdks/ruby/examples
|
||||
run: bundle exec ruby worker.rb > worker.log 2>&1 &
|
||||
|
||||
- name: Wait for worker health
|
||||
working-directory: .
|
||||
run: |
|
||||
for i in $(seq 1 60); do
|
||||
if curl -s http://localhost:8001/health > /dev/null 2>&1; then
|
||||
echo "Worker is healthy after ${i}s"
|
||||
exit 0
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
echo "Worker failed to start within 60s"
|
||||
cat /tmp/old-sdk/sdks/ruby/examples/worker.log || true
|
||||
exit 1
|
||||
|
||||
- name: Run e2e tests
|
||||
working-directory: /tmp/old-sdk/sdks/ruby/examples
|
||||
run: bundle exec rspec -f d --fail-fast
|
||||
|
||||
- name: Upload worker logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: ${{ env.HATCHET_CLIENT_NAMESPACE }}-worker-logs
|
||||
path: /tmp/old-sdk/sdks/ruby/examples/worker.log
|
||||
|
||||
- name: Upload engine logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: ${{ env.HATCHET_CLIENT_NAMESPACE }}-engine-logs
|
||||
path: engine.log
|
||||
|
||||
- name: Upload API logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: ${{ env.HATCHET_CLIENT_NAMESPACE }}-api-logs
|
||||
path: api.log
|
||||
|
||||
publish:
|
||||
runs-on: ubicloud-standard-4
|
||||
needs: [lint, test]
|
||||
|
||||
@@ -185,6 +185,203 @@ jobs:
|
||||
name: sdk-typescript-api-logs
|
||||
path: api.log
|
||||
|
||||
old-engine-new-sdk:
|
||||
runs-on: ubicloud-standard-4
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
|
||||
- name: Start Docker dependencies
|
||||
working-directory: .
|
||||
run: docker compose up -d
|
||||
|
||||
- name: Determine latest stable release tag
|
||||
working-directory: .
|
||||
run: |
|
||||
LATEST_TAG=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -1)
|
||||
if [ -z "$LATEST_TAG" ]; then
|
||||
echo "ERROR: No stable release tag found"
|
||||
exit 1
|
||||
fi
|
||||
echo "Latest stable tag: $LATEST_TAG"
|
||||
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
|
||||
|
||||
- name: Pull release images
|
||||
working-directory: .
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.release.yml pull hatchet-migrate hatchet-admin hatchet-engine hatchet-api
|
||||
|
||||
- name: Run migrations
|
||||
working-directory: .
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.release.yml run --rm hatchet-migrate
|
||||
|
||||
- name: Setup config and seed database
|
||||
working-directory: .
|
||||
run: |
|
||||
mkdir -p generated
|
||||
docker compose -f docker-compose.yml -f docker-compose.release.yml run --rm \
|
||||
hatchet-admin /hatchet/hatchet-admin quickstart --skip certs --generated-config-dir /hatchet/generated
|
||||
|
||||
- name: Generate API token
|
||||
working-directory: .
|
||||
run: |
|
||||
TOKEN=$(docker compose -f docker-compose.yml -f docker-compose.release.yml run -T --rm \
|
||||
hatchet-admin /hatchet/hatchet-admin token create --config /hatchet/generated --tenant-id 707d0855-80ab-4e1f-a156-f1c4546cbf52)
|
||||
echo "HATCHET_CLIENT_TOKEN=$TOKEN" >> $GITHUB_ENV
|
||||
|
||||
- name: Start engine and API
|
||||
working-directory: .
|
||||
run: |
|
||||
docker compose -f docker-compose.yml -f docker-compose.release.yml up -d hatchet-engine hatchet-api
|
||||
sleep 30
|
||||
|
||||
- name: Install pnpm
|
||||
run: npm install -g pnpm@10.16.1
|
||||
|
||||
- name: Get pnpm store directory
|
||||
shell: bash
|
||||
run: |
|
||||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||
|
||||
- name: Setup pnpm cache
|
||||
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
|
||||
with:
|
||||
path: ${{ env.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Set HATCHET_CLIENT_NAMESPACE
|
||||
run: |
|
||||
SHORT_SHA=$(git rev-parse --short HEAD)
|
||||
echo "HATCHET_CLIENT_NAMESPACE=old-engine-new-sdk-ts-${SHORT_SHA}" >> $GITHUB_ENV
|
||||
|
||||
- name: Run e2e tests
|
||||
env:
|
||||
HATCHET_CLIENT_TLS_STRATEGY: none
|
||||
HATCHET_CLIENT_WORKER_HEALTHCHECK_ENABLED: "true"
|
||||
NODE_TLS_REJECT_UNAUTHORIZED: "0"
|
||||
run: |
|
||||
echo "Testing current SDK against engine ${{ env.LATEST_TAG }}"
|
||||
echo "Using HATCHET_CLIENT_NAMESPACE: $HATCHET_CLIENT_NAMESPACE"
|
||||
pnpm test:e2e
|
||||
|
||||
- name: Collect engine logs
|
||||
if: always()
|
||||
working-directory: .
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.release.yml logs hatchet-engine > /tmp/engine.log 2>&1 || true
|
||||
|
||||
- name: Upload engine logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: ${{ env.HATCHET_CLIENT_NAMESPACE }}-engine-logs
|
||||
path: /tmp/engine.log
|
||||
|
||||
- name: Collect API logs
|
||||
if: always()
|
||||
working-directory: .
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.release.yml logs hatchet-api > /tmp/api.log 2>&1 || true
|
||||
|
||||
- name: Upload API logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: ${{ env.HATCHET_CLIENT_NAMESPACE }}-api-logs
|
||||
path: /tmp/api.log
|
||||
|
||||
- name: Teardown
|
||||
if: always()
|
||||
working-directory: .
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.release.yml down
|
||||
|
||||
new-engine-old-sdk:
|
||||
runs-on: ubicloud-standard-4
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
|
||||
with:
|
||||
go-version: "1.25"
|
||||
|
||||
- name: Start Docker dependencies
|
||||
working-directory: .
|
||||
run: docker compose up -d
|
||||
|
||||
- name: Run migrations
|
||||
working-directory: .
|
||||
run: |
|
||||
export DATABASE_URL="postgresql://hatchet:hatchet@127.0.0.1:5431/hatchet"
|
||||
go run ./cmd/hatchet-migrate
|
||||
|
||||
- name: Setup and start engine
|
||||
working-directory: .
|
||||
run: |
|
||||
export SEED_DEVELOPMENT=true
|
||||
export SERVER_PORT=8080
|
||||
export SERVER_URL=http://localhost:8080
|
||||
export SERVER_AUTH_COOKIE_DOMAIN=localhost
|
||||
export SERVER_AUTH_COOKIE_INSECURE=true
|
||||
export SERVER_DEFAULT_ENGINE_VERSION=V1
|
||||
export SERVER_MSGQUEUE_RABBITMQ_URL="amqp://user:password@localhost:5672/"
|
||||
|
||||
go run ./cmd/hatchet-admin quickstart
|
||||
|
||||
go run ./cmd/hatchet-engine --config ./generated/ > engine.log 2>&1 &
|
||||
go run ./cmd/hatchet-api --config ./generated/ > api.log 2>&1 &
|
||||
|
||||
sleep 30
|
||||
|
||||
- name: Generate API token
|
||||
working-directory: .
|
||||
run: |
|
||||
echo "HATCHET_CLIENT_TOKEN=$(go run ./cmd/hatchet-admin token create --config ./generated/ --tenant-id 707d0855-80ab-4e1f-a156-f1c4546cbf52)" >> $GITHUB_ENV
|
||||
echo "HATCHET_CLIENT_TLS_ROOT_CA_FILE=${{ github.workspace }}/certs/ca.cert" >> $GITHUB_ENV
|
||||
|
||||
- name: Clone main SDK source
|
||||
run: |
|
||||
git clone --depth=1 --branch main https://github.com/hatchet-dev/hatchet.git /tmp/old-sdk
|
||||
|
||||
- name: Install pnpm
|
||||
run: npm install -g pnpm@10.16.1
|
||||
|
||||
- name: Install old SDK dependencies
|
||||
working-directory: /tmp/old-sdk/sdks/typescript
|
||||
run: pnpm install
|
||||
|
||||
- name: Set HATCHET_CLIENT_NAMESPACE
|
||||
run: |
|
||||
SHORT_SHA=$(git rev-parse --short HEAD)
|
||||
echo "HATCHET_CLIENT_NAMESPACE=new-engine-old-sdk-ts-${SHORT_SHA}" >> $GITHUB_ENV
|
||||
|
||||
- name: Run e2e tests against new engine
|
||||
working-directory: /tmp/old-sdk/sdks/typescript
|
||||
run: |
|
||||
echo "Testing main SDK against current engine"
|
||||
echo "Using HATCHET_CLIENT_NAMESPACE: $HATCHET_CLIENT_NAMESPACE"
|
||||
pnpm test:e2e
|
||||
|
||||
- name: Upload engine logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: ${{ env.HATCHET_CLIENT_NAMESPACE }}-engine-logs
|
||||
path: engine.log
|
||||
|
||||
- name: Upload API logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: ${{ env.HATCHET_CLIENT_NAMESPACE }}-api-logs
|
||||
path: api.log
|
||||
|
||||
publish:
|
||||
runs-on: ubicloud-standard-4
|
||||
needs: [lint, test-unit, test-e2e]
|
||||
|
||||
Reference in New Issue
Block a user