Skip to content

Commit

Permalink
Added custom system tests repo and branch input option
Browse files Browse the repository at this point in the history
  • Loading branch information
Vindiya Singh committed Oct 1, 2021
1 parent 1a5c2c3 commit 6f8c8e9
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 4 deletions.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ inputs:
aqa-testsRepo:
description: 'Personal aqa-tests Repo. For example, octocat/aqa-tests:test'
required: false
aqa-systemtestsRepo:
description: 'Personal aqa-systemtests Repo. For example, octocat/aqa-systemtests:test'
required: false
default: 'aqa-systemtest:master'
openj9_repo:
description: 'openj9 Repo'
required: false
Expand Down
21 changes: 19 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2954,6 +2954,7 @@ function run() {
const target = core.getInput('target', { required: false });
const customTarget = core.getInput('custom_target', { required: false });
const aqatestsRepo = core.getInput('aqa-testsRepo', { required: false });
const aqasystemtestsRepo = core.getInput('aqa-systemtestsRepo', {required: false});
const openj9Repo = core.getInput('openj9_repo', { required: false });
const tkgRepo = core.getInput('tkg_Repo', { required: false });
const vendorTestRepos = core.getInput('vendor_testRepos', { required: false });
Expand Down Expand Up @@ -2991,7 +2992,7 @@ function run() {
if (vendorTestShas !== '') {
vendorTestParams += ` --vendor_shas ${vendorTestShas}`;
}
yield runaqa.runaqaTest(version, jdksource, buildList, target, customTarget, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams);
yield runaqa.runaqaTest(version, jdksource, buildList, target, customTarget, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams, aqasystemtestsRepo);
}
catch (error) {
core.setFailed(error.message);
Expand Down Expand Up @@ -3393,14 +3394,18 @@ if (!tempDirectory) {
}
tempDirectory = path.join(baseLocation, 'actions', 'temp');
}
function runaqaTest(version, jdksource, buildList, target, customTarget, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams) {
function runaqaTest(version, jdksource, buildList, target, customTarget, aqatestsRepo, openj9Repo, tkgRepo, vendorTestParams, aqasystemtestsRepo) {
return __awaiter(this, void 0, void 0, function* () {
yield installDependencyAndSetup();
setSpec();
process.env.BUILD_LIST = buildList;
if (!('TEST_JDK_HOME' in process.env))
process.env.TEST_JDK_HOME = getTestJdkHome(version, jdksource);
yield getAqaTestsRepo(aqatestsRepo);
if(buildList.includes('system') || buildList.includes('openjdk')) {
yield getAqaSystemTestsRepo(aqasystemtestsRepo);
}

yield runGetSh(tkgRepo, openj9Repo, vendorTestParams);
//Get Dependencies, using /*zip*/dependents.zip to avoid loop every available files
let dependents = yield tc.downloadTool('https://ci.adoptopenjdk.net/view/all/job/test.getDependency/lastSuccessfulBuild/artifact//*zip*/dependents.zip');
Expand Down Expand Up @@ -3559,6 +3564,18 @@ function getAqaTestsRepo(aqatestsRepo) {
process.chdir('aqa-tests');
});
}

function getAqaSystemTestsRepo(aqasystemtestsRepo) {
return __awaiter(this, void 0, void 0, function* () {
let repoBranch = ['adoptium/aqa-systemtests', 'master'];
if (aqasystemtestsRepo.length !== 0) {
repoBranch = parseRepoBranch(aqasystemtestsRepo);
}
yield exec.exec(`git clone --depth 1 -b ${repoBranch[1]} https://github.com/${repoBranch[0]}.git`);
process.chdir('aqa-systemtests');
});
}

function runGetSh(tkgRepo, openj9Repo, vendorTestParams) {
return __awaiter(this, void 0, void 0, function* () {
let parameters = '';
Expand Down
4 changes: 3 additions & 1 deletion src/aqa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ async function run(): Promise<void> {
const target = core.getInput('target', {required: false})
const customTarget = core.getInput('custom_target', {required: false})
const aqatestsRepo = core.getInput('aqa-testsRepo', {required: false})
const aqasystemtestsRepo = core.getInput('aqa-systemtestsRepo', {required: false})
const openj9Repo = core.getInput('openj9_repo', {required: false})
const tkgRepo = core.getInput('tkg_Repo', {required: false})
const vendorTestRepos = core.getInput('vendor_testRepos', {required: false})
Expand Down Expand Up @@ -67,7 +68,8 @@ async function run(): Promise<void> {
aqatestsRepo,
openj9Repo,
tkgRepo,
vendorTestParams
vendorTestParams,
aqasystemtestsRepo,
)
} catch (error) {
core.setFailed(error.message)
Expand Down
17 changes: 16 additions & 1 deletion src/runaqa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export async function runaqaTest(
aqatestsRepo: string,
openj9Repo: string,
tkgRepo: string,
vendorTestParams: string
vendorTestParams: string,
aqasystemtestsRepo: string,
): Promise<void> {
await installDependencyAndSetup()
setSpec()
Expand All @@ -57,6 +58,9 @@ export async function runaqaTest(
await exec.exec(
`${sevenzexe} e ${dependents} -o${process.env.GITHUB_WORKSPACE}/aqa-tests/TKG/lib`
)
if(buildList.includes('system') || buildList.includes('openjdk')) {
await getAqaSystemTestsRepo(aqasystemtestsRepo);
}

if (buildList.includes('system')) {
dependents = await tc.downloadTool(
Expand Down Expand Up @@ -229,6 +233,17 @@ async function getAqaTestsRepo(aqatestsRepo: string): Promise<void> {
process.chdir('aqa-tests')
}

async function getAqaSystemTestsRepo(aqasystemtestsRepo: string): Promise<void> {
let repoBranch = ['adoptium/aqa-systemtests', 'master']
if (aqasystemtestsRepo.length !== 0) {
repoBranch = parseRepoBranch(aqasystemtestsRepo)
}
await exec.exec(
`git clone --depth 1 -b ${repoBranch[1]} https://github.com/${repoBranch[0]}.git`
)
process.chdir('aqa-systemtests')
}

async function runGetSh(
tkgRepo: string,
openj9Repo: string,
Expand Down

0 comments on commit 6f8c8e9

Please sign in to comment.