Skip to content

fix(bulker) small tweak. fix test #293

fix(bulker) small tweak. fix test

fix(bulker) small tweak. fix test #293

Workflow file for this run

name: 🧪Lint and Test
on:
push:
pull_request:
workflow_dispatch:
env:
# The jitsu-builder container has Playwright browsers binaries preinstalled on this path:
PLAYWRIGHT_BROWSERS_PATH: /root/.cache/ms-playwright
BETA_BRANCH: newjitsu
STABLE_BRANCH: stable-services
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint-and-format:
name: ✨ Lint & Test
timeout-minutes: 20
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
packages: write
steps:
- name: 📥 Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: 🔍 Check changed files
id: changes
uses: dorny/paths-filter@v3
with:
filters: |
playwright:
- 'libs/jitsu-js/**'
- '**/playwright/**'
- '**/*.spec.ts'
- '**/playwright.config.ts'
nodejs:
- 'cli/**'
- 'libs/**'
- 'services/**'
- 'types/**'
- 'webapps/**'
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- name: 🚀 Setup Turbo cache
if: steps.changes.outputs.nodejs == 'true'
uses: actions/cache@v4
with:
path: |
.turbo
**/node_modules/.cache
key: ${{ runner.os }}-turbo-lint-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-turbo-lint-
- name: 🐳 Pull and start builder container
if: steps.changes.outputs.nodejs == 'true'
run: |
docker pull jitsucom/jitsu-builder:latest
docker run -d --name builder -v ${{ github.workspace }}:/workspace -w /workspace -e CI=true jitsucom/jitsu-builder:latest tail -f /dev/null
- name: 📦 Fetch dependencies from store
if: steps.changes.outputs.nodejs == 'true'
run: |
docker exec builder sh -c 'echo "pnpm store path: $(pnpm store path)"'
docker exec builder pnpm fetch
- name: 📦 Install dependencies
if: steps.changes.outputs.nodejs == 'true'
run: docker exec builder pnpm install --frozen-lockfile --offline
- name: ✨ Check code format
if: steps.changes.outputs.nodejs == 'true'
run: docker exec builder pnpm format:check:all
- name: 🔧 Run codegen
if: steps.changes.outputs.nodejs == 'true'
run: docker exec builder pnpm codegen
- name: 🧪️ Run Typecheck
if: steps.changes.outputs.nodejs == 'true'
run: docker exec builder pnpm typecheck
- name: 🧪 Run linter
if: steps.changes.outputs.nodejs == 'true'
run: docker exec builder pnpm lint
- name: 🧪 Run tests
if: steps.changes.outputs.nodejs == 'true'
run: docker exec builder pnpm test
- name: 🎭 Run Playwright tests
if: steps.changes.outputs.nodejs == 'true' && steps.changes.outputs.playwright == 'true'
# Note: build of @jitsu/js and all it's dep is required for playwright tests to work
run: |
docker exec builder pnpm --filter jsondiffpatch --filter @jitsu/js build
docker exec builder pnpm test:playwright
- name: 🧹 Cleanup container
if: always() && steps.changes.outputs.nodejs == 'true'
run: docker stop builder && docker rm builder
bulker-test:
name: 🧪 Bulker Test
timeout-minutes: 60
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: 📥 Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: 🔍 Check changed files
id: changes
uses: dorny/paths-filter@v3
with:
filters: |
bulker:
- 'bulker/**'
- name: Set up Go
if: steps.changes.outputs.bulker == 'true'
uses: actions/setup-go@v6
with:
go-version: '1.25'
cache-dependency-path: "bulker/**/*.sum"
check-latest: true
# cache: false
- name: 🧪 Run Bulker tests
if: steps.changes.outputs.bulker == 'true'
working-directory: ./bulker
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
BULKER_TEST_BIGQUERY: ${{ secrets.BULKER_TEST_BIGQUERY }}
BULKER_TEST_REDSHIFT_IAM: ${{ secrets.BULKER_TEST_REDSHIFT_IAM }}
BULKER_TEST_S3: ${{ secrets.BULKER_TEST_S3 }}
BULKER_TEST_MOTHERDUCK: ${{ secrets.BULKER_TEST_MOTHERDUCK }}
# BULKER_TEST_REDSHIFT: ${{ secrets.BULKER_TEST_REDSHIFT }}
BULKER_TEST_REDSHIFT_SERVERLESS: ${{ secrets.BULKER_TEST_REDSHIFT_SERVERLESS }}
BULKER_TEST_SNOWFLAKE: ${{ secrets.BULKER_TEST_SNOWFLAKE }}
BULKER_TEST_MILLION_ROWS_BATCHED: postgres
TESTCONTAINERS_RYUK_DISABLED: true
run: |
go test -parallel=10 -timeout 60m -json ./jitsubase/... ./kafkabase/... ./eventslog/... ./bulkerlib/... ./bulkerapp/... > test_report.json
- name: 📊 Generate test report
if: always() && steps.changes.outputs.bulker == 'true'
working-directory: ./bulker
run: |
go install github.com/vakenbolt/go-test-report@latest
cat test_report.json | ~/go/bin/go-test-report
- name: 📤 Upload test artifacts
if: always() && steps.changes.outputs.bulker == 'true'
uses: actions/upload-artifact@v4
with:
name: bulker-test-report
path: |
bulker/test_report.html
bulker/test_report.json
notify:
name: 📢 Notify
needs: [lint-and-format, bulker-test]
if: always() && github.ref == 'refs/heads/newjitsu'
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
packages: write
steps:
- name: 📥 Checkout code
uses: actions/checkout@v4
- name: 📝 Get short SHA
id: short-sha
run: echo "sha=$(git rev-parse --short=7 HEAD)" >> $GITHUB_OUTPUT
- name: 🔍 Check job statuses
id: status
run: |
if [[ "${{ needs.lint-and-format.result }}" == "success" && "${{ needs.bulker-test.result }}" == "success" ]]; then
echo "success=true" >> $GITHUB_OUTPUT
echo "color=#36a64f" >> $GITHUB_OUTPUT
echo "header=✅ Lint & Test on branch \`${{ github.ref_name }}\` SUCCEEDED" >> $GITHUB_OUTPUT
else
echo "success=false" >> $GITHUB_OUTPUT
echo "color=#ff0000" >> $GITHUB_OUTPUT
FAILED_JOBS=""
[[ "${{ needs.lint-and-format.result }}" != "success" ]] && FAILED_JOBS="lint-and-format"
[[ "${{ needs.bulker-test.result }}" != "success" ]] && FAILED_JOBS="$FAILED_JOBS bulker-test"
echo "header=❌ Lint & Test on branch \`${{ github.ref_name }}\` FAILED ($FAILED_JOBS)" >> $GITHUB_OUTPUT
fi
- name: 💬 Send notification to Slack
uses: ./.github/actions/slack-notify
with:
slack_webhook_url: ${{ secrets.CI_SLACK_WEBHOOK }}
color: ${{ steps.status.outputs.color }}
header: ${{ steps.status.outputs.header }}
blocks: |
- title: Commit
value: ${{ steps.short-sha.outputs.sha }}
url: ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}
- title: Commit message
value: ${{ toJSON(github.event.head_commit.message) }}
is_code: true
- title: Workflow run
value: ${{ steps.status.outputs.success == 'true' && 'View workflow run' || 'View failed run' }}
url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- title: Triggered by
value: ${{ github.actor }}
deploy:
name: 🐳 Build Docker Images
needs: [lint-and-format, bulker-test]
if: github.event_name == 'push' && (github.ref == 'refs/heads/newjitsu' || github.ref == 'refs/heads/stable-services')
permissions:
contents: write
issues: write
pull-requests: write
packages: write
id-token: write
uses: ./.github/workflows/services-build.yaml
secrets: inherit
# Note: skip_install doesn't work as packages are installed inside docker
deploy-client-libraries:
name: 📦 Build Client Libraries
needs: [lint-and-format]
if: github.event_name == 'push' && (github.ref == 'refs/heads/newjitsu' || github.ref == 'refs/heads/stable-jsclient')
permissions:
contents: write
issues: write
pull-requests: write
packages: read
id-token: write
uses: ./.github/workflows/client-libraries-build.yaml
secrets: inherit
# Note: skip_install doesn't work as packages are installed inside docker