Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
tests: fix unit tests, add e2e tests
  • Loading branch information
Ivan Zosimov committed Sep 13, 2023
commit 9799c80ea4c231dad0b1a821ebb6eb3a7d16fdd6
32 changes: 29 additions & 3 deletions .github/workflows/e2e-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,17 @@ jobs:
'liberica',
'microsoft',
'semeru',
'corretto'
'corretto',
'dragonwell'
] # internally 'adopt-hotspot' is the same as 'adopt'
version: ['8', '11', '16']
exclude:
- distribution: microsoft
version: 8
- distribution: dragonwell
os: macos-latest
- distribution: dragonwell
version: 16
include:
- distribution: oracle
os: macos-latest
Expand All @@ -45,6 +50,12 @@ jobs:
- distribution: oracle
os: ubuntu-latest
version: 19
- distribution: dragonwell
os: windows-latest
version: 17
- distribution: dragonwell
os: ubuntu-latest
version: 17
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -75,6 +86,15 @@ jobs:
- distribution: oracle
os: ubuntu-latest
version: '19.0.1'
- distribution: dragonwell
os: ubuntu-latest
version: '11.0'
- distribution: dragonwell
os: ubuntu-latest
version: '8.13.14'
- distribution: dragonwell
os: ubuntu-latest
version: '11.0.13+9'
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -96,7 +116,10 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
distribution: ['temurin', 'zulu', 'liberica']
distribution: ['temurin', 'zulu', 'liberica', 'dragonwell']
exclude:
- distribution: dragonwell
os: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -119,7 +142,10 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
distribution: ['temurin', 'zulu', 'liberica']
distribution: ['temurin', 'zulu', 'liberica', 'dragonwell']
exclude:
- distribution: dragonwell
os: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
21 changes: 9 additions & 12 deletions __tests__/distributors/dragonwell-installer.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import {HttpClient} from '@actions/http-client';
import * as semver from 'semver';
import {DragonwellDistribution} from '../../src/distributions/dragonwell/installer';
import {IDragonwellAllVersions} from '../../src/distributions/dragonwell/models';
import * as utils from '../../src/util';
import os from 'os';

import manifestData from '../data/dragonwell.json';

Expand Down Expand Up @@ -44,17 +41,17 @@ describe('getAvailableVersions', () => {
describe('getAvailableVersions', () => {
it.each([
['8', 'x86', 'linux', 0],
['8', 'aarch64', 'linux', 33],
['8.6.6', 'x64', 'linux', 36],
['8', 'aarch64', 'linux', 24],
['8.6.6', 'x64', 'linux', 27],
['8', 'x86', 'anolis', 0],
['8', 'x86', 'windows', 0],
['8', 'x86', 'mac', 0],
['11', 'x64', 'linux', 36],
['11', 'aarch64', 'linux', 33],
['11', 'x64', 'linux', 27],
['11', 'aarch64', 'linux', 24],
['17', 'riscv', 'linux', 0],
['16.0.1', 'x64', 'linux', 36]
['16.0.1', 'x64', 'linux', 27]
])(
'load available versions',
'should get right number of available versions from JSON',
async (
jdkVersion: string,
arch: string,
Expand Down Expand Up @@ -163,7 +160,7 @@ describe('getAvailableVersions', () => {
'https://github.com/alibaba/dragonwell17/releases/download/dragonwell-standard-17.0.4.0.4%2B8_jdk-17.0.4-ga/Alibaba_Dragonwell_Standard_17.0.4.0.4%2B8_x64_linux.tar.gz'
]
])(
'test for download link',
'should return proper link according to the specified java-version, platform and arch',
async (
jdkVersion: string,
platform: string,
Expand Down Expand Up @@ -192,7 +189,7 @@ describe('getAvailableVersions', () => {
['11', 'macos', 'aarch64'],
['17', 'linux', 'riscv']
])(
'test for unsupported version',
'should throw when required version of JDK can not be found in the JSON',
async (jdkVersion: string, platform: string, arch: string) => {
const distribution = new DragonwellDistribution({
version: jdkVersion,
Expand All @@ -205,7 +202,7 @@ describe('getAvailableVersions', () => {
await expect(
distribution['findPackageForDownload'](jdkVersion)
).rejects.toThrow(
`Couldn't find any satisfied version for the specified: "${jdkVersion}".`
`Couldn't find any satisfied version for the specified java-version: "${jdkVersion}".`
);
}
);
Expand Down