Skip to content

Commit

Permalink
test containers
Browse files Browse the repository at this point in the history
  • Loading branch information
sophia-guo committed Jan 15, 2025
1 parent aa7718e commit c3e533c
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 31 deletions.
37 changes: 22 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,6 @@ on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
jobs:
openjdk: # make sure build/ci work properly
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: AQA
uses: ./
with:
version: '11'
jdksource: 'github-hosted'
build_list: 'openjdk'
target: '_jdk_custom'
openjdk_disto: # make sure build/ci work properly with other distros
runs-on: ubuntu-latest
container:
Expand All @@ -38,3 +23,25 @@ jobs:
jdksource: 'github-hosted'
build_list: 'openjdk'
target: '_jdk_custom'
test_container: # make sure build/ci work properly with other distros
runs-on: ubuntu-latest
container:
image: ${{ matrix.image }}
strategy:
fail-fast: false
matrix:
image: ['ghcr.io/adoptium/test-containers:ubuntu2204']
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
java-version: '17'
distribution: 'temurin'
- name: AQA
uses: ./
with:
version: '17'
jdksource: 'install-jdk'
build_list: 'openjdk'
target: '_jdk_custom'
envReady: 'true'
24 changes: 16 additions & 8 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ function run() {
const vendorTestShas = core.getInput('vendor_testShas', { required: false });
const runParallel = core.getInput('run_parallel', { required: false });
const numMachines = core.getInput('num_machines', { required: false });
let envReady = core.getInput('envReady', { required: false });
let vendorTestParams = '';
// let arch = core.getInput("architecture", { required: false })
if (jdksource !== 'upstream' &&
Expand Down Expand Up @@ -112,11 +113,14 @@ function run() {
if (sdkdir === '') {
sdkdir = process.cwd();
}
if (envReady === '') {
envReady = 'false';
}
if (runParallel === 'true' && numMachines != '1') {
yield runaqa.setupParallelEnv(version, jdksource, customizedSdkUrl, sdkdir, buildList, target, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams, aqasystemtestsRepo, numMachines);
yield runaqa.setupParallelEnv(version, jdksource, customizedSdkUrl, sdkdir, buildList, target, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams, aqasystemtestsRepo, numMachines, envReady);
}
else {
yield runaqa.runaqaTest(version, jdksource, customizedSdkUrl, sdkdir, buildList, target, customTarget, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams, aqasystemtestsRepo);
yield runaqa.runaqaTest(version, jdksource, customizedSdkUrl, sdkdir, buildList, target, customTarget, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams, aqasystemtestsRepo, envReady);
}
}
catch (error) {
Expand Down Expand Up @@ -221,11 +225,12 @@ if (!tempDirectory) {
* @param {[string]} tkgRepo Alternative TKG repo
* @param {[string]} vendorTestParams Vendor provided test parameters
* @param {[string]} aqasystemtestsRepo Alternative AQA-systemtestRepo
* @param {[boolean]} evnReady if environment need to update
* @return {[null]} null
*/
function runaqaTest(version, jdksource, customizedSdkUrl, sdkdir, buildList, target, customTarget, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams, aqasystemtestsRepo) {
function runaqaTest(version, jdksource, customizedSdkUrl, sdkdir, buildList, target, customTarget, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams, aqasystemtestsRepo, envReady) {
return __awaiter(this, void 0, void 0, function* () {
yield setupTestEnv(version, jdksource, customizedSdkUrl, sdkdir, buildList, target, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams, aqasystemtestsRepo);
yield setupTestEnv(version, jdksource, customizedSdkUrl, sdkdir, buildList, target, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams, aqasystemtestsRepo, envReady);
const options = {};
let myOutput = '';
options.listeners = {
Expand Down Expand Up @@ -503,11 +508,12 @@ function runGetSh(tkgRepo, openj9Repo, vendorTestParams, jdksource, customizedSd
* @param {[string]} tkgRepo Alternative TKG repo
* @param {[string]} vendorTestParams Vendor provided test parameters
* @param {[string]} aqasystemtestsRepo Alternative AQA-systemtestRepo
* @param {[boolean]} evnReady if environment need to update
* @return {[null]} null
*/
function setupParallelEnv(version, jdksource, customizedSdkUrl, sdkdir, buildList, target, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams, aqasystemtestsRepo, numMachines) {
function setupParallelEnv(version, jdksource, customizedSdkUrl, sdkdir, buildList, target, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams, aqasystemtestsRepo, numMachines, envReady) {
return __awaiter(this, void 0, void 0, function* () {
yield setupTestEnv(version, jdksource, customizedSdkUrl, sdkdir, buildList, target, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams, aqasystemtestsRepo);
yield setupTestEnv(version, jdksource, customizedSdkUrl, sdkdir, buildList, target, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams, aqasystemtestsRepo, envReady);
process.chdir('TKG');
process.env.PARALLEL_OPTIONS = `PARALLEL_OPTIONS=TEST=${target} TEST_TIME= NUM_MACHINES=${numMachines}`;
yield exec.exec(`make genParallelList ${process.env.PARALLEL_OPTIONS}`);
Expand Down Expand Up @@ -548,9 +554,11 @@ function setupEnvVariables(version, jdksource, buildList, sdkdir) {
* @param {[string]} aqasystemtestsRepo Alternative AQA-systemtestRepo
* @return {null} null
*/
function setupTestEnv(version, jdksource, customizedSdkUrl, sdkdir, buildList, target, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams, aqasystemtestsRepo) {
function setupTestEnv(version, jdksource, customizedSdkUrl, sdkdir, buildList, target, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams, aqasystemtestsRepo, envReady) {
return __awaiter(this, void 0, void 0, function* () {
yield installPlatformDependencies();
if (envReady == "false") {
yield installPlatformDependencies();
}
setupEnvVariables(version, jdksource, buildList, sdkdir);
yield getAqaTestsRepo(aqatestsRepo, version, buildList);
yield runGetSh(tkgRepo, openj9Repo, vendorTestParams, jdksource, customizedSdkUrl, sdkdir);
Expand Down
10 changes: 8 additions & 2 deletions src/aqa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ async function run(): Promise<void> {
const vendorTestShas = core.getInput('vendor_testShas', {required: false})
const runParallel = core.getInput('run_parallel', {required: false})
const numMachines = core.getInput('num_machines', {required: false})
let envReady = core.getInput('envReady', {required: false})
let vendorTestParams = ''
// let arch = core.getInput("architecture", { required: false })
if (
Expand Down Expand Up @@ -74,6 +75,9 @@ async function run(): Promise<void> {
if (sdkdir === '') {
sdkdir = process.cwd()
}
if (envReady === '') {
envReady = 'false'
}
if(runParallel === 'true' && numMachines != '1') {

await runaqa.setupParallelEnv(
Expand All @@ -88,7 +92,8 @@ async function run(): Promise<void> {
tkgRepo,
vendorTestParams,
aqasystemtestsRepo,
numMachines
numMachines,
envReady
)
}
else {
Expand All @@ -104,7 +109,8 @@ async function run(): Promise<void> {
openj9Repo,
tkgRepo,
vendorTestParams,
aqasystemtestsRepo
aqasystemtestsRepo,
envReady
)
}
} catch (error) {
Expand Down
20 changes: 14 additions & 6 deletions src/runaqa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ if (!tempDirectory) {
* @param {[string]} tkgRepo Alternative TKG repo
* @param {[string]} vendorTestParams Vendor provided test parameters
* @param {[string]} aqasystemtestsRepo Alternative AQA-systemtestRepo
* @param {[boolean]} evnReady if environment need to update
* @return {[null]} null
*/
export async function runaqaTest(
Expand All @@ -52,7 +53,8 @@ export async function runaqaTest(
openj9Repo: string,
tkgRepo: string,
vendorTestParams: string,
aqasystemtestsRepo: string
aqasystemtestsRepo: string,
envReady: string
): Promise<void> {

await setupTestEnv(
Expand All @@ -66,7 +68,8 @@ export async function runaqaTest(
openj9Repo,
tkgRepo,
vendorTestParams,
aqasystemtestsRepo
aqasystemtestsRepo,
envReady
);

const options: ExecOptions = {}
Expand Down Expand Up @@ -367,6 +370,7 @@ async function runGetSh(
* @param {[string]} tkgRepo Alternative TKG repo
* @param {[string]} vendorTestParams Vendor provided test parameters
* @param {[string]} aqasystemtestsRepo Alternative AQA-systemtestRepo
* @param {[boolean]} evnReady if environment need to update
* @return {[null]} null
*/
export async function setupParallelEnv(
Expand All @@ -381,10 +385,11 @@ export async function setupParallelEnv(
tkgRepo: string,
vendorTestParams: string,
aqasystemtestsRepo: string,
numMachines: string
numMachines: string,
envReady: string
): Promise<void> {

await setupTestEnv(version, jdksource, customizedSdkUrl, sdkdir, buildList, target, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams, aqasystemtestsRepo);
await setupTestEnv(version, jdksource, customizedSdkUrl, sdkdir, buildList, target, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams, aqasystemtestsRepo, envReady);
process.chdir('TKG');
process.env.PARALLEL_OPTIONS = `PARALLEL_OPTIONS=TEST=${target} TEST_TIME= NUM_MACHINES=${numMachines}`;
await exec.exec(`make genParallelList ${process.env.PARALLEL_OPTIONS}`);
Expand Down Expand Up @@ -438,9 +443,12 @@ async function setupTestEnv(
openj9Repo: string,
tkgRepo: string,
vendorTestParams: string,
aqasystemtestsRepo: string
aqasystemtestsRepo: string,
envReady: string
): Promise<void> {
await installPlatformDependencies();
if (envReady == "false") {
await installPlatformDependencies();
}
setupEnvVariables(version, jdksource, buildList, sdkdir);
await getAqaTestsRepo(aqatestsRepo, version, buildList);
await runGetSh(tkgRepo, openj9Repo, vendorTestParams, jdksource, customizedSdkUrl, sdkdir);
Expand Down

0 comments on commit c3e533c

Please sign in to comment.