diff --git a/_plugins/docusaurus.rb b/_plugins/docusaurus.rb index 8320b7ad..66779df0 100644 --- a/_plugins/docusaurus.rb +++ b/_plugins/docusaurus.rb @@ -47,6 +47,9 @@ def system!(*args) system!("mkdir -p _site/vitest/reference") system!("cp docusaurus/build/vitest/reference/index.html _site/vitest/reference") + system!("mkdir -p _site/vitest/cookbook") + system!("cp docusaurus/build/vitest/cookbook/index.html _site/vitest/cookbook") + system!("mkdir -p _site/vitest/troubleshooting") system!("cp docusaurus/build/vitest/troubleshooting/index.html _site/vitest/troubleshooting") diff --git a/docusaurus/docs/cypress/cookbook.md b/docusaurus/docs/cypress/cookbook.md index fef61607..20d1a7c2 100644 --- a/docusaurus/docs/cypress/cookbook.md +++ b/docusaurus/docs/cypress/cookbook.md @@ -66,3 +66,11 @@ You should replace `$MY_CI_BUILD_ID` with the correct environment variable provi | Semaphore 2.0 | `SEMAPHORE_WORKFLOW_ID` | | Travis | `TRAVIS_BUILD_ID` | | Codefresh.io | `CF_BUILD_ID` | + +## Run a subset of tests + +To run a subset of your test suite you can use the `KNAPSACK_PRO_TEST_FILE_*` environment variables: + +- [`KNAPSACK_PRO_TEST_FILE_PATTERN`](reference.md#knapsack_pro_test_file_pattern) +- [`KNAPSACK_PRO_TEST_FILE_EXCLUDE_PATTERN`](reference.md#knapsack_pro_test_file_exclude_pattern) +- [`KNAPSACK_PRO_TEST_FILE_LIST_SOURCE_FILE`](reference.md#knapsack_pro_test_file_list_source_file) diff --git a/docusaurus/docs/jest/cookbook.md b/docusaurus/docs/jest/cookbook.md index fc20194c..bd52fedc 100644 --- a/docusaurus/docs/jest/cookbook.md +++ b/docusaurus/docs/jest/cookbook.md @@ -63,3 +63,11 @@ npx knapsack-pro-jest --ci --reporters=jest-junit ``` Knapsack Pro will generate one XML reports for each batch of tests executed on the CI node. Some CI providers (e.g., GitLab CI) can merge multiple XML files from parallel CI nodes. + +## Run a subset of tests + +To run a subset of your test suite you can use the `KNAPSACK_PRO_TEST_FILE_*` environment variables: + +- [`KNAPSACK_PRO_TEST_FILE_PATTERN`](reference.md#knapsack_pro_test_file_pattern) +- [`KNAPSACK_PRO_TEST_FILE_EXCLUDE_PATTERN`](reference.md#knapsack_pro_test_file_exclude_pattern) +- [`KNAPSACK_PRO_TEST_FILE_LIST_SOURCE_FILE`](reference.md#knapsack_pro_test_file_list_source_file) diff --git a/docusaurus/docs/ruby/rspec.mdx b/docusaurus/docs/ruby/rspec.mdx index 6f893fb8..306d7ede 100644 --- a/docusaurus/docs/ruby/rspec.mdx +++ b/docusaurus/docs/ruby/rspec.mdx @@ -45,8 +45,12 @@ bundle exec rake "knapsack_pro:queue:rspec[--fail-fast 3]" To run a subset of your test suite you have a couple of options: -- `KNAPSACK_PRO_TEST_FILE_*` [environment variables](reference.md) (recommended) -- RSpec's `--tag MY_TAG`, `--tag ~MY_TAG`, `--tag type:feature`, or `--tag ~type:feature` +- `KNAPSACK_PRO_TEST_FILE_*` environment variables (recommended): + - [`KNAPSACK_PRO_TEST_FILE_PATTERN`](reference.md#knapsack_pro_test_file_pattern) + - [`KNAPSACK_PRO_TEST_FILE_EXCLUDE_PATTERN`](reference.md#knapsack_pro_test_file_exclude_pattern) + - [`KNAPSACK_PRO_TEST_FILE_LIST_SOURCE_FILE`](reference.md#knapsack_pro_test_file_list_source_file) + - [`KNAPSACK_PRO_TEST_FILE_LIST`](reference.md#knapsack_pro_test_file_list) +- RSpec's `--tag MY_TAG`, `--tag ~MY_TAG`, `--tag type:feature`, or `--tag ~type:feature`. See how to [pass command-line arguments](reference.md#command-line-arguments) here. If you are seeking faster performance on your CI, you may want to read [Parallelize test examples (instead of files)](#parallelize-test-examples-instead-of-files) diff --git a/docusaurus/docs/vitest/cookbook.md b/docusaurus/docs/vitest/cookbook.md new file mode 100644 index 00000000..f6a3d466 --- /dev/null +++ b/docusaurus/docs/vitest/cookbook.md @@ -0,0 +1,14 @@ +--- +pagination_next: null +pagination_prev: null +--- + +# Vitest Cookbook + +## Run a subset of tests + +To run a subset of your test suite you can use the `KNAPSACK_PRO_TEST_FILE_*` environment variables: + +- [`KNAPSACK_PRO_TEST_FILE_PATTERN`](reference.md#knapsack_pro_test_file_pattern) +- [`KNAPSACK_PRO_TEST_FILE_EXCLUDE_PATTERN`](reference.md#knapsack_pro_test_file_exclude_pattern) +- [`KNAPSACK_PRO_TEST_FILE_LIST_SOURCE_FILE`](reference.md#knapsack_pro_test_file_list_source_file) diff --git a/docusaurus/sidebars.ts b/docusaurus/sidebars.ts index 16840893..77849632 100644 --- a/docusaurus/sidebars.ts +++ b/docusaurus/sidebars.ts @@ -244,6 +244,11 @@ const sidebars: SidebarsConfig = { label: "Troubleshooting", id: "vitest/troubleshooting", }, + { + type: "doc", + label: "Cookbook", + id: "vitest/cookbook", + }, { type: "link", label: "GitHub",