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

Add option to pass in openJ9 repo and branch #87

Merged
merged 1 commit into from
Jun 9, 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: 2 additions & 2 deletions __tests__/runaqa.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//import {runaqaTest} from '../src/runaqa'
describe('TODO - Add a test suite', () => {
it('TODO - Add a test', async () => {});
});
it('TODO - Add a test', async () => {})
})
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ inputs:
description: 'openjdk Repo'
required: false
default: 'openjdk-tests:master'
openj9_repo:
description: 'openj9 Repo'
required: false
default: 'openj9:master'
Copy link
Contributor

@llxia llxia Jun 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use the new repo? i.e., eclipse-openj9:master

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talked with @renfeiw , this is used as a check. It is not used for constructing openj9 git repo url, so it does not need to be changed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openj9 is the OpenJ9 main code base under eclipse-openj9 : https://github.com/eclipse-openj9/openj9. I think openj9 is a correct one. Also I believe openj9_repo is set as the same way as two other repos do, which only use default as a flag. We actually don't need the default value as we can check if the parameter is empty or not. I will open a separate issue to do that.

tkg_Repo:
description: 'TKG Repo'
required: false
Expand Down
29 changes: 17 additions & 12 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 openjdktestRepo = core.getInput('openjdk_testRepo', { required: false });
const openj9Repo = core.getInput('openj9_repo', { required: false });
const tkgRepo = core.getInput('tkg_Repo', { required: false });
// let arch = core.getInput("architecture", { required: false })
if (jdksource !== 'upstream' &&
Expand All @@ -2971,7 +2972,7 @@ function run() {
if (jdksource !== 'upstream' && version.length === 0) {
core.setFailed('Please provide jdkversion if jdksource is github-hosted installed or AdoptOpenJKD/install-jdk installed.');
}
yield runaqa.runaqaTest(version, jdksource, buildList, target, customTarget, openjdktestRepo, tkgRepo);
yield runaqa.runaqaTest(version, jdksource, buildList, target, customTarget, openjdktestRepo, openj9Repo, tkgRepo);
}
catch (error) {
core.setFailed(error.message);
Expand Down Expand Up @@ -3351,7 +3352,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
/* eslint-disable prefer-template */
const exec = __importStar(__webpack_require__(986));
const core = __importStar(__webpack_require__(470));
const io = __importStar(__webpack_require__(1));
Expand All @@ -3374,15 +3374,15 @@ if (!tempDirectory) {
}
tempDirectory = path.join(baseLocation, 'actions', 'temp');
}
function runaqaTest(version, jdksource, buildList, target, customTarget, openjdktestRepo, tkgRepo) {
function runaqaTest(version, jdksource, buildList, target, customTarget, openjdktestRepo, openj9Repo, tkgRepo) {
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 getOpenjdkTestRepo(openjdktestRepo);
yield runGetSh(tkgRepo);
yield runGetSh(tkgRepo, openj9Repo);
//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');
// Test.dependency only has one level of archive directory, none of actions toolkit support mv files by regex. Using 7zip discards the directory directly
Expand All @@ -3406,7 +3406,9 @@ function runaqaTest(version, jdksource, buildList, target, customTarget, openjdk
try {
yield exec.exec('make compile');
if (target.includes('custom') && customTarget !== '') {
const customOption = `${target.substr(1).toUpperCase()}_TARGET=${customTarget}`;
const customOption = `${target
.substr(1)
.toUpperCase()}_TARGET=${customTarget}`;
yield exec.exec('make', [`${target}`, `${customOption}`], options);
}
else {
Expand Down Expand Up @@ -3506,19 +3508,22 @@ function getOpenjdkTestRepo(openjdktestRepo) {
process.chdir('openjdk-tests');
});
}
function runGetSh(tkgRepo) {
function runGetSh(tkgRepo, openj9Repo) {
return __awaiter(this, void 0, void 0, function* () {
let tkgParameters = '';
let repoBranch = ['AdoptOpenJDK/TKG', 'master'];
let parameters = '';
if (tkgRepo !== 'TKG:master') {
repoBranch = parseRepoBranch(tkgRepo);
tkgParameters = `--tkg_branch ${repoBranch[1]} --tkg_repo https://github.com/${repoBranch[0]}.git`;
const repoBranch = parseRepoBranch(tkgRepo);
parameters += `--tkg_branch ${repoBranch[1]} --tkg_repo https://github.com/${repoBranch[0]}.git`;
}
if (openj9Repo !== 'openj9:master') {
const repoBranch = parseRepoBranch(openj9Repo);
parameters += ` --openj9_branch ${repoBranch[1]} --openj9_repo https://github.com/${repoBranch[0]}.git`;
}
if (IS_WINDOWS) {
yield exec.exec(`bash ./get.sh ${tkgParameters}`);
yield exec.exec(`bash ./get.sh ${parameters}`);
}
else {
yield exec.exec(`./get.sh ${tkgParameters}`);
yield exec.exec(`./get.sh ${parameters}`);
}
});
}
Expand Down
Loading