Skip to content

Commit

Permalink
Support rc aware version in docker integration and update tests
Browse files Browse the repository at this point in the history
- make package name of docker.py in testlib rc aware
- make omd version of version.py in testlib rc version

This follows a5828d9

CMK-16521

Change-Id: I2013196651468472802b84a398f03486f273b7b2
  • Loading branch information
JonasScharpf committed Sep 17, 2024
1 parent d94e5fb commit 3625534
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
10 changes: 5 additions & 5 deletions buildscripts/scripts/test-integration-docker.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@ def main() {
artifacts_helper.download_deb(
INTERNAL_DEPLOY_DEST,
INTERNAL_DEPLOY_PORT,
cmk_version,
"${package_dir}/${cmk_version}",
cmk_version_rc_aware,
"${package_dir}/${cmk_version_rc_aware}",
EDITION,
"jammy", // TODO (CMK-11568): This must be kept in sync with e.g. docker/Dockerfile
);

artifacts_helper.download_source_tar(
INTERNAL_DEPLOY_DEST,
INTERNAL_DEPLOY_PORT,
cmk_version,
"${package_dir}/${cmk_version}",
cmk_version_rc_aware,
"${package_dir}/${cmk_version_rc_aware}",
EDITION,
);
}
Expand All @@ -76,7 +76,7 @@ def main() {
// TODO: don't run make-test-docker but use docker.inside() instead
stage('test cmk-docker integration') {
dir("${checkout_dir}/tests") {
def cmd = "make test-docker-docker WORKSPACE='${checkout_dir}' BRANCH='$branch_name' EDITION='$EDITION' VERSION='$cmk_version'";
def cmd = "make test-docker-docker WORKSPACE='${checkout_dir}' BRANCH='$branch_name' EDITION='$EDITION' VERSION='$cmk_version_rc_aware'";
on_dry_run_omit(LONG_RUNNING, "RUN ${cmd}") {
sh(cmd);
}
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/scripts/test-update.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def main() {
DOCKER_TAG: docker_tag,
MAKE_TARGET: make_target,
BRANCH: branch_name,
cmk_version: cmk_version,
cmk_version: cmk_version_rc_aware,
);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/testlib/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def image_name(version: CMKVersion) -> str:


def package_name(version: CMKVersion) -> str:
return f"check-mk-{version.edition.long}-{version.version}_0.{distro_codename}_amd64.deb"
return f"check-mk-{version.edition.long}-{version.version.split('-rc')[0]}_0.{distro_codename}_amd64.deb"


def prepare_build() -> None:
Expand Down
5 changes: 3 additions & 2 deletions tests/testlib/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def version_directory(self) -> str:
return self.omd_version()

def omd_version(self) -> str:
return f"{self.version}.{self.edition.short}"
return f"{self.version.split('-rc')[0]}.{self.edition.short}"

def version_path(self) -> str:
return "/omd/versions/%s" % self.version_directory()
Expand Down Expand Up @@ -312,6 +312,7 @@ def install(self, version: str, edition: Edition) -> None:
package_name, self.package_url_public(version, package_name)
)

logger.info("Install from tstbuild or portal (%s)", package_path)
self._write_package_hash(version, edition, package_path)
self._install_package(package_path)
os.unlink(package_path)
Expand All @@ -331,7 +332,7 @@ def _build_system_package_path(self, version: str, package_name: str) -> Path:
def _download_package(self, package_name: str, package_url: PackageUrl) -> Path:
temp_package_path = Path("/tmp", package_name)

logger.info("Downloading from: %s", package_url)
logger.info("Downloading from: %s to %s", package_url, temp_package_path)
response = requests.get( # nosec
package_url, auth=get_cmk_download_credentials(), verify=False
)
Expand Down

0 comments on commit 3625534

Please sign in to comment.