Skip to content

Refactor Execution profiles#417

Open
adespawn wants to merge 3 commits intoscylladb:mainfrom
adespawn:execution-profile
Open

Refactor Execution profiles#417
adespawn wants to merge 3 commits intoscylladb:mainfrom
adespawn:execution-profile

Conversation

@adespawn
Copy link
Contributor

This PR refactors Execution profiles, and some of the unit tests.

Fixes: #271 - This class was already supported and used across integration tests. I've ensured it's logic is used properly. Also moved unit tests related to this class from unit-not-supported to unit.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors ExecutionProfile handling and reorganizes unit tests so execution-profile/execution-options behavior is covered under the main unit test suite (aligning with the already-used integration coverage referenced in #271).

Changes:

  • Refactor ExecutionProfile from a function constructor to an ES6 class and explicitly reject graphOptions.
  • Add new unit test suites for ProfileManager and DefaultExecutionOptions.
  • Move a large set of basic/type/clientOptions/export API unit tests from unit-not-supported into unit.

Reviewed changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
lib/execution-profile.js Refactors ExecutionProfile to a class; adds graphOptions rejection; adjusts JSDoc/type-hint imports.
lib/client-options.js Updates JSDoc typing for profiles and removes the outdated TODO note.
test/unit/execution-profile-tests.js New unit tests for ProfileManager defaults and lookup behavior.
test/unit/execution-options-tests.js New unit tests for DefaultExecutionOptions resolution and defaults.
test/unit/basic-tests.js Imports/hosts moved tests previously under unit-not-supported into the main unit suite.
test/unit-not-supported/basic-tests.js Removes tests that were migrated to test/unit/basic-tests.js.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 31 to 46
/**
* Consistency level.
* @type {Number}
* @param {String} name Name of the execution profile.
* Use `'default'` to specify that the new instance should be the default {@link ExecutionProfile} if no
* profile is specified in the execution.
* @param {Object} [options] Profile options, when any of the options is not specified the {@link Client} will the use
* the ones defined in the default profile.
* @param {Number} [options.consistency] The consistency level to use for this profile.
* @param {LoadBalancingPolicy} [options.loadBalancing] The load-balancing policy to use for this profile.
* @param {Number} [options.readTimeout] The client per-host request timeout to use for this profile.
* @param {RetryPolicy} [options.retry] The retry policy to use for this profile.
* @param {Number} [options.serialConsistency] The serial consistency level to use for this profile.
* @param {LoadBalancingPolicy} [options.loadBalancing] The load-balancing policy to use for this profile.
* @param {Number} [options.readTimeout] The client per-host request timeout to use for this profile.
* @param {RetryPolicy} [options.retry] The retry policy to use for this profile.
* @param {Number} [options.serialConsistency] The serial consistency level to use for this profile.
*/
Same as always, automatic refactor with manual changes to the documentation
This option was already supported through JS part of the code
Some of the unit tests from not supported (working but not revived)
can now be considered fully supported (were updated for the use in this driver)
@adespawn adespawn force-pushed the execution-profile branch from d70a556 to cc137b1 Compare March 19, 2026 17:07
@adespawn adespawn requested a review from Copilot March 19, 2026 17:07
@adespawn adespawn self-assigned this Mar 19, 2026
@adespawn adespawn added this to the GA milestone Mar 19, 2026
@adespawn adespawn added the area/configuration Anything releated to configuring the driver label Mar 19, 2026
@adespawn adespawn review requested due to automatic review settings March 19, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/configuration Anything releated to configuring the driver

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for ExecutionProfile class

2 participants