Skip to content

chore(api-tests): honour --base-url / VNEXT_BASE_URL and refresh runsettings wording - #18

Merged
yilmaztayfun merged 1 commit into
masterfrom
chore/base-url-and-runsettings-wording
Sep 8, 2026
Merged

yilmaztayfun merged 1 commit into
masterfrom
chore/base-url-and-runsettings-wording

Conversation

@yilmaztayfun

@yilmaztayfun yilmaztayfun commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • All api-tests/ Python scripts that hard-coded http://localhost:4201 now accept --base-url, defaulting to VNEXT_BASE_URL and then localhost:4201, so behaviour/load tests can target another domain or offset the same way the xUnit suite already does.
  • Fix a latent in-process call: race-load.py and perf-load.py load their sibling publish.py and call main(); with argparse added, main(argv=None, base_url=None) keeps that path working.
  • Refresh stale "uncomment VNEXT_BASE_URL" wording in TEST-SCENARIOS.md and three READMEs — the value is committed as set; the personal override lever is the git-ignored test.runsettings.local.

Changes

  • api-tests/chain-busy/*.py, data-integrity-lab/integrity-lab-test.py, l1-cache-lab/l1-cache-behaviour-test.py, script-race-lab/{race-load,publish}.py, script-perf-lab/{perf-load,publish}.py, secret-cache-lab/secret-cache-behaviour-test.py, subflow-orchestration/updatedata-concurrency-test.py
  • TEST-SCENARIOS.md, tests/Core.IntegrationTests/Tests/FanOut/README.md, tests/Core.IntegrationTests/Tests/RoleMatrixLab/README.md, api-tests/fan-out-documents/README.md

Test Plan

  • python3 -m py_compile and --help on all nine scripts.
  • VNEXT_BASE_URL=http://partner:4211/ → module BASE resolves to http://partner:4211/api/v1 (two scripts checked).
  • In-process publish.main(argv=[], base_url=...) with a foreign sys.argv raises a connection error, not an argparse error.
  • Optional: python3 api-tests/chain-busy/chain-busy-behaviour-test.py --list against a running runtime (behaviour unchanged on the default URL).

Notes

Companion of burgan-tech/vnext#974, which commits the integration-test contract (docs/testing/integration-testing.md) and the runtime-integration-test skill that points at these scripts.

🤖 Generated with Claude Code

Summary by Sourcery

Allow API tests to run against configurable runtime endpoints while refreshing integration-test configuration guidance.

New Features:

  • Enable API behavior and load test scripts to target configurable orchestrator URLs via --base-url or VNEXT_BASE_URL.

Bug Fixes:

  • Preserve in-process publishing for race and performance load tests without accidentally parsing the caller's command-line arguments.

Enhancements:

  • Align API test URL resolution with the existing integration-test configuration.
  • Clarify that the committed VNEXT_BASE_URL setting should remain enabled and that local overrides belong in the ignored runsettings file.

Documentation:

  • Update scenario and test README guidance for configuring the runtime URL and local runsettings overrides.

Tests:

  • Validate script compilation, CLI help, environment-based URL resolution, and in-process publishing behavior.

…s and refresh runsettings wording

- Every script under api-tests/ that hard-coded http://localhost:4201 now takes --base-url,
  defaulting to the VNEXT_BASE_URL environment variable and then to localhost:4201, so the
  behaviour/load tests can target a second domain or offset (e.g. partner on :4211) like the
  integration tests already can.
- publish.py (script-race-lab, script-perf-lab) gained main(argv=None, base_url=None):
  race-load.py and perf-load.py load it in-process and would otherwise have fed their own
  argv into its parser; they now pass argv=[] and their --base-url.
- TEST-SCENARIOS.md, Tests/FanOut, Tests/RoleMatrixLab and api-tests/fan-out-documents READMEs
  no longer tell the reader to "uncomment" VNEXT_BASE_URL — it has been committed as set for a
  while; they now say to verify it and to use the git-ignored test.runsettings.local for a
  different port, with the SDK's precedence order.

Companion of burgan-tech/vnext#974 (integration-test contract + runtime-integration-test skill).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@yilmaztayfun
yilmaztayfun requested review from a team September 8, 2026 12:27
@sourcery-ai

sourcery-ai Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

The PR makes all targeted API-test scripts honor VNEXT_BASE_URL or an explicit --base-url, including safe propagation through in-process publish calls, and updates integration-test documentation to reflect the committed runsettings value and local override workflow.

File-Level Changes

Change Details Files
Make the API-test scripts configurable against a runtime URL while preserving the existing local default.
  • Resolve the default from VNEXT_BASE_URL, falling back to localhost:4201.
  • Add --base-url to the behavior, load, and concurrency scripts.
  • Normalize the selected URL and append /api/v1 before requests.
api-tests/chain-busy/chain-busy-accept-test.py
api-tests/chain-busy/chain-busy-behaviour-test.py
api-tests/data-integrity-lab/integrity-lab-test.py
api-tests/l1-cache-lab/l1-cache-behaviour-test.py
api-tests/script-race-lab/race-load.py
api-tests/script-perf-lab/perf-load.py
api-tests/secret-cache-lab/secret-cache-behaviour-test.py
api-tests/subflow-orchestration/updatedata-concurrency-test.py
Preserve URL propagation when load tests invoke their sibling publish scripts in-process.
  • Change publish helpers to accept and forward the selected base URL.
  • Allow publish.main() to receive explicit argv and base_url values, avoiding consumption of the caller's sys.argv while retaining standalone CLI parsing.
api-tests/script-race-lab/race-load.py
api-tests/script-race-lab/publish.py
api-tests/script-perf-lab/perf-load.py
api-tests/script-perf-lab/publish.py
Align testing documentation with the committed runsettings configuration and new Python URL override.
  • Replace instructions to uncomment VNEXT_BASE_URL with guidance to verify the committed value.
  • Document test.runsettings.local as the git-ignored per-developer override.
  • Document VNEXT_BASE_URL and --base-url usage for Python behavior/load tests.
TEST-SCENARIOS.md
api-tests/fan-out-documents/README.md
tests/Core.IntegrationTests/Tests/FanOut/README.md
tests/Core.IntegrationTests/Tests/RoleMatrixLab/README.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 1edd8674-891f-4c09-b309-208e991cdcfe


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="api-tests/script-perf-lab/perf-load.py" line_range="340" />
<code_context>

     if args.publish:
         print("Publish:")
-        if not publish():
+        if not publish(args.base_url):
             return 1
</code_context>
<issue_to_address>
**issue (broader_impact):** `perf-load.py` still defaults its own `--base-url` to `http://localhost:4201`, so when only `VNEXT_BASE_URL` is set, `publish(args.base_url)` publishes to localhost instead of the configured orchestrator. The subsequent performance requests use the same hard-coded default and also ignore `VNEXT_BASE_URL`.

**Triggers:** When `perf-load.py` is run without `--base-url` and `VNEXT_BASE_URL` points to a non-default orchestrator.

**Suggested fix:** Give `perf-load.py` the same `DEFAULT_BASE_URL = os.environ.get(...)` default as the other scripts and use it for its argument parser.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 1 finding to address first, and the scripts now derive their API target from an environment variable or command-line argument, so a misconfigured value can publish definitions and run workflow tests against an unintended runtime. Reverting restores the previous localhost behavior, but any records or other test-side effects already created on the wrong runtime would need to be cleaned up separately.

Blocking findings: api-tests/script-perf-lab/perf-load.py:340


Sourcery is free for open source - if you like our reviews please consider sharing them ✨


if args.publish:
print("Publish:")
if not publish():

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (broader_impact): perf-load.py still defaults its own --base-url to http://localhost:4201, so when only VNEXT_BASE_URL is set, publish(args.base_url) publishes to localhost instead of the configured orchestrator. The subsequent performance requests use the same hard-coded default and also ignore VNEXT_BASE_URL.

Triggers: When perf-load.py is run without --base-url and VNEXT_BASE_URL points to a non-default orchestrator.

Suggested fix: Give perf-load.py the same DEFAULT_BASE_URL = os.environ.get(...) default as the other scripts and use it for its argument parser.

@yilmaztayfun yilmaztayfun self-assigned this Sep 8, 2026
@yilmaztayfun
yilmaztayfun merged commit 4a09354 into master Sep 8, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant