Skip to content

Commit 3cb2cff

Browse files
authored
Use docker compose v2 for tests (#66)
* wip * wip * use docker compose * wip * clean a bit
1 parent 68cb50d commit 3cb2cff

2 files changed

Lines changed: 8 additions & 25 deletions

File tree

artifactory_tests/run_tests.sh

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,20 @@
11
#!/usr/bin/env bash
2-
32
set -e
43

5-
# Upgrade pip and install dependencies
64
pip install --upgrade pip
7-
pip install docker-compose
8-
pip install "docker==6.1.3"
9-
10-
# Function to compare versions
11-
function version_gt() {
12-
test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"
13-
}
14-
15-
min_artifactory_version="6.9.0"
16-
if version_gt "$min_artifactory_version" "$ARTIFACTORY_VERSION"; then
17-
echo "Artifactory version $ARTIFACTORY_VERSION does not support Conan revisions, exiting successfully."
18-
exit 0
19-
fi
205

216
echo "Building Docker containers..."
22-
docker-compose build
23-
docker-compose pull
7+
docker compose build
8+
docker compose pull
249

2510
echo "Starting Docker containers and running tests..."
26-
docker-compose up -d
27-
if docker-compose run test_runner ./launch.sh; then
11+
docker compose up -d
12+
if docker compose run test_runner ./launch.sh; then
2813
echo "Tests passed!"
29-
docker-compose down
14+
docker compose down
3015
exit 0
3116
else
3217
echo "Tests failed or Artifactory failed to start."
33-
docker-compose down
18+
docker compose down
3419
exit 99
3520
fi

jenkins/Jenkinsfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ try{
2020
node("LinuxSlave") {
2121
stage("Testing revisions with Artifactory"){
2222
checkout scm
23-
// FIXME: uncomment latest when the docker image works again
23+
sh 'sudo apt-get update && sudo apt-get install -y docker-compose-plugin'
2424
def arti_versions = (branch != 'develop2' && !branch.startsWith('release/2.')) ? ["latest", "7.63.14", "7.59.9", "7.55.13", "7.47.12", "7.37.17" , "7.27.10", "7.17.5", "7.2.1", "6.18.1", "6.9.0"] : ["latest", "7.63.14", "7.59.9", "7.55.13"]
2525
for (arti_version in arti_versions){
2626
echo "Testing Artifactory ${arti_version} with Conan '${branch}'"
2727
withEnv(["CONAN_GIT_TAG=${branch}".toString(), 'CONAN_GIT_REPO=https://github.com/conan-io/conan.git', "ARTIFACTORY_VERSION=${arti_version}"]) {
2828
withCredentials([string(credentialsId: 'NEW_ART_LICENSE', variable: 'ART_LICENSE')]) {
29-
sh(script: "cd artifactory_tests && ./run_tests.sh")
29+
sh 'cd artifactory_tests && ./run_tests.sh'
3030
}
3131
}
3232
}
@@ -40,7 +40,6 @@ catch(e){
4040
throw e
4141
}
4242

43-
// these tests are not prepared for Conan 2.0, omit them
4443
if (branch != 'develop2' && !branch.startsWith('release/2.'))
4544
{
4645
def builders = [:]
@@ -100,7 +99,6 @@ if (branch != 'develop2' && !branch.startsWith('release/2.'))
10099
}
101100
}
102101

103-
104102
def subject = "SUCCESS ${env.JOB_NAME}! Another day with a green ${branch}!"
105103
def summary = "${subject} (${env.BUILD_URL})"
106104
slackSend (color: '#00FF00', message: summary)

0 commit comments

Comments
 (0)