Skip to content

Commit

Permalink
update install tests for deprecated packages and site
Browse files Browse the repository at this point in the history
  • Loading branch information
lena-larionova committed Sep 11, 2024
1 parent ca02d0a commit e7cd6db
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/install-instructions-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
distro: [ubuntu, rhel, amazon-linux, debian, centos]
distro: [ubuntu, rhel, amazon-linux, debian]
arch: ["linux/amd64", "linux/arm64"]
runs-on: ubuntu-latest
timeout-minutes: 60
Expand Down
8 changes: 2 additions & 6 deletions tools/install-tester/config/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
distros:
- amazon-linux
- ubuntu
- rhel:7
- rhel:9
- debian
arch:
- linux/amd64
Expand All @@ -43,15 +43,11 @@
- enterprise
distros:
- ubuntu
- rhel:7
- rhel:8
- amazon-linux
- debian
- centos
arch:
- linux/amd64
skip:
- 2.8.x/centos/oss/package # No OSS package for 2.8
- 2.8.x/centos/oss/repository # No OSS package for 2.8
outputs:
enterprise: "Kong Enterprise {{ version }}"
oss: "{{ version }}"
10 changes: 2 additions & 8 deletions tools/install-tester/config/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ debian:
- useradd tester -m -p password
- usermod -aG sudo tester
- "echo 'ALL ALL = (ALL) NOPASSWD: ALL' > /etc/sudoers.d/tester"
"rhel:7":
image: "registry.access.redhat.com/ubi7/ubi-init:latest"
"rhel:8":
image: "registry.access.redhat.com/ubi8/ubi-init:latest"
setup:
- yum install -y curl gpg sudo
- useradd tester -m -p password
Expand All @@ -32,9 +32,3 @@ amazon-linux:
- yum install -y curl gpg sudo shadow-utils util-linux
- useradd tester -m -p password
- "echo 'ALL ALL = (ALL) NOPASSWD: ALL' > /etc/sudoers.d/tester"
centos:
image: "centos:centos7"
setup:
- yum install -y curl gpg sudo
- useradd tester -m -p password
- "echo 'ALL ALL = (ALL) NOPASSWD: ALL' > /etc/sudoers.d/tester"
28 changes: 1 addition & 27 deletions tools/install-tester/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,34 +134,8 @@ async function runSingleJob(distro, job, arch, installOption, conditions) {
);

if (expected !== version) {
// Check if the package exists on download.konghq.com
// Only supports RHEL at the moment
let existsOnOldSite = "❓";
const expectedParts = expected.split(" ");
const expectedVersion = expectedParts[expectedParts.length - 1];
let packageArch = arch.replace("linux/", "");

let packageName = "kong";
if (installOption.package == "enterprise") {
packageName = "kong-enterprise-edition";
}

if (distro === "rhel") {
// 2.x packages are noarch for enterprise on RHEL
if (
installOption.package == "enterprise" &&
expectedVersion[0] == "2"
) {
packageArch = "noarch";
}
url = `https://download.konghq.com/gateway-${expectedVersion[0]}.x-rhel-7/Packages/k/${packageName}-${expectedVersion}.rhel7.${packageArch}.rpm`;

const response = await fetch(url, { method: "HEAD" });
existsOnOldSite = response.status != 404 ? "✅" : "❌";
}

console.log(
`❌ ${summary} Expected: ${expected}, Got: ${version}, Exists on download.konghq.com: ${existsOnOldSite}`,
`❌ ${summary} Expected: ${expected}, Got: ${version}`,
);
process.exitCode = 1;

Expand Down

0 comments on commit e7cd6db

Please sign in to comment.