-
Notifications
You must be signed in to change notification settings - Fork 324
chore(ci): add code-block testing workflow #6810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 4 commits
b569d09
8925058
d739d58
ae646cb
83db31c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,219 @@ | ||||||
| name: Test Code Blocks | ||||||
|
|
||||||
| on: | ||||||
| pull_request: | ||||||
| paths: | ||||||
| - 'content/**/*.md' | ||||||
| - 'test/**' | ||||||
| - 'Dockerfile.pytest' | ||||||
| - 'compose.yaml' | ||||||
| types: [opened, synchronize, reopened] | ||||||
| workflow_dispatch: | ||||||
| inputs: | ||||||
| test_suite: | ||||||
| description: 'Test suite to run (all, cloud, v2, telegraf, or specific products)' | ||||||
| required: false | ||||||
| default: 'all' | ||||||
|
||||||
| default: 'all' | |
| default: 'influxdb3_core' |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| echo "test-products=[\"cloud\", \"v2\", \"telegraf\"]" >> $GITHUB_OUTPUT | |
| echo "test-products=[\"influxdb3_core\"]" >> $GITHUB_OUTPUT |
Copilot
AI
Feb 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the telegraf suite, the workflow writes mock credentials to content/telegraf/v1/.env.test, but the telegraf-pytest service mounts ./content/telegraf/.env.test to /app/.env.test (see compose.yaml). As-is, yarn test:codeblocks:telegraf in CI will fail because the expected env file isn’t present at the mount source. Write the mock file to content/telegraf/.env.test (and create content/telegraf/, not content/telegraf/v1/).
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,7 @@ test-results.xml | |
| /influxdb3cli-build-scripts/content | ||
| tmp | ||
| .tmp | ||
| .test-cache | ||
|
|
||
| # IDE files | ||
| .vscode/* | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -86,13 +86,21 @@ | |||||||||||||
| "test": "echo \"Run 'yarn test:e2e', 'yarn test:links', 'yarn test:codeblocks:all' or a specific test command. e2e and links test commands can take a glob of file paths to test. Some commands run automatically during the git pre-commit and pre-push hooks.\" && exit 0", | ||||||||||||||
| "test:codeblocks": "echo \"Run a specific codeblocks test command\" && exit 0", | ||||||||||||||
| "test:codeblocks:all": "docker compose --profile test up", | ||||||||||||||
| "test:codeblocks:parallel": "docker compose run --rm cloud-pytest & docker compose run --rm v2-pytest & docker compose run --rm telegraf-pytest & wait", | ||||||||||||||
|
||||||||||||||
| "test:codeblocks:parallel": "docker compose run --rm cloud-pytest & docker compose run --rm v2-pytest & docker compose run --rm telegraf-pytest & wait", | |
| "test:codeblocks:parallel": "docker compose run --rm cloud-pytest && docker compose run --rm v2-pytest && docker compose run --rm telegraf-pytest", |
Copilot
AI
Feb 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test:codeblocks:{python,bash,sql} commands use docker compose run ... cloud-pytest bash -c ..., but the cloud-pytest service has an entrypoint of /src/test/scripts/run-tests.sh pytest (see compose.yaml). As written, bash -c ... becomes arguments to run-tests.sh rather than executing your script, so these commands won’t work. Use --entrypoint bash (or add a dedicated service without the test runner entrypoint) when you need to run ad-hoc commands.
| "test:codeblocks:python": "echo 'Testing Python code blocks...' && docker compose run --rm cloud-pytest bash -c './test/scripts/test-by-language.sh python content/influxdb/cloud/**/*.md'", | |
| "test:codeblocks:bash": "echo 'Testing Bash/Shell code blocks...' && docker compose run --rm cloud-pytest bash -c './test/scripts/test-by-language.sh bash content/influxdb/cloud/**/*.md'", | |
| "test:codeblocks:sql": "echo 'Testing SQL code blocks...' && docker compose run --rm cloud-pytest bash -c './test/scripts/test-by-language.sh sql content/influxdb/cloud/**/*.md'", | |
| "test:codeblocks:python": "echo 'Testing Python code blocks...' && docker compose run --rm --entrypoint bash cloud-pytest -lc './test/scripts/test-by-language.sh python content/influxdb/cloud/**/*.md'", | |
| "test:codeblocks:bash": "echo 'Testing Bash/Shell code blocks...' && docker compose run --rm --entrypoint bash cloud-pytest -lc './test/scripts/test-by-language.sh bash content/influxdb/cloud/**/*.md'", | |
| "test:codeblocks:sql": "echo 'Testing SQL code blocks...' && docker compose run --rm --entrypoint bash cloud-pytest -lc './test/scripts/test-by-language.sh sql content/influxdb/cloud/**/*.md'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.