From 90bc02b66ca7c65ac9aa88b6807ffd5879f63433 Mon Sep 17 00:00:00 2001 From: barkha06 Date: Wed, 14 Oct 2026 20:34:15 +0530 Subject: [PATCH 1/6] added edge server jenkins support for JS replication tests --- jenkins/pipelines/QE/es/Jenkinsfile | 58 ++++++++++++++----- jenkins/pipelines/QE/es/setup_test.py | 14 ++++- jenkins/pipelines/QE/es/teardown.sh | 7 ++- jenkins/pipelines/QE/es/test.sh | 5 +- .../es/topologies/3es_1sgw_1js_topology.json | 33 +++++++++++ 5 files changed, 100 insertions(+), 17 deletions(-) create mode 100644 jenkins/pipelines/QE/es/topologies/3es_1sgw_1js_topology.json diff --git a/jenkins/pipelines/QE/es/Jenkinsfile b/jenkins/pipelines/QE/es/Jenkinsfile index 54f623eeb..c6aff4c5c 100644 --- a/jenkins/pipelines/QE/es/Jenkinsfile +++ b/jenkins/pipelines/QE/es/Jenkinsfile @@ -4,10 +4,13 @@ pipeline { string(name: 'ES_VERSION', defaultValue: '1.0.1', description: 'Edge Server version') choice(name: 'TEST_DIR', choices: ['both','QE', 'dev_e2e'], description: 'Edge Server test directory: tests/QE/edge_server, tests/dev_e2e/edge_server, or both') string(name: 'TEST_NAME', defaultValue: '.', description: '"." runs all tests in TEST_DIR; anything else is passed to pytest -k (not allowed with TEST_DIR=both)') - string(name: 'TOPOLOGY_NAME', defaultValue: 'es_sgw_topology.json', description: 'Topology file name') + string(name: 'TOPOLOGY_NAME', defaultValue: 'es_sgw_topology.json', description: 'Topology file name. 3es_1sgw_1js_topology.json also runs a CBL-JS test server on the Jenkins agent (localhost), and needs CBL_VERSION.') + string(name: 'CBL_VERSION', defaultValue: '', description: 'CBL-JS version-build for a topology with a JS test server (e.g. 1.1.0-25). Leave empty for topologies without test servers.') + booleanParam(name: 'RUN_PREBUILD', defaultValue: true, description: 'Prebuild the JS test server for CBL_VERSION. Uncheck to reuse existing artifacts.') string(name: 'SGW_VERSION', defaultValue: '', description: 'Sync Gateway version (leave empty to skip SGW/CBS provisioning)') string(name: 'CBS_VERSION', defaultValue: '', description: 'Couchbase Server version (leave empty to skip SGW/CBS provisioning)') string(name: 'TS_DATASET_VERSION', defaultValue: '4.0', description: 'The version of the dataset to use on the test servers') + booleanParam(name: 'JS_REPLICATION_TESTS_ONLY', defaultValue:true, description:'Only CBL JS tests that run using edge server') } options { ansiColor('xterm') @@ -20,8 +23,26 @@ pipeline { if (params.ES_VERSION == '') { error "ES_VERSION is required" } if (params.TEST_NAME == '') { error "TEST_NAME is required" } if (params.TEST_DIR == 'both' && params.TEST_NAME != '.') { error "TEST_NAME must be '.' when TEST_DIR is 'both'" } + if (params.TOPOLOGY_NAME.contains('_js') && !params.CBL_VERSION) { error "CBL_VERSION is required for ${params.TOPOLOGY_NAME}" } + if (params.CBL_VERSION && !(params.CBL_VERSION ==~ /\d+\.\d+\.\d+-\d+/)) { error "CBL_VERSION must be -, e.g. 1.1.0-25" } currentBuild.displayName = "ES:${params.ES_VERSION} (#${currentBuild.number})" - currentBuild.description = "${params.TEST_DIR}: ${params.TEST_NAME} | SGW: ${params.SGW_VERSION ?: 'none'} | CBS: ${params.CBS_VERSION ?: 'none'}" + currentBuild.description = "${params.TEST_DIR}: ${params.TEST_NAME} | SGW: ${params.SGW_VERSION ?: 'none'} | CBS: ${params.CBS_VERSION ?: 'none'} | CBL-JS: ${params.CBL_VERSION ?: 'none'}" + } + } + } + stage('Prebuild JS Test Server') { + when { beforeAgent true; expression { params.CBL_VERSION && params.RUN_PREBUILD } } + steps { + script { + def (cblVersion, cblBuild) = params.CBL_VERSION.tokenize('-') + build job: 'prebuild-test-server', + parameters: [ + string(name: 'TS_PLATFORM', value: 'js'), + string(name: 'CBL_VERSION', value: cblVersion), + string(name: 'CBL_BUILD', value: cblBuild) + ], + wait: true, + propagate: true } } } @@ -37,17 +58,28 @@ pipeline { // Unlock keychain: sh 'security unlock-keychain -p ${KEYCHAIN_PASSWORD} ~/Library/Keychains/login.keychain-db' echo "=== Run Edge server Tests" - timeout(time: 60, unit: 'MINUTES') { - sh """ - jenkins/pipelines/QE/es/test.sh \ - "${params.ES_VERSION}" \ - "${params.TEST_NAME}" \ - "${params.TOPOLOGY_NAME}" \ - "${params.SGW_VERSION}" \ - "${params.CBS_VERSION}" \ - "${params.TS_DATASET_VERSION}" \ - "${params.TEST_DIR}" - """ + script { + def runTests = { + timeout(time: 60, unit: 'MINUTES') { + sh """ + jenkins/pipelines/QE/es/test.sh \ + "${params.ES_VERSION}" \ + "${params.TEST_NAME}" \ + "${params.TOPOLOGY_NAME}" \ + "${params.SGW_VERSION}" \ + "${params.CBS_VERSION}" \ + "${params.TS_DATASET_VERSION}" \ + "${params.TEST_DIR}" \ + "${params.CBL_VERSION}" + """ + } + } + // The JS test server runs on this agent at localhost:5173, so only one such run per agent. + if (params.CBL_VERSION) { + lock("${env.NODE_NAME}-js-test-server") { runTests() } + } else { + runTests() + } } echo "=== Edge server Tests Complete" } diff --git a/jenkins/pipelines/QE/es/setup_test.py b/jenkins/pipelines/QE/es/setup_test.py index e69c298a8..209deaeec 100755 --- a/jenkins/pipelines/QE/es/setup_test.py +++ b/jenkins/pipelines/QE/es/setup_test.py @@ -28,10 +28,12 @@ def generate_topology( topology_out: Path, sgw_version: str | None = None, cbs_version: str | None = None, + cbl_version: str | None = None, tag: str = "es", ) -> None: """ - Generate a topology JSON without injecting implicit CBS/SGW defaults. + Generate a topology JSON without injecting implicit CBS/SGW defaults. A topology with test + servers (such as the localhost JS test server) needs `cbl_version`, the CBL version to run. """ with topology_in.open() as f: @@ -49,6 +51,12 @@ def generate_topology( if cbs: for cb in cbs: cb["version"] = cbs_version + test_servers = topology.get("test_servers") + if test_servers: + if not cbl_version: + raise click.UsageError(f"{topology_in.name} has test servers, so --cbl-version is required") + for ts in test_servers: + ts["cbl_version"] = cbl_version topology_out.parent.mkdir(parents=True, exist_ok=True) with topology_out.open("w") as f: @@ -66,12 +74,14 @@ def generate_topology( ) @click.option("--sgw-version", default=None, help="Provision Sync Gateway (omit for latest release)") @click.option("--cbs-version", default=None, help="Provision Couchbase Server (omit for latest release)") +@click.option("--cbl-version", default=None, help="CBL version-build for the topology's test servers, e.g. 1.1.0-25") @click.option("--config-file", default="config.json", help="Backend config file") def main( es_version: str, topology_file: Path, sgw_version: str | None, cbs_version: str | None, + cbl_version: str | None, config_file: str, ) -> None: topology_out = SCRIPT_DIR.parents[3] / "environment" / "aws" / "topology_setup" / "topology.json" @@ -89,6 +99,7 @@ def main( click.echo(f"Topology File : {topology_file}") click.echo(f"SGW Version : {sgw_version}") click.echo(f"CBS Version : {cbs_version}") + click.echo(f"CBL Version : {cbl_version or '(no test servers)'}") click.echo() generate_topology( es_version=es_version, @@ -96,6 +107,7 @@ def main( topology_out=topology_out, sgw_version=sgw_version, cbs_version=cbs_version, + cbl_version=cbl_version, ) topology_obj = TopologyConfig(str(topology_out)) diff --git a/jenkins/pipelines/QE/es/teardown.sh b/jenkins/pipelines/QE/es/teardown.sh index 132d90fe8..f99605c15 100755 --- a/jenkins/pipelines/QE/es/teardown.sh +++ b/jenkins/pipelines/QE/es/teardown.sh @@ -6,4 +6,9 @@ SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) source $SCRIPT_DIR/../../shared/config.sh pushd $AWS_ENVIRONMENT_DIR -uv run ./stop_backend.py +# Passing the generated topology also stops its test servers, such as the JS test server on localhost. +if [ -f topology_setup/topology.json ]; then + uv run ./stop_backend.py --topology topology_setup/topology.json +else + uv run ./stop_backend.py +fi diff --git a/jenkins/pipelines/QE/es/test.sh b/jenkins/pipelines/QE/es/test.sh index 12eb90d33..fe02deaa2 100755 --- a/jenkins/pipelines/QE/es/test.sh +++ b/jenkins/pipelines/QE/es/test.sh @@ -9,7 +9,8 @@ TOPOLOGY_NAME="${3:-es_sgw_topology.json}" SGW_VERSION="${4:-}" CBS_VERSION="${5:-}" DATASET_VERSION="${6:-4.0}" -TEST_DIR="${7:-QE}" # QE | dev_e2e | both +TEST_DIR="${7:-QE}" # QE | dev_e2e | both +CBL_VERSION="${8:-}" # version-build for the topology's test servers (e.g. the localhost JS test server) TOPOLOGY_FILE="$SCRIPT_DIR/topologies/$TOPOLOGY_NAME" if [ -z "$SGW_VERSION" ]; then @@ -45,7 +46,7 @@ if [ "$TEST_NAME" != "." ]; then fi echo "Setup backend..." -uv run $SCRIPT_DIR/setup_test.py $ES_VERSION $TOPOLOGY_FILE --sgw-version "${SGW_VERSION:-}" --cbs-version "${CBS_VERSION:-}" +uv run $SCRIPT_DIR/setup_test.py $ES_VERSION $TOPOLOGY_FILE --sgw-version "${SGW_VERSION:-}" --cbs-version "${CBS_VERSION:-}" --cbl-version "${CBL_VERSION:-}" export COLUMNS=200 TEST_RESULT=0 diff --git a/jenkins/pipelines/QE/es/topologies/3es_1sgw_1js_topology.json b/jenkins/pipelines/QE/es/topologies/3es_1sgw_1js_topology.json new file mode 100644 index 000000000..b4562ef03 --- /dev/null +++ b/jenkins/pipelines/QE/es/topologies/3es_1sgw_1js_topology.json @@ -0,0 +1,33 @@ +{ + "$schema": "./../../../../../environment/aws/topology_setup/topology_schema.json", + "edge_servers": [ + { + "version": "{{version}}" + }, + { + "version": "{{version}}" + }, + { + "version": "{{version}}" + } + ], + "clusters": [ + { + "server_count": 1 + } + ], + "sync_gateways": [ + { + "cluster": 0 + } + ], + "test_servers": [ + { + "platform": "js", + "cbl_version": "{{version}}", + "location": "localhost", + "download": true + } + ], + "logslurp": true +} \ No newline at end of file From c54c29f24e64c7e4a650f8138f97d81504432704 Mon Sep 17 00:00:00 2001 From: barkha06 Date: Wed, 14 Oct 2026 20:36:23 +0530 Subject: [PATCH 2/6] added JS only support for JS regression runs --- jenkins/pipelines/QE/es/Jenkinsfile | 13 +++++++++---- jenkins/pipelines/QE/es/test.sh | 14 +++++++++++--- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/jenkins/pipelines/QE/es/Jenkinsfile b/jenkins/pipelines/QE/es/Jenkinsfile index c6aff4c5c..7065c4fab 100644 --- a/jenkins/pipelines/QE/es/Jenkinsfile +++ b/jenkins/pipelines/QE/es/Jenkinsfile @@ -10,7 +10,7 @@ pipeline { string(name: 'SGW_VERSION', defaultValue: '', description: 'Sync Gateway version (leave empty to skip SGW/CBS provisioning)') string(name: 'CBS_VERSION', defaultValue: '', description: 'Couchbase Server version (leave empty to skip SGW/CBS provisioning)') string(name: 'TS_DATASET_VERSION', defaultValue: '4.0', description: 'The version of the dataset to use on the test servers') - booleanParam(name: 'JS_REPLICATION_TESTS_ONLY', defaultValue:true, description:'Only CBL JS tests that run using edge server') + booleanParam(name: 'JS_REPLICATION_TESTS_ONLY', defaultValue: true, description: 'Run only the tests that replicate with the CBL-JS test server (those marked min_test_servers, all in tests/QE/edge_server). Needs a topology with a JS test server. TEST_NAME still narrows them with -k; TEST_DIR is ignored.') } options { ansiColor('xterm') @@ -22,11 +22,15 @@ pipeline { script { if (params.ES_VERSION == '') { error "ES_VERSION is required" } if (params.TEST_NAME == '') { error "TEST_NAME is required" } - if (params.TEST_DIR == 'both' && params.TEST_NAME != '.') { error "TEST_NAME must be '.' when TEST_DIR is 'both'" } + if (params.TEST_DIR == 'both' && params.TEST_NAME != '.' && !params.JS_REPLICATION_TESTS_ONLY) { error "TEST_NAME must be '.' when TEST_DIR is 'both'" } if (params.TOPOLOGY_NAME.contains('_js') && !params.CBL_VERSION) { error "CBL_VERSION is required for ${params.TOPOLOGY_NAME}" } if (params.CBL_VERSION && !(params.CBL_VERSION ==~ /\d+\.\d+\.\d+-\d+/)) { error "CBL_VERSION must be -, e.g. 1.1.0-25" } + if (params.JS_REPLICATION_TESTS_ONLY && !params.TOPOLOGY_NAME.contains('_js')) { + error "JS_REPLICATION_TESTS_ONLY needs a topology with a JS test server (e.g. 3es_1sgw_1js_topology.json); ${params.TOPOLOGY_NAME} has none, so every selected test would be skipped" + } + def scope = params.JS_REPLICATION_TESTS_ONLY ? "QE (JS replication only)" : params.TEST_DIR currentBuild.displayName = "ES:${params.ES_VERSION} (#${currentBuild.number})" - currentBuild.description = "${params.TEST_DIR}: ${params.TEST_NAME} | SGW: ${params.SGW_VERSION ?: 'none'} | CBS: ${params.CBS_VERSION ?: 'none'} | CBL-JS: ${params.CBL_VERSION ?: 'none'}" + currentBuild.description = "${scope}: ${params.TEST_NAME} | SGW: ${params.SGW_VERSION ?: 'none'} | CBS: ${params.CBS_VERSION ?: 'none'} | CBL-JS: ${params.CBL_VERSION ?: 'none'}" } } } @@ -70,7 +74,8 @@ pipeline { "${params.CBS_VERSION}" \ "${params.TS_DATASET_VERSION}" \ "${params.TEST_DIR}" \ - "${params.CBL_VERSION}" + "${params.CBL_VERSION}" \ + "${params.JS_REPLICATION_TESTS_ONLY}" """ } } diff --git a/jenkins/pipelines/QE/es/test.sh b/jenkins/pipelines/QE/es/test.sh index fe02deaa2..6a12b7f0c 100755 --- a/jenkins/pipelines/QE/es/test.sh +++ b/jenkins/pipelines/QE/es/test.sh @@ -9,8 +9,9 @@ TOPOLOGY_NAME="${3:-es_sgw_topology.json}" SGW_VERSION="${4:-}" CBS_VERSION="${5:-}" DATASET_VERSION="${6:-4.0}" -TEST_DIR="${7:-QE}" # QE | dev_e2e | both -CBL_VERSION="${8:-}" # version-build for the topology's test servers (e.g. the localhost JS test server) +TEST_DIR="${7:-QE}" # QE | dev_e2e | both +CBL_VERSION="${8:-}" # version-build for the topology's test servers (e.g. the localhost JS test server) +JS_ONLY="${9:-false}" # true: run only the tests that replicate with a CBL test server TOPOLOGY_FILE="$SCRIPT_DIR/topologies/$TOPOLOGY_NAME" if [ -z "$SGW_VERSION" ]; then @@ -45,6 +46,13 @@ if [ "$TEST_NAME" != "." ]; then PYTEST_FILTER=(-k "$TEST_NAME") fi +# JS-only runs the tests that need a CBL test server, which are all marked min_test_servers. +# Only tests/QE/edge_server has any, so dev_e2e (where pytest would select nothing) is skipped. +if [ "$JS_ONLY" = "true" ]; then + SUITE_DIRS=("$QE_TESTS_DIR/edge_server") + PYTEST_FILTER+=(-m min_test_servers) +fi + echo "Setup backend..." uv run $SCRIPT_DIR/setup_test.py $ES_VERSION $TOPOLOGY_FILE --sgw-version "${SGW_VERSION:-}" --cbs-version "${CBS_VERSION:-}" --cbl-version "${CBL_VERSION:-}" @@ -54,7 +62,7 @@ TEST_RESULT=0 # Each directory runs as its own pytest session against the same backend. # A failure in one does not stop the next; the script fails if any failed. for suite_dir in "${SUITE_DIRS[@]}"; do - echo "RUNNING COORDINATED TEST ($suite_dir, TEST_NAME=$TEST_NAME)" + echo "RUNNING COORDINATED TEST ($suite_dir, TEST_NAME=$TEST_NAME, JS_ONLY=$JS_ONLY)" pushd "$suite_dir" >/dev/null if uv run pytest -v --no-header -W ignore::DeprecationWarning --config "$QE_TESTS_DIR/config.json" --dataset-version "$DATASET_VERSION" ${PYTEST_FILTER[@]+"${PYTEST_FILTER[@]}"} .; then From 0769341021ed359a77e10e64a6b06305ae039645 Mon Sep 17 00:00:00 2001 From: barkha06 Date: Wed, 14 Oct 2026 20:39:38 +0530 Subject: [PATCH 3/6] add cors support for db access control tests --- .../config/test_per_db_access_control.json | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/QE/edge_server/config/test_per_db_access_control.json b/tests/QE/edge_server/config/test_per_db_access_control.json index e8ad13299..c1aac12e0 100644 --- a/tests/QE/edge_server/config/test_per_db_access_control.json +++ b/tests/QE/edge_server/config/test_per_db_access_control.json @@ -4,6 +4,17 @@ "enable_user_access_control": true, "enable_anonymous_users": true, "users": "/home/ec2-user/user/per_db_access_users.json", + "cors": { + "origin": [ + "http://localhost:5173" + ], + "headers": [ + "Authorization", + "Content-Type", + "If-Match" + ], + "max_age": 600 + }, "databases": { "enforced": { "path": "/home/ec2-user/database/enforced.cblite2", From 675138ed9832b70d634c34691fede755edd6bb76 Mon Sep 17 00:00:00 2001 From: barkha06 Date: Thu, 15 Oct 2026 18:20:14 +0530 Subject: [PATCH 4/6] increased timeout for edge server pipeline --- jenkins/pipelines/QE/es/Jenkinsfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jenkins/pipelines/QE/es/Jenkinsfile b/jenkins/pipelines/QE/es/Jenkinsfile index 7065c4fab..003b27a63 100644 --- a/jenkins/pipelines/QE/es/Jenkinsfile +++ b/jenkins/pipelines/QE/es/Jenkinsfile @@ -64,7 +64,7 @@ pipeline { echo "=== Run Edge server Tests" script { def runTests = { - timeout(time: 60, unit: 'MINUTES') { + timeout(time: 90, unit: 'MINUTES') { sh """ jenkins/pipelines/QE/es/test.sh \ "${params.ES_VERSION}" \ @@ -98,7 +98,8 @@ pipeline { timeout(time: 5, unit: 'MINUTES') { sh "jenkins/pipelines/QE/es/teardown.sh" } - archiveArtifacts artifacts: 'tests/QE/es/**/*', fingerprint: true, allowEmptyArchive: true + archiveArtifacts artifacts: 'tests/QE/edge_server/session.log', fingerprint: true, allowEmptyArchive: true + archiveArtifacts artifacts: 'tests/QE/edge_server/http_log/*', fingerprint: true, allowEmptyArchive: true echo "=== Edge server Test Teardown Complete" } } From 4979189dad4d7da6726a4d5251880c96428d6063 Mon Sep 17 00:00:00 2001 From: barkha06 Date: Thu, 15 Oct 2026 19:33:06 +0530 Subject: [PATCH 5/6] added a topology filo for 1 edge server and 1 js testserver instance --- jenkins/pipelines/QE/es/Jenkinsfile | 36 +++++++------------ jenkins/pipelines/QE/es/teardown.sh | 9 ++--- jenkins/pipelines/QE/es/test.sh | 4 --- .../QE/es/topologies/1es_1js_topology.json | 17 +++++++++ 4 files changed, 33 insertions(+), 33 deletions(-) create mode 100644 jenkins/pipelines/QE/es/topologies/1es_1js_topology.json diff --git a/jenkins/pipelines/QE/es/Jenkinsfile b/jenkins/pipelines/QE/es/Jenkinsfile index 003b27a63..c976ac799 100644 --- a/jenkins/pipelines/QE/es/Jenkinsfile +++ b/jenkins/pipelines/QE/es/Jenkinsfile @@ -62,29 +62,19 @@ pipeline { // Unlock keychain: sh 'security unlock-keychain -p ${KEYCHAIN_PASSWORD} ~/Library/Keychains/login.keychain-db' echo "=== Run Edge server Tests" - script { - def runTests = { - timeout(time: 90, unit: 'MINUTES') { - sh """ - jenkins/pipelines/QE/es/test.sh \ - "${params.ES_VERSION}" \ - "${params.TEST_NAME}" \ - "${params.TOPOLOGY_NAME}" \ - "${params.SGW_VERSION}" \ - "${params.CBS_VERSION}" \ - "${params.TS_DATASET_VERSION}" \ - "${params.TEST_DIR}" \ - "${params.CBL_VERSION}" \ - "${params.JS_REPLICATION_TESTS_ONLY}" - """ - } - } - // The JS test server runs on this agent at localhost:5173, so only one such run per agent. - if (params.CBL_VERSION) { - lock("${env.NODE_NAME}-js-test-server") { runTests() } - } else { - runTests() - } + timeout(time: 90, unit: 'MINUTES') { + sh """ + jenkins/pipelines/QE/es/test.sh \ + "${params.ES_VERSION}" \ + "${params.TEST_NAME}" \ + "${params.TOPOLOGY_NAME}" \ + "${params.SGW_VERSION}" \ + "${params.CBS_VERSION}" \ + "${params.TS_DATASET_VERSION}" \ + "${params.TEST_DIR}" \ + "${params.CBL_VERSION}" \ + "${params.JS_REPLICATION_TESTS_ONLY}" + """ } echo "=== Edge server Tests Complete" } diff --git a/jenkins/pipelines/QE/es/teardown.sh b/jenkins/pipelines/QE/es/teardown.sh index f99605c15..f8aa1253c 100755 --- a/jenkins/pipelines/QE/es/teardown.sh +++ b/jenkins/pipelines/QE/es/teardown.sh @@ -6,9 +6,6 @@ SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) source $SCRIPT_DIR/../../shared/config.sh pushd $AWS_ENVIRONMENT_DIR -# Passing the generated topology also stops its test servers, such as the JS test server on localhost. -if [ -f topology_setup/topology.json ]; then - uv run ./stop_backend.py --topology topology_setup/topology.json -else - uv run ./stop_backend.py -fi +move_artifacts + +uv run ./stop_backend.py --topology topology_setup/topology.json diff --git a/jenkins/pipelines/QE/es/test.sh b/jenkins/pipelines/QE/es/test.sh index 6a12b7f0c..c31a10cd4 100755 --- a/jenkins/pipelines/QE/es/test.sh +++ b/jenkins/pipelines/QE/es/test.sh @@ -46,8 +46,6 @@ if [ "$TEST_NAME" != "." ]; then PYTEST_FILTER=(-k "$TEST_NAME") fi -# JS-only runs the tests that need a CBL test server, which are all marked min_test_servers. -# Only tests/QE/edge_server has any, so dev_e2e (where pytest would select nothing) is skipped. if [ "$JS_ONLY" = "true" ]; then SUITE_DIRS=("$QE_TESTS_DIR/edge_server") PYTEST_FILTER+=(-m min_test_servers) @@ -59,8 +57,6 @@ uv run $SCRIPT_DIR/setup_test.py $ES_VERSION $TOPOLOGY_FILE --sgw-version "${SGW export COLUMNS=200 TEST_RESULT=0 -# Each directory runs as its own pytest session against the same backend. -# A failure in one does not stop the next; the script fails if any failed. for suite_dir in "${SUITE_DIRS[@]}"; do echo "RUNNING COORDINATED TEST ($suite_dir, TEST_NAME=$TEST_NAME, JS_ONLY=$JS_ONLY)" pushd "$suite_dir" >/dev/null diff --git a/jenkins/pipelines/QE/es/topologies/1es_1js_topology.json b/jenkins/pipelines/QE/es/topologies/1es_1js_topology.json new file mode 100644 index 000000000..1d50a37ac --- /dev/null +++ b/jenkins/pipelines/QE/es/topologies/1es_1js_topology.json @@ -0,0 +1,17 @@ +{ + "$schema": "./../../../../../environment/aws/topology_setup/topology_schema.json", + "edge_servers": [ + { + "version": "{{version}}" + } + ], + "test_servers": [ + { + "platform": "js", + "cbl_version": "{{version}}", + "location": "localhost", + "download": true + } + ], + "logslurp": true +} \ No newline at end of file From 42699c1adc5f1c39e6ccce178356f2814287581c Mon Sep 17 00:00:00 2001 From: barkha06 Date: Thu, 15 Oct 2026 20:37:20 +0530 Subject: [PATCH 6/6] added more fixes --- jenkins/pipelines/QE/es/Jenkinsfile | 9 ++++----- jenkins/pipelines/QE/es/teardown.sh | 4 +++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/jenkins/pipelines/QE/es/Jenkinsfile b/jenkins/pipelines/QE/es/Jenkinsfile index c976ac799..b10455fa1 100644 --- a/jenkins/pipelines/QE/es/Jenkinsfile +++ b/jenkins/pipelines/QE/es/Jenkinsfile @@ -10,7 +10,7 @@ pipeline { string(name: 'SGW_VERSION', defaultValue: '', description: 'Sync Gateway version (leave empty to skip SGW/CBS provisioning)') string(name: 'CBS_VERSION', defaultValue: '', description: 'Couchbase Server version (leave empty to skip SGW/CBS provisioning)') string(name: 'TS_DATASET_VERSION', defaultValue: '4.0', description: 'The version of the dataset to use on the test servers') - booleanParam(name: 'JS_REPLICATION_TESTS_ONLY', defaultValue: true, description: 'Run only the tests that replicate with the CBL-JS test server (those marked min_test_servers, all in tests/QE/edge_server). Needs a topology with a JS test server. TEST_NAME still narrows them with -k; TEST_DIR is ignored.') + booleanParam(name: 'JS_REPLICATION_TESTS_ONLY', defaultValue: false, description: 'Run only the tests that replicate with the CBL-JS test server (those marked min_test_servers, all in tests/QE/edge_server). Needs a topology with a JS test server. TEST_NAME still narrows them with -k; TEST_DIR is ignored.') } options { ansiColor('xterm') @@ -23,9 +23,9 @@ pipeline { if (params.ES_VERSION == '') { error "ES_VERSION is required" } if (params.TEST_NAME == '') { error "TEST_NAME is required" } if (params.TEST_DIR == 'both' && params.TEST_NAME != '.' && !params.JS_REPLICATION_TESTS_ONLY) { error "TEST_NAME must be '.' when TEST_DIR is 'both'" } - if (params.TOPOLOGY_NAME.contains('_js') && !params.CBL_VERSION) { error "CBL_VERSION is required for ${params.TOPOLOGY_NAME}" } + if (params.TOPOLOGY_NAME.contains('js_topology') && !params.CBL_VERSION) { error "CBL_VERSION is required for ${params.TOPOLOGY_NAME}" } if (params.CBL_VERSION && !(params.CBL_VERSION ==~ /\d+\.\d+\.\d+-\d+/)) { error "CBL_VERSION must be -, e.g. 1.1.0-25" } - if (params.JS_REPLICATION_TESTS_ONLY && !params.TOPOLOGY_NAME.contains('_js')) { + if (params.JS_REPLICATION_TESTS_ONLY && !params.TOPOLOGY_NAME.contains('js_topology')) { error "JS_REPLICATION_TESTS_ONLY needs a topology with a JS test server (e.g. 3es_1sgw_1js_topology.json); ${params.TOPOLOGY_NAME} has none, so every selected test would be skipped" } def scope = params.JS_REPLICATION_TESTS_ONLY ? "QE (JS replication only)" : params.TEST_DIR @@ -88,8 +88,7 @@ pipeline { timeout(time: 5, unit: 'MINUTES') { sh "jenkins/pipelines/QE/es/teardown.sh" } - archiveArtifacts artifacts: 'tests/QE/edge_server/session.log', fingerprint: true, allowEmptyArchive: true - archiveArtifacts artifacts: 'tests/QE/edge_server/http_log/*', fingerprint: true, allowEmptyArchive: true + archiveArtifacts artifacts: 'tests/QE/edge_server/es/**, tests/dev_e2e/edge_server/es/**', fingerprint: true, allowEmptyArchive: true echo "=== Edge server Test Teardown Complete" } } diff --git a/jenkins/pipelines/QE/es/teardown.sh b/jenkins/pipelines/QE/es/teardown.sh index f8aa1253c..614cc910c 100755 --- a/jenkins/pipelines/QE/es/teardown.sh +++ b/jenkins/pipelines/QE/es/teardown.sh @@ -6,6 +6,8 @@ SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) source $SCRIPT_DIR/../../shared/config.sh pushd $AWS_ENVIRONMENT_DIR -move_artifacts +for d in "$QE_TESTS_DIR/edge_server" "$DEV_E2E_TESTS_DIR/edge_server"; do + move_artifacts "$d" +done uv run ./stop_backend.py --topology topology_setup/topology.json