Skip to content

Commit

Permalink
Add maven logging to jenkins
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Wisniewski <[email protected]>
  • Loading branch information
Adam Wisniewski authored and Adam Wisniewski committed Feb 27, 2024
1 parent 1afb8b0 commit a8aeb2e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-regression-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
# Collect logs
- run: |
mkdir logs
find tests -type f -name "*.log" -exec cp {} logs \;
find tests -type f -name "lte-dev-mode-output-*.log" -exec cp {} logs \;
if: failure()
# save logs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2022, 2023 IBM Corporation and others.
* Copyright (c) 2022, 2024 IBM Corporation and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand All @@ -18,7 +18,6 @@
import java.net.URL;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand All @@ -29,17 +28,14 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.ISelectionService;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
Expand All @@ -58,6 +54,7 @@
import io.openliberty.tools.eclipse.ui.terminal.ProjectTabController;
import io.openliberty.tools.eclipse.ui.terminal.TerminalListener;
import io.openliberty.tools.eclipse.utils.ErrorHandler;
import jdk.internal.org.jline.utils.Display;

/**
* Provides the implementation of all supported dev mode operations.
Expand Down
12 changes: 8 additions & 4 deletions ci/jenkins/run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pipeline {
tools {
jdk 'java17-semeru'
xvfb 'gui-test'
maven 'maven-3.8.6'
maven 'maven-3.9.6'
gradle 'gradle-7.6.1'
}

Expand All @@ -13,8 +13,8 @@ pipeline {
steps {
dir('liberty-tools-eclipse') {
// Clone git repo
git branch: 'main',
url: 'https://github.com/OpenLiberty/liberty-tools-eclipse.git'
git branch: '1Q24-release',
url: 'https://github.com/awisniew90/liberty-tools-eclipse.git'
}
}
}
Expand Down Expand Up @@ -48,12 +48,16 @@ pipeline {
sh '''
MVNPATH="$(dirname $(which mvn))/.."
GRADLEPATH="$(dirname $(which gradle))/.."
mvn clean verify -DmvnPath=$MVNPATH -DgradlePath=$GRADLEPATH -Dtycho.disableP2Mirrors=true -Declipse.target=4Q2023 -Dosgi.debug=./tests/resources/ci/debug.opts -DtestAppImportWait=120000 -Dtycho.showEclipseLog -e
mvn clean verify -DmvnLogFile -DmvnPath=$MVNPATH -DgradlePath=$GRADLEPATH -Dtycho.disableP2Mirrors=true -Declipse.target=4Q2023 -Dosgi.debug=./tests/resources/ci/debug.opts -DtestAppImportWait=120000 -Dtycho.showEclipseLog -e
'''
}
} finally {
sh "cd tests/target/surefire-reports && zip -r 4Q2023-test-reports.zip ."
sh "mkdir lte-dev-mode-output-logs && find tests -type f -name \"lte-dev-mode-output-*.log\" -exec cp {} lte-dev-mode-output-logs \\;"
sh "zip -r lte-dev-mode-output-logs.zip lte-dev-mode-output-logs"

archiveArtifacts artifacts: 'tests/target/surefire-reports/4Q2023-test-reports.zip', fingerprint: true
archiveArtifacts artifacts: 'lte-dev-mode-output-logs.zip', fingerprint: true
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*******************************************************************************/
package io.openliberty.tools.eclipse.test.it;

import static io.openliberty.tools.eclipse.DevModeOperations.MVN_RUN_APP_LOG_FILE;
import static io.openliberty.tools.eclipse.test.it.utils.LibertyPluginTestUtils.isInternalBrowserSupportAvailable;
import static io.openliberty.tools.eclipse.test.it.utils.MagicWidgetFinder.go;
import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.closeWelcomePage;
Expand Down Expand Up @@ -50,7 +51,6 @@
import org.junit.jupiter.api.TestInfo;

import io.openliberty.tools.eclipse.test.it.utils.LibertyPluginTestUtils;
import static io.openliberty.tools.eclipse.DevModeOperations.MVN_RUN_APP_LOG_FILE;

public abstract class AbstractLibertyPluginSWTBotTest {

Expand Down Expand Up @@ -126,7 +126,7 @@ public void beforeEach(TestInfo info) {

if (isMvnLogFile()) {
// Turn on config to log dev mode output to file
System.setProperty(MVN_RUN_APP_LOG_FILE, getTimestamp() + ".log");
System.setProperty(MVN_RUN_APP_LOG_FILE, "lte-dev-mode-output-" + getTimestamp() + ".log");
}
}

Expand Down

0 comments on commit a8aeb2e

Please sign in to comment.