From 79a630334897960d93fd4d633e6fd5323db56f66 Mon Sep 17 00:00:00 2001 From: Sophia Guo Date: Mon, 11 May 2020 21:28:17 -0400 Subject: [PATCH 1/2] support custom_target --- .github/workflows/test.yml | 4 ++-- .github/workflows/testcustom.yml | 25 +++++++++++++++++++++++++ .github/workflows/testexample.yml | 24 ++++++++++++++++++++++++ .project | 11 +++++++++++ action.yml | 5 ++++- dist/index.js | 11 ++++++++--- src/aqa.ts | 3 ++- src/runaqa.ts | 9 +++++++-- 8 files changed, 83 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/testcustom.yml create mode 100644 .github/workflows/testexample.yml create mode 100644 .project diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8eb5755..a23ba81 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,8 +1,8 @@ name: "build-test" on: # rebuild any PRs and main branch changes push: - branches: - - feature + branches-ignore: + - '**' jobs: build: # make sure build/ci work properly diff --git a/.github/workflows/testcustom.yml b/.github/workflows/testcustom.yml new file mode 100644 index 0000000..378fcc8 --- /dev/null +++ b/.github/workflows/testcustom.yml @@ -0,0 +1,25 @@ +name: "build-test" +on: # rebuild any PRs and main branch changes + push: + +jobs: + build: # make sure build/ci work properly + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + steps: + - uses: actions/checkout@v1 + - uses: AdoptOpenJDK/install-jdk@v1 + with: + version: '11' + targets: 'JDK_11' + - name: AQA + uses: ./ + with: + version: '11' + jdksource: 'install-jdk' + build_list: 'openjdk' + target: '_jdk_custom' + custom_target: 'test/jdk/java/math/BigInteger/BigIntegerTest.java' diff --git a/.github/workflows/testexample.yml b/.github/workflows/testexample.yml new file mode 100644 index 0000000..5f4ca00 --- /dev/null +++ b/.github/workflows/testexample.yml @@ -0,0 +1,24 @@ +name: "build-test" +on: # rebuild any PRs and main branch changes + push: + +jobs: + build: # make sure build/ci work properly + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] #[ubuntu-latest, macos-latest] + steps: + - uses: actions/checkout@v1 + - uses: AdoptOpenJDK/install-jdk@v1 + with: + version: '11' + targets: 'JDK_11' + - name: AQA + uses: ./ + with: + version: '11' + jdksource: 'install-jdk' + build_list: 'openjdk' + target: '_jdk_custom' diff --git a/.project b/.project new file mode 100644 index 0000000..c4660bd --- /dev/null +++ b/.project @@ -0,0 +1,11 @@ + + + run-aqa + + + + + + + + diff --git a/action.yml b/action.yml index 478b3a9..2e2bafe 100644 --- a/action.yml +++ b/action.yml @@ -13,7 +13,10 @@ inputs: default: 'openjdk' target: # test description: - default: '_jdk_custom' + default: '_jdk_math' + custom_target: + description: + required: false runs: using: 'node12' main: 'dist/index.js' diff --git a/dist/index.js b/dist/index.js index 39565b4..c535ee3 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2890,6 +2890,7 @@ function run() { const version = core.getInput('version', { required: false }); const buildList = core.getInput('build_list', { required: false }); const target = core.getInput('target', { required: false }); + const customTarget = core.getInput('custom_target', { required: false }); // let arch = core.getInput("architecture", { required: false }) if (jdksource !== 'upstream' && jdksource !== 'github-hosted' && @@ -2906,7 +2907,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); + yield runaqa.runaqaTest(version, jdksource, buildList, target, customTarget); } catch (error) { core.setFailed(error.message); @@ -3237,9 +3238,13 @@ const io = __importStar(__webpack_require__(1)); const tc = __importStar(__webpack_require__(533)); const path = __importStar(__webpack_require__(622)); const isWindows = process.platform === 'win32'; -function runaqaTest(version, jdksource, buildList, target) { +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); @@ -3260,7 +3265,7 @@ function runaqaTest(version, jdksource, buildList, target) { process.chdir('TKG'); try { yield exec.exec('make compile'); - yield exec.exec('make', [`${target}`], options); + yield exec.exec('make', [`${target} ${customOption}`], options); } catch (error) { core.setFailed(error.message); diff --git a/src/aqa.ts b/src/aqa.ts index 9c4b375..ec83bc4 100644 --- a/src/aqa.ts +++ b/src/aqa.ts @@ -7,6 +7,7 @@ async function run(): Promise { const version = core.getInput('version', {required: false}) const buildList = core.getInput('build_list', {required: false}) const target = core.getInput('target', {required: false}) + const customTarget = core.getInput('custom_target',{required: false}) // let arch = core.getInput("architecture", { required: false }) if ( jdksource !== 'upstream' && @@ -35,7 +36,7 @@ async function run(): Promise { ) } - await runaqa.runaqaTest(version, jdksource, buildList, target) + await runaqa.runaqaTest(version, jdksource, buildList, target, customTarget) } catch (error) { core.setFailed(error.message) } diff --git a/src/runaqa.ts b/src/runaqa.ts index b78200f..bef8794 100644 --- a/src/runaqa.ts +++ b/src/runaqa.ts @@ -11,9 +11,14 @@ export async function runaqaTest( version: string, jdksource: string, buildList: string, - target: string + target: string, + customTarget: string ): Promise { 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) @@ -36,7 +41,7 @@ export async function runaqaTest( process.chdir('TKG') try { await exec.exec('make compile') - await exec.exec('make', [`${target}`], options) + await exec.exec('make', [`${target} ${customOption}`], options) } catch (error) { core.setFailed(error.message) } From 43100af6bdb1558068ee70a12b83fa7eb602fa70 Mon Sep 17 00:00:00 2001 From: Sophia Guo Date: Mon, 11 May 2020 21:41:51 -0400 Subject: [PATCH 2/2] support custom_target --- .github/workflows/test.yml | 2 +- .github/workflows/testcustom.yml | 25 ------------------------- .github/workflows/testexample.yml | 24 ------------------------ .gitignore | 5 ++++- .project | 11 ----------- README.md | 5 +++++ action.yml | 2 +- dist/index.js | 12 +++++++----- src/runaqa.ts | 11 ++++++----- 9 files changed, 24 insertions(+), 73 deletions(-) delete mode 100644 .github/workflows/testcustom.yml delete mode 100644 .github/workflows/testexample.yml delete mode 100644 .project diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a23ba81..4ab75ab 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,6 +21,6 @@ jobs: uses: ./ with: version: '11' - jdksource: 'customized' + jdksource: 'install-jdk' build_list: 'functional' target: '_floatSanityTests' diff --git a/.github/workflows/testcustom.yml b/.github/workflows/testcustom.yml deleted file mode 100644 index 378fcc8..0000000 --- a/.github/workflows/testcustom.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: "build-test" -on: # rebuild any PRs and main branch changes - push: - -jobs: - build: # make sure build/ci work properly - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest] - steps: - - uses: actions/checkout@v1 - - uses: AdoptOpenJDK/install-jdk@v1 - with: - version: '11' - targets: 'JDK_11' - - name: AQA - uses: ./ - with: - version: '11' - jdksource: 'install-jdk' - build_list: 'openjdk' - target: '_jdk_custom' - custom_target: 'test/jdk/java/math/BigInteger/BigIntegerTest.java' diff --git a/.github/workflows/testexample.yml b/.github/workflows/testexample.yml deleted file mode 100644 index 5f4ca00..0000000 --- a/.github/workflows/testexample.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: "build-test" -on: # rebuild any PRs and main branch changes - push: - -jobs: - build: # make sure build/ci work properly - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] #[ubuntu-latest, macos-latest] - steps: - - uses: actions/checkout@v1 - - uses: AdoptOpenJDK/install-jdk@v1 - with: - version: '11' - targets: 'JDK_11' - - name: AQA - uses: ./ - with: - version: '11' - jdksource: 'install-jdk' - build_list: 'openjdk' - target: '_jdk_custom' diff --git a/.gitignore b/.gitignore index 18e337d..4aafce2 100644 --- a/.gitignore +++ b/.gitignore @@ -96,4 +96,7 @@ Thumbs.db # Ignore built ts files __tests__/runner/* -lib/**/* \ No newline at end of file +lib/**/* + +# Ignore Eclipse project +.project \ No newline at end of file diff --git a/.project b/.project deleted file mode 100644 index c4660bd..0000000 --- a/.project +++ /dev/null @@ -1,11 +0,0 @@ - - - run-aqa - - - - - - - - diff --git a/README.md b/README.md index 4cc8f40..74c7115 100644 --- a/README.md +++ b/README.md @@ -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`. @@ -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 diff --git a/action.yml b/action.yml index 2e2bafe..f74fcb3 100644 --- a/action.yml +++ b/action.yml @@ -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: diff --git a/dist/index.js b/dist/index.js index c535ee3..ac2010d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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); @@ -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); diff --git a/src/runaqa.ts b/src/runaqa.ts index bef8794..49cb742 100644 --- a/src/runaqa.ts +++ b/src/runaqa.ts @@ -15,10 +15,6 @@ export async function runaqaTest( customTarget: string ): Promise { 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) @@ -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) }