Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
c29e1aa
Changed default versions being used in Jenkinsfile
sanjivanipatrax Nov 17, 2025
11dbf84
Android Jenkinsfile necessary changes
sanjivanipatrax Nov 23, 2025
c4ca093
C Jenkinsfile necessary changes
sanjivanipatrax Nov 23, 2025
902776c
.net Jenkinsfile necessary changes
sanjivanipatrax Nov 23, 2025
e92b332
ios Jenkinsfile necessary changes
sanjivanipatrax Nov 23, 2025
4c26118
Java Jenkinsfile necessary changes
sanjivanipatrax Nov 23, 2025
1db3aba
Changed default versions
sanjivanipatrax Nov 23, 2025
4236b27
Fixed bugs
sanjivanipatrax Nov 23, 2025
e7f3240
Removed EDITION parameter
sanjivanipatrax Nov 23, 2025
dd2af1c
Small changes including changed agent
sanjivanipatrax Nov 23, 2025
4079763
Changed C Jenkinsfile to only run tests on one platform
sanjivanipatrax Nov 23, 2025
c3dfaeb
Changed dotnet Jenkinsfile to only run tests on one platform
sanjivanipatrax Nov 23, 2025
63849dd
Changed java Jenkinsfile to only run tests on one platform
sanjivanipatrax Nov 23, 2025
137f618
Changed agent name
sanjivanipatrax Dec 2, 2025
4e1261f
Changed agent name for iOS
sanjivanipatrax Dec 2, 2025
a23bb52
Changed agent name to account for change in name on Jenkins
sanjivanipatrax Dec 3, 2025
b82c13b
Removed webservice part for Java
sanjivanipatrax Dec 12, 2025
c6b507f
Changed keychain name in ios Jenkinsfile
sanjivanipatrax Dec 12, 2025
46d455f
Changes to ensure build doesn't fail due to realpath
sanjivanipatrax Dec 12, 2025
823484d
Reverted previous changes
sanjivanipatrax Dec 12, 2025
7849a9f
Removed pem file and added ts_dataset_version parameter
sanjivanipatrax Dec 12, 2025
1d8e1f6
Use awk instead of wc -L for macOS compatibility
sanjivanipatrax Dec 12, 2025
e3baa42
Changed aws profile name
sanjivanipatrax Dec 12, 2025
0fe03ae
Changed agent
sanjivanipatrax Dec 12, 2025
8a038e2
Changed agent name
sanjivanipatrax Dec 12, 2025
b9517e8
Changed keychain name
sanjivanipatrax Dec 12, 2025
378a651
Changed device being used as iPhone 16e
sanjivanipatrax Dec 12, 2025
cd696f5
Changed device being used as iPhone 16e
sanjivanipatrax Dec 12, 2025
6105149
Made changes for mac-mini-new agent
sanjivanipatrax Dec 12, 2025
ba3fe36
Removed aws profile
sanjivanipatrax Dec 12, 2025
c50f4b1
Debug lines added
sanjivanipatrax Dec 12, 2025
040eaa0
Debug lines added
sanjivanipatrax Dec 12, 2025
75b26fa
Changed path to use homebrew's aws
sanjivanipatrax Dec 12, 2025
56aa56f
Added fix for the greenboard issue seen on jenkins
sanjivanipatrax Dec 14, 2025
4ddf0b9
Added agent for prebuild test server job
sanjivanipatrax Dec 14, 2025
94f6c47
Updated default values for SGW
sanjivanipatrax Dec 15, 2025
3c45b1d
Changes to android jenkinsfile
sanjivanipatrax Dec 15, 2025
360b870
Added gnubin path to android shell script
sanjivanipatrax Dec 15, 2025
4236ae5
Added gnubin path to teardown script too
sanjivanipatrax Dec 15, 2025
9aac32b
Changes to Java Jenkinsfile
sanjivanipatrax Dec 15, 2025
e7b19aa
Fixed wrong setup dir mentioned
sanjivanipatrax Dec 15, 2025
a0f9492
Update Android device serial to R5CT20FYA7R
sanjivanipatrax Dec 15, 2025
b4554a5
Changes to C jenkinsfile
sanjivanipatrax Dec 15, 2025
bf3a357
Added JAVA_HOME to adnroid jenkinsfile
sanjivanipatrax Dec 15, 2025
00c5f97
Changed JAVA_HOME path
sanjivanipatrax Dec 15, 2025
faee31c
Set download as true on android topology file
sanjivanipatrax Dec 15, 2025
873783f
Changes to .net Jenkinsfile
sanjivanipatrax Dec 15, 2025
57a1cb3
Changed pwsh to powershell
sanjivanipatrax Dec 15, 2025
82352ec
Made changes to run C tests on all supported platforms
sanjivanipatrax Dec 30, 2025
832c6c6
Made changes to run dotnet tests on all supported platforms
sanjivanipatrax Dec 30, 2025
a18b4b6
Made changes to run java desktop tests on all supported platforms
sanjivanipatrax Dec 30, 2025
625009d
Fix keychain unlock in C pipeline by avoiding Groovy string interpola…
sanjivanipatrax Dec 30, 2025
d9f9c4e
Fix keychain unlock by moving credentials to withCredentials wrapper
sanjivanipatrax Dec 30, 2025
78aeeca
Changed the dotnet version
sanjivanipatrax Jan 2, 2026
850d547
Added ip hint for dotnet ios topology file
sanjivanipatrax Jan 2, 2026
e556d65
Added code to find cmake in windows easily
sanjivanipatrax Jan 2, 2026
23e3b5f
Added code to add the assets and dbs dir in cbl
sanjivanipatrax Jan 2, 2026
599c1d8
Went to older code for cmake
sanjivanipatrax Jan 2, 2026
70ef34c
Modified to store log and pid files in parent dir of jar file
sanjivanipatrax Jan 2, 2026
885de35
Updated stop() to stop gracefully if process doesn't exist
sanjivanipatrax Jan 5, 2026
f70ad03
Changed .net version to 8.0 in prepare_env
sanjivanipatrax Jan 7, 2026
632a4f2
Changed target version to 8.0
sanjivanipatrax Jan 19, 2026
8258ec4
Changed target versions to all to 9.0
sanjivanipatrax Jan 19, 2026
d8f151f
Changed it to fit to ARM
sanjivanipatrax Jan 19, 2026
f36ef34
Updated the powershell run_test script
sanjivanipatrax Jan 19, 2026
4c9e138
Added the network security config needed by Android 9+
sanjivanipatrax Jan 19, 2026
cc4aa8c
Changed .net pipeline to use india node
sanjivanipatrax Jan 20, 2026
9c2755c
Added flock path
sanjivanipatrax Jan 20, 2026
7213c81
Added locks for all devices
sanjivanipatrax Jan 20, 2026
825cc4b
Added fixes for .net issues
sanjivanipatrax Jan 20, 2026
07b3a04
Updated developer-dir path
sanjivanipatrax Jan 20, 2026
80bf422
Try entitlements fix
sanjivanipatrax Jan 20, 2026
64e33ce
Changed version back to 9, changed it to use arm64 builds
sanjivanipatrax Jan 21, 2026
ceea42f
Set download = true
sanjivanipatrax Jan 21, 2026
d8a7e9e
Added PATH to flock
sanjivanipatrax Jan 21, 2026
6ff06f2
Changed it to always download fresh script
sanjivanipatrax Jan 21, 2026
b88aeeb
Passed dotnet version as a parameter
sanjivanipatrax Jan 21, 2026
a694cbd
Passed .net version to install_dotnet
sanjivanipatrax Jan 21, 2026
2635827
Fix iOS bridge to gracefully handle ideviceinfo failures and use fall…
sanjivanipatrax Jan 21, 2026
22d83fe
Re-added code to use cached script is present
sanjivanipatrax Jan 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions client/src/cbltest/plugins/greenboard_fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pytest_asyncio
from cbltest import CBLPyTest
from cbltest.greenboarduploader import GreenboardUploader
from cbltest.logging import cbl_info
from cbltest.logging import cbl_info, cbl_warning

# This plugin provides an automatic (i.e. not used directly by tests)
# fixture that will upload test results to greenboard, if it is
Expand Down Expand Up @@ -44,20 +44,22 @@ async def greenboard(cblpytest: CBLPyTest, pytestconfig: pytest.Config):
# is 'session' it basically means "before and after the run"
yield

test_server_info = await cblpytest.test_servers[0].get_info()
sgw_version: str = "n/a"
if len(cblpytest.sync_gateways) > 0:
sgw_version_parts = await cblpytest.sync_gateways[0].get_version()
sgw_version = f"{sgw_version_parts.version}-{sgw_version_parts.build_number}"
os_name = (
test_server_info.device["systemName"]
if "systemName" in test_server_info.device
else ""
)
uploader.upload(
test_server_info.cbl, os_name, test_server_info.library_version, sgw_version
)
pytestconfig.pluginmanager.unregister(uploader)
try:
test_server_info = await cblpytest.test_servers[0].get_info()
sgw_version: str = "n/a"
if len(cblpytest.sync_gateways) > 0:
sgw_version_parts = await cblpytest.sync_gateways[0].get_version()
sgw_version = f"{sgw_version_parts.version}-{sgw_version_parts.build_number}"
os_name = (
test_server_info.device["systemName"] if "systemName" in test_server_info.device else ""
)
uploader.upload(
test_server_info.cbl, os_name, test_server_info.library_version, sgw_version
)
except Exception as e:
cbl_warning(f"Failed to upload results to Greenboard: {e}")
finally:
pytestconfig.pluginmanager.unregister(uploader)


# This adds the --no-result-upload option to the pytest command line.
Expand Down
21 changes: 21 additions & 0 deletions environment/aws/topology_setup/test_server_platforms/c_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
LIB_DIR = C_TEST_SERVER_DIR / "lib"
IOS_FRAMEWORKS_DIR = C_TEST_SERVER_DIR / "platforms" / "ios" / "Frameworks"
IOS_VENDOR_DIR = C_TEST_SERVER_DIR / "platforms" / "ios" / "vendor"
ASSETS_DIR = C_TEST_SERVER_DIR / "assets"
DATASET_DIR = TEST_SERVER_DIR.parent / "dataset" / "server"


class CTestServer(TestServer):
Expand All @@ -80,6 +82,23 @@ def cbl_filename(self, version: str) -> str:
def product(self) -> str:
return "couchbase-lite-c"

def _setup_assets(self):
"""
Set up symlinks to the dataset assets required by iOS and Android builds.
"""
header("Setting up dataset assets")
ASSETS_DIR.mkdir(0o755, exist_ok=True)

blobs_link = ASSETS_DIR / "blobs"
if blobs_link.is_symlink() or blobs_link.exists():
blobs_link.unlink()
blobs_link.symlink_to(DATASET_DIR / "blobs")

dbs_link = ASSETS_DIR / "dbs"
if dbs_link.is_symlink() or dbs_link.exists():
dbs_link.unlink()
dbs_link.symlink_to(DATASET_DIR / "dbs")


class CTestServer_Desktop(CTestServer):
def _download_cbl(self) -> None:
Expand Down Expand Up @@ -226,6 +245,7 @@ def _download_cbl(self):

def build(self):
self._download_cbl()
self._setup_assets()
header("Building")
env = os.environ.copy()
env["LANG"] = "en_US.UTF-8"
Expand Down Expand Up @@ -383,6 +403,7 @@ def build(self) -> None:
Build the C test server.
"""
self._download_cbl()
self._setup_assets()
gradle_path = C_TEST_SERVER_DIR / "platforms" / "android" / "gradlew"
if platform.system() == "Windows":
gradle_path = gradle_path.with_suffix(".bat")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ def create_bridge(self, **kwargs) -> PlatformBridge:
/ "bin"
/ "Release"
/ "net9.0-maccatalyst"
/ "maccatalyst-x64"
/ "maccatalyst-arm64"
)
return macOSBridge(str(prefix / "testserver.app"))

Expand All @@ -645,7 +645,7 @@ def compress_package(self) -> str:
/ "bin"
/ "Release"
/ "net9.0-maccatalyst"
/ "maccatalyst-x64"
/ "maccatalyst-arm64"
/ "testserver.app"
)
zip_path = publish_dir.parents[5] / "testserver_macos.zip"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,7 @@ def _get_ip(self, location: str) -> str | None:
location (str): The device location (e.g., device UUID).

Returns:
str: The IP address of the device.

Raises:
RuntimeError: If the IP address cannot be determined.
str | None: The IP address of the device, or None if it cannot be determined.
"""
# Apple provides no sane way to do this so the following dance is performed:
# 1. Retrieve MAC address of device (this requires the default "Private Wifi Address" to be turned off on device)
Expand All @@ -427,10 +424,17 @@ def _get_ip(self, location: str) -> str | None:
self.__verify_libimobiledevice()
result = subprocess.run(
["ideviceinfo", "-u", location, "-k", "WiFiAddress"],
check=True,
check=False,
capture_output=True,
text=True,
)
if result.returncode != 0:
click.secho(
f"Failed to retrieve WiFi address for device {location}: {result.stderr.strip()}",
fg="yellow",
)
return None

mac_address = result.stdout.strip()
stripped_mac_parts = [
part.lstrip("0") or "0" for part in mac_address.split(":")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def run(self, location: str) -> None:
if platform.system() != "Windows":
args.insert(0, "nohup")

info_dir = JAK_TEST_SERVER_DIR / "desktop"
info_dir = Path(self.__jar_path).parent
log_file = open(info_dir / "server.log", "w")
process = subprocess.Popen(
args,
Expand All @@ -152,9 +152,19 @@ def stop(self, location):
if location != "localhost":
raise ValueError("JarBridge only supports running on localhost")

with open(JAK_TEST_SERVER_DIR / "desktop" / "server.pid") as pid_file:
info_dir = Path(self.__jar_path).parent
pid_file_path = info_dir / "server.pid"
if not pid_file_path.exists():
click.secho("No PID file found, server may not be running", fg="yellow")
return

with open(pid_file_path) as pid_file:
pid = int(pid_file.read())
psutil.Process(pid).kill()
try:
psutil.Process(pid).kill()
click.secho(f"Stopped PID {pid}", fg="green")
except psutil.NoSuchProcess:
click.secho(f"Process {pid} not found, may have already exited", fg="yellow")


class JettyBridge(JavaBridge):
Expand Down
33 changes: 18 additions & 15 deletions jenkins/pipelines/QE/android/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
pipeline {
agent none
parameters {
string(name: 'CBL_VERSION', defaultValue: '', description: 'Couchbase Lite Version')
string(name: 'SGW_VERSION', defaultValue: '', description: "The version of Sync Gateway to download")
string(name: 'CBL_VERSION', defaultValue: '3.3.0', description: 'Couchbase Lite Version (build number will be fetched if not provided)')
string(name: 'SGW_VERSION', defaultValue: '3.3.0', description: "The version of Sync Gateway to download")
string(name: 'TS_DATASET_VERSION', defaultValue: '4.0', description: 'The version of the dataset to use on the test servers')
}
stages {
stage('Init') {
steps {
script {
if (params.CBL_VERSION == '') { error "CBL_VERSION is required" }
if (params.SGW_VERSION == '') { error "SGW_VERSION is required" }
currentBuild.displayName = "android ${params.CBL_VERSION} (#${currentBuild.number})"
currentBuild.displayName = "Android CBL:${params.CBL_VERSION} (#${currentBuild.number})"
currentBuild.description = "SGW: ${params.SGW_VERSION}"
}
}
}
Expand All @@ -26,38 +28,39 @@ pipeline {
}
}
stage('Android') {
agent { label 'mac-laptop1-new' }
agent { label 'mac-mini-CBL-Android1' }
options {
lock('mac-mini-CBL-Android1')
}
environment {
KEYCHAIN_PASSWORD = credentials('mobile-qe-keychain')
KEYCHAIN_PASSWORD = credentials('mobile-qe')
ANDROID_HOME = "/Users/couchbase/Library/Android/sdk"
PATH = "\$ANDROID_HOME/platform-tools:\$ANDROID_HOME/tools:\$ANDROID_HOME/tools/bin:/opt/homebrew/opt/[email protected]/bin:/opt/homebrew/bin:/usr/local/bin:${env.PATH}"
AWS_PROFILE = "mobile-for-now"
JAVA_HOME = "/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home"
PATH = "\$JAVA_HOME/bin:\$ANDROID_HOME/platform-tools:\$ANDROID_HOME/tools:\$ANDROID_HOME/tools/bin:/opt/homebrew/opt/[email protected]/bin:/opt/homebrew/bin:/usr/local/bin:${env.PATH}"
TS_ARTIFACTS_DIR = 'android'
TS_DATASET_VERSION = "${params.TS_DATASET_VERSION}"
}
steps {
// Unlock keychain:
sh 'security unlock-keychain -p ${KEYCHAIN_PASSWORD} ~/Library/Keychains/login.keychain-db'
echo "Run Android Tests"
echo "=== Run Android Tests"
timeout(time: 120, unit: 'MINUTES') {
sh """
jenkins/pipelines/QE/android/android_tests.sh "${params.CBL_VERSION}" "${params.SGW_VERSION}" ~/.ssh/jborden.pem
jenkins/pipelines/QE/android/android_tests.sh "${params.CBL_VERSION}" "${params.SGW_VERSION}"
"""
}
echo "=== Android Tests Complete"
}
post {
always {
echo "Teardown Android Tests"
echo "=== Teardown Android Tests"
timeout(time: 5, unit: 'MINUTES') {
sh "jenkins/pipelines/QE/android/android_teardown.sh"
}
archiveArtifacts artifacts: 'tests/QE/android/**/*', fingerprint: true, allowEmptyArchive: true
echo "=== Android Test Teardown Complete"
}
}
}
}
post {
failure {
mail bcc: '', body: "Project: <a href='${env.BUILD_URL}'>${env.JOB_NAME}</a> has failed!", cc: '', charset: 'UTF-8', from: '[email protected]', mimeType: 'text/html', replyTo: '[email protected]', subject: "${env.JOB_NAME} failed", to: "[email protected]";
}
}
}
1 change: 1 addition & 0 deletions jenkins/pipelines/QE/android/android_teardown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -euo pipefail

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
export PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:/opt/homebrew/bin:$PATH"
source $SCRIPT_DIR/../../shared/config.sh

export PYTHONPATH=$SCRIPT_DIR/../../../
Expand Down
1 change: 1 addition & 0 deletions jenkins/pipelines/QE/android/android_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ set -eu
BUILD_TOOLS_VERSION='34.0.0'
SDK_MGR="${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
export PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:/opt/homebrew/bin:$PATH"
source $SCRIPT_DIR/../../shared/config.sh

function usage() {
Expand Down
3 changes: 2 additions & 1 deletion jenkins/pipelines/QE/android/topology_single_device.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
{
"platform": "jak_android",
"cbl_version": "{{version}}",
"location": "HT79F1A00593"
"location": "R5CT20FYA7R",
"download": true
}
],
"include": "../../../../environment/aws/topology_setup/default_topology.json"
Expand Down
Loading