Skip to content

Commit

Permalink
support custom_target
Browse files Browse the repository at this point in the history
  • Loading branch information
Sophia Guo committed May 12, 2020
1 parent 79a6303 commit 43100af
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 73 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ jobs:
uses: ./
with:
version: '11'
jdksource: 'customized'
jdksource: 'install-jdk'
build_list: 'functional'
target: '_floatSanityTests'
25 changes: 0 additions & 25 deletions .github/workflows/testcustom.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/testexample.yml

This file was deleted.

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,7 @@ Thumbs.db

# Ignore built ts files
__tests__/runner/*
lib/**/*
lib/**/*

# Ignore Eclipse project
.project
11 changes: 0 additions & 11 deletions .project

This file was deleted.

5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ You can also:
| version | 8 |
| build_list | openjdk |
| target | _jdk_math |
| custom_target | |
| jdksource | upstream |


### version
The Java version that tests are running against (Supported values are: 8, 9, 10, 11, 12, 13, ...)
By default, this action will run against upstream jdk build action installed JDK. Specifying this parameter is required when jdksource is not `upstream`.
Expand All @@ -103,6 +105,9 @@ Test category. The values are openjdk, functional, system, perf, external.
### target
Specific testcase name or different test level under build_list

### custom_target
Set customized testcase when any custom target is selected(e.g. jdk_custom, langtools_custom, etc) , path to the test class to execute

### jdksource
THe source of test against JDK. Default is `upstream`. Supported value is [`upstream`, `install-jdk`, `github-hosted`]
- upstream: JDK built by buildjdk action
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ inputs:
target: # test
description:
default: '_jdk_math'
custom_target:
custom_target: # Used if need to set non-default custom target
description:
required: false
runs:
Expand Down
12 changes: 7 additions & 5 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3241,10 +3241,6 @@ const isWindows = process.platform === 'win32';
function runaqaTest(version, jdksource, buildList, target, customTarget) {
return __awaiter(this, void 0, void 0, function* () {
yield installDependency();
let customOption = '';
if (target.includes('custom') && customTarget !== '') {
customOption = `${target.toUpperCase()}_TARGET=${customTarget}`;
}
process.env.BUILD_LIST = buildList;
if (!('TEST_JDK_HOME' in process.env))
process.env.TEST_JDK_HOME = getTestJdkHome(version, jdksource);
Expand All @@ -3265,7 +3261,13 @@ function runaqaTest(version, jdksource, buildList, target, customTarget) {
process.chdir('TKG');
try {
yield exec.exec('make compile');
yield exec.exec('make', [`${target} ${customOption}`], options);
if (target.includes('custom') && customTarget !== '') {
const customOption = `${target.substr(1).toUpperCase()}_TARGET=${customTarget}`;
yield exec.exec('make', [`${target}`, `${customOption}`], options);
}
else {
yield exec.exec('make', [`${target}`], options);
}
}
catch (error) {
core.setFailed(error.message);
Expand Down
11 changes: 6 additions & 5 deletions src/runaqa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ export async function runaqaTest(
customTarget: string
): Promise<void> {
await installDependency()
let customOption = ''
if (target.includes('custom') && customTarget !== '') {
customOption = `${target.toUpperCase()}_TARGET=${customTarget}`
}
process.env.BUILD_LIST = buildList
if (!('TEST_JDK_HOME' in process.env)) process.env.TEST_JDK_HOME = getTestJdkHome(version, jdksource)

Expand All @@ -41,7 +37,12 @@ export async function runaqaTest(
process.chdir('TKG')
try {
await exec.exec('make compile')
await exec.exec('make', [`${target} ${customOption}`], options)
if (target.includes('custom') && customTarget !== '') {
const customOption = `${target.substr(1).toUpperCase()}_TARGET=${customTarget}`
await exec.exec('make', [`${target}`, `${customOption}`], options)
} else {
await exec.exec('make', [`${target}`], options)
}
} catch (error) {
core.setFailed(error.message)
}
Expand Down

0 comments on commit 43100af

Please sign in to comment.