Skip to content

Commit c57fb96

Browse files
committed
PR comments
1 parent e5e63fe commit c57fb96

3 files changed

Lines changed: 34 additions & 12 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ tools/stats-definition-exporter/stats-definition-exporter
3131
planPIndexes/
3232

3333
couchbase-lite-tests
34+
integration-test/e2e/.gitconfig.e2e

integration-test/e2e/Jenkinsfile

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,28 @@ pipeline {
2626
script: '''
2727
import jenkins.model.Jenkins
2828
def defaultVal = ""
29+
def errorMsg = ""
2930
try {
3031
def envVarsNodePropertyList = Jenkins.instance.globalNodeProperties.getAll(hudson.slaves.EnvironmentVariablesNodeProperty)
3132
if (envVarsNodePropertyList && envVarsNodePropertyList[0]) {
3233
defaultVal = envVarsNodePropertyList[0].envVars.get("DEFAULT_COUCHBASE_LITE_VERSION") ?: ""
3334
}
3435
} catch (Throwable t) {
35-
defaultVal = "Exception: " + t.toString()
36+
errorMsg = "Exception retrieving default: " + t.toString().replace("'", "&apos;").replace("<", "&lt;").replace(">", "&gt;")
3637
}
37-
return "<input name='value' value='" + defaultVal + "' class='setting-input' type='text'>"
38+
defaultVal = defaultVal.replace("'", "&apos;").replace("<", "&lt;").replace(">", "&gt;")
39+
def html = "<input name='value' value='" + defaultVal + "' class='setting-input' type='text'>"
40+
if (errorMsg) {
41+
html += "<div class='description' style='color: #d9534f; margin-top: 5px;'>" + errorMsg + "</div>"
42+
}
43+
return html
3844
''',
3945
sandbox: false
4046
],
4147
fallbackScript: [
4248
script: '''
43-
return "<input name='value' value='Error: Script approval required or execution failed.' class='setting-input' type='text' style='color: red; border: 1px solid red;'>"
49+
return "<input name='value' value='' class='setting-input' type='text' placeholder='Enter COUCHBASE_LITE_VERSION...'>" +
50+
"<div class='description' style='color: #d9534f; margin-top: 5px;'>Error: Script approval required or execution failed. Check Jenkins script approvals if this is not populated. Please enter the version manually.</div>"
4451
''',
4552
sandbox: false
4653
]
@@ -56,21 +63,28 @@ pipeline {
5663
script: '''
5764
import jenkins.model.Jenkins
5865
def defaultVal = ""
66+
def errorMsg = ""
5967
try {
6068
def envVarsNodePropertyList = Jenkins.instance.globalNodeProperties.getAll(hudson.slaves.EnvironmentVariablesNodeProperty)
6169
if (envVarsNodePropertyList && envVarsNodePropertyList[0]) {
6270
defaultVal = envVarsNodePropertyList[0].envVars.get("DEFAULT_COUCHBASE_SERVER_VERSION") ?: ""
6371
}
6472
} catch (Throwable t) {
65-
defaultVal = "Exception: " + t.toString()
73+
errorMsg = "Exception retrieving default: " + t.toString().replace("'", "&apos;").replace("<", "&lt;").replace(">", "&gt;")
74+
}
75+
defaultVal = defaultVal.replace("'", "&apos;").replace("<", "&lt;").replace(">", "&gt;")
76+
def html = "<input name='value' value='" + defaultVal + "' class='setting-input' type='text'>"
77+
if (errorMsg) {
78+
html += "<div class='description' style='color: #d9534f; margin-top: 5px;'>" + errorMsg + "</div>"
6679
}
67-
return "<input name='value' value='" + defaultVal + "' class='setting-input' type='text'>"
80+
return html
6881
''',
6982
sandbox: false
7083
],
7184
fallbackScript: [
7285
script: '''
73-
return "<input name='value' value='Error: Script approval required or execution failed.' class='setting-input' type='text' style='color: red; border: 1px solid red;'>"
86+
return "<input name='value' value='' class='setting-input' type='text' placeholder='Enter COUCHBASE_SERVER_VERSION...'>" +
87+
"<div class='description' style='color: #d9534f; margin-top: 5px;'>Error: Script approval required or execution failed. Check Jenkins script approvals if this is not populated. Please enter the version manually.</div>"
7488
''',
7589
sandbox: false
7690
]
@@ -92,9 +106,9 @@ pipeline {
92106
steps {
93107
cleanWs()
94108
git(
95-
url: 'https://github.com/couchbase/sync_gateway.git',
96-
branch: "${params.SG_COMMIT}",
97-
credentialsId: 'CB_SG_Robot_Github_SSH_Key'
109+
url: 'git@github.com:couchbase/sync_gateway.git',
110+
branch: "${params.SG_COMMIT}",
111+
credentialsId: 'CB_SG_Robot_Github_SSH_Key'
98112
)
99113
}
100114
}

integration-test/e2e/run_e2e_tests.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ set -eux -o pipefail
1212

1313
# Resolve the script and repository directories
1414
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
15-
REPO_DIR="$( dirname "${SCRIPT_DIR}" )"
15+
REPO_DIR="$( dirname "$( dirname "${SCRIPT_DIR}" )" )"
1616

1717
# Check for required environment variables
1818
: "${BACKING_STORE:?BACKING_STORE must be set}"
@@ -28,15 +28,22 @@ fi
2828

2929
if [[ "$BACKING_STORE" == "cbs" ]]; then
3030
: "${COUCHBASE_SERVER_VERSION:?COUCHBASE_SERVER_VERSION must be set when BACKING_STORE=cbs}"
31-
"${SCRIPT_DIR}/start_server.sh" "${COUCHBASE_SERVER_VERSION}"
31+
"${REPO_DIR}/integration-test/start_server.sh" "${COUCHBASE_SERVER_VERSION}"
3232
fi
3333

34-
export GIT_CONFIG_GLOBAL="${PWD}/.gitconfig.e2e"
34+
export GIT_CONFIG_GLOBAL="${SCRIPT_DIR}/.gitconfig.e2e"
3535
export GOPRIVATE="github.com/couchbaselabs/go-fleecedelta"
3636
git config --global url.git@github.com:couchbaselabs/go-fleecedelta.insteadOf https://github.com/couchbaselabs/go-fleecedelta
37+
38+
# Clean up any existing clone to make local re-runs idempotent
39+
rm -rf couchbase-lite-tests
40+
3741
git clone --recurse-submodules https://github.com/couchbaselabs/couchbase-lite-tests.git
3842
cd couchbase-lite-tests
3943
git checkout --detach "${COUCHBASE_LITE_TESTS_COMMIT}"
44+
git submodule sync --recursive
45+
git submodule update --init --recursive --force
46+
4047
uv run -- ./environment/local/start_local.py --build-testserver "${COUCHBASE_LITE_VERSION}"
4148
uv run -- ./environment/local/build_sync_gateway.py --repo-path "${REPO_DIR}"
4249
uv run -- ./environment/local/run_sync_gateway.py --start --server "${BACKING_STORE}"

0 commit comments

Comments
 (0)