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

Feature/UI tests #342

Draft
wants to merge 97 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 95 commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
0b99a5a
Added ui tests top hierarchy
NikolasFunction Dec 11, 2021
f74b5eb
Added UI tests structure
NikolasFunction Dec 11, 2021
21feff3
tests are running now
Tjuri Dec 23, 2021
f9fa8bf
edit pom
Tjuri Jan 4, 2022
9a99cbb
fist progress ui tests
Tjuri Jan 7, 2022
887e421
build summary tests work
Tjuri Jan 9, 2022
2f2fef0
Added page object files plus dummy test methods (both for a few useca…
NikolasFunction Jan 9, 2022
1f077e8
Added two TODOs
NikolasFunction Jan 9, 2022
3f5f942
Fixed a bug, organized imports
NikolasFunction Jan 9, 2022
221c1a0
Added error stacktrace and message, added title failures
NikolasFunction Jan 9, 2022
8539c95
merge stashed changes
Tjuri Jan 9, 2022
3e5d283
added test utils class
Tjuri Jan 9, 2022
db36b91
fixed test in build summary
Tjuri Jan 9, 2022
8054bbb
added todo for check extraction of test result text
Tjuri Jan 9, 2022
9958c4a
Fixes in junitBuildDetail
Tjuri Jan 9, 2022
c226c3f
Added tests, fixed a few things, deleted unused README
NikolasFunction Jan 9, 2022
0db2210
Merge remote-tracking branch 'origin/develop' into develop
NikolasFunction Jan 9, 2022
4d65bfd
Replaced hamcrest with assertj, fixed copy bug
NikolasFunction Jan 13, 2022
5bc7a8b
Fixed testing bug
NikolasFunction Jan 13, 2022
c373ba3
Fixed Testing Bugs
NikolasFunction Jan 13, 2022
5580459
Added build configuration UI tests. In progress.
Tjuri Jan 14, 2022
25a1b69
added junit publisher tests. in progress
Tjuri Jan 15, 2022
f146352
added test for retain long standard output error
Tjuri Jan 15, 2022
271bf79
Moved files, removed hamcrest testing, fixed openPage, fixed test
NikolasFunction Jan 16, 2022
104debe
Moved files, removed hamcrest testing, fixed openPage, fixed test
NikolasFunction Jan 16, 2022
587624b
added test for direct url navigation to test report
Tjuri Jan 16, 2022
082d67c
Refactored BuildDetails, fixed tests, implemented tests
NikolasFunction Jan 17, 2022
ede0865
Implemented tests, fixed tests, added testfiles
NikolasFunction Jan 19, 2022
995a01c
cleaned up tests.
Tjuri Jan 19, 2022
f111cef
rename and restructure tests
Tjuri Jan 19, 2022
4a9c808
Merge branch 'feature/renaming-of-test-classes' into develop
Tjuri Jan 19, 2022
e72a54a
added test verifyWithNoFailures in BuildTestResultsByPackageTest
Tjuri Jan 19, 2022
3b0f5e4
corrected author name
Tjuri Jan 19, 2022
53ce8a1
corrected descriptions of test classes
Tjuri Jan 19, 2022
4c1db9d
added more tests.
Tjuri Jan 19, 2022
2793e80
progress test implementation
Tjuri Jan 20, 2022
3e835e3
added evaluation of diff in BuildTestResultsByPackageTest
Tjuri Jan 20, 2022
ca153cd
Fixed parsing bugs
NikolasFunction Jan 20, 2022
9a77bf6
moved code for two builds with increasing test failures into utils me…
Tjuri Jan 20, 2022
65d30b4
tests for verifying differences in build failures and passed tests works
Tjuri Jan 20, 2022
edfb16f
Added new tests for regression of test. Added javaDocs to many test.
Tjuri Jan 20, 2022
f032062
Added interface for ProjectSummaryPage
NikolasFunction Jan 20, 2022
1948a76
Merge remote-tracking branch 'origin/develop' into develop
NikolasFunction Jan 20, 2022
1da2535
added more javadocs
Tjuri Jan 20, 2022
21a076d
Implemented tests (pair programming)
NikolasFunction Jan 20, 2022
2b70169
Merge remote-tracking branch 'origin/develop' into develop
NikolasFunction Jan 20, 2022
91c958c
Cleaned up ProjectSummaryTest after merge
Tjuri Jan 20, 2022
8343cb4
Removed old test
Tjuri Jan 20, 2022
1fc6342
Documented FixedCopyJobDecorator
NikolasFunction Jan 20, 2022
5637f70
Merge remote-tracking branch 'origin/develop' into develop
NikolasFunction Jan 20, 2022
75ddfe9
Refactored tests.
Tjuri Jan 20, 2022
573bbb7
Fixed test in JobConfigurationTest.
Tjuri Jan 20, 2022
5b4c1ce
Cleaned up TestDetailTest and added Javadocs.
Tjuri Jan 20, 2022
1bb2c0b
Added documentation
NikolasFunction Jan 20, 2022
8b28141
Merge remote-tracking branch 'origin/develop' into develop
NikolasFunction Jan 20, 2022
bfb40f4
Reduced redundancy in TestUtils
Tjuri Jan 20, 2022
3932b96
Merge branch 'develop' of https://github.com/NikolasFunction/junit-pl…
Tjuri Jan 20, 2022
8896a2b
Added documentation
NikolasFunction Jan 20, 2022
8637e4f
Merge remote-tracking branch 'origin/develop' into develop
NikolasFunction Jan 20, 2022
d951ffb
Added more java docs
Tjuri Jan 20, 2022
9d2a823
Fixed get title bug
NikolasFunction Jan 20, 2022
f8e6b57
Merge remote-tracking branch 'origin/develop' into develop
NikolasFunction Jan 20, 2022
b3160f0
fixed test.
Tjuri Jan 20, 2022
a777753
Created feature branch
NikolasFunction Jan 20, 2022
67dc926
fixed order of booleans
Tjuri Jan 20, 2022
692a63c
removed test
Tjuri Jan 20, 2022
b41bb85
fixed tests
Tjuri Jan 20, 2022
246795a
Merge branch 'develop' into feature/ui-tests
Tjuri Jan 20, 2022
93bc858
fixed code styling
Tjuri Jan 20, 2022
d0affb2
added javadocs
Tjuri Jan 20, 2022
da45943
edited code styling
Tjuri Jan 20, 2022
8ae96e7
Added documentation
NikolasFunction Jan 20, 2022
be8fba4
Merge remote-tracking branch 'origin/feature/ui-tests' into feature/u…
NikolasFunction Jan 20, 2022
8a2d2e5
Optimized imports
NikolasFunction Jan 20, 2022
00bfad4
private class variable
Tjuri Jan 20, 2022
a719458
Merge branch 'feature/ui-tests' of https://github.com/NikolasFunction…
Tjuri Jan 20, 2022
7060ea7
Update selection of links due to removed CSS classes in https://githu…
uhafner Feb 10, 2022
bb6f5d6
Fix some typos in maven test setup (local and CI tests).
uhafner Feb 10, 2022
adac616
Add actions to run the UI tests.
uhafner Feb 10, 2022
754d9e2
Merge remote-tracking branch 'upstream/master' into feature/ui-tests
uhafner Feb 10, 2022
7010942
Merge pom.xml with `master`.
uhafner Feb 10, 2022
f6f8011
Update ui-tests.yml
timja Feb 10, 2022
40bb597
Move ui-tests workflow to correct folder.
uhafner Feb 10, 2022
8cf406a
Update selection of links due to removed CSS classes in https://githu…
uhafner Feb 10, 2022
0e2b337
Fix some paths due to new table layout changes.
uhafner Feb 14, 2022
d9d506e
Merge remote-tracking branch 'upstream/master' into ui-tests
uhafner Feb 15, 2022
ae69d52
Merge with master.
uhafner Feb 15, 2022
c085a11
Use JDK 11 in build.
uhafner Feb 16, 2022
4a6c035
Update steps to latest versions.
uhafner Feb 16, 2022
0f8f584
Fix Jenkinsfile configuration for JDK11.
uhafner Feb 16, 2022
ede4252
Add caching to Java setup step.
uhafner Feb 16, 2022
f4ed8b7
Fix broken yml file.
uhafner Feb 16, 2022
ba363f9
Add missing checkout.
uhafner Feb 16, 2022
ac49da6
Use `docker` agent in CI.
uhafner Feb 20, 2022
dad7865
Start test `ProjectSummaryTest`.
uhafner Feb 20, 2022
d91569f
fixed seperation of text title and text for failures in build summary
Tjuri Mar 26, 2022
0c85320
Fixed assertion in multiple test classes. Few still missing
Tjuri Mar 27, 2022
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
  •  
  •  
  •  
155 changes: 155 additions & 0 deletions .github/workflows/ui-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
name: 'Run UI tests'

on:
push:
branches:
- master
pull_request:

jobs:
build-summary:
runs-on: [ubuntu-latest]
name: Build summary UI tests

steps:
- uses: actions/[email protected]
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
check-latest: true
cache: 'maven'
- name: Build junit plugin and download dependencies
run: mvn -V -ntp verify -Pskip --file plugin/pom.xml -Dgpg.skip
- name: Run UI tests for the tests summary on the build summary page of a job
env:
BROWSER: firefox-container
run: mvn -V -ntp test --file ui-tests/pom.xml -Dtest=BuildSummaryTest -Dgpg.skip -Dsurefire.rerunFailingTestsCount=1

build-results:
runs-on: [ubuntu-latest]
name: Build results UI tests

steps:
- uses: actions/[email protected]
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
check-latest: true
cache: 'maven'
- name: Build junit plugin and download dependencies
run: mvn -V -ntp verify -Pskip --file plugin/pom.xml -Dgpg.skip
- name: Run UI tests for the detail view of failed unit tests of a build
env:
BROWSER: firefox-container
run: mvn -V -ntp test --file ui-tests/pom.xml -Dtest=BuildTestResultsTest -Dgpg.skip -Dsurefire.rerunFailingTestsCount=1

details:
runs-on: [ubuntu-latest]
name: Details UI tests

steps:
- uses: actions/[email protected]
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
check-latest: true
cache: 'maven'
- name: Build junit plugin and download dependencies
run: mvn -V -ntp verify -Pskip --file plugin/pom.xml -Dgpg.skip
- name: Run UI tests for the detail view of a failed JUnit test
env:
BROWSER: firefox-container
run: mvn -V -ntp test --file ui-tests/pom.xml -Dtest=TestDetailTest -Dgpg.skip -Dsurefire.rerunFailingTestsCount=1

publisher:
runs-on: [ubuntu-latest]
name: Publisher UI tests

steps:
- uses: actions/[email protected]
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
check-latest: true
cache: 'maven'
- name: Cache local Maven repository
uses: actions/[email protected]
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build junit plugin and download dependencies
run: mvn -V -ntp verify -Pskip --file plugin/pom.xml -Dgpg.skip
- name: Run UI tests for the job configuration of the JUnit test results report publisher
env:
BROWSER: firefox-container
run: mvn -V -ntp test --file ui-tests/pom.xml -Dtest=JobConfigurationTest -Dgpg.skip -Dsurefire.rerunFailingTestsCount=1

job-overview:
runs-on: [ubuntu-latest]
name: Job overview UI tests

steps:
- uses: actions/[email protected]
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
check-latest: true
cache: 'maven'
- name: Build junit plugin and download dependencies
run: mvn -V -ntp verify -Pskip --file plugin/pom.xml -Dgpg.skip
- name: Run UI tests for the the published results of JUnit tests on the job summary page
env:
BROWSER: firefox-container
run: mvn -V -ntp test --file ui-tests/pom.xml -Dtest=ProjectSummaryTest -Dgpg.skip -Dsurefire.rerunFailingTestsCount=1

class-filter:
runs-on: [ubuntu-latest]
name: Filtered by class UI tests

steps:
- uses: actions/[email protected]
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
check-latest: true
cache: 'maven'
- name: Build junit plugin and download dependencies
run: mvn -V -ntp verify -Pskip --file plugin/pom.xml -Dgpg.skip
- name: Run UI tests for the unit tests results of a build which are filtered by a class
env:
BROWSER: firefox-container
run: mvn -V -ntp test --file ui-tests/pom.xml -Dtest=BuildTestResultsByClassTest -Dgpg.skip -Dsurefire.rerunFailingTestsCount=1

package-filter:
runs-on: [ubuntu-latest]
name: Filtered by package UI tests

steps:
- uses: actions/[email protected]
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
check-latest: true
cache: 'maven'
- name: Build junit plugin and download dependencies
run: mvn -V -ntp verify -Pskip --file plugin/pom.xml -Dgpg.skip
- name: Run UI tests for the unit tests results of a build which are filtered by a package
env:
BROWSER: firefox-container
run: mvn -V -ntp test --file ui-tests/pom.xml -Dtest=BuildTestResultsByPackageTest -Dgpg.skip -Dsurefire.rerunFailingTestsCount=1
5 changes: 4 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
buildPlugin(useContainerAgent: true, platforms: ['linux'])
def configurations = [
[ platform: "docker", jdk: "11" ]
]
buildPlugin(configurations: configurations)
File renamed without changes.
File renamed without changes.
207 changes: 207 additions & 0 deletions plugin/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.31</version>
<relativePath />
</parent>
<artifactId>junit</artifactId>
<version>${revision}${changelist}</version>
<packaging>hpi</packaging>
<name>JUnit Plugin</name>
<description>Allows JUnit-format test results to be published.</description>
<url>https://github.com/jenkinsci/junit-plugin</url>
<properties>
<revision>1.56</revision>
<changelist>-SNAPSHOT</changelist>
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
<jenkins.version>2.321</jenkins.version>
<java.level>8</java.level>
<no-test-jar>false</no-test-jar>
</properties>
<licenses>
<license>
<name>MIT</name>
<url>https://opensource.org/licenses/MIT</url>
</license>
</licenses>
<scm>
<connection>scm:git:git://github.com/${gitHubRepo}.git</connection>
<developerConnection>scm:git:[email protected]:${gitHubRepo}.git</developerConnection>
<url>https://github.com/${gitHubRepo}</url>
<tag>${scmTag}</tag>
</scm>
<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>echarts-api</artifactId>
</dependency>
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>checks-api</artifactId>
</dependency>
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>checks-api</artifactId>
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>plugin-util-api</artifactId>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>display-url-api</artifactId>
</dependency>
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>github-checks</artifactId>
<version>1.0.16</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>bootstrap4-api</artifactId>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-step-api</artifactId>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-api</artifactId>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>script-security</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>matrix-project</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-cps</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-job</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-cps</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-basic-steps</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-support</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>pipeline-stage-step</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-durable-task-step</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkinsci.plugins</groupId>
<artifactId>pipeline-model-definition</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>database</artifactId>
<version>128.vaa83e142f7f2</version>
<scope>test</scope>
<exclusions>
<exclusion> <!-- TODO move to bom in Jenkins core -->
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>database-h2</artifactId>
<version>1.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.jenkins</groupId>
<artifactId>configuration-as-code</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.jenkins.configuration-as-code</groupId>
<artifactId>test-harness</artifactId>
<scope>test</scope>
<!-- TODO bump version in jcasc -->
<exclusions>
<exclusion>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>jackson2-api</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.303.x</artifactId>
<version>1117.v62a_f6a_01de98</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<!-- mockito and hibernate are conflicting (both test dependencies) -->
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.12.8</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import hudson.model.Saveable;
import hudson.model.TaskListener;
import hudson.tasks.junit.JUnitTask;
import hudson.tasks.junit.Messages;
import hudson.tasks.junit.TestDataPublisher;
import hudson.util.DescribableList;
import hudson.util.FormValidation;
Expand Down Expand Up @@ -190,15 +189,5 @@ public Set<? extends Class<?>> getRequiredContext() {
return Collections.unmodifiableSet(context);
}

public FormValidation doCheckHealthScaleFactor(@QueryParameter double value) {
Copy link
Member

Choose a reason for hiding this comment

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

Why is this removed if the change is only adding UI tets?

if (value < 1e-7) return FormValidation.warning("Test health reporting disabled");
return FormValidation.ok(Messages.JUnitResultArchiver_HealthScaleFactorAnalysis(
1,
(int) (100.0 - Math.max(0.0, Math.min(100.0, 1 * value))),
5,
(int) (100.0 - Math.max(0.0, Math.min(100.0, 5 * value)))
));
}

}
}
Loading