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

Move UI tests from ATH to plugin #396

Closed
wants to merge 47 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
86c1f90
Copy ATH files to plugin.
uhafner Feb 25, 2020
b6656fd
Activate release drafter as GitHub action.
uhafner Feb 25, 2020
834c744
Bump version of analysis-pom to 2.2.1.
uhafner Feb 25, 2020
492ad39
Bump version of plugin-util to 0.1.0-beta10.
uhafner Feb 25, 2020
72ea8f4
Bump version of jquery3 to 3.4.1-7-beta1.
uhafner Feb 25, 2020
a45b2a1
Bump version of font-awesome to 5.12.0-5-beta1.
uhafner Feb 25, 2020
5e1f22b
Bump version of analysis-model to 8.0.0-beta17.
uhafner Feb 25, 2020
c2a0776
Bump version of bootstrap to 4.4.1-8-beta1.
uhafner Feb 25, 2020
e1babe6
Bump version of datatables to 1.10.20-10-beta1.
uhafner Feb 25, 2020
aae13a0
Bump version of echarts to 4.6.0-4-beta1.
uhafner Feb 25, 2020
f30a984
Bump echarts to 4.6.0-5-beta1.
uhafner Feb 26, 2020
a99b3a8
Bump forensics to 0.7.0-beta8.
uhafner Feb 26, 2020
802058d
Bump git-forensics to 0.7.0-beta6.
uhafner Feb 26, 2020
899e8fa
Move DuplicationGroup to analysis package.
uhafner Feb 26, 2020
d12d762
[maven-release-plugin] prepare release warnings-ng-8.0.0-beta7
uhafner Feb 26, 2020
8658f4c
[maven-release-plugin] prepare for next development iteration
uhafner Feb 26, 2020
5862af8
Add alias to old package of DuplicationGroup.
uhafner Feb 27, 2020
3f8eef2
[maven-release-plugin] prepare release warnings-ng-8.0.0-beta8
uhafner Feb 27, 2020
cda3a6d
[maven-release-plugin] prepare for next development iteration
uhafner Feb 27, 2020
3147c31
Use JacksonFacade from echarts module.
uhafner Feb 28, 2020
08b613f
Bump versions of UI plugins to first public release.
uhafner Feb 29, 2020
a794064
Bump version of data tables to 1.10.20-12.
uhafner Feb 29, 2020
9c4e87f
Bump analysis-pom from 2.2.1 to 2.2.2
dependabot-preview[bot] Feb 28, 2020
73ceba3
Bump version of data tables to 1.10.20-13.
uhafner Mar 1, 2020
423df37
Bump UI plugins to released versions.
uhafner Mar 1, 2020
42b7347
Use JacksonFacade from echarts module.
uhafner Mar 1, 2020
51a0566
Remove dependency to codingstyle test-jar.
uhafner Mar 1, 2020
c70b38a
Bump version of plugin-util to 1.0.1.
uhafner Mar 1, 2020
914c2e7
Bump version to 8.0.0.
uhafner Mar 1, 2020
f8185cb
[maven-release-plugin] prepare release warnings-ng-8.0.0
uhafner Mar 1, 2020
c6b4913
[maven-release-plugin] prepare for next development iteration
uhafner Mar 1, 2020
1d8ea26
Expose NPE from JENKINS-61293.
uhafner Mar 3, 2020
ed16bb3
Bump version of analysis-model to 8.0.2 and plugin-util to 1.0.2.
uhafner Mar 3, 2020
3172354
Bump jsoup from 1.12.2 to 1.13.1
dependabot-preview[bot] Mar 2, 2020
b22f5e6
Bump configuration-as-code from 1.35 to 1.36
dependabot-preview[bot] Mar 2, 2020
9fa398d
Improve naming of labels.
uhafner Mar 4, 2020
4e9e595
Move POs to correct package.
uhafner Mar 7, 2020
5afcf60
Add JUnit 4 on classpath.
uhafner Mar 8, 2020
28b5770
Create multi-module pom.
uhafner Mar 8, 2020
f7ff787
Add forgotten files.
uhafner Mar 8, 2020
ae96c7a
Improve new POMs.
uhafner Mar 8, 2020
b31036f
Disable ITests.
uhafner Mar 8, 2020
9ff3f2d
Temporarily remove Windows node.
uhafner Mar 8, 2020
31b0071
Fix folder name.
uhafner Mar 8, 2020
1a1cdba
Fix name of BROWSER.
uhafner Mar 8, 2020
8155ae9
Use new Jenkinsfile.
uhafner Mar 8, 2020
740893b
Restart tests.
uhafner Mar 9, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ labels:
description: Enhancement of existing functionality
color: 94a6eb
- name: deprecated
description: Deprecating API
description: API Deprecation
color: f4c21d
- name: removed
description: Removing API
description: API Removal
color: e4b21d
- name: tests
description: Enhancement of tests
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/run-release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Release Drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
290 changes: 218 additions & 72 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,89 +1,235 @@
node ('maven') {
timeout(200) {
stage ('Linux Checkout') {
checkout scm
}
Map params = [platform: "docker && highmem", jdk: "8"]

stage ('Linux Build') {
String jdk = '8'
String jdkTool = "jdk${jdk}"
List<String> env = [
"JAVA_HOME=${tool jdkTool}",
'PATH+JAVA=${JAVA_HOME}/bin',
]
String command
List<String> mavenOptions = [
'--batch-mode',
'--errors',
'--update-snapshots',
'-Dmaven.test.failure.ignore',
]
if (jdk.toInteger() > 7 && infra.isRunningOnJenkinsInfra()) {
/* Azure mirror only works for sufficiently new versions of the JDK due to Letsencrypt cert */
def settingsXml = "${pwd tmp: true}/settings-azure.xml"
writeFile file: settingsXml, text: libraryResource('settings-azure.xml')
mavenOptions += "-s $settingsXml"
}
mavenOptions += "clean verify jacoco:prepare-agent test integration-test jacoco:report -Djenkins.test.timeout=1000"
command = "mvn ${mavenOptions.join(' ')}"
env << "PATH+MAVEN=${tool 'mvn'}/bin"
// Faster build and reduces IO needs
properties([
durabilityHint('PERFORMANCE_OPTIMIZED'),
buildDiscarder(logRotator(numToKeepStr: '5')),
])

def repo = params.containsKey('repo') ? params.repo : null
def failFast = params.containsKey('failFast') ? params.failFast : true
def timeoutValue = params.containsKey('timeout') ? params.timeout : 60
def useAci = params.containsKey('useAci') ? params.useAci : false
def forceAci = params.containsKey('forceAci') ? params.forceAci : false
if(timeoutValue > 180) {
echo "Timeout value requested was $timeoutValue, lowering to 180 to avoid Jenkins project's resource abusive consumption"
timeoutValue = 180
}

withEnv(env) {
sh command
boolean publishingIncrementals = false
boolean archivedArtifacts = false
Map tasks = [failFast: failFast]
getConfigurations(params).each { config ->
String label = config.platform
String jdk = config.jdk
String jenkinsVersion = config.jenkins
String javaLevel = config.javaLevel

String stageIdentifier = "${label}-${jdk}${jenkinsVersion ? '-' + jenkinsVersion : ''}"
boolean first = tasks.size() == 1
boolean skipTests = params?.tests?.skip
boolean reallyUseAci = (useAci && label == 'linux') || forceAci
boolean addToolEnv = !reallyUseAci

if(reallyUseAci) {
String aciLabel = jdk == '8' ? 'maven' : 'maven-11'
if(label == 'windows') {
aciLabel += "-windows"
}
label = aciLabel
}

archiveArtifacts artifacts: '**/target/*.hpi', fingerprint: true
tasks[stageIdentifier] = {
node(label) {
try {
timeout(timeoutValue) {
boolean isMaven
// Archive artifacts once with pom declared baseline
boolean doArchiveArtifacts = !jenkinsVersion && !archivedArtifacts
if (doArchiveArtifacts) {
archivedArtifacts = true
}
boolean incrementals // cf. JEP-305

junit testResults: '**/target/*-reports/TEST-*.xml'
stage("Checkout (${stageIdentifier})") {
infra.checkout(repo)
isMaven = fileExists('pom.xml')
incrementals = fileExists('.mvn/extensions.xml') &&
readFile('.mvn/extensions.xml').contains('git-changelist-maven-extension')
}

recordIssues enabledForFailure: true, tool: mavenConsole(), referenceJobName: 'Plugins/warnings-ng-plugin/master'
recordIssues enabledForFailure: true, tools: [java(), javaDoc()], sourceCodeEncoding: 'UTF-8', referenceJobName: 'Plugins/warnings-ng-plugin/master'
recordIssues enabledForFailure: true, tool: checkStyle(pattern: 'target/checkstyle-result.xml'), sourceCodeEncoding: 'UTF-8', referenceJobName: 'Plugins/warnings-ng-plugin/master'
recordIssues enabledForFailure: true, tool: cpd(pattern: 'target/cpd.xml'), sourceCodeEncoding: 'UTF-8', referenceJobName: 'Plugins/warnings-ng-plugin/master'
recordIssues enabledForFailure: true, tool: pmdParser(pattern: 'target/pmd.xml'), sourceCodeEncoding: 'UTF-8', referenceJobName: 'Plugins/warnings-ng-plugin/master'
recordIssues enabledForFailure: true, tool: spotBugs(pattern: 'target/spotbugsXml.xml'), sourceCodeEncoding: 'UTF-8', referenceJobName: 'Plugins/warnings-ng-plugin/master'
recordIssues enabledForFailure: true, tool: taskScanner(includePattern:'**/*.java', excludePattern:'target/**/*,**/TaskScannerTest*', highTags:'FIXME', normalTags:'TODO'), sourceCodeEncoding: 'UTF-8', referenceJobName: 'Plugins/warnings-ng-plugin/master'
jacoco()
sh "curl -s https://codecov.io/bash | bash -s - -t c4071f73-a222-43ff-a41b-a6c8c118e242"
String changelistF
String m2repo

stage("Build (${stageIdentifier})") {
String command
if (isMaven) {
m2repo = "${pwd tmp: true}/m2repo"
List<String> mavenOptions = [
'--update-snapshots',
"-Dmaven.repo.local=$m2repo",
'-Dmaven.test.failure.ignore',
]
if (incrementals) { // set changelist and activate produce-incrementals profile
mavenOptions += '-Dset.changelist'
if (doArchiveArtifacts) { // ask Maven for the value of -rc999.abc123def456
changelistF = "${pwd tmp: true}/changelist"
mavenOptions += "help:evaluate -Dexpression=changelist -Doutput=$changelistF"
}
}
if (jenkinsVersion) {
mavenOptions += "-Djenkins.version=${jenkinsVersion} -Daccess-modifier-checker.failOnError=false"
}
if (javaLevel) {
mavenOptions += "-Djava.level=${javaLevel}"
}
if (skipTests) {
mavenOptions += "-DskipTests -DskipITs"
}
mavenOptions += "clean install -npu -DskipITs"
infra.runMaven(mavenOptions, jdk, ["BROWSER=firefox-container"], null, addToolEnv)
} else {
echo "WARNING: Gradle mode for buildPlugin() is deprecated, please use buildPluginWithGradle()"
List<String> gradleOptions = [
'--no-daemon',
'cleanTest',
'build',
]
command = "gradlew ${gradleOptions.join(' ')}"
if (isUnix()) {
command = "./" + command
}
infra.runWithJava(command, jdk, null, addToolEnv)
}
}

stage("Archive (${stageIdentifier})") {
if (!skipTests) {
String testReports
if (isMaven) {
testReports = '**/target/surefire-reports/**/*.xml,**/target/failsafe-reports/**/*.xml'
} else {
testReports = '**/build/test-results/**/*.xml'
}
junit testReports
// TODO do this in a finally-block so we capture all test results even if one branch aborts early
}
if (failFast && currentBuild.result == 'UNSTABLE') {
error 'There were test failures; halting early'
}

if (first) {
recordIssues enabledForFailure: true, tool: mavenConsole()
recordIssues enabledForFailure: true, tools: [java(), javaDoc()], sourceCodeEncoding: 'UTF-8'
recordIssues tools: [spotBugs(), checkStyle(), pmdParser(), cpd()], sourceCodeEncoding: 'UTF-8'
recordIssues enabledForFailure: true, tool: taskScanner(
includePattern:'**/*.java',
excludePattern:'target/**',
highTags:'FIXME',
normalTags:'TODO'), sourceCodeEncoding: 'UTF-8'
if (failFast && currentBuild.result == 'UNSTABLE') {
error 'There were static analysis warnings; halting early'
}
jacoco()
}
if (doArchiveArtifacts) {
if (incrementals) {
String changelist = readFile(changelistF)
dir(m2repo) {
fingerprint '**/*-rc*.*/*-rc*.*' // includes any incrementals consumed
archiveArtifacts artifacts: "**/*$changelist/*$changelist*",
excludes: '**/*.lastUpdated',
allowEmptyArchive: true // in case we forgot to reincrementalify
}
publishingIncrementals = true
} else {
String artifacts
if (isMaven) {
artifacts = '**/target/*.hpi,**/target/*.jpi,**/target/*.jar'
} else {
artifacts = '**/build/libs/*.hpi,**/build/libs/*.jpi'
}
archiveArtifacts artifacts: artifacts, fingerprint: true
}
}
}
}
} finally {
if (hasDockerLabel()) {
if(isUnix()) {
sh 'docker system prune --force --all || echo "Failed to cleanup docker images"'
} else {
bat 'docker system prune --force --all || echo "Failed to cleanup docker images"'
}
}
}
}
}
}

parallel(tasks)
if (publishingIncrementals) {
infra.maybePublishIncrementals()
}

boolean hasDockerLabel() {
env.NODE_LABELS?.contains("docker")
}

node ('windows') {
timeout(200) {
stage ('Windows Checkout') {
checkout scm
List<Map<String, String>> getConfigurations(Map params) {
boolean explicit = params.containsKey("configurations")
boolean implicit = params.containsKey('platforms') || params.containsKey('jdkVersions') || params.containsKey('jenkinsVersions')

if (explicit && implicit) {
error '"configurations" option can not be used with either "platforms", "jdkVersions" or "jenkinsVersions"'
}


def configs = params.configurations
configs.each { c ->
if (!c.platform) {
error("Configuration field \"platform\" must be specified: $c")
}
if (!c.jdk) {
error("Configuration filed \"jdk\" must be specified: $c")
}
}

stage ('Windows Build') {
String jdk = '8'
String jdkTool = "jdk${jdk}"
List<String> env = [
"JAVA_HOME=${tool jdkTool}",
'PATH+JAVA=${JAVA_HOME}/bin',
]
String command
List<String> mavenOptions = [
'--batch-mode',
'--errors',
'--update-snapshots',
'-Dmaven.test.failure.ignore',
]
if (jdk.toInteger() > 7 && infra.isRunningOnJenkinsInfra()) {
/* Azure mirror only works for sufficiently new versions of the JDK due to Letsencrypt cert */
def settingsXml = "${pwd tmp: true}/settings-azure.xml"
writeFile file: settingsXml, text: libraryResource('settings-azure.xml')
mavenOptions += "-s $settingsXml"
}
mavenOptions += "clean verify -Djenkins.test.timeout=1000"
command = "mvn ${mavenOptions.join(' ')}"
env << "PATH+MAVEN=${tool 'mvn'}/bin"
if (explicit) return params.configurations

withEnv(env) {
bat command
}
def platforms = params.containsKey('platforms') ? params.platforms : ['linux', 'windows']
def jdkVersions = params.containsKey('jdkVersions') ? params.jdkVersions : [8]
def jenkinsVersions = params.containsKey('jenkinsVersions') ? params.jenkinsVersions : [null]

junit testResults: '**/target/*-reports/TEST-*.xml'
def ret = []
for (p in platforms) {
for (jdk in jdkVersions) {
for (jenkins in jenkinsVersions) {
ret << [
"platform": p,
"jdk": jdk,
"jenkins": jenkins,
"javaLevel": null // not supported in the old format
]
}
}
}
return ret
}

/**
* Get recommended configurations for testing.
* Includes testing Java 8 and 11 on the newest LTS.
*/
static List<Map<String, String>> recommendedConfigurations() {
def recentLTS = "2.164.1"
def configurations = [
[ platform: "linux", jdk: "8", jenkins: null ],
[ platform: "windows", jdk: "8", jenkins: null ],
[ platform: "linux", jdk: "8", jenkins: recentLTS, javaLevel: "8" ],
[ platform: "windows", jdk: "8", jenkins: recentLTS, javaLevel: "8" ],
[ platform: "linux", jdk: "11", jenkins: recentLTS, javaLevel: "8" ],
[ platform: "windows", jdk: "11", jenkins: recentLTS, javaLevel: "8" ]
]
return configurations
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading