Skip to content

Move test resource setup from Python to Typescript#2438

Draft
SylvainSenechal wants to merge 2 commits into
development/2.15from
improvement/ZENKO-5077
Draft

Move test resource setup from Python to Typescript#2438
SylvainSenechal wants to merge 2 commits into
development/2.15from
improvement/ZENKO-5077

Conversation

@SylvainSenechal

Copy link
Copy Markdown
Contributor

Issue: ZENKO-5077

  • Moving the configuration of various resources needed for the tests (accounts, locations, buckets etc) from python to typescript. Integrating it directly with our existing functional tests library (no new javascript project).
    This change wasn't absolutely needed, but it was very cheap and easy to do with Claude, it goes toward aligning the codebase on a single programming language and a single typescript project, to ease future maintenance.
    It also open doors for later progressive refactoring of test configuration, as the code is now shared, cucumber/mocha test could directly call functions defined in this configuration folder
  • Bump functional test transitive dependencies to reduce dependabot noise

@bert-e

bert-e commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Hello sylvainsenechal,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

Comment thread tests/functional/testResourcesSetup/setup/buckets/ring.ts Outdated
@SylvainSenechal SylvainSenechal force-pushed the improvement/ZENKO-5077 branch from 36a43c8 to 352b2fb Compare June 12, 2026 17:10

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this one is completely removed, was not used

if (!env.DEPLOY_CRR_LOCATIONS) {
continue;
}
const accountName = location.name === env.CRR_DESTINATION_LOCATION_NAME

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Non-null assertions on env.CRR_DESTINATION_ACCOUNT_NAME! and env.CRR_SOURCE_ACCOUNT_NAME! bypass type checking without runtime validation. If these env vars are missing while DEPLOY_CRR_LOCATIONS is true, accountsCreds[undefined] silently returns undefined, producing a confusing TypeError: Cannot read properties of undefined (reading 'AccessKeyId'). The original Python used os.environ[...] which raised a clear KeyError. Add a guard before using them.

Suggested change
const accountName = location.name === env.CRR_DESTINATION_LOCATION_NAME
if (!env.CRR_SOURCE_ACCOUNT_NAME || !env.CRR_DESTINATION_ACCOUNT_NAME) {
throw new Error('CRR_SOURCE_ACCOUNT_NAME and CRR_DESTINATION_ACCOUNT_NAME are required when deploying CRR locations');
}
const accountName = location.name === env.CRR_DESTINATION_LOCATION_NAME

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

outdated

@SylvainSenechal SylvainSenechal force-pushed the improvement/ZENKO-5077 branch 2 times, most recently from 9f459d7 to 593dbfd Compare June 12, 2026 17:20
@scality scality deleted a comment from bert-e Jun 12, 2026
@bert-e

bert-e commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

Comment thread tests/functional/testResourcesSetup/setup/locations.ts Outdated
Comment thread tests/functional/testResourcesSetup/config.ts Outdated
@SylvainSenechal SylvainSenechal force-pushed the improvement/ZENKO-5077 branch from 593dbfd to 22104b7 Compare June 12, 2026 18:54
@SylvainSenechal SylvainSenechal force-pushed the improvement/ZENKO-5077 branch from 22104b7 to f69ac66 Compare June 12, 2026 18:55
ENABLE_RING_TESTS: process.env.ENABLE_RING_TESTS?.toLowerCase() !== 'false',
DEPLOY_CRR_LOCATIONS: process.env.DEPLOY_CRR_LOCATIONS?.toLowerCase() !== 'false',
CRR_ROLE_NAME: process.env.CRR_ROLE_NAME ?? 'crr-role',
CRR_SOURCE_ACCOUNT_NAME: requireEnv('CRR_SOURCE_ACCOUNT_NAME'),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CRR_SOURCE_ACCOUNT_NAME, CRR_DESTINATION_ACCOUNT_NAME, and CRR_DESTINATION_LOCATION_NAME are eagerly required via requireEnv at startup, but they're only consumed in locations.ts inside the DEPLOY_CRR_LOCATIONS guard. The original Python accessed them lazily (os.environ['CRR_SOURCE_ACCOUNT_NAME'] only inside the CRR block), so setup succeeded with DEPLOY_CRR_LOCATIONS=false even when these vars were unset. This could break environments (e.g. codespaces) where CRR is disabled and these vars aren't configured. Consider making them optional like the cloud-provider credentials above.

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.

2 participants