Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/maven/org.apache.maven.plugins-…
Browse files Browse the repository at this point in the history
…maven-javadoc-plugin-3.2.0
  • Loading branch information
olamy authored Mar 24, 2021
2 parents a8200a1 + d99066d commit 7931819
Show file tree
Hide file tree
Showing 72 changed files with 547 additions and 669 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5.11.0
- uses: release-drafter/release-drafter@v5.15.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ envs = [
'[email protected]'
]

jenkinsVersions = ['2.176.4']
jenkinsVersions = ['2.222.4']

if (params.USE_SAUCELABS) {
credentials.add(usernamePassword(credentialsId: 'saucelabs', passwordVariable: 'SAUCE_ACCESS_KEY', usernameVariable: 'SAUCE_USERNAME'))
Expand Down Expand Up @@ -81,7 +81,7 @@ node() {

stage('Building BlueOcean') {
timeout(time: 90, unit: 'MINUTES') {
sh "mvn clean install -V -B -DcleanNode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Dmaven.test.failure.ignore -s settings.xml -Dmaven.artifact.threads=30"
sh "mvn clean install -T1C -V -B -DcleanNode --no-transfer-progress -Dmaven.test.failure.ignore -s settings.xml -Dmaven.artifact.threads=30"
}

junit '**/target/surefire-reports/TEST-*.xml'
Expand All @@ -91,7 +91,7 @@ node() {

jenkinsVersions.each { version ->
stage("ATH - Jenkins ${version}") {
timeout(time: 90, unit: 'MINUTES') {
timeout(time: 150, unit: 'MINUTES') {
dir('acceptance-tests') {
sh "bash -x ./run.sh -v=${version} --host=${ip} --no-selenium --settings='-s ${env.WORKSPACE}/settings.xml'"
junit '**/target/surefire-reports/*.xml'
Expand Down
2 changes: 1 addition & 1 deletion acceptance-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<maven.compiler.target>1.8</maven.compiler.target>
<phantomjs.binary.path>./target/phantomjs-maven-plugin/phantomjs-2.1.1-linux-x86_64/bin/phantomjs</phantomjs.binary.path>
<argLine>-Djdk.net.URLClassPath.disableClassPathURLCheck=true</argLine>
<slf4j.version>1.7.25</slf4j.version>
<slf4j.version>1.7.30</slf4j.version>
<selenium.version>3.141.59</selenium.version> <!-- 3.141.59 4.0.0-alpha-6 -->
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<properties>
<!-- Baseline Jenkins version you use to build the plugin. Users must have this version or newer to run. -->
<jenkins.version>2.176.4</jenkins.version>
<jenkins.version>2.222.4</jenkins.version>
<!-- Other properties you may want to use:
~ java.level: set to 6 if your jenkins.version <= 1.611
~ jenkins-test-harness.version: Jenkins Test Harness version you use to test the plugin. For Jenkins version >= 1.580.1 use JTH 2.0 or higher.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
</pluginRepository>
</pluginRepositories>
<properties>
<jenkins.version>2.176.4</jenkins.version>
<jenkins.version>2.222.4</jenkins.version>
<java.level>8</java.level>
<spotbugs.failOnError>false</spotbugs.failOnError>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion acceptance-tests/runner/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<jenkins.acceptance.testharness.version>1.74</jenkins.acceptance.testharness.version>
<argLine>-Djdk.net.URLClassPath.disableClassPathURLCheck=true</argLine>
<java.level>8</java.level>
<slf4j.version>1.7.25</slf4j.version>
<slf4j.version>1.7.30</slf4j.version>
</properties>

<repositories>
Expand Down
2 changes: 1 addition & 1 deletion acceptance-tests/runner/scripts/args.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
JENKINS_VERSION=2.176.4
JENKINS_VERSION=2.222.4
SELENIUM_VERSION=2.53

MAVEN_SETTINGS=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.google.inject.Injector;
import io.blueocean.ath.pages.classic.LoginPage;
import org.apache.commons.io.FileUtils;
import org.apache.log4j.Logger;
import org.junit.internal.AssumptionViolatedException;
import org.junit.internal.runners.model.EachTestNotifier;
import org.junit.runner.Description;
Expand All @@ -21,6 +20,8 @@
import org.openqa.selenium.remote.ScreenshotException;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.IOException;
Expand All @@ -35,7 +36,7 @@
public class ATHJUnitRunner extends BlockJUnit4ClassRunner {
private Injector injector;

private Logger logger = Logger.getLogger(ATHJUnitRunner.class);
private Logger logger = LoggerFactory.getLogger(ATHJUnitRunner.class);

public ATHJUnitRunner(Class<?> klass) throws InitializationError {
super(klass);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import io.blueocean.ath.pages.blue.RunDetailsArtifactsPage;
import io.blueocean.ath.pages.blue.RunDetailsPipelinePage;
import io.blueocean.ath.pages.blue.RunDetailsTestsPage;
import org.apache.log4j.Logger;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.MutableCapabilities;
import org.openqa.selenium.WebDriver;
Expand All @@ -33,8 +32,9 @@
import org.openqa.selenium.logging.LoggingPreferences;
import org.openqa.selenium.remote.Augmenter;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.FileInputStream;
Expand All @@ -46,7 +46,7 @@
import java.util.logging.Level;

public class AthModule extends AbstractModule {
private static final Logger logger = Logger.getLogger(AthModule.class);
private static final Logger logger = LoggerFactory.getLogger(AthModule.class);

@Override
protected void configure() {
Expand Down Expand Up @@ -117,7 +117,7 @@ protected void configure() {
if(server.getComputerSet().getTotalExecutors() < 10) {
server.runScript(
"jenkins.model.Jenkins.getInstance().setNumExecutors(10);\n" +
"jenkins.model.Jenkins.getInstance().save();\n");
"jenkins.model.Jenkins.getInstance().save();\n", true);
}

Properties properties = new Properties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import com.offbytwo.jenkins.JenkinsServer;
import com.offbytwo.jenkins.client.JenkinsHttpClient;
import org.apache.http.client.HttpResponseException;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.net.URI;
Expand All @@ -14,7 +15,7 @@
*/
public class CustomJenkinsServer extends JenkinsServer {

private final Logger logger = Logger.getLogger(getClass());
private final Logger logger = LoggerFactory.getLogger(getClass());

protected final JenkinsHttpClient client;

Expand All @@ -37,14 +38,14 @@ public void deleteUserDomainCredential(String userName, String domainName, Strin
String path = "/user/" + userName + "/credentials/store/user/domain/" + domainName + "/credential/" + credentialId;

try {
client.post(path + "/doDelete", false);
logger.info("deleted credential at " + path);
client.post(path + "/doDelete", true);
logger.info("deleted credential at {}", path);
} catch (HttpResponseException e) {
if (e.getStatusCode() == 404) {
logger.debug("received 404 while trying to delete credential at " + path);
logger.debug("received 404 while trying to delete credential at {}", path);
} else {
logger.error("error deleting credential at " + path);
logger.error("message = " + e.getMessage());
logger.error("error deleting credential at {}", path);
logger.error("message = {}", e.getMessage());
throw e;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package io.blueocean.ath;


import com.google.common.collect.Lists;
import org.apache.log4j.Logger;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.junit.JGitTestUtil;
Expand All @@ -11,10 +8,13 @@
import org.junit.Rule;
import org.junit.rules.ExternalResource;
import org.junit.rules.TemporaryFolder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.validation.constraints.NotNull;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;


Expand Down Expand Up @@ -42,11 +42,11 @@ protected void after() {
//temporaryFolder.delete();
}

private Logger logger = Logger.getLogger(GitRepositoryRule.class);
private Logger logger = LoggerFactory.getLogger(GitRepositoryRule.class);

@NotNull
public List<Ref> createBranches(@NotNull String prefix, int number) throws GitAPIException {
List<Ref> refs = Lists.newArrayList();
List<Ref> refs = new ArrayList<>();
for(int i = 1; i < number + 1; i++) {
Ref ref = client.branchCreate().setName(prefix + i).call();
refs.add(ref);
Expand All @@ -58,7 +58,7 @@ public List<Ref> createBranches(@NotNull String prefix, int number) throws GitAP

public Ref createBranch(String branch) throws GitAPIException {
Ref ref = client.branchCreate().setName(branch).call();
logger.info("Created branch " + branch);
logger.info("Created branch {}", branch);
return ref;
}

Expand All @@ -69,7 +69,7 @@ public void writeJenkinsFile(String jenkinsFile) throws IOException {

public void writeFile(String name, String contents) throws IOException {
JGitTestUtil.writeTrashFile(client.getRepository(), name, contents);
logger.info("Wrote " + name +" to git repository");
logger.info("Wrote {} to git repository", name);
}

public RevCommit commit(String message) throws GitAPIException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.log4j.Logger;
import org.openqa.selenium.logging.LogEntry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.util.HashMap;
Expand All @@ -12,11 +13,11 @@
import java.util.stream.Collectors;

/**
* Writes a Selenium LogEntry to log4j
* Writes a Selenium LogEntry to slf4j
* @author cliffmeyers
*/
class LogEntryLogger {
private static final Logger logger = Logger.getLogger(LogEntryLogger.class);
private static final Logger logger = LoggerFactory.getLogger(LogEntryLogger.class);
private static final ObjectMapper jsonMapper = new ObjectMapper();
private static final TypeReference<HashMap<String, Object>> typeRef = new TypeReference<HashMap<String, Object>>() {};

Expand All @@ -36,9 +37,7 @@ static void recordLogEntries(List<LogEntry> entries) {

if (usefulEntries.iterator().hasNext()) {
logger.info("browser console output below:");
for (LogEntry entry : usefulEntries) {
LogEntryLogger.recordLogEntry(entry);
}
usefulEntries.stream().forEach(LogEntryLogger::recordLogEntry);
} else {
logger.info(String.format("nothing useful written to browser console; %s entries were hidden", entries.size()));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.blueocean.ath;

import com.google.common.base.Preconditions;
import org.apache.log4j.Logger;
import org.openqa.selenium.By;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.JavascriptExecutor;
Expand All @@ -15,6 +14,8 @@
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.FluentWait;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;
import java.util.concurrent.TimeUnit;
Expand All @@ -27,7 +28,7 @@
* Accepts expressions for css and xpath, if the provided lookup starts with a /, XPath is used
*/
public class SmartWebElement implements WebElement {
private static Logger logger = Logger.getLogger(SmartWebElement.class);
private static Logger logger = LoggerFactory.getLogger(SmartWebElement.class);
public static final int DEFAULT_TIMEOUT = Integer.getInteger("webDriverDefaultTimeout", 3000);
public static final int RETRY_COUNT = 3;

Expand Down
9 changes: 5 additions & 4 deletions acceptance-tests/src/main/java/io/blueocean/ath/WaitUtil.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.blueocean.ath;

import com.google.common.base.Function;
import org.apache.log4j.Logger;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.NoSuchElementException;
Expand All @@ -12,6 +11,8 @@
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.FluentWait;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.inject.Inject;
import javax.inject.Singleton;
Expand All @@ -24,7 +25,7 @@ public class WaitUtil {
public static String DEFAULT_ERROR_MESSAGE = "Error while waiting for something";
public static final int RETRY_COUNT = 10;

private Logger logger = Logger.getLogger(WaitUtil.class);
private Logger logger = LoggerFactory.getLogger(WaitUtil.class);

private WebDriver driver;

Expand Down Expand Up @@ -106,7 +107,7 @@ public void clear(By by) {
} catch (WebDriverException ex) {
if (ex.getMessage().contains("is not clickable at point")) {
logger.warn(String.format("%s not clickable: will retry clear", by.toString()));
logger.debug("exception: " + ex.getMessage());
logger.debug("exception: {}", ex.getMessage());
} else {
throw ex;
}
Expand Down Expand Up @@ -135,7 +136,7 @@ public void click(By by) {
if (ex.getMessage().contains("is not clickable at point")) {
logger.warn(String.format("%s not clickable on attempt " + i + ", will sleep and retry ", by.toString()));
tinySleep(500);
logger.debug("exception: " + ex.getMessage());
logger.debug("exception: {}", ex.getMessage());
} else {
throw ex;
}
Expand Down
Loading

0 comments on commit 7931819

Please sign in to comment.