├── .github
├── release-drafter.yml
├── CODEOWNERS
└── workflows
│ └── cd.yml
├── src
├── test
│ ├── resources
│ │ ├── credentialsbinding
│ │ │ ├── secretFile
│ │ │ ├── secretZip.zip
│ │ │ ├── secretTextScript
│ │ │ ├── secretTextScriptWindows
│ │ │ ├── usernameTogetherPasswordScript
│ │ │ ├── usernameTogetherPasswordScriptWindows
│ │ │ ├── secretFileScript
│ │ │ ├── secretFileScriptWindows
│ │ │ ├── usernameSplitPasswordScript
│ │ │ ├── secretZipFileScript
│ │ │ ├── secretZipFileScriptWindows
│ │ │ ├── usernameSplitPasswordScriptWindows
│ │ │ ├── sshUserPrivateKeyScript
│ │ │ └── sshUserPrivateKeyScriptWindows
│ │ ├── job_dsl_plugin
│ │ │ ├── CreateFolder.groovy
│ │ │ ├── CreateJobInFolder.groovy
│ │ │ ├── Utility.jar
│ │ │ └── MyUtilities.groovy
│ │ ├── plaincredentialsbinding
│ │ │ └── secretFile
│ │ ├── textfinder_plugin
│ │ │ ├── textfinder-result_failed.log
│ │ │ ├── textfinder-result_success.log
│ │ │ └── textfinder-result_warning.log
│ │ ├── htmlpublisher_plugin
│ │ │ ├── style.css
│ │ │ └── home.html
│ │ ├── pipelines
│ │ │ └── hello-world
│ │ │ │ └── Jenkinsfile
│ │ ├── scriptler_plugin
│ │ │ ├── hello_world.groovy
│ │ │ └── hello_parameterized.groovy
│ │ ├── docker_build_step
│ │ │ └── context.dir
│ │ │ │ └── Dockerfile
│ │ ├── logparser_plugin
│ │ │ └── rules
│ │ │ │ ├── log-parser-rule-markings
│ │ │ │ ├── log-parser-rules-sample
│ │ │ │ └── log-parser-rules-JENKINS33085
│ │ ├── configuration_as_code
│ │ │ └── trivial.yaml
│ │ ├── stageview_plugin
│ │ │ ├── single_job.txt
│ │ │ ├── multi_job.txt
│ │ │ ├── multi_job_aborted.txt
│ │ │ ├── multi_job_unstable.txt
│ │ │ ├── multi_job_fail.txt
│ │ │ └── multi_job_irregularnames.txt
│ │ ├── gradle_plugin
│ │ │ ├── scriptNoPlugins.gradle
│ │ │ ├── pipeline_test_multiple_tasks.txt
│ │ │ └── script.gradle
│ │ ├── plugins
│ │ │ └── ant
│ │ │ │ ├── echo-helloworld.xml
│ │ │ │ └── custom-build-file.xml
│ │ ├── org
│ │ │ └── jenkinsci
│ │ │ │ └── test
│ │ │ │ └── acceptance
│ │ │ │ └── po
│ │ │ │ └── ant-1.0.hpi
│ │ ├── deploy_plugin
│ │ │ └── build-war.sh
│ │ ├── msbuild_plugin
│ │ │ ├── projProject
│ │ │ │ ├── project.proj
│ │ │ │ └── HelloWorld.cs
│ │ │ └── slnProject
│ │ │ │ ├── project.proj
│ │ │ │ ├── HelloWorld.cs
│ │ │ │ └── project.sln
│ │ ├── junit
│ │ │ ├── success
│ │ │ │ └── com.simple.project.AppTest.txt
│ │ │ └── failure
│ │ │ │ └── com.simple.project.AppTest.txt
│ │ └── maven_plugin
│ │ │ └── multimodule
│ │ │ ├── module_a
│ │ │ └── pom.xml
│ │ │ ├── module_b
│ │ │ └── pom.xml
│ │ │ └── pom.xml
│ └── java
│ │ ├── org
│ │ └── jenkinsci
│ │ │ └── test
│ │ │ └── acceptance
│ │ │ ├── po
│ │ │ ├── PluginManagerTest.java
│ │ │ └── SnippetGeneratorTest.java
│ │ │ └── ByFactoryTest.java
│ │ ├── core
│ │ ├── ScriptTest.java
│ │ └── JdkTest.java
│ │ ├── UnixDomainSocketTestServer.java
│ │ └── plugins
│ │ ├── ProjectDescriptionSetterPluginTest.java
│ │ └── BuildTimeoutPluginTest.java
└── main
│ ├── resources
│ ├── org
│ │ └── jenkinsci
│ │ │ └── test
│ │ │ └── acceptance
│ │ │ ├── docker
│ │ │ └── fixtures
│ │ │ │ ├── SshAgentContainer
│ │ │ │ ├── ed25519.pass
│ │ │ │ ├── ed25519.pub
│ │ │ │ ├── Dockerfile
│ │ │ │ └── ed25519.priv
│ │ │ │ ├── SvnContainer
│ │ │ │ ├── config
│ │ │ │ │ ├── passwd
│ │ │ │ │ ├── passwd.htpasswd
│ │ │ │ │ └── supervisord.conf
│ │ │ │ └── svnRepo
│ │ │ │ │ ├── testOne.txt
│ │ │ │ │ └── simpleProject
│ │ │ │ │ └── testTwo.txt
│ │ │ │ ├── MailhogContainer
│ │ │ │ └── Dockerfile
│ │ │ │ ├── GitLabContainer
│ │ │ │ ├── Dockerfile
│ │ │ │ └── create_user.rb
│ │ │ │ ├── GitContainer
│ │ │ │ ├── unsafe.pub
│ │ │ │ └── Dockerfile
│ │ │ │ ├── JavaGitContainer
│ │ │ │ ├── unsafe.pub
│ │ │ │ └── Dockerfile
│ │ │ │ ├── LdapContainer
│ │ │ │ ├── config
│ │ │ │ │ ├── cn=config
│ │ │ │ │ │ ├── cn=schema.ldif
│ │ │ │ │ │ ├── olcBackend={0}mdb.ldif
│ │ │ │ │ │ ├── cn=module{0}.ldif
│ │ │ │ │ │ ├── olcDatabase={0}config.ldif
│ │ │ │ │ │ ├── olcDatabase={-1}frontend.ldif
│ │ │ │ │ │ └── olcDatabase={1}mdb.ldif
│ │ │ │ │ ├── cn=config.ldif
│ │ │ │ │ └── slapd.sh
│ │ │ │ └── Dockerfile
│ │ │ │ ├── Tomcat10Container
│ │ │ │ └── Dockerfile
│ │ │ │ ├── XvncSlaveContainer
│ │ │ │ └── Dockerfile
│ │ │ │ ├── SMBContainer
│ │ │ │ └── Dockerfile
│ │ │ │ ├── JiraContainer
│ │ │ │ └── Dockerfile
│ │ │ │ └── FtpdContainer
│ │ │ │ └── Dockerfile
│ │ │ ├── plugins
│ │ │ └── ant
│ │ │ │ └── fake-ant.sh
│ │ │ ├── selenium
│ │ │ └── disable-sticky-elements.js
│ │ │ └── machine
│ │ │ └── autoterminate.sh
│ ├── log4j.properties
│ └── ath-container
│ │ └── set-java.sh
│ └── java
│ └── org
│ └── jenkinsci
│ └── test
│ └── acceptance
│ ├── junit
│ ├── package-info.java
│ ├── DockerTest.java
│ ├── SmokeTest.java
│ ├── RuleFailedException.java
│ ├── GlobalRule.java
│ └── RuleAnnotation.java
│ ├── po
│ ├── Step.java
│ ├── BuildStep.java
│ ├── WhoAmI.java
│ ├── Cloud.java
│ ├── ListViewColumn.java
│ ├── Logout.java
│ ├── PostBuildStep.java
│ ├── TimerTrigger.java
│ ├── Fingerprint.java
│ ├── TextAxis.java
│ ├── LabelExpressionAxis.java
│ ├── Trigger.java
│ ├── FreeStyleJob.java
│ ├── JUnitPublisher.java
│ ├── MatrixConfiguration.java
│ ├── StringParameter.java
│ ├── AbstractStep.java
│ ├── ComputerConnector.java
│ ├── ComputerLauncher.java
│ ├── Axis.java
│ ├── AuthorizationStrategy.java
│ ├── MixIn.java
│ ├── BuildWrapper.java
│ ├── CopyArchivedArtifactsBuildStep.java
│ ├── Container.java
│ ├── PasswordParameter.java
│ ├── AggregateDownstreamTestResults.java
│ ├── AbstractListViewColumn.java
│ ├── BuildTrigger.java
│ ├── ShellBuildStep.java
│ ├── UpstreamJobTrigger.java
│ ├── ArtifactArchiver.java
│ ├── BatchCommandBuildStep.java
│ ├── MatrixRun.java
│ ├── MatrixBuild.java
│ ├── OicAuthConfigurationMode.java
│ ├── LoggedInAuthorizationStrategy.java
│ ├── LabelAxis.java
│ ├── GlobalPluginConfiguration.java
│ ├── SnippetGenerator.java
│ ├── Describable.java
│ ├── Changes.java
│ └── FreeStyleMultiBranchJob.java
│ ├── utils
│ ├── GNUCLibrary.java
│ ├── SystemEnvironmentVariables.java
│ └── HttpUtils.java
│ ├── FallbackConfig.java
│ ├── plugins
│ ├── git_client
│ │ ├── ssh_host_key_verification
│ │ │ ├── SshHostKeyVerificationStrategy.java
│ │ │ ├── NoVerificationStrategy.java
│ │ │ ├── KnownHostsFileStrategy.java
│ │ │ ├── AcceptFirstConnectionStrategy.java
│ │ │ └── ManuallyProvidedKeysStrategy.java
│ │ └── JGitInstallation.java
│ ├── job_dsl
│ │ ├── JobDslLookupStrategy.java
│ │ ├── JobDslRemovedViewAction.java
│ │ ├── JobDslRemovedJobAction.java
│ │ └── JobDslRemovedConfigFilesAction.java
│ ├── credentialsbinding
│ │ ├── SecretFileCredentialsBinding.java
│ │ ├── SecretStringCredentialsBinding.java
│ │ ├── ManagedCredentialsBinding.java
│ │ └── CredentialsBinding.java
│ ├── authorize_project
│ │ ├── BuildAccessControl.java
│ │ └── ProjectDefaultBuildAccessControl.java
│ ├── msbuild
│ │ ├── MSBuildInstallation.java
│ │ └── MSBuildStep.java
│ ├── subversion
│ │ ├── SvnRepositoryBrowser.java
│ │ ├── SubversionSvmAdvanced.java
│ │ └── SvnRepositoryBrowserWebSvn.java
│ ├── extra_columns
│ │ └── LastConsoleColumn.java
│ ├── jira
│ │ ├── JiraUpdater.java
│ │ └── JiraGlobalConfig.java
│ ├── ldap
│ │ ├── LdapGroupMembershipStrategy.java
│ │ ├── LdapEnvironmentVariable.java
│ │ ├── ParseUserAttributeLdapGroupMembershipStrategy.java
│ │ └── SearchForGroupsLdapGroupMembershipStrategy.java
│ ├── parameterized_trigger
│ │ ├── BuildTriggerConfig.java
│ │ ├── TriggerConfig.java
│ │ ├── ParameterizedTrigger.java
│ │ ├── TriggerCallBuildStep.java
│ │ └── BuildParameters.java
│ ├── project_description_setter
│ │ └── ProjectDescriptionSetter.java
│ ├── timestamper
│ │ └── TimstamperGlobalConfig.java
│ ├── mailer
│ │ └── Mailer.java
│ ├── config_file_provider
│ │ ├── CustomConfig.java
│ │ ├── ServerCredentialMapping.java
│ │ └── MavenSettingsConfig.java
│ ├── credentials
│ │ ├── FileCredentials.java
│ │ ├── StringCredentials.java
│ │ ├── UserPwdCredential.java
│ │ └── Domain.java
│ ├── workflow_multibranch
│ │ ├── BranchSource.java
│ │ └── GitBranchSource.java
│ ├── workflow_shared_library
│ │ ├── WorkflowSharedLibrary.java
│ │ ├── WorkflowSharedLibraryGlobalConfig.java
│ │ └── WorkflowGithubSharedLibrary.java
│ ├── javadoc
│ │ └── JavadocPublisher.java
│ ├── ant
│ │ └── AntBuildStep.java
│ ├── script_security
│ │ └── PendingScript.java
│ ├── description_setter
│ │ └── BuildDescriptionSetter.java
│ ├── nodelabelparameter
│ │ └── LabelParameter.java
│ ├── gradle
│ │ └── GradleTask.java
│ ├── audit_trail
│ │ └── AuditTrailGlobalConfiguration.java
│ ├── stageview
│ │ ├── StageViewStage.java
│ │ └── StageViewHeadline.java
│ ├── ssh_slaves
│ │ └── SshSlaveConnector.java
│ ├── mock_security_realm
│ │ └── MockSecurityRealm.java
│ ├── gitlab_plugin
│ │ ├── GitLabBranchSource.java
│ │ ├── GitLabServerConfig.java
│ │ ├── GitLabPersonalAccessTokenCredential.java
│ │ └── GitLabOrganizationFolder.java
│ ├── ssh_credentials
│ │ └── SshCredentialDialog.java
│ ├── dashboard_view
│ │ ├── AbstractDashboardViewPortlet.java
│ │ └── read
│ │ │ ├── MainPanel.java
│ │ │ └── BreadCrumbs.java
│ ├── nested_view
│ │ └── NestedView.java
│ ├── matrix_auth
│ │ ├── ProjectBasedMatrixAuthorizationStrategy.java
│ │ └── MatrixAuthorizationStrategy.java
│ ├── xunit
│ │ └── XUnitPublisher.java
│ ├── textfinder
│ │ └── TextFinderPublisher.java
│ ├── external_workspace_manager
│ │ ├── ExternalGlobalConfig.java
│ │ └── ExternalNodeConfig.java
│ └── deploy
│ │ └── DeployPublisher.java
│ ├── machine
│ └── JenkinsProvider.java
│ ├── guice
│ ├── WorldCleaner.java
│ ├── TestName.java
│ ├── AutoCleaned.java
│ ├── TestScopeModule.java
│ ├── TestScope.java
│ ├── TestCleaner.java
│ └── SubWorld.java
│ ├── slave
│ ├── LocalSlaveProvider.java
│ ├── SlaveProvider.java
│ └── LocalSlaveController.java
│ ├── docker
│ ├── fixtures
│ │ ├── JavaGitContainer.java
│ │ ├── IPasswordDockerContainer.java
│ │ ├── Tomcat10Container.java
│ │ └── SMBContainer.java
│ └── DockerModule.java
│ ├── update_center
│ └── UpdateCenterMetadataDecorator.java
│ ├── log
│ ├── NullPrinter.java
│ ├── LogListenable.java
│ ├── LogPrinter.java
│ ├── LogListener.java
│ └── LogSplitter.java
│ ├── controller
│ ├── JenkinsControllerFactory.java
│ └── IJenkinsController.java
│ └── recorder
│ └── TestRecorderRule.java
├── .mvn
├── jvm.config
├── maven.config
└── extensions.xml
├── grab-latest-rc.sh
├── .git-blame-ignore-revs
├── docs
├── img
│ ├── exporting_docker_host_steps.png
│ └── debuging-ath-containerized-from-idea.png
├── SUPPORT-BUNDLE.md
├── MACHINE-CONFIG.md
├── SINGLE-TEST.md
├── MIXIN.md
├── EXERCISEDPLUGINSREPORTER.md
├── USING-A-HTTP-PROXY.md
├── INVESTIGATION.md
└── MATCHERS.md
├── jut-server.sh
├── .gitignore
├── Jenkinsfile.infra.ci.jenkins.io
├── etc
└── templates
│ └── assertions_entry_point_class_template.txt
├── core-commit.sh
├── ath-container.sh
├── vars.sh
├── ci.sh
└── vars.cmd
/.github/release-drafter.yml:
--------------------------------------------------------------------------------
1 | _extends: .github
2 |
--------------------------------------------------------------------------------
/src/test/resources/credentialsbinding/secretFile:
--------------------------------------------------------------------------------
1 | secret inside a file
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | * @jenkinsci/acceptance-test-harness-developers
2 |
--------------------------------------------------------------------------------
/src/test/resources/job_dsl_plugin/CreateFolder.groovy:
--------------------------------------------------------------------------------
1 | folder('My_Folder')
--------------------------------------------------------------------------------
/src/test/resources/plaincredentialsbinding/secretFile:
--------------------------------------------------------------------------------
1 | secret inside a file
--------------------------------------------------------------------------------
/src/test/resources/textfinder_plugin/textfinder-result_failed.log:
--------------------------------------------------------------------------------
1 | RESULT=FAILED
--------------------------------------------------------------------------------
/src/test/resources/htmlpublisher_plugin/style.css:
--------------------------------------------------------------------------------
1 | p {
2 | display: none;
3 | }
4 |
--------------------------------------------------------------------------------
/src/test/resources/job_dsl_plugin/CreateJobInFolder.groovy:
--------------------------------------------------------------------------------
1 | job('My_Folder/New_Job')
--------------------------------------------------------------------------------
/src/test/resources/pipelines/hello-world/Jenkinsfile:
--------------------------------------------------------------------------------
1 | echo 'Hello Jenkinsfile in Git'
--------------------------------------------------------------------------------
/src/test/resources/scriptler_plugin/hello_world.groovy:
--------------------------------------------------------------------------------
1 | println "Hello world!"
2 |
--------------------------------------------------------------------------------
/src/test/resources/textfinder_plugin/textfinder-result_success.log:
--------------------------------------------------------------------------------
1 | RESULT=SUCCESS
--------------------------------------------------------------------------------
/src/test/resources/textfinder_plugin/textfinder-result_warning.log:
--------------------------------------------------------------------------------
1 | RESULT=WARNING
--------------------------------------------------------------------------------
/src/test/resources/scriptler_plugin/hello_parameterized.groovy:
--------------------------------------------------------------------------------
1 | println "Hello " + noun + "!"
2 |
--------------------------------------------------------------------------------
/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/SshAgentContainer/ed25519.pass:
--------------------------------------------------------------------------------
1 | s3cr3t
--------------------------------------------------------------------------------
/src/test/resources/docker_build_step/context.dir/Dockerfile:
--------------------------------------------------------------------------------
1 | # Dummy container
2 |
3 | FROM ubuntu
4 |
--------------------------------------------------------------------------------
/src/test/resources/logparser_plugin/rules/log-parser-rule-markings:
--------------------------------------------------------------------------------
1 | warn /.*warn.*/
2 | error /.*error.*/
--------------------------------------------------------------------------------
/.mvn/jvm.config:
--------------------------------------------------------------------------------
1 | -Xmx512m -XX:+HeapDumpOnOutOfMemoryError -XX:+TieredCompilation -XX:TieredStopAtLevel=1
2 |
--------------------------------------------------------------------------------
/.mvn/maven.config:
--------------------------------------------------------------------------------
1 | -Pconsume-incrementals
2 | -Pmight-produce-incrementals
3 | -Dchangelist.format=%d.v%s
4 |
--------------------------------------------------------------------------------
/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/SvnContainer/config/passwd:
--------------------------------------------------------------------------------
1 | [users]
2 | svnUser = test
--------------------------------------------------------------------------------
/src/test/resources/configuration_as_code/trivial.yaml:
--------------------------------------------------------------------------------
1 | jenkins:
2 | systemMessage: JCasC populated description
3 |
--------------------------------------------------------------------------------
/grab-latest-rc.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | set -eux
3 | curl -L https://get.jenkins.io/war-rc/latest/jenkins.war >jenkins.war
4 |
--------------------------------------------------------------------------------
/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/MailhogContainer/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mailhog/mailhog:latest
2 |
--------------------------------------------------------------------------------
/.git-blame-ignore-revs:
--------------------------------------------------------------------------------
1 | # .git-blame-ignore-revs
2 | # Format repository with Spotless (#1707)
3 | 224beaaf72d33daedd167b0123b6741008dc539a
4 |
--------------------------------------------------------------------------------
/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/SvnContainer/svnRepo/testOne.txt:
--------------------------------------------------------------------------------
1 | I'm going to be uploaded to the repository.
--------------------------------------------------------------------------------
/src/test/resources/stageview_plugin/single_job.txt:
--------------------------------------------------------------------------------
1 | node {
2 | stage ('Clone sources'){
3 | echo 'cloned'
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/SvnContainer/config/passwd.htpasswd:
--------------------------------------------------------------------------------
1 | svnUser:$apr1$hVTk7G7x$9ov.xJ0h6LPFo/2Whlk/I.
--------------------------------------------------------------------------------
/docs/img/exporting_docker_host_steps.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jenkinsci/acceptance-test-harness/master/docs/img/exporting_docker_host_steps.png
--------------------------------------------------------------------------------
/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/SvnContainer/svnRepo/simpleProject/testTwo.txt:
--------------------------------------------------------------------------------
1 | I'm going to be uploaded to the repository.
--------------------------------------------------------------------------------
/src/main/resources/org/jenkinsci/test/acceptance/plugins/ant/fake-ant.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | echo fake ant at $0
3 | export ANT_HOME=
4 | exec "%s/ant" "$@"
5 |
--------------------------------------------------------------------------------
/src/test/resources/gradle_plugin/scriptNoPlugins.gradle:
--------------------------------------------------------------------------------
1 |
2 | task hello {
3 | doLast {
4 | println 'Hello world!'
5 | }
6 | }
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/test/resources/job_dsl_plugin/Utility.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jenkinsci/acceptance-test-harness/master/src/test/resources/job_dsl_plugin/Utility.jar
--------------------------------------------------------------------------------
/docs/img/debuging-ath-containerized-from-idea.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jenkinsci/acceptance-test-harness/master/docs/img/debuging-ath-containerized-from-idea.png
--------------------------------------------------------------------------------
/src/test/resources/credentialsbinding/secretZip.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jenkinsci/acceptance-test-harness/master/src/test/resources/credentialsbinding/secretZip.zip
--------------------------------------------------------------------------------
/src/test/resources/plugins/ant/echo-helloworld.xml:
--------------------------------------------------------------------------------
1 |
hidden
9 | 10 | 11 | -------------------------------------------------------------------------------- /src/test/resources/job_dsl_plugin/MyUtilities.groovy: -------------------------------------------------------------------------------- 1 | package utilities 2 | 3 | class MyUtilities { 4 | static void addDescription(def job) { 5 | job.with { 6 | description('Description from class in src folder.') 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/GitLabContainer/Dockerfile: -------------------------------------------------------------------------------- 1 | # Use the official GitLab Community Edition image as the base 2 | FROM gitlab/gitlab-ce:18.7.0-ce.0 3 | 4 | COPY create_user.rb /usr/bin/ 5 | 6 | # Expose the required ports 7 | EXPOSE 80 443 22 8 | -------------------------------------------------------------------------------- /src/main/java/org/jenkinsci/test/acceptance/FallbackConfig.java: -------------------------------------------------------------------------------- 1 | package org.jenkinsci.test.acceptance; 2 | 3 | /** 4 | * The previous configuration for running tests. 5 | * 6 | * @deprecated use {@link Config} 7 | */ 8 | @Deprecated 9 | public class FallbackConfig extends Config {} 10 | -------------------------------------------------------------------------------- /src/test/resources/gradle_plugin/pipeline_test_multiple_tasks.txt: -------------------------------------------------------------------------------- 1 | stage ('build_Project') { 2 | tools { 3 | gradle 'Gradle 4.10.2' 4 | } 5 | 6 | steps { 7 | script { 8 | sh "gradle firstTask secondTask --no-daemon" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/msbuild_plugin/projProject/project.proj: -------------------------------------------------------------------------------- 1 |
6 | * Use {@link Describable} annotation to register an implementation.
7 | *
8 | * @author christian.fritz
9 | */
10 | public interface BuildStep extends Step {}
11 |
--------------------------------------------------------------------------------
/src/test/resources/credentialsbinding/usernameSplitPasswordScript:
--------------------------------------------------------------------------------
1 | node {
2 | withCredentials([usernamePassword(credentialsId: '%s', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
3 | sh '[ \"$USERNAME\" = \"%s\" ] && echo \"%s\"'
4 | sh '[ \"$PASSWORD\" = \"%s\" ] && echo \"%s\"'
5 | }
6 | }
--------------------------------------------------------------------------------
/src/test/resources/credentialsbinding/secretZipFileScript:
--------------------------------------------------------------------------------
1 | node {
2 | withCredentials([zip(credentialsId: '%s', variable: 'SECRETFILE')]) {
3 | sh 'cat $SECRETFILE/dir/testfile.txt > testfile'
4 | def content = readFile 'testfile'
5 | sh '[ \"' + content.trim() + '\" = \"%s\" ] && echo \"%s\"'
6 | }
7 | }
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/machine/JenkinsProvider.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.machine;
2 |
3 | import com.google.inject.Provider;
4 | import org.jenkinsci.test.acceptance.controller.JenkinsController;
5 |
6 | @Deprecated
7 | public abstract class JenkinsProvider implements Provider
6 | * Subtypes should have {@link Describable} annotation on it.
7 | *
8 | * @author Fabian Trampusch
9 | */
10 | public interface ListViewColumn {}
11 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/po/Logout.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.po;
2 |
3 | /**
4 | * Page object for logging out of Jenkins.
5 | * @author Marco.Miller@ericsson.com
6 | */
7 | public class Logout extends PageObject {
8 | public Logout(Jenkins jenkins) {
9 | super(jenkins.injector, jenkins.url("logout"));
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | jenkins*.war
2 | /*.log
3 | .DS_Store
4 | *.swp
5 | *.swn
6 | *~
7 | .vagrant
8 | iso
9 | *.box
10 | workspace/
11 | path-element.hpi
12 | slave.jar
13 | temp_dir_*
14 | .buildpath
15 | .project
16 | target
17 | .classpath
18 | .settings/
19 | jenkins*home/
20 | .idea/
21 | *.iml
22 | *.iws
23 | *.ipr
24 | jenkins-plugins/
25 | .jenkins_test/
26 | .history
27 | .vscode
28 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/job_dsl/JobDslRemovedJobAction.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.job_dsl;
2 |
3 | /**
4 | * Actions what to do when a previously generated job is not referenced anymore.
5 | *
6 | * @author Maximilian Oeckler
7 | */
8 | public enum JobDslRemovedJobAction {
9 | IGNORE,
10 | DISABLE,
11 | DELETE
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/po/PostBuildStep.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.po;
2 |
3 | /**
4 | * Marker Interface for {@link PageArea} that corresponds to 'Publisher' in the core.
5 | *
6 | * Subtypes should have {@link Describable} annotation on it.
7 | *
8 | * @author christian.fritz
9 | */
10 | public interface PostBuildStep extends Step {}
11 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/po/TimerTrigger.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.po;
2 |
3 | /**
4 | * @author Kohsuke Kawaguchi
5 | */
6 | public class TimerTrigger extends Trigger {
7 | public final Control spec = control("spec");
8 |
9 | public TimerTrigger(Job parent) {
10 | super(parent, "/hudson-triggers-TimerTrigger");
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/SshAgentContainer/Dockerfile:
--------------------------------------------------------------------------------
1 | # curl -s https://raw.githubusercontent.com/jenkinsci/docker-fixtures/master/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/JavaContainer/Dockerfile | sha1sum | cut -c 1-12
2 | FROM jenkins/java:978f1af53461
3 | COPY *.pub /tmp
4 | RUN cat /tmp/*.pub >> /home/test/.ssh/authorized_keys
5 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/job_dsl/JobDslRemovedConfigFilesAction.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.job_dsl;
2 |
3 | /**
4 | * Actions what to do when a previously generated config file is not referenced anymore.
5 | *
6 | * @author Maximilian Oeckler
7 | */
8 | public enum JobDslRemovedConfigFilesAction {
9 | IGNORE,
10 | DELETE
11 | }
12 |
--------------------------------------------------------------------------------
/src/test/resources/maven_plugin/multimodule/module_a/pom.xml:
--------------------------------------------------------------------------------
1 |
6 | * Use {@link Describable} annotation to register an implementation.
7 | *
8 | * @author Kohsuke Kawaguchi
9 | */
10 | public abstract class ComputerConnector extends PageAreaImpl {
11 | protected ComputerConnector(PageObject context, String path) {
12 | super(context, path);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/test/resources/credentialsbinding/sshUserPrivateKeyScriptWindows:
--------------------------------------------------------------------------------
1 | node {
2 | withCredentials([sshUserPrivateKey(keyFileVariable: 'THEKEY', passphraseVariable: 'THEPASS', usernameVariable: 'THEUSER', credentialsId: '%s')]) {
3 | bat '@if \"%%THEUSER%%\"==\"%s\" echo \"%s\"'
4 | bat '@if \"%%THEPASS%%\"==\"%s\" echo \"%s\"'
5 | bat '@type %%THEKEY%% > testfile'
6 | def content = readFile 'testfile'
7 | bat '@if \"' + content.trim() + '\"==\"%s\" echo \"%s\"'
8 | }
9 | }
--------------------------------------------------------------------------------
/docs/SUPPORT-BUNDLE.md:
--------------------------------------------------------------------------------
1 | # Support bundle
2 |
3 | If [support-core](https://github.com/jenkinsci/support-core-plugin) plugin is installed during the test execution, a support bundle will be captured and attached to the test scenario.
4 | This behaviour is executed only in CI environment, and is disabled when running a test locally.
5 |
6 | The behaviour can be overridden if necessary by setting the environment variable `CAPTURE_SUPPORT_BUNDLE=true` or `CAPTURE_SUPPORT_BUNDLE=false` depending on the desired behaviour.
7 |
--------------------------------------------------------------------------------
/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/LdapContainer/config/cn=config/cn=schema.ldif:
--------------------------------------------------------------------------------
1 | # AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
2 | dn: cn=schema
3 | objectClass: olcSchemaConfig
4 | cn: schema
5 | structuralObjectClass: olcSchemaConfig
6 | entryUUID: 00dcaa58-5042-1033-9a38-ff1e70d71313
7 | creatorsName: cn=config
8 | createTimestamp: 20140404124009Z
9 | entryCSN: 20140404124009.976848Z#000000#000#000000
10 | modifiersName: cn=config
11 | modifyTimestamp: 20140404124009Z
12 |
--------------------------------------------------------------------------------
/Jenkinsfile.infra.ci.jenkins.io:
--------------------------------------------------------------------------------
1 | // This pipeline runs on infra.ci.jenkins.io (private) to build, test and deploy the Docker image
2 | buildDockerAndPublishImage('ath', [
3 | automaticSemanticVersioning: false,
4 | gitCredentials: 'jenkinsci-ath-ghapp', // Only available in infra.ci.jenkins.io
5 | dockerfile: 'src/main/resources/ath-container/Dockerfile',
6 | imageDir: 'src/main/resources/ath-container/',
7 | registryNamespace: 'jenkins',
8 | cacheTo: 'type=registry,ref=jenkins/ath:build-cache',
9 | ])
10 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/git_client/ssh_host_key_verification/NoVerificationStrategy.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.git_client.ssh_host_key_verification;
2 |
3 | import org.jenkinsci.test.acceptance.po.Describable;
4 |
5 | @Describable("org.jenkinsci.plugins.gitclient.verifier.NoHostKeyVerificationStrategy")
6 | public class NoVerificationStrategy extends SshHostKeyVerificationStrategy {
7 | @Override
8 | public String id() {
9 | return "3";
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/git_client/ssh_host_key_verification/KnownHostsFileStrategy.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.git_client.ssh_host_key_verification;
2 |
3 | import org.jenkinsci.test.acceptance.po.Describable;
4 |
5 | @Describable("org.jenkinsci.plugins.gitclient.verifier.KnownHostsFileVerificationStrategy")
6 | public class KnownHostsFileStrategy extends SshHostKeyVerificationStrategy {
7 | @Override
8 | public String id() {
9 | return "1";
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/GitLabContainer/create_user.rb:
--------------------------------------------------------------------------------
1 | input_array = ARGV
2 |
3 | user = User.create();
4 | user.name = input_array[0];
5 | user.username = input_array[0];
6 | user.password = input_array[1];
7 | user.confirmed_at = '01/01/1990';
8 | user.admin = input_array[3];
9 | user.email = input_array[2];
10 | user.save!;
11 |
12 | token = user.personal_access_tokens.create(scopes: [:api], name: 'MyToken');
13 | token.expires_at='01/01/2024';
14 | token.save!;
15 | puts token.token;
16 |
--------------------------------------------------------------------------------
/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/LdapContainer/config/cn=config/olcBackend={0}mdb.ldif:
--------------------------------------------------------------------------------
1 | # AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
2 | dn: olcBackend={0}mdb
3 | objectClass: olcBackendConfig
4 | olcBackend: {0}mdb
5 | structuralObjectClass: olcBackendConfig
6 | entryUUID: 00dd052a-5042-1033-9a3e-ff1e70d71313
7 | creatorsName: cn=config
8 | createTimestamp: 20140404124009Z
9 | entryCSN: 20140404124009.979183Z#000000#000#000000
10 | modifiersName: cn=config
11 | modifyTimestamp: 20140404124009Z
12 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/git_client/ssh_host_key_verification/AcceptFirstConnectionStrategy.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.git_client.ssh_host_key_verification;
2 |
3 | import org.jenkinsci.test.acceptance.po.Describable;
4 |
5 | @Describable("org.jenkinsci.plugins.gitclient.verifier.AcceptFirstConnectionStrategy")
6 | public class AcceptFirstConnectionStrategy extends SshHostKeyVerificationStrategy {
7 | @Override
8 | public String id() {
9 | return "0";
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/po/ComputerLauncher.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.po;
2 |
3 | /**
4 | * Configuration fragment for computer launcher.
5 | *
6 | * Use {@link Describable} annotation to register an implementation.
7 | *
8 | * @author Kohsuke Kawaguchi
9 | * @see DumbSlave#setLauncher(Class)
10 | */
11 | public abstract class ComputerLauncher extends PageAreaImpl {
12 | protected ComputerLauncher(PageObject context, String path) {
13 | super(context, path);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/credentialsbinding/SecretFileCredentialsBinding.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.credentialsbinding;
2 |
3 | import org.jenkinsci.test.acceptance.po.ContainerPageObject;
4 | import org.jenkinsci.test.acceptance.po.Describable;
5 |
6 | @Describable("Secret file")
7 | public class SecretFileCredentialsBinding extends CredentialsBinding {
8 |
9 | public SecretFileCredentialsBinding(ContainerPageObject po, String path) {
10 | super(po, path);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/po/Axis.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.po;
2 |
3 | /**
4 | * Page area for matrix axis.
5 | *
6 | * Use {@link Describable} annotation to register an implementation.
7 | *
8 | * @author Kohsuke Kawaguchi
9 | * @see MatrixProject#addAxis(Class)
10 | */
11 | public abstract class Axis extends PageAreaImpl {
12 | public final Control name = control("name");
13 |
14 | protected Axis(PageObject context, String path) {
15 | super(context, path);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/credentialsbinding/SecretStringCredentialsBinding.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.credentialsbinding;
2 |
3 | import org.jenkinsci.test.acceptance.po.ContainerPageObject;
4 | import org.jenkinsci.test.acceptance.po.Describable;
5 |
6 | @Describable("Secret text")
7 | public class SecretStringCredentialsBinding extends CredentialsBinding {
8 |
9 | public SecretStringCredentialsBinding(ContainerPageObject po, String path) {
10 | super(po, path);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/git_client/ssh_host_key_verification/ManuallyProvidedKeysStrategy.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.git_client.ssh_host_key_verification;
2 |
3 | import org.jenkinsci.test.acceptance.po.Describable;
4 |
5 | @Describable("org.jenkinsci.plugins.gitclient.verifier.ManuallyProvidedKeyVerificationStrategy")
6 | public class ManuallyProvidedKeysStrategy extends SshHostKeyVerificationStrategy {
7 | @Override
8 | public String id() {
9 | return "2";
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/update_center/UpdateCenterMetadataDecorator.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.update_center;
2 |
3 | import com.cloudbees.sdk.extensibility.ExtensionPoint;
4 |
5 | /**
6 | * A hook to tweak {@link UpdateCenterMetadata} to allow plugins and versions that are not in the update
7 | * center to be installed and tested.
8 | *
9 | * @author Kohsuke Kawaguchi
10 | */
11 | @ExtensionPoint
12 | public interface UpdateCenterMetadataDecorator {
13 | void decorate(UpdateCenterMetadata ucm);
14 | }
15 |
--------------------------------------------------------------------------------
/src/test/resources/maven_plugin/multimodule/pom.xml:
--------------------------------------------------------------------------------
1 |
8 | * Among other things, optionally implemented by {@link JenkinsController} that provides access
9 | * to the console output.
10 | *
11 | * @author Kohsuke Kawaguchi
12 | */
13 | public interface LogListenable {
14 | void addLogListener(LogListener l);
15 |
16 | void removeLogListener(LogListener l);
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/po/AuthorizationStrategy.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.po;
2 |
3 | /**
4 | * Base type for {@link PageArea} for Authorization Strategy.
5 | *
6 | * Use {@link Describable} annotation to register an implementation.
7 | *
8 | * @see GlobalSecurityConfig#useAuthorizationStrategy(Class)
9 | */
10 | public abstract class AuthorizationStrategy extends PageAreaImpl {
11 | protected AuthorizationStrategy(GlobalSecurityConfig context, String path) {
12 | super(context, path);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/authorize_project/BuildAccessControl.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.authorize_project;
2 |
3 | import org.jenkinsci.test.acceptance.po.GlobalSecurityConfig;
4 | import org.jenkinsci.test.acceptance.po.PageAreaImpl;
5 |
6 | /**
7 | * Base type for {@link PageAreaImpl} for Build Access Control.
8 | */
9 | public class BuildAccessControl extends PageAreaImpl {
10 |
11 | public BuildAccessControl(GlobalSecurityConfig security, String path) {
12 | super(security, path);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/docs/MACHINE-CONFIG.md:
--------------------------------------------------------------------------------
1 | # Machine configuration
2 |
3 | You can launch pools of Machines each pool targeted to a Jenkins master or slave.
4 | Here you will create two subworlds, one for master and another one for slave.
5 | See [Wiring](WIRING.md) for details on SubWorld and wiring different pieces.
6 |
7 | ## How to configure
8 |
9 | As defined in [Wiring](WIRING.md), all the configuration parameters are Guice Named parameters.
10 | You should provide configuration in a groovy script.
11 |
12 | ## Ec2Provider configuration
13 |
14 | See [EC2 Configuration](EC2-CONFIG.md).
15 |
--------------------------------------------------------------------------------
/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/LdapContainer/config/cn=config/cn=module{0}.ldif:
--------------------------------------------------------------------------------
1 | # AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
2 | dn: cn=module{0}
3 | objectClass: olcModuleList
4 | cn: module{0}
5 | olcModulePath: /usr/lib/ldap
6 | olcModuleLoad: {0}back_mdb
7 | structuralObjectClass: olcModuleList
8 | entryUUID: 00dcf792-5042-1033-9a3d-ff1e70d71313
9 | creatorsName: cn=config
10 | createTimestamp: 20140404124009Z
11 | entryCSN: 20140404124009.978834Z#000000#000#000000
12 | modifiersName: cn=config
13 | modifyTimestamp: 20140404124009Z
14 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/po/MixIn.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.po;
2 |
3 | /**
4 | * Different Jenkins model objects often share a common trait,
5 | * and for better reuse it makes sense to split them off into a separate page object.
6 | *
7 | *
8 | * This class is mostly a marker super-type for such mix-in types.
9 | *
10 | * @author Kohsuke Kawaguchi
11 | */
12 | public abstract class MixIn extends ContainerPageObject {
13 | protected MixIn(ContainerPageObject context) {
14 | super(context, context.url);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/msbuild/MSBuildInstallation.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.msbuild;
2 |
3 | import org.jenkinsci.test.acceptance.po.Jenkins;
4 | import org.jenkinsci.test.acceptance.po.ToolInstallation;
5 | import org.jenkinsci.test.acceptance.po.ToolInstallationPageObject;
6 |
7 | @ToolInstallationPageObject(installer = "", name = "MSBuild")
8 | public class MSBuildInstallation extends ToolInstallation {
9 |
10 | public MSBuildInstallation(Jenkins context, String path) {
11 | super(context, path);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/po/BuildWrapper.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.po;
2 |
3 | /**
4 | * @author Kohsuke Kawaguchi
5 | */
6 | public abstract class BuildWrapper extends PageAreaImpl {
7 | /**
8 | * @param path p Each BuildWrapper occupies a unique path that is supplied by the subtype.
9 | */
10 | protected BuildWrapper(Job context, String path) {
11 | super(context, path);
12 | }
13 |
14 | /**
15 | * Checkbox that activates this build wrapper.
16 | */
17 | public final Control enable = control("");
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/po/CopyArchivedArtifactsBuildStep.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.po;
2 |
3 | @Describable("Copy archived artifacts from remote/local job")
4 | public class CopyArchivedArtifactsBuildStep extends AbstractStep implements BuildStep {
5 |
6 | public final Control sourceJob = control("");
7 | public final Control timeout = control("timeout");
8 | public final Control includes = control("includes");
9 |
10 | public CopyArchivedArtifactsBuildStep(Job parent, String path) {
11 | super(parent, path);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/guice/TestName.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.guice;
2 |
3 | import jakarta.inject.Provider;
4 |
5 | /**
6 | * Keeps track of the current test name.
7 | *
8 | * @author Kohsuke Kawaguchi
9 | */
10 | @TestScope
11 | public class TestName implements Provider
9 | * When a test scope exits, all the existing instances that implement this interface
10 | * gets its {@link #close()} method invoked.
11 | *
12 | *
13 | * Currently this only works with {@link TestScope}.
14 | *
15 | * @see TestCleaner
16 | * @author Kohsuke Kawaguchi
17 | */
18 | public interface AutoCleaned extends Closeable {}
19 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/po/Container.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.po;
2 |
3 | /**
4 | * A container owns jobs and views. Known container implementations are {@link Jenkins} and {@link Folder}.
5 | *
6 | * @author Ullrich Hafner
7 | */
8 | public interface Container {
9 | /**
10 | * Returns the jobs in this container.
11 | *
12 | * @return the jobs
13 | */
14 | JobsMixIn getJobs();
15 |
16 | /**
17 | * Returns the views in this container.
18 | *
19 | * @return the views
20 | */
21 | ViewsMixIn getViews();
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/po/PasswordParameter.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.po;
2 |
3 | @Describable("Password Parameter")
4 | public class PasswordParameter extends Parameter {
5 |
6 | public PasswordParameter(Job job, String path) {
7 | super(job, path);
8 | }
9 |
10 | @Override
11 | public void fillWith(Object v) {
12 | control("value").set(v.toString());
13 | }
14 |
15 | @Override
16 | public Parameter setDefault(String value) {
17 | control("defaultValueAsSecret").set(value);
18 | return this;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/LdapContainer/config/cn=config.ldif:
--------------------------------------------------------------------------------
1 | # AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
2 | dn: cn=config
3 | objectClass: olcGlobal
4 | cn: config
5 | olcArgsFile: /var/run/slapd/slapd.args
6 | olcLogLevel: none
7 | olcPidFile: /var/run/slapd/slapd.pid
8 | olcToolThreads: 1
9 | structuralObjectClass: olcGlobal
10 | entryUUID: 00dc9e14-5042-1033-9a35-ff1e70d71313
11 | creatorsName: cn=config
12 | createTimestamp: 20140404124009Z
13 | entryCSN: 20140404124009.976505Z#000000#000#000000
14 | modifiersName: cn=config
15 | modifyTimestamp: 20140404124009Z
16 |
--------------------------------------------------------------------------------
/core-commit.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | set -euo pipefail
3 |
4 | #
5 | # Extract the core commit from the WAR.
6 | #
7 | # TODO handle transitive dependencies like Stapler, Remoting, etc.
8 | #
9 |
10 | war=
11 | if [[ -f target/jenkins-war.war ]]; then
12 | war=target/jenkins-war.war
13 | elif [[ -f jenkins.war ]]; then
14 | war=jenkins.war
15 | else
16 | echo 'Failed to locate WAR' >&2
17 | exit 1
18 | fi
19 |
20 | jar xf "${war}" META-INF/MANIFEST.MF
21 | core_commit=$(awk '/Implementation-Build:/ {print $2}' META-INF/MANIFEST.MF)
22 | rm -f META-INF/MANIFEST.MF
23 | rm -df META-INF
24 | echo "${core_commit}"
25 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/po/AggregateDownstreamTestResults.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.po;
2 |
3 | @Describable("Aggregate downstream test results")
4 | public class AggregateDownstreamTestResults extends AbstractStep implements PostBuildStep {
5 |
6 | public final Control specify = control("specify");
7 | public final Control jobs = control("specify/jobs");
8 | public final Control includeFailedBuilds = control("specify/includeFailedBuilds");
9 |
10 | public AggregateDownstreamTestResults(Job parent, String path) {
11 | super(parent, path);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/po/AbstractListViewColumn.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.po;
2 |
3 | /**
4 | * Abstract base class for configuring dash board columns.
5 | *
6 | * @author Fabian Trampusch
7 | */
8 | public class AbstractListViewColumn extends PageAreaImpl implements ListViewColumn {
9 |
10 | protected AbstractListViewColumn(ListView parent, String path) {
11 | super(parent, path);
12 | }
13 |
14 | /**
15 | * Deletes the column, i.e. removes it from the view.
16 | */
17 | public void delete() {
18 | control("repeatable-delete").click();
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/docker/fixtures/IPasswordDockerContainer.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.docker.fixtures;
2 |
3 | /**
4 | * gets username and password for a service on a docker container
5 | *
6 | * @author Tobias Meyer
7 | */
8 | public interface IPasswordDockerContainer {
9 | /**
10 | * Gets the passsword for a service on the docker server
11 | *
12 | * @return password
13 | */
14 | String getPassword();
15 | /**
16 | * Gets the username for a service on the docker server
17 | *
18 | * @return username
19 | */
20 | String getUsername();
21 | }
22 |
--------------------------------------------------------------------------------
/src/test/java/org/jenkinsci/test/acceptance/po/PluginManagerTest.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.po;
2 |
3 | import java.io.File;
4 | import java.io.IOException;
5 | import java.net.URISyntaxException;
6 | import org.jenkinsci.test.acceptance.junit.AbstractJUnitTest;
7 | import org.junit.Test;
8 |
9 | public class PluginManagerTest extends AbstractJUnitTest {
10 |
11 | @Test
12 | public void installAVerySpecificPluginByHpiFile() throws IOException, URISyntaxException {
13 | final File plugin = new File(getClass().getResource("ant-1.0.hpi").toURI());
14 | jenkins.getPluginManager().installPlugin(plugin);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/LdapContainer/config/cn=config/olcDatabase={0}config.ldif:
--------------------------------------------------------------------------------
1 | # AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
2 | dn: olcDatabase={0}config
3 | objectClass: olcDatabaseConfig
4 | olcDatabase: {0}config
5 | olcAccess: {0}to * by dn.exact=gidNumber=0+uidNumber=0,cn=peercred,cn=external
6 | ,cn=auth manage by * break
7 | structuralObjectClass: olcDatabaseConfig
8 | entryUUID: 00dca684-5042-1033-9a37-ff1e70d71313
9 | creatorsName: cn=config
10 | createTimestamp: 20140404124009Z
11 | entryCSN: 20140404124009.976760Z#000000#000#000000
12 | modifiersName: cn=config
13 | modifyTimestamp: 20140404124009Z
14 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/extra_columns/LastConsoleColumn.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.extra_columns;
2 |
3 | import org.jenkinsci.test.acceptance.po.AbstractListViewColumn;
4 | import org.jenkinsci.test.acceptance.po.Describable;
5 | import org.jenkinsci.test.acceptance.po.ListView;
6 |
7 | /**
8 | * Column for the last console output.
9 | *
10 | * @author Ullrich Hafner
11 | */
12 | @Describable("Last/Current Build Console Output")
13 | public class LastConsoleColumn extends AbstractListViewColumn {
14 | public LastConsoleColumn(ListView parent, String path) {
15 | super(parent, path);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/jira/JiraUpdater.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.jira;
2 |
3 | import org.jenkinsci.test.acceptance.po.AbstractStep;
4 | import org.jenkinsci.test.acceptance.po.Describable;
5 | import org.jenkinsci.test.acceptance.po.Job;
6 | import org.jenkinsci.test.acceptance.po.PostBuildStep;
7 |
8 | /**
9 | * @author Kohsuke Kawaguchi
10 | */
11 | @Describable({"JIRA: Update relevant issues", "Jira: Update relevant issues"})
12 | public class JiraUpdater extends AbstractStep implements PostBuildStep {
13 | public JiraUpdater(Job parent, String path) {
14 | super(parent, path);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/subversion/SubversionSvmAdvanced.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.subversion;
2 |
3 | import java.net.URL;
4 | import org.jenkinsci.test.acceptance.po.Control;
5 | import org.jenkinsci.test.acceptance.po.PageObject;
6 |
7 | /**
8 | * PageObject for the Subversion "advanced" section.
9 | *
10 | * @author Matthias Karl
11 | */
12 | public class SubversionSvmAdvanced extends PageObject {
13 | public final Control excludedRegions = control(by.input("_.excludedRegions"));
14 |
15 | public SubversionSvmAdvanced(PageObject context, URL url) {
16 | super(context, url);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/log/LogPrinter.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.log;
2 |
3 | import java.io.IOException;
4 |
5 | /**
6 | * Prints out the received log with a prefix.
7 | *
8 | * @author Kohsuke Kawaguchi
9 | */
10 | public class LogPrinter implements LogListener {
11 | private final String prefix;
12 |
13 | public LogPrinter(String id) {
14 | this.prefix = id == null ? "" : id + "|";
15 | }
16 |
17 | @Override
18 | public void processLine(String line) throws IOException {
19 | System.out.println(prefix + line);
20 | }
21 |
22 | @Override
23 | public void processClose(Exception t) {}
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/po/BuildTrigger.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.po;
2 |
3 | /**
4 | * Trigger other projects at the end of a build
5 | *
6 | * @author Kohsuke Kawaguchi
7 | */
8 | @Describable("Build other projects")
9 | public class BuildTrigger extends AbstractStep implements PostBuildStep {
10 | public final Control childProjects = control("childProjects");
11 |
12 | public final Control thresholdSuccess = control("threshold[SUCCESS]");
13 | public final Control thresholdFailure = control("threshold[FAILURE]");
14 |
15 | public BuildTrigger(Job parent, String path) {
16 | super(parent, path);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/ath-container.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | set -uo pipefail
3 |
4 | DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
5 |
6 | # Obtain the group ID to grant to access the Docker socket
7 | if [[ -z ${DOCKER_GID:-} ]]; then
8 | DOCKER_GID=$(docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:Z ubuntu:noble stat -c %g /var/run/docker.sock) || exit 1
9 | export DOCKER_GID
10 | fi
11 |
12 | "${DIR}/build-image.sh" || exit 1
13 |
14 | trap 'docker-compose kill && docker-compose down' EXIT
15 |
16 | docker-compose run --name mvn --rm -P -v "${HOME}/.m2/repository:/home/ath-user/.m2/repository:Z" mvn bash -c 'set-java.sh 17; bash'
17 | status=$?
18 |
19 | exit $status
20 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/po/ShellBuildStep.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.po;
2 |
3 | import org.openqa.selenium.NoSuchElementException;
4 |
5 | /**
6 | * @author Kohsuke Kawaguchi
7 | */
8 | @Describable("Execute shell")
9 | public class ShellBuildStep extends AbstractStep implements BuildStep {
10 | public ShellBuildStep(Job parent, String path) {
11 | super(parent, path);
12 | }
13 |
14 | public void command(String command) {
15 | try {
16 | new CodeMirror(this, "command").set(command);
17 | } catch (NoSuchElementException e) {
18 | control("command").set(command);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/test/resources/junit/failure/com.simple.project.AppTest.txt:
--------------------------------------------------------------------------------
1 | -------------------------------------------------------------------------------
2 | Test set: com.simple.project.AppTest
3 | -------------------------------------------------------------------------------
4 | Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.014 sec <<< FAILURE!
5 | testApp(com.simple.project.AppTest) Time elapsed: 0.007 sec <<< FAILURE!
6 | junit.framework.AssertionFailedError
7 | at junit.framework.Assert.fail(Assert.java:47)
8 | at junit.framework.Assert.assertTrue(Assert.java:20)
9 | at junit.framework.Assert.assertTrue(Assert.java:27)
10 | at com.simple.project.AppTest.testApp(AppTest.java:36)
11 |
12 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/ldap/LdapGroupMembershipStrategy.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.ldap;
2 |
3 | import org.jenkinsci.test.acceptance.po.GlobalSecurityConfig;
4 | import org.jenkinsci.test.acceptance.po.PageAreaImpl;
5 |
6 | /**
7 | * Use @Describable to register an implementation.
8 | *
9 | * @author Michael Prankl
10 | * @since ldap version 1.10
11 | */
12 | public abstract class LdapGroupMembershipStrategy extends PageAreaImpl {
13 |
14 | protected LdapGroupMembershipStrategy(GlobalSecurityConfig context, String path) {
15 | super(context, path);
16 | }
17 |
18 | public abstract void configure(String strategyParam);
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/po/UpstreamJobTrigger.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.po;
2 |
3 | import org.apache.commons.lang3.StringUtils;
4 |
5 | /**
6 | * Triggers a job, if another job has been finished.
7 | *
8 | * @author Ulli Hafner
9 | */
10 | public class UpstreamJobTrigger extends Trigger {
11 | private final Control upstreamProjects = control("upstreamProjects");
12 |
13 | public UpstreamJobTrigger(Job parent) {
14 | super(parent, "/jenkins-triggers-ReverseBuildTrigger");
15 | }
16 |
17 | public void setUpstreamProjects(final String... upstreamProjects) {
18 | this.upstreamProjects.set(StringUtils.join(upstreamProjects, ","));
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/controller/JenkinsControllerFactory.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.controller;
2 |
3 | import com.cloudbees.sdk.extensibility.ExtensionPoint;
4 |
5 | /**
6 | * Extension point for instantiating {@link JenkinsController} from command-line options / environments.
7 | *
8 | * @author Kohsuke Kawaguchi
9 | */
10 | @ExtensionPoint
11 | public interface JenkinsControllerFactory {
12 | /**
13 | * Unique short name that distinguishes this controller from others.
14 | *
15 | * User can select the factory by specifying its ID to the "TYPE" environment variable.
16 | */
17 | String getId();
18 |
19 | JenkinsController create();
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/parameterized_trigger/BuildTriggerConfig.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.parameterized_trigger;
2 |
3 | import org.jenkinsci.test.acceptance.po.Control;
4 | import org.jenkinsci.test.acceptance.po.PageAreaImpl;
5 |
6 | /**
7 | * Configuration section of a trigger/call build step.
8 | *
9 | * @author Ullrich Hafner
10 | */
11 | public class BuildTriggerConfig extends PageAreaImpl {
12 | public final Control projects = control("projects");
13 | public final Control block = control("block");
14 |
15 | public BuildTriggerConfig(TriggerCallBuildStep parent, String relativePath) {
16 | super(parent, relativePath);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/project_description_setter/ProjectDescriptionSetter.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.project_description_setter;
2 |
3 | import org.jenkinsci.test.acceptance.po.BuildWrapper;
4 | import org.jenkinsci.test.acceptance.po.Control;
5 | import org.jenkinsci.test.acceptance.po.Job;
6 |
7 | /**
8 | * @author Kohsuke Kawaguchi
9 | */
10 | public class ProjectDescriptionSetter extends BuildWrapper {
11 | public final Control filename = control("projectDescriptionFilename");
12 |
13 | public ProjectDescriptionSetter(Job context) {
14 | super(context, "/org-jenkinsCi-plugins-projectDescriptionSetter-DescriptionSetterWrapper");
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/docker/fixtures/Tomcat10Container.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.docker.fixtures;
2 |
3 | import java.io.IOException;
4 | import java.net.URL;
5 | import org.jenkinsci.test.acceptance.docker.DockerContainer;
6 | import org.jenkinsci.test.acceptance.docker.DockerFixture;
7 |
8 | /**
9 | * Runs stock Tomcat 7 container.
10 | *
11 | * @author Kohsuke Kawaguchi
12 | */
13 | @DockerFixture(id = "tomcat10", ports = 8080)
14 | public class Tomcat10Container extends DockerContainer {
15 | /**
16 | * URL of Tomcat.
17 | */
18 | public URL getUrl() throws IOException {
19 | return new URL("http://" + ipBound(8080) + ":" + port(8080));
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/subversion/SvnRepositoryBrowserWebSvn.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.subversion;
2 |
3 | import java.net.URL;
4 | import org.jenkinsci.test.acceptance.po.Control;
5 | import org.jenkinsci.test.acceptance.po.Describable;
6 | import org.jenkinsci.test.acceptance.po.Scm;
7 |
8 | /**
9 | * PageArea for the WebSvn repository browser
10 | *
11 | * @author Matthias Karl
12 | */
13 | @Describable("WebSVN")
14 | public class SvnRepositoryBrowserWebSvn extends SvnRepositoryBrowser {
15 |
16 | public Control url = control("/scm[1]/browser/url");
17 |
18 | public SvnRepositoryBrowserWebSvn(Scm area, URL path) {
19 | super(area, path);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/po/ArtifactArchiver.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.po;
2 |
3 | /**
4 | * @author Kohsuke Kawaguchi
5 | */
6 | @Describable("Archive the artifacts")
7 | public class ArtifactArchiver extends AbstractStep implements PostBuildStep {
8 | public ArtifactArchiver(Job parent, String path) {
9 | super(parent, path);
10 | }
11 |
12 | public ArtifactArchiver includes(String value) {
13 | control("artifacts").set(value);
14 | return this;
15 | }
16 |
17 | public ArtifactArchiver excludes(String value) {
18 | control("advanced-button").click();
19 | control("excludes").set(value);
20 | return this;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/timestamper/TimstamperGlobalConfig.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.timestamper;
2 |
3 | import org.jenkinsci.test.acceptance.po.Control;
4 | import org.jenkinsci.test.acceptance.po.Jenkins;
5 | import org.jenkinsci.test.acceptance.po.PageAreaImpl;
6 |
7 | /**
8 | * @author Kohsuke Kawaguchi
9 | */
10 | public class TimstamperGlobalConfig extends PageAreaImpl {
11 | public final Control systemTimeFormat = control("systemTimeFormat");
12 | public final Control elapsedTimeFormat = control("elapsedTimeFormat");
13 |
14 | public TimstamperGlobalConfig(Jenkins jenkins) {
15 | super(jenkins, "/hudson-plugins-timestamper-TimestamperConfig");
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/Tomcat10Container/Dockerfile:
--------------------------------------------------------------------------------
1 | #
2 | # Runs Tomcat10 on Ubuntu at port 8080, with the admin app
3 | #
4 | # The admin user has username 'admin' and password 'tomcat'
5 | #
6 |
7 | FROM ubuntu:noble
8 |
9 | RUN apt-get update && apt-get install -y tomcat10 tomcat10-admin
10 |
11 | # configure the admin user
12 | RUN echo '
14 | * {@link TestScope} is tied to a thread that executes a test, in anticipation of multi-threaded
15 | * concurrent test executions. See {@link World}
16 | *
17 | * @author Kohsuke Kawaguchi
18 | */
19 | @Retention(RetentionPolicy.RUNTIME)
20 | @Target({ElementType.TYPE, ElementType.METHOD})
21 | @Inherited
22 | @Documented
23 | @ScopeAnnotation
24 | public @interface TestScope {}
25 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/recorder/TestRecorderRule.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.recorder;
2 |
3 | import org.jenkinsci.test.acceptance.utils.SystemEnvironmentVariables;
4 |
5 | public final class TestRecorderRule {
6 |
7 | private static final String OFF = "off";
8 | private static final String FAILURES = "failuresOnly";
9 | private static final String ALWAYS = "always";
10 |
11 | private static final String DEFAULT_MODE = FAILURES;
12 |
13 | private static String RECORDER_OPTION = SystemEnvironmentVariables.getPropertyVariableOrEnvironment(
14 | "RECORDER", DEFAULT_MODE)
15 | .trim();
16 |
17 | public static boolean isRecorderEnabled() {
18 | return !OFF.equals(RECORDER_OPTION);
19 | }
20 |
21 | public static boolean saveAllExecutions() {
22 | return ALWAYS.equals(RECORDER_OPTION);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/credentials/UserPwdCredential.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.credentials;
2 |
3 | import org.jenkinsci.test.acceptance.po.Control;
4 | import org.jenkinsci.test.acceptance.po.Describable;
5 | import org.jenkinsci.test.acceptance.po.PageArea;
6 | import org.jenkinsci.test.acceptance.po.PageObject;
7 |
8 | /**
9 | * @author Kohsuke Kawaguchi
10 | */
11 | @Describable("Username with password")
12 | public class UserPwdCredential extends BaseStandardCredentials {
13 | public final Control username = control(by.name("_.username"));
14 | public final Control password = control(by.name("_.password"));
15 |
16 | public UserPwdCredential(PageObject context, String path) {
17 | super(context, path);
18 | }
19 |
20 | public UserPwdCredential(PageArea area, String relativePath) {
21 | super(area, relativePath);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/test/java/org/jenkinsci/test/acceptance/po/SnippetGeneratorTest.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.po;
2 |
3 | import static org.hamcrest.MatcherAssert.assertThat;
4 | import static org.hamcrest.Matchers.is;
5 |
6 | import org.jenkinsci.test.acceptance.junit.AbstractJUnitTest;
7 | import org.jenkinsci.test.acceptance.junit.WithPlugins;
8 | import org.junit.Test;
9 |
10 | @WithPlugins("pipeline-model-definition")
11 | public class SnippetGeneratorTest extends AbstractJUnitTest {
12 | @Test
13 | public void createPipelineSnippetToArchiveArtifacts() {
14 | WorkflowJob job = jenkins.getJobs().create(WorkflowJob.class);
15 | job.save();
16 |
17 | SnippetGenerator snippetGenerator = new SnippetGenerator(job);
18 | snippetGenerator.open();
19 |
20 | assertThat(snippetGenerator.generateScript(), is("archiveArtifacts artifacts: '', followSymlinks: false"));
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/parameterized_trigger/TriggerConfig.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.parameterized_trigger;
2 |
3 | import org.jenkinsci.test.acceptance.po.Control;
4 | import org.jenkinsci.test.acceptance.po.PageAreaImpl;
5 |
6 | /**
7 | * @author Kohsuke Kawaguchi
8 | */
9 | public class TriggerConfig extends PageAreaImpl {
10 | public final Control projects = control("projects");
11 | public final Control block = control("block");
12 |
13 | public TriggerConfig(ParameterizedTrigger parent, String relativePath) {
14 | super(parent, relativePath);
15 | }
16 |
17 | public
9 | * Oftentimes marking your class with {@link AutoCleaned} gets the job done.
10 | *
11 | * @author Kohsuke Kawaguchi
12 | */
13 | @TestScope
14 | public class TestCleaner extends Cleaner {
15 | @Inject
16 | TestLifecycle lifecycle;
17 |
18 | @Override
19 | public List
11 | * See WIRING.md
12 | *
13 | * @author Kohsuke Kawaguchi
14 | */
15 | public class SubWorld {
16 | /*package*/ Injector injector;
17 | /*package*/ String name;
18 |
19 | /*package*/ SubWorld() {}
20 |
21 | public String getName() {
22 | return name;
23 | }
24 |
25 | public Injector getInjector() {
26 | return injector;
27 | }
28 |
29 | /**
30 | * This is a part of the DSL construct that allows people to say:
31 | *
32 | *
25 | * Note that newly added trigger has one entry in there by default.
26 | */
27 | public TriggerConfig addTriggerConfig() {
28 | String path = createPageArea("configs", () -> clickButton("Add trigger..."));
29 | return new TriggerConfig(this, path);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/resources/ath-container/set-java.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # Inspired by https://disconnected.systems/blog/another-bash-strict-mode/
3 | set -uo pipefail
4 | trap 's=$?; echo >&2 "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR
5 |
6 | # The selection used by update-alternatives for each java version
7 | if [[ $1 == '17' ]]; then
8 | selection='17-openjdk'
9 | elif [[ $1 == '21' ]]; then
10 | selection='21-openjdk'
11 | else
12 | echo >&2 "Unsupported java version '${1}'"
13 | exit 1
14 | fi
15 |
16 | # For some reason, all tools from JDK are split to 2 groups named java and javac
17 |
18 | JAVA_PATH=$(update-alternatives --list java | grep $selection)
19 | JAVAC_PATH=$(update-alternatives --list javac | grep $selection)
20 |
21 | update-alternatives --set java "$JAVA_PATH"
22 | update-alternatives --set javac "$JAVAC_PATH"
23 |
24 | echo
25 | echo -------------------- INFORMATION --------------------
26 | echo Running on...
27 | java -version
28 | echo
29 | javac -version
30 | echo
31 | echo Start running tests with...
32 | echo
33 | echo run.sh remote-webdriver-firefox latest -DforkCount=1 -Dmaven.test.failure.ignore=true -B -Dtest=...
34 | echo
35 | echo ------------------ END INFORMATION ------------------
36 | echo
37 |
--------------------------------------------------------------------------------
/src/test/java/UnixDomainSocketTestServer.java:
--------------------------------------------------------------------------------
1 | import java.io.File;
2 | import java.io.InputStream;
3 | import java.io.OutputStream;
4 | import java.nio.channels.Channels;
5 | import jnr.unixsocket.UnixServerSocketChannel;
6 | import jnr.unixsocket.UnixSocketAddress;
7 | import jnr.unixsocket.UnixSocketChannel;
8 | import org.apache.commons.io.IOUtils;
9 |
10 | /**
11 | * Unix domain socket test.
12 | *
13 | * @author Kohsuke Kawaguchi
14 | */
15 | public class UnixDomainSocketTestServer {
16 | public static void main(String[] args) throws Exception {
17 | File path = new File("./jenkins.sock");
18 | path.deleteOnExit();
19 | UnixServerSocketChannel channel = UnixServerSocketChannel.open();
20 | channel.configureBlocking(true);
21 | channel.socket().bind(new UnixSocketAddress(path));
22 |
23 | while (true) {
24 | UnixSocketChannel c = channel.accept();
25 | System.out.println("Accepted");
26 |
27 | InputStream in = Channels.newInputStream(c);
28 | OutputStream out = Channels.newOutputStream(c);
29 |
30 | IOUtils.copy(in, out);
31 | System.out.println("Closed");
32 | c.close();
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/gitlab_plugin/GitLabServerConfig.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.gitlab_plugin;
2 |
3 | import static org.jenkinsci.test.acceptance.Matchers.hasContent;
4 |
5 | import jakarta.inject.Inject;
6 | import org.jenkinsci.test.acceptance.po.Control;
7 | import org.jenkinsci.test.acceptance.po.Jenkins;
8 | import org.jenkinsci.test.acceptance.po.PageAreaImpl;
9 |
10 | public class GitLabServerConfig extends PageAreaImpl {
11 |
12 | private Control serverName = control("servers/name");
13 | private Control serverUrl = control("servers/serverUrl");
14 |
15 | @Inject
16 | public GitLabServerConfig(Jenkins jenkins) {
17 | super(jenkins, "/io-jenkins-plugins-gitlabserverconfig-servers-GitLabServers");
18 | }
19 |
20 | public void configureServer(String url) {
21 | serverName.set("servername");
22 | serverUrl.set(url);
23 |
24 | waitFor(by.option("GitLab Personal Access Token")).click();
25 |
26 | find(by.path("/io-jenkins-plugins-gitlabserverconfig-servers-GitLabServers/servers/validate-button"))
27 | .click();
28 |
29 | waitFor(driver, hasContent("Credentials verified for user"), 10);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/test/java/core/JdkTest.java:
--------------------------------------------------------------------------------
1 | package core;
2 |
3 | import org.jenkinsci.test.acceptance.junit.AbstractJUnitTest;
4 | import org.jenkinsci.test.acceptance.junit.Native;
5 | import org.jenkinsci.test.acceptance.po.FreeStyleJob;
6 | import org.jenkinsci.test.acceptance.po.JdkInstallation;
7 | import org.jenkinsci.test.acceptance.po.ToolInstallation;
8 | import org.junit.Test;
9 |
10 | public class JdkTest extends AbstractJUnitTest {
11 |
12 | // This actually tests any installed JDK, not necessarily oracle.
13 | @Test
14 | @Native("java")
15 | public void usePreinstalledJdk() {
16 | String expectedVersion = localJavaVersion();
17 |
18 | JdkInstallation jdk = ToolInstallation.addTool(jenkins, JdkInstallation.class);
19 | jdk.name.set("preinstalled");
20 | jdk.useNative();
21 | jdk.getPage().save();
22 |
23 | FreeStyleJob job = jenkins.jobs.create();
24 | job.configure();
25 | job.addShellStep("java -version");
26 | job.save();
27 |
28 | job.startBuild().shouldSucceed().shouldContainsConsoleOutput(expectedVersion);
29 | }
30 |
31 | private String localJavaVersion() {
32 | return jenkins.runScript("'java -version'.execute().text");
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/workflow_multibranch/GitBranchSource.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.workflow_multibranch;
2 |
3 | import org.jenkinsci.test.acceptance.po.Control;
4 | import org.jenkinsci.test.acceptance.po.Describable;
5 | import org.jenkinsci.test.acceptance.po.WorkflowMultiBranchJob;
6 | import org.openqa.selenium.By;
7 | import org.openqa.selenium.support.ui.Select;
8 |
9 | /**
10 | * Git Branch Source for the pipeline multi-branch plugin.
11 | *
12 | * @author Ullrich Hafner
13 | */
14 | @Describable("Git")
15 | // TODO: Remove duplicates with GitScm
16 | public class GitBranchSource extends BranchSource {
17 | private final Control remote = control("remote");
18 |
19 | public GitBranchSource(WorkflowMultiBranchJob job, String path) {
20 | super(job, path);
21 | }
22 |
23 | public GitBranchSource setRemote(final String remoteUrl) {
24 | this.remote.set(remoteUrl);
25 |
26 | return this;
27 | }
28 |
29 | public GitBranchSource setCredentials(final String name) {
30 | Select select = new Select(control(By.className("credentials-select")).resolve());
31 | select.selectByVisibleText(name);
32 |
33 | return this;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/config_file_provider/MavenSettingsConfig.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.config_file_provider;
2 |
3 | import org.jenkinsci.test.acceptance.po.CodeMirror;
4 | import org.jenkinsci.test.acceptance.po.Control;
5 | import org.jenkinsci.test.acceptance.po.Describable;
6 |
7 | /**
8 | * Class for Maven Settings files.
9 | */
10 | @Describable("Maven settings.xml")
11 | public class MavenSettingsConfig extends ProvidedFile {
12 |
13 | public final Control replaceAll = control("/config/isReplaceAll");
14 |
15 | public MavenSettingsConfig(ConfigFileProvider context, String id) {
16 | super(context, id);
17 | }
18 |
19 | @Override
20 | public void content(String mvnSettings) {
21 | new CodeMirror(this, "/config/content").set(mvnSettings);
22 | }
23 |
24 | public void replaceAll(final boolean replaceAll) {
25 | this.replaceAll.check(replaceAll);
26 | }
27 |
28 | public ServerCredentialMapping addServerCredentialMapping() {
29 | final String path = createPageArea("/config/serverCredentialMappings", () -> control("/config/repeatable-add")
30 | .click());
31 |
32 | return new ServerCredentialMapping(this, path);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/ssh_credentials/SshCredentialDialog.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.ssh_credentials;
2 |
3 | import org.jenkinsci.test.acceptance.plugins.credentials.BaseStandardCredentials;
4 | import org.jenkinsci.test.acceptance.plugins.credentials.Credential;
5 | import org.jenkinsci.test.acceptance.po.Control;
6 | import org.jenkinsci.test.acceptance.po.PageObject;
7 |
8 | /**
9 | * Modal dialog to enter a credential.
10 | *
11 | * @author Kohsuke Kawaguchi
12 | */
13 | public class SshCredentialDialog extends BaseStandardCredentials {
14 | public final Control kind = control(by.xpath("//*[@id='credentials-dialog-form']//*[@path='/']"));
15 |
16 | public SshCredentialDialog(PageObject context, String path) {
17 | super(context, path);
18 | }
19 |
20 | /**
21 | * Selects the credential type and bind the controls to the page area.
22 | */
23 | public
26 | * Note that newly added trigger has one entry in there by default.
27 | */
28 | public BuildTriggerConfig addTriggerConfig() {
29 | String path = createPageArea("configs", () -> clickButton("Add trigger..."));
30 | return new BuildTriggerConfig(this, path);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/po/GlobalPluginConfiguration.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.po;
2 |
3 | import org.openqa.selenium.WebDriver;
4 | import org.openqa.selenium.WebElement;
5 |
6 | /**
7 | * PageArea generated from a server-side {@code GlobalPluginConfiguration} implementation.
8 | *
9 | *
10 | * These page areas do not get fixed path name, so we need to figure that out from the hidden "name" field.
11 | *
12 | * TODO: improve core to make this more robust
13 | *
14 | * @author Kohsuke Kawaguchi
15 | */
16 | public class GlobalPluginConfiguration extends PageAreaImpl {
17 | public GlobalPluginConfiguration(JenkinsConfig context, String pluginShortName) {
18 | super(context, toPathName(context.driver, pluginShortName));
19 | }
20 |
21 | private static String toPathName(WebDriver d, String pluginShortName) {
22 | for (int i = 0; ; i++) {
23 | String path = "/jenkins-model-GlobalPluginConfiguration/plugin";
24 | if (i > 0) {
25 | path += String.format("[%d]", i);
26 | }
27 |
28 | WebElement e = d.findElement(by.path("%s/name", path));
29 | if (e.getAttribute("value").equals(pluginShortName)) {
30 | return path;
31 | }
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/log/LogSplitter.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.log;
2 |
3 | import java.io.IOException;
4 | import java.util.List;
5 | import java.util.concurrent.CopyOnWriteArrayList;
6 |
7 | /**
8 | * Receives logs from {@link LogListener} and distributes them to other {@link LogListener}s.
9 | *
10 | * @author Kohsuke Kawaguchi
11 | */
12 | public class LogSplitter implements LogListenable, LogListener {
13 | private final List
13 | * It provides access to the particular web elements to configure the post build step.
14 | *
15 | * This post build step requires installation of the text-finder plugin.
16 | *
17 | * @author Martin Ende
18 | */
19 | @Describable("Jenkins Text Finder")
20 | public class TextFinderPublisher extends AbstractStep implements PostBuildStep {
21 |
22 | public final WebElement filePath = find(by.xpath("//input[@name='_.fileSet']"));
23 | public final WebElement regEx = find(by.xpath("//input[@name='_.regexp']"));
24 | public final WebElement succeedIfFound = find(by.xpath("//input[@name='_.succeedIfFound']"));
25 | public final WebElement unstableIfFound = find(by.xpath("//input[@name='_.unstableIfFound']"));
26 |
27 | public TextFinderPublisher(Job parent, String path) {
28 | super(parent, path);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/resources/org/jenkinsci/test/acceptance/machine/autoterminate.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | ##
4 | ## Touches $HOME/terminate.txt file if there is at least 1 sshd process
5 | ## is found running by the user owning this process. It would wait for $2
6 | ##
7 | ## $1 username
8 | ## $2 timout to wait before shutdown
9 | ##
10 | ## author: Vivek Pandey
11 | ##
12 | function usage(){
13 | echo "USAGE: sh autoterminate.sh USERNAME TIMEOUT"
14 | exit 1
15 | }
16 |
17 | if [ -z "$1" ]
18 | then
19 | usage
20 | fi
21 |
22 | if [ -z "$2" ]
23 | then
24 | usage
25 | fi
26 |
27 | if [ $# -eq 0 ]
28 | then
29 | usage
30 | fi
31 |
32 | echo "Executing with username=$1, timeout=$2"
33 |
34 | FILE=$HOME/terminate.txt
35 | echo touching file $FILE
36 |
37 | touch $FILE
38 |
39 | while(true)
40 | do
41 | num_of_sshd=$(pgrep -u $1 sshd |wc -l)
42 | if [ -z "$num_of_sshd" ]
43 | then
44 | num_of_sshd=0
45 | fi
46 |
47 | echo Number of sshd processes: $num_of_sshd
48 |
49 | if [ $num_of_sshd -gt 0 ]
50 | then
51 | echo "Touching file..."
52 | touch $FILE
53 | fi
54 |
55 | if test `find "$FILE" -cmin +$2`
56 | then
57 | echo "Shutting down now..."
58 | sudo shutdown -h now
59 | exit 0
60 | else
61 | echo Not yet, waiting for $2 minutes
62 | fi
63 | echo "Going to sleep for 10 min"
64 | sleep 600
65 | done
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/credentialsbinding/CredentialsBinding.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.credentialsbinding;
2 |
3 | import org.jenkinsci.test.acceptance.po.ContainerPageObject;
4 | import org.jenkinsci.test.acceptance.po.Control;
5 | import org.jenkinsci.test.acceptance.po.PageArea;
6 | import org.jenkinsci.test.acceptance.po.PageAreaImpl;
7 | import org.openqa.selenium.NoSuchElementException;
8 |
9 | /**
10 | * Represents a credential binding in the job configuration page.
11 | */
12 | public class CredentialsBinding extends PageAreaImpl {
13 |
14 | public Control credentialId = control("credentialId");
15 | public Control variable = control("variable");
16 |
17 | public CredentialsBinding(PageArea area, String path) {
18 | super(area, path);
19 | }
20 |
21 | public CredentialsBinding(ContainerPageObject po, String path) {
22 | super(po, path);
23 | }
24 |
25 | /**
26 | * Checks whether there are credentials in the credentials drop down
27 | *
28 | * @return true if there are no credentials, false otherwise
29 | */
30 | public boolean noCredentials() {
31 | try {
32 | credentialId.resolve().findElement(by.tagName("option"));
33 | return false;
34 | } catch (NoSuchElementException ex) {
35 | return true;
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/docs/INVESTIGATION.md:
--------------------------------------------------------------------------------
1 | # Investigating a failed test
2 |
3 | ## Interactive investigation
4 |
5 | As an alternative to setting a breakpoint, that would stop the test suite and keep Jenkins and browser running for manual investigation.
6 | There is an environment variable `INTERACTIVE=true` that, when provided, will pause the suite whenever a test fails/throws exception.
7 |
8 | You can also add a call to `InteractiveConsole.execute(this)` in the code to stop the execution and debug in interactive groovy console.
9 |
10 | ## Diagnostic information
11 |
12 | Test harness keeps track of test diagnostic information in `/target/diagnostics/
14 | * Annotate {@link TestRule} to have it run for every test.
15 | * See {@link RuleAnnotation} optional rule registration.
16 | *
17 | * @author ogondza
18 | */
19 | @Retention(RetentionPolicy.RUNTIME)
20 | @Target(ElementType.TYPE)
21 | @Documented
22 | @Indexed
23 | public @interface GlobalRule {
24 |
25 | /**
26 | * Optional ordering among rules.
27 | *
28 | * Annotation with {@code priority >= 0} are guaranteed to be run after
29 | * Jenkins is up. Negative priorities are run before startup on best effort
30 | * basis. (It might not happen before for ExistingJenkinsController,
31 | * PooledJenkinsController and possibly others).
32 | *
33 | * Annotations that skips execution are encouraged to run before Jenkins is
34 | * booted up to save time. Note, that these implementations can not inject
35 | * Jenkins for obvious reasons.
36 | */
37 | int priority() default 0;
38 | }
39 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/git_client/JGitInstallation.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.git_client;
2 |
3 | import java.util.regex.Pattern;
4 | import org.jenkinsci.test.acceptance.po.ConfigurablePageObject;
5 | import org.jenkinsci.test.acceptance.po.Control;
6 | import org.jenkinsci.test.acceptance.po.Jenkins;
7 | import org.jenkinsci.test.acceptance.po.ToolInstallation;
8 | import org.jenkinsci.test.acceptance.po.ToolInstallationPageObject;
9 |
10 | @ToolInstallationPageObject(name = "Git", installer = "hudson.tools.ZipExtractionInstaller")
11 | public class JGitInstallation extends ToolInstallation {
12 |
13 | public JGitInstallation(Jenkins jenkins, String path) {
14 | super(jenkins, path);
15 | }
16 |
17 | public static JGitInstallation addJGit(Jenkins jenkins) {
18 | ConfigurablePageObject toolsPage = ToolInstallation.ensureConfigPage(jenkins);
19 |
20 | final String name = JGitInstallation.class
21 | .getAnnotation(ToolInstallationPageObject.class)
22 | .name();
23 | final Control button = toolsPage.control(by.button("Add " + name));
24 |
25 | String pathPrefix =
26 | button.resolve().getAttribute("path").replaceAll(Pattern.quote("hetero-list-add[tool]"), "tool");
27 | return ToolInstallation.addTool(
28 | jenkins, JGitInstallation.class, pathPrefix, () -> button.selectDropdownMenu("JGit"));
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/external_workspace_manager/ExternalNodeConfig.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.external_workspace_manager;
2 |
3 | import org.jenkinsci.test.acceptance.po.PageAreaImpl;
4 | import org.jenkinsci.test.acceptance.po.Slave;
5 |
6 | /**
7 | * Helper class for interacting with External Workspace Manager Plugin node config page.
8 | *
9 | * @author Alexandru Somai
10 | */
11 | public class ExternalNodeConfig extends PageAreaImpl {
12 |
13 | public ExternalNodeConfig(Slave context) {
14 | super(context, "/nodeProperties/org-jenkinsci-plugins-ewm-nodes-ExternalWorkspaceProperty");
15 | }
16 |
17 | public void setConfig(String diskPoolId, String diskOneId, String diskTwoId, String fakeMountingPoint) {
18 | // set disk pool
19 | control(by.checkbox("External Workspace")).click();
20 | control("repeatable-add").click();
21 | control("nodeDiskPools/diskPoolRefId").set(diskPoolId);
22 |
23 | // add first disk
24 | control("nodeDiskPools/repeatable-add").click();
25 | control("nodeDiskPools/nodeDisks/diskRefId").set(diskOneId);
26 | control("nodeDiskPools/nodeDisks/nodeMountPoint").set(fakeMountingPoint);
27 |
28 | // add second disk
29 | control("nodeDiskPools/repeatable-add").click();
30 | control("nodeDiskPools/nodeDisks[1]/diskRefId").set(diskTwoId);
31 | control("nodeDiskPools/nodeDisks[1]/nodeMountPoint").set(fakeMountingPoint);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/po/Describable.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.po;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 | import org.jvnet.hudson.annotation_indexer.Indexed;
8 |
9 | /**
10 | * Annotation used to register implementations to be discovered automatically.
11 | *
12 | * Note that different services creating an instances have different conventions concerning both the values of this
13 | * annotation as well as the class interface. In some cases, descriptions are visual labels used in UI, but it can as
14 | * well be an internal identifier such as Jenkins class name. Compare {@link Describable} annotations for {@link
15 | * MatrixProject} and {@link ShellBuildStep}. Unique constructor signature is often required for implementations of the
16 | * same abstraction.
17 | *
18 | * The details should be documented in particular superclass, such as {@link Job} or {@link BuildStep}.
19 | *
20 | * @author Kohsuke Kawaguchi
21 | * @see CapybaraPortingLayerImpl#findCaption(Class, CapybaraPortingLayerImpl.Finder)
22 | */
23 | @Retention(RetentionPolicy.RUNTIME)
24 | @Target(ElementType.TYPE)
25 | @Indexed
26 | public @interface Describable {
27 | /**
28 | * Descriptions.
29 | *
30 | * The annotation accepts several values as possible alternatives. First that exists will be used.
31 | */
32 | String[] value();
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/matrix_auth/MatrixAuthorizationStrategy.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.matrix_auth;
2 |
3 | import org.jenkinsci.test.acceptance.po.AuthorizationStrategy;
4 | import org.jenkinsci.test.acceptance.po.Control;
5 | import org.jenkinsci.test.acceptance.po.Describable;
6 | import org.jenkinsci.test.acceptance.po.GlobalSecurityConfig;
7 |
8 | /**
9 | * @author Kohsuke Kawaguchi
10 | */
11 | @Describable("Matrix-based security")
12 | public class MatrixAuthorizationStrategy extends AuthorizationStrategy {
13 | private final Control table = control("/data");
14 |
15 | public MatrixAuthorizationStrategy(GlobalSecurityConfig context, String path) {
16 | super(context, path);
17 | }
18 |
19 | /**
20 | * Adds a new user to this matrix.
21 | */
22 | public MatrixRow addUser(String name) {
23 | runThenHandleInputDialog(
24 | () -> this.table
25 | .resolve()
26 | .findElement(
27 | by.xpath(
28 | "../div/span/span/button[text()='Add user\u2026'] | ../div/button[text()='Add user\u2026']"))
29 | .click(),
30 | name);
31 | return getUser(name);
32 | }
33 |
34 | /**
35 | * Picks up the existing user in the table.
36 | */
37 | public MatrixRow getUser(String name) {
38 | return new MatrixRow(this, "data/USER:" + name);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/po/Changes.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.po;
2 |
3 | import java.net.URL;
4 | import org.openqa.selenium.NoSuchElementException;
5 |
6 | /**
7 | * @author Matthias Karl
8 | */
9 | public class Changes extends PageObject {
10 |
11 | protected Changes(PageObject context, URL url) {
12 | super(context, url);
13 | }
14 |
15 | /**
16 | * Are there any changes in the current build.
17 | *
18 | * @return true if the build has changes.
19 | */
20 | public boolean hasChanges() {
21 | try {
22 | // TODO: improve test to be more failproove
23 | find(by.xpath("//h2[text()='%s']/following-sibling::ol/li", "Summary"));
24 | return true;
25 | } catch (NoSuchElementException e) {
26 | return false;
27 | }
28 | }
29 |
30 | /**
31 | * Is there a (diff) link for a specific file.
32 | * Links are present if there are changes in a file and a repository browser is specified.
33 | *
34 | * @param file name of the file with changes.
35 | * @return true if (diff) link for file is present.
36 | */
37 | public boolean hasDiffFileLink(String file) {
38 | try {
39 | // TODO: improve test to be more failproove
40 | find(by.xpath("//a[text()='/%s']/following-sibling::a[text()='(diff)']", file));
41 | return true;
42 | } catch (NoSuchElementException e) {
43 | return false;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/deploy/DeployPublisher.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.plugins.deploy;
2 |
3 | import org.jenkinsci.test.acceptance.po.AbstractStep;
4 | import org.jenkinsci.test.acceptance.po.Control;
5 | import org.jenkinsci.test.acceptance.po.Describable;
6 | import org.jenkinsci.test.acceptance.po.Job;
7 | import org.jenkinsci.test.acceptance.po.PostBuildStep;
8 | import org.openqa.selenium.NoSuchElementException;
9 |
10 | /**
11 | * @author Kohsuke Kawaguchi
12 | */
13 | @Describable("Deploy war/ear to a container")
14 | public class DeployPublisher extends AbstractStep implements PostBuildStep {
15 | public DeployPublisher(Job parent, String path) {
16 | super(parent, path);
17 | }
18 |
19 | public final Control war = control("war");
20 | public final Control contextPath = control("contextPath");
21 | public final Control url = control("adapters/url");
22 |
23 | public void setCredentials(String credentials) {
24 | control("adapters/credentialsId").select(credentials);
25 | }
26 |
27 | public void useContainer(String... container) {
28 | RuntimeException last = new RuntimeException("No container names provided");
29 | for (String c : container) {
30 | try {
31 | control("hetero-list-add[adapters]").selectDropdownMenu(c);
32 | return;
33 | } catch (NoSuchElementException ex) {
34 | last = ex;
35 | }
36 | }
37 | throw last;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/po/FreeStyleMultiBranchJob.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.po;
2 |
3 | import com.google.inject.Injector;
4 | import java.net.URL;
5 | import org.openqa.selenium.WebElement;
6 |
7 | /**
8 | * A freestyle multi-branch job (requires installation of multi-branch-project-plugin).
9 | *
10 | * @author Ullrich Hafner
11 | */
12 | @Describable("com.github.mjdetullio.jenkins.plugins.multibranch.FreeStyleMultiBranchProject")
13 | public class FreeStyleMultiBranchJob extends Job {
14 | public FreeStyleMultiBranchJob(Injector injector, URL url, String name) {
15 | super(injector, url, name);
16 | }
17 |
18 | @Override
19 | public
14 | * This allows annotations on test class/method to add additional setup/shutdown behaviours.
15 | *
16 | * @author Kohsuke Kawaguchi
17 | */
18 | @Retention(RetentionPolicy.RUNTIME)
19 | @Target(ElementType.ANNOTATION_TYPE)
20 | @Documented
21 | public @interface RuleAnnotation {
22 | /**
23 | * The rule class that defines the setup/shutdown behaviour.
24 | *
25 | * The instance is obtained through Guice.
26 | */
27 | Class extends TestRule> value();
28 |
29 | /**
30 | * Optional ordering among rules.
31 | *
32 | * Annotation with {@code priority >= 0} are guaranteed to be run after
33 | * Jenkins is up. Negative priorities are run before startup on best effort
34 | * basis. (It might not happen before for ExistingJenkinsController,
35 | * PooledJenkinsController and possibly others).
36 | *
37 | * Annotations that skips execution are encouraged to run before Jenkins is
38 | * booted up to save time. Note, that these implementations can not inject
39 | * Jenkins for obvious reasons.
40 | */
41 | int priority() default 0;
42 | }
43 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/plugins/parameterized_trigger/BuildParameters.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The MIT License
3 | *
4 | * Copyright (c) 2015 Red Hat, Inc.
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | * THE SOFTWARE.
23 | */
24 | package org.jenkinsci.test.acceptance.plugins.parameterized_trigger;
25 |
26 | import org.jenkinsci.test.acceptance.po.PageAreaImpl;
27 |
28 | public abstract class BuildParameters extends PageAreaImpl {
29 |
30 | protected BuildParameters(TriggerConfig area, String path) {
31 | super(area, path);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/FtpdContainer/Dockerfile:
--------------------------------------------------------------------------------
1 | #
2 | # Runs sshd and allow the 'test' user to login
3 | #
4 |
5 | FROM ubuntu:22.04
6 |
7 | # install FTP
8 | RUN apt-get update && apt-get install -y vsftpd
9 | RUN echo "local_enable=YES" >> /etc/myftp.conf
10 | RUN echo "write_enable=YES" >> /etc/myftp.conf
11 | RUN echo "listen=YES" >> /etc/myftp.conf
12 | RUN echo "anonymous_enable=YES" >> /etc/myftp.conf
13 | RUN echo "dirmessage_enable=YES" >> /etc/myftp.conf
14 | RUN echo "use_localtime=YES" >> /etc/myftp.conf
15 | RUN echo "xferlog_enable=YES" >> /etc/myftp.conf
16 | RUN echo "secure_chroot_dir=/var/run/vsftpd/empty" >> /etc/myftp.conf
17 | RUN echo "pam_service_name=vsftpd" >> /etc/myftp.conf
18 | RUN echo "rsa_cert_file=/etc/ssl/private/vsftpd.pem" >> /etc/myftp.conf
19 | RUN echo "pasv_enable=YES" >> /etc/myftp.conf
20 | RUN echo "pasv_min_port=9050" >> /etc/myftp.conf
21 | RUN echo "pasv_max_port=9055" >> /etc/myftp.conf
22 | # To enable passv mode through NAT (for remote docker) we need to set the
23 | # passv_address to the address that docker will use to port forward
24 | RUN echo "pasv_address=localhost" >> /etc/myftpd.conf
25 | # however DockerCOntainer has no way to specify the port offset so this will just not work..
26 | # unless the container and host ports match exactly
27 | RUN mkdir -p /var/run/vsftpd/empty
28 |
29 | # create a test user
30 | RUN useradd test -d /home/test -s /bin/bash && \
31 | mkdir -p /home/test/ftp && \
32 | chown test /home/test && \
33 | echo "test:test" | chpasswd
34 |
35 | # run VSFTPD
36 | CMD /usr/sbin/vsftpd /etc/myftp.conf
37 |
--------------------------------------------------------------------------------
{@link Assertions}.
12 | */
13 | protected Assertions() {
14 | // empty
15 | }
16 | }
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/junit/SmokeTest.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.junit;
2 |
3 | /**
4 | * Marker interface to identify a smoke test. A smoke test is a test that basically uses one important aspect of the
5 | * acceptance testing framework. Run these smoke tests in order to get a first impression if a framework change did not
6 | * break anything. The overall number of smoke tests should be less than 10.
7 | *
8 | * @author Ullrich Hafner
9 | */
10 | public interface SmokeTest {
11 | // marker interface
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/org/jenkinsci/test/acceptance/log/LogListenable.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.test.acceptance.log;
2 |
3 | import org.jenkinsci.test.acceptance.controller.JenkinsController;
4 |
5 | /**
6 | * Produces line-by-line log.
7 | *
33 | * subworld "masters" {
34 | * ...
35 | * bind Foo to ...
36 | * }
37 | *
38 | * bind Foo toProvider masters[Foo] // export Foo from the "masters" subworld to the parent
39 | *
40 | */
41 | public