fix(ci): run influxdb3-core tests when test harness files change
Co-authored-by: jstirnaman <212227+jstirnaman@users.noreply.github.com>copilot/sub-pr-6810
parent
c6dc15c586
commit
0472cfd1c7
|
|
@ -39,12 +39,24 @@ jobs:
|
|||
exit 0
|
||||
fi
|
||||
|
||||
# For PRs, check if content files changed
|
||||
# For PRs, check if content or test harness files changed
|
||||
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}...${{ github.sha }} | grep '^content/.*\.md$' || true)
|
||||
CHANGED_HARNESS_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}...${{ github.sha }} | grep -E '^(test/|Dockerfile\.pytest|compose\.yaml)' || true)
|
||||
|
||||
if [[ -z "$CHANGED_FILES" ]]; then
|
||||
# If neither content nor harness files changed, skip tests
|
||||
if [[ -z "$CHANGED_FILES" && -z "$CHANGED_HARNESS_FILES" ]]; then
|
||||
echo "should-run=false" >> $GITHUB_OUTPUT
|
||||
echo "📝 No content changes detected - skipping code block tests"
|
||||
echo "📝 No relevant changes detected - skipping code block tests"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# If only harness files changed, run influxdb3-core tests
|
||||
if [[ -z "$CHANGED_FILES" && -n "$CHANGED_HARNESS_FILES" ]]; then
|
||||
echo "should-run=true" >> $GITHUB_OUTPUT
|
||||
PRODUCTS=("influxdb3-core")
|
||||
PRODUCTS_JSON=$(printf '%s\n' "${PRODUCTS[@]}" | jq -R . | jq -s -c .)
|
||||
echo "test-products=$PRODUCTS_JSON" >> $GITHUB_OUTPUT
|
||||
echo "✅ Test harness changes detected - running influxdb3-core tests"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
|
@ -115,6 +127,7 @@ jobs:
|
|||
mkdir -p content/influxdb/cloud
|
||||
mkdir -p content/influxdb/v2
|
||||
mkdir -p content/telegraf/v1
|
||||
mkdir -p content/influxdb3/core
|
||||
|
||||
cat > content/influxdb/cloud/.env.test << 'EOF'
|
||||
# Mock credentials for CI testing
|
||||
|
|
@ -138,6 +151,13 @@ jobs:
|
|||
INFLUX_TOKEN=mock_token_for_ci
|
||||
EOF
|
||||
|
||||
cat > content/influxdb3/core/.env.test << 'EOF'
|
||||
# Mock credentials for CI testing
|
||||
INFLUX_HOST=http://localhost:8181
|
||||
INFLUX_TOKEN=mock_token_for_ci
|
||||
INFLUX_DATABASE=mock_database
|
||||
EOF
|
||||
|
||||
echo "✅ Mock test credentials created"
|
||||
|
||||
- name: Run ${{ matrix.product }} code block tests
|
||||
|
|
|
|||
|
|
@ -91,6 +91,7 @@
|
|||
"test:codeblocks:cloud-dedicated": "./test/scripts/monitor-tests.sh start cloud-dedicated-pytest && docker compose run --name cloud-dedicated-pytest cloud-dedicated-pytest",
|
||||
"test:codeblocks:cloud-serverless": "docker compose run --rm --name cloud-serverless-pytest cloud-serverless-pytest",
|
||||
"test:codeblocks:clustered": "./test/scripts/monitor-tests.sh start clustered-pytest && docker compose run --name clustered-pytest clustered-pytest",
|
||||
"test:codeblocks:influxdb3-core": "docker compose run --rm --name influxdb3-core-pytest influxdb3-core-pytest",
|
||||
"test:codeblocks:telegraf": "docker compose run --rm --name telegraf-pytest telegraf-pytest",
|
||||
"test:codeblocks:v2": "docker compose run --rm --name v2-pytest v2-pytest",
|
||||
"test:codeblocks:stop-monitors": "./test/scripts/monitor-tests.sh stop cloud-dedicated-pytest && ./test/scripts/monitor-tests.sh stop clustered-pytest",
|
||||
|
|
|
|||
Loading…
Reference in New Issue