From 521665c952e3034b91fdbe3462d8c78bde38c2f9 Mon Sep 17 00:00:00 2001 From: Artur Trzop Date: Sat, 4 Jan 2025 21:49:07 +0100 Subject: [PATCH 1/6] update(rspec docs): make more actionable "Run a subset of tests" by adding links to env vars --- docusaurus/docs/ruby/rspec.mdx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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) From c755a7d303e4c4e6787a103e5114872739d1f953 Mon Sep 17 00:00:00 2001 From: Artur Trzop Date: Sat, 4 Jan 2025 21:55:40 +0100 Subject: [PATCH 2/6] update(jest cookbook): add "Run a subset of tests" --- docusaurus/docs/jest/cookbook.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docusaurus/docs/jest/cookbook.md b/docusaurus/docs/jest/cookbook.md index fc20194c..b3d355c0 100644 --- a/docusaurus/docs/jest/cookbook.md +++ b/docusaurus/docs/jest/cookbook.md @@ -63,3 +63,12 @@ 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 have a couple of options: + +- `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) From a6481fa29f5e31103654c934d29101d7ad0e45a4 Mon Sep 17 00:00:00 2001 From: Artur Trzop Date: Mon, 6 Jan 2025 18:23:49 +0100 Subject: [PATCH 3/6] update(cypress cookbook): add "Run a subset of tests" --- docusaurus/docs/cypress/cookbook.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docusaurus/docs/cypress/cookbook.md b/docusaurus/docs/cypress/cookbook.md index fef61607..690e66c2 100644 --- a/docusaurus/docs/cypress/cookbook.md +++ b/docusaurus/docs/cypress/cookbook.md @@ -66,3 +66,12 @@ 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 have a couple of options: + +- `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) From 88421c91ba8b2cd08d91424e0ed37ff45968b87a Mon Sep 17 00:00:00 2001 From: Artur Trzop Date: Mon, 6 Jan 2025 18:26:19 +0100 Subject: [PATCH 4/6] update(vitest cookbook): add "Run a subset of tests" --- docusaurus/docs/vitest/cookbook.md | 15 +++++++++++++++ docusaurus/sidebars.ts | 5 +++++ 2 files changed, 20 insertions(+) create mode 100644 docusaurus/docs/vitest/cookbook.md diff --git a/docusaurus/docs/vitest/cookbook.md b/docusaurus/docs/vitest/cookbook.md new file mode 100644 index 00000000..83152d38 --- /dev/null +++ b/docusaurus/docs/vitest/cookbook.md @@ -0,0 +1,15 @@ +--- +pagination_next: null +pagination_prev: null +--- + +# Vitest Cookbook + +## Run a subset of tests + +To run a subset of your test suite you have a couple of options: + +- `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", From 158312c3f89594bd0cbf367bfd7ff6eb15e5ac80 Mon Sep 17 00:00:00 2001 From: Artur Trzop Date: Wed, 8 Jan 2025 12:30:14 +0100 Subject: [PATCH 5/6] Update docusaurus.rb --- _plugins/docusaurus.rb | 3 +++ 1 file changed, 3 insertions(+) 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") From b653d902a4d43bc877ba34232bf0aa32d3d3fdae Mon Sep 17 00:00:00 2001 From: Artur Trzop Date: Wed, 8 Jan 2025 12:35:19 +0100 Subject: [PATCH 6/6] update(js clients): use one level indentation for the "Run a subset of tests" cookbook --- docusaurus/docs/cypress/cookbook.md | 9 ++++----- docusaurus/docs/jest/cookbook.md | 9 ++++----- docusaurus/docs/vitest/cookbook.md | 9 ++++----- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/docusaurus/docs/cypress/cookbook.md b/docusaurus/docs/cypress/cookbook.md index 690e66c2..20d1a7c2 100644 --- a/docusaurus/docs/cypress/cookbook.md +++ b/docusaurus/docs/cypress/cookbook.md @@ -69,9 +69,8 @@ You should replace `$MY_CI_BUILD_ID` with the correct environment variable provi ## Run a subset of tests -To run a subset of your test suite you have a couple of options: +To run a subset of your test suite you can use the `KNAPSACK_PRO_TEST_FILE_*` environment variables: -- `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) +- [`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 b3d355c0..bd52fedc 100644 --- a/docusaurus/docs/jest/cookbook.md +++ b/docusaurus/docs/jest/cookbook.md @@ -66,9 +66,8 @@ Knapsack Pro will generate one XML reports for each batch of tests executed on t ## Run a subset of tests -To run a subset of your test suite you have a couple of options: +To run a subset of your test suite you can use the `KNAPSACK_PRO_TEST_FILE_*` environment variables: -- `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) +- [`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/vitest/cookbook.md b/docusaurus/docs/vitest/cookbook.md index 83152d38..f6a3d466 100644 --- a/docusaurus/docs/vitest/cookbook.md +++ b/docusaurus/docs/vitest/cookbook.md @@ -7,9 +7,8 @@ pagination_prev: null ## Run a subset of tests -To run a subset of your test suite you have a couple of options: +To run a subset of your test suite you can use the `KNAPSACK_PRO_TEST_FILE_*` environment variables: -- `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) +- [`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)