Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-019d2ced-ab0a-77ca-a5ae-685c7676235c Co-authored-by: Amp <amp@ampcode.com>
- Add bin/run-tests custom runner that maps .cs file paths to dotnet test --filter expressions by class name - Update bin/test to install bktec and configure custom runner with TEST_FILE_PATTERN=tests/**/*Tests.cs - Build solution upfront so run-tests can use --no-build - Add parallelism: 2 and API access token to pipeline step Amp-Thread-ID: https://ampcode.com/threads/T-019d2d0d-68c7-731c-b8dc-f482d3d473d4 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019d2d0d-68c7-731c-b8dc-f482d3d473d4 Co-authored-by: Amp <amp@ampcode.com>
bktec custom runner for test splitting
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd9670b053
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
nunit/bin/test
Outdated
|
|
||
| # Install Buildkite Test Engine Client | ||
| # See https://buildkite.com/docs/test-engine/test-splitting/client-installation | ||
| if [ -z "${BKTEC_VERSION}" ]; then |
There was a problem hiding this comment.
Use a nounset-safe BKTEC_VERSION guard
Because the script enables set -u, expanding "${BKTEC_VERSION}" here throws an unbound variable error when the variable is missing, so the intended diagnostic and exit path on the next lines never runs. In any environment where BKTEC_VERSION is not populated (for example local runs or CI misconfiguration), this causes a hard failure with a less actionable message than the script is explicitly trying to provide.
Useful? React with 👍 / 👎.
Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-019d2d0d-68c7-731c-b8dc-f482d3d473d4
Adds an NUnit/.NET example demonstrating test splitting with
bktecusingBUILDKITE_TEST_ENGINE_TEST_RUNNER=custom.Since
bktecdoesn't have built-in NUnit support, this example uses a custom runner to split.cstest files across parallel agents and map them todotnet test --filterexpressions.How it works
bin/testbuilds the solution, installsbktec, and configures the custom runner withBUILDKITE_TEST_ENGINE_TEST_FILE_PATTERN=tests/**/*Tests.csbktecdiscovers test files, gets a split plan from the API, and invokesbin/run-testswith the assigned filesbin/run-testsextracts class names from the.csfile paths and builds adotnet test --filter "FullyQualifiedName~.CalculatorTests|..."expressionPipeline details
parallelism: 2for test splitting across agentslanguage.name=dotnetandtest.framework.name=nunittagsTest suite
25 NUnit tests across 3 files:
CalculatorTests,StringUtilsTests,SimpleStackTests.