Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added custom system tests repo and branch input option #102

Merged
merged 3 commits into from
Oct 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
17 changes: 15 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,15 @@ 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);

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 All @@ -3411,6 +3413,7 @@ function runaqaTest(version, jdksource, buildList, target, customTarget, aqatest
// Test.dependency only has one level of archive directory, none of actions toolkit support mv files by regex. Using 7zip discards the directory directly
yield exec.exec(`${sevenzexe} e ${dependents} -o${process.env.GITHUB_WORKSPACE}/aqa-tests/TKG/lib`);
if (buildList.includes('system')) {
getAqaSystemTestsRepo(aqasystemtestsRepo);
dependents = yield tc.downloadTool('https://ci.adoptopenjdk.net/view/all/job/systemtest.getDependency/lastSuccessfulBuild/artifact/*zip*/dependents.zip');
// System.dependency has different levels of archive structures archive/systemtest_prereqs/*.*
// None of io.mv, io.cp and exec.exec can mv directories as expected (mv archive/ ./). Move subfolder systemtest_prereqs instead.
Expand Down Expand Up @@ -3559,6 +3562,16 @@ function getAqaTestsRepo(aqatestsRepo) {
process.chdir('aqa-tests');
});
}

function getAqaSystemTestsRepo(aqasystemtestsRepo) {
let repoBranch = ['adoptium/aqa-systemtests', 'master'];
if (aqasystemtestsRepo.length !== 0) {
repoBranch = parseRepoBranch(aqasystemtestsRepo);
}
process.env.ADOPTOPENJDK_SYSTEMTEST_REPO = repoBranch[0];
process.env.ADOPTOPENJDK_SYSTEMTEST_BRANCH = repoBranch[1];
}

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
13 changes: 12 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 @@ -59,6 +60,7 @@ export async function runaqaTest(
)

if (buildList.includes('system')) {
getAqaSystemTestsRepo(aqasystemtestsRepo);
dependents = await tc.downloadTool(
'https://ci.adoptopenjdk.net/view/all/job/systemtest.getDependency/lastSuccessfulBuild/artifact/*zip*/dependents.zip'
)
Expand Down Expand Up @@ -229,6 +231,15 @@ async function getAqaTestsRepo(aqatestsRepo: string): Promise<void> {
process.chdir('aqa-tests')
}

function getAqaSystemTestsRepo(aqasystemtestsRepo: string) {
let repoBranch = ['adoptium/aqa-systemtests', 'master']
if (aqasystemtestsRepo.length !== 0) {
repoBranch = parseRepoBranch(aqasystemtestsRepo)
}
process.env.ADOPTOPENJDK_SYSTEMTEST_REPO = repoBranch[0];
process.env.ADOPTOPENJDK_SYSTEMTEST_BRANCH = repoBranch[1];
}

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