Work around error highlighting and run application failures in Happy path tests (#19068)
Signed-off-by: Dmytro Nochevnov <dnochevn@redhat.com> Co-authored-by: Radim Hopp <rhopp@redhat.com>7.28.x
parent
889187e4e1
commit
ed2fd1cfc0
|
|
@ -242,9 +242,6 @@ pipeline {
|
|||
eval \$(minikube docker-env)
|
||||
docker login -u maxura -p ${maxura_docker_password}
|
||||
|
||||
docker pull mariolet/petclinic:d2831f9b
|
||||
docker pull centos/postgresql-96-centos7:9.6
|
||||
docker pull centos/mysql-57-centos7
|
||||
docker pull ${cheImageRepo}:${mutableCheImageTag}
|
||||
docker pull docker.io/traefik:v2.2.8
|
||||
"""
|
||||
|
|
@ -372,6 +369,7 @@ EOL"""
|
|||
-e TS_SELENIUM_PASSWORD="admin" \\
|
||||
-e TEST_SUITE="${e2eTestToRun}" ${e2eTestParameters} \\
|
||||
-e NODE_TLS_REJECT_UNAUTHORIZED=0 \\
|
||||
-e TS_SELENIUM_LOG_LEVEL="TRACE" \\
|
||||
-v ${WORKSPACE}/tests/e2e:/tmp/e2e:Z \\
|
||||
quay.io/eclipse/che-e2e:${cheE2eImageTag}
|
||||
"""
|
||||
|
|
@ -398,6 +396,7 @@ EOL"""
|
|||
mkdir -p $LOGS_AND_CONFIGS/kubectl
|
||||
kubectl --namespace=eclipse-che get events > $LOGS_AND_CONFIGS/kubectl/events.txt || true
|
||||
kubectl --namespace=eclipse-che get events -o json > $LOGS_AND_CONFIGS/kubectl/events.json || true
|
||||
kubectl get pods -A >$LOGS_AND_CONFIGS/kubectl/pods.txt || true
|
||||
|
||||
mkdir -p $LOGS_AND_CONFIGS/che-config
|
||||
|
||||
|
|
@ -416,13 +415,18 @@ EOL"""
|
|||
for pod in \$PODS ; do \
|
||||
kubectl logs --namespace=eclipse-che "\${pod}" --namespace=eclipse-che > $LOGS_AND_CONFIGS/che-logs/"\${pod}".pod.log || true; \
|
||||
done
|
||||
kubectl describe pod --namespace=eclipse-che \$WS_POD > $LOGS_AND_CONFIGS/che-config/eclipse-che-pod-description.txt || true
|
||||
|
||||
mkdir -p $LOGS_AND_CONFIGS/workspace-logs
|
||||
export WS_POD=\$(kubectl get pod --namespace=eclipse-che | grep ".workspace-" | awk '{print \$1}')
|
||||
for c in \$(kubectl get pod --namespace=eclipse-che \$WS_POD -o jsonpath="{.spec.containers[*].name}") ; do \\
|
||||
kubectl logs \$(kubectl get pod --namespace=eclipse-che | grep ".workspace-" | awk '{print \$1}') "\${c}" --namespace=eclipse-che > $LOGS_AND_CONFIGS/workspace-logs/"\${c}".container.log || true; \\
|
||||
WORKSPACE_NAMESPACE_NAME=admin-che
|
||||
export WS_POD=\$(kubectl get pod --namespace=\$WORKSPACE_NAMESPACE_NAME | grep ".workspace-" | awk '{print \$1}')
|
||||
for c in \$(kubectl get pod --namespace=\$WORKSPACE_NAMESPACE_NAME \$WS_POD -o jsonpath="{.spec.containers[*].name}") ; do
|
||||
CONTAINER_LOGS_DIR=$LOGS_AND_CONFIGS/workspace-logs/"\${c}"
|
||||
mkdir \$CONTAINER_LOGS_DIR
|
||||
kubectl logs \$WS_POD "\${c}" --namespace=\$WORKSPACE_NAMESPACE_NAME > \${CONTAINER_LOGS_DIR}.container.log || true;
|
||||
kubectl cp \$WORKSPACE_NAMESPACE_NAME/\$WS_POD:/workspace_logs \$CONTAINER_LOGS_DIR -c "\${c}" || true;
|
||||
done
|
||||
kubectl describe pod --namespace=eclipse-che \$WS_POD > $LOGS_AND_CONFIGS/che-config/workspace-pod-description.txt || true
|
||||
kubectl describe pod --namespace=\$WORKSPACE_NAMESPACE_NAME \$WS_POD > $LOGS_AND_CONFIGS/che-config/workspace-pod-description.txt || true
|
||||
|
||||
mkdir -p $LOGS_AND_CONFIGS/docker
|
||||
docker image ls > $LOGS_AND_CONFIGS/docker/images.txt || true
|
||||
|
|
|
|||
|
|
@ -65,14 +65,14 @@ export const TimeoutConstants = {
|
|||
TS_SELENIUM_LANGUAGE_SERVER_START_TIMEOUT: Number(process.env.TS_SELENIUM_LANGUAGE_SERVER_START_TIMEOUT) || 180_000,
|
||||
|
||||
/**
|
||||
* Timeout for suggestion invoking, "30 000" by default.
|
||||
* Timeout for suggestion invoking, "60 000" by default.
|
||||
*/
|
||||
TS_SUGGESTION_TIMEOUT: Number(process.env.TS_OPEN_PROJECT_TREE_TIMEOUT) || 30_000,
|
||||
TS_SUGGESTION_TIMEOUT: Number(process.env.TS_OPEN_PROJECT_TREE_TIMEOUT) || 60_000,
|
||||
|
||||
/**
|
||||
* Timeout for error highlighting presence, "10 000" by default
|
||||
* Timeout for error highlighting presence, "90 000" by default
|
||||
*/
|
||||
TS_ERROR_HIGHLIGHTING_TIMEOUT: Number(process.env.TS_OPEN_PROJECT_TREE_TIMEOUT) || 20_000,
|
||||
TS_ERROR_HIGHLIGHTING_TIMEOUT: Number(process.env.TS_OPEN_PROJECT_TREE_TIMEOUT) || 90_000,
|
||||
|
||||
|
||||
// -------------------------------------------- PROJECT TREE --------------------------------------------
|
||||
|
|
@ -128,9 +128,9 @@ export const TimeoutConstants = {
|
|||
TS_NOTIFICATION_CENTER_TIMEOUT: Number(process.env.TS_OPEN_PROJECT_TREE_TIMEOUT) || 10_000,
|
||||
|
||||
/**
|
||||
* Timeout for debugger to connect, "30 000" by default
|
||||
* Timeout for debugger to connect, "60 000" by default
|
||||
*/
|
||||
TS_DEBUGGER_CONNECTION_TIMEOUT: Number(process.env.TS_DEBUGGER_CONNECTION_TIMEOUT) || 30_000,
|
||||
TS_DEBUGGER_CONNECTION_TIMEOUT: Number(process.env.TS_DEBUGGER_CONNECTION_TIMEOUT) || 60_000,
|
||||
|
||||
/**
|
||||
* Timeout for context menu manipulation, "10 000" by default
|
||||
|
|
|
|||
|
|
@ -45,30 +45,30 @@ commands:
|
|||
actions:
|
||||
- type: exec
|
||||
component: maven-container
|
||||
command: mvn clean package | tee build.txt && tail -n 40 /projects/petclinic/build.txt | grep 'BUILD SUCCESS' > /projects/petclinic/result-build.txt
|
||||
command: mvn clean package | tee /workspace_logs/build.log && tail -n 40 /workspace_logs/build.log | grep 'BUILD SUCCESS' > /projects/petclinic/result-build.txt
|
||||
workdir: /projects/petclinic
|
||||
- name: build-file-output
|
||||
actions:
|
||||
- type: exec
|
||||
component: maven-container
|
||||
command: cd /projects/petclinic && mvn package | tee build-output.txt && tail -n 40 /projects/petclinic/build-output.txt | grep 'BUILD SUCCESS' > /projects/petclinic/result-build-output.txt
|
||||
command: cd /projects/petclinic && mvn package | tee /workspace_logs/build-output.log && tail -n 40 /workspace_logs/build-output.log | grep 'BUILD SUCCESS' > /projects/petclinic/result-build-output.txt
|
||||
- name: run
|
||||
actions:
|
||||
- type: exec
|
||||
component: maven-container
|
||||
command: java -jar spring-petclinic-2.4.2.jar --spring.profiles.active=mysql
|
||||
command: java -jar spring-petclinic-2.4.2.jar --spring.profiles.active=mysql | tee /workspace_logs/run.log
|
||||
workdir: /projects/petclinic/target
|
||||
- name: run-with-changes
|
||||
actions:
|
||||
- type: exec
|
||||
component: maven-container
|
||||
command: java -jar spring-petclinic-2.4.2.jar --spring.profiles.active=mysql
|
||||
command: java -jar spring-petclinic-2.4.2.jar --spring.profiles.active=mysql | tee /workspace_logs/run-with-changes.log
|
||||
workdir: /projects/petclinic/target
|
||||
- name: run-debug
|
||||
actions:
|
||||
- type: exec
|
||||
component: maven-container
|
||||
command: java -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 spring-petclinic-2.4.2.jar --spring.profiles.active=mysql
|
||||
command: java -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 spring-petclinic-2.4.2.jar --spring.profiles.active=mysql | tee /workspace_logs/run-debug.log
|
||||
workdir: /projects/petclinic/target
|
||||
- name: Debug remote java application
|
||||
actions:
|
||||
|
|
|
|||
|
|
@ -9,8 +9,9 @@
|
|||
**********************************************************************/
|
||||
import { inject, injectable } from 'inversify';
|
||||
import { CLASSES } from '../../inversify.types';
|
||||
import { TestConstants } from '../../TestConstants';
|
||||
import { DriverHelper } from '../../utils/DriverHelper';
|
||||
import { By, Key, WebElement } from 'selenium-webdriver';
|
||||
import { By, Key, WebElement, error } from 'selenium-webdriver';
|
||||
import { Ide } from './Ide';
|
||||
import { Logger } from '../../utils/Logger';
|
||||
import { TimeoutConstants } from '../../TimeoutConstants';
|
||||
|
|
@ -55,11 +56,19 @@ export class DebugView {
|
|||
|
||||
const threadsTreeLocator = `//div[contains(@class, 'theia-debug-thread')]`;
|
||||
|
||||
const threadElements: WebElement[] = await this.driverHelper.waitAllPresence(By.xpath(threadsTreeLocator));
|
||||
if (threadElements.length > 1) {
|
||||
return true;
|
||||
try {
|
||||
const threadElements: WebElement[] = await this.driverHelper.waitAllPresence(By.xpath(threadsTreeLocator));
|
||||
if (threadElements.length > 1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
if (!(err instanceof error.TimeoutError)) {
|
||||
throw err;
|
||||
}
|
||||
|
||||
return await this.driverHelper.wait(TestConstants.TS_SELENIUM_DEFAULT_POLLING);
|
||||
}
|
||||
return false;
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -114,7 +114,6 @@ export class Ide {
|
|||
async waitNotificationAndOpenLink(notificationText: string, timeout: number) {
|
||||
Logger.debug(`Ide.waitNotificationAndOpenLink "${notificationText}"`);
|
||||
await this.waitNotification(notificationText, timeout);
|
||||
await this.waitApllicationIsReady(await this.getApplicationUrlFromNotification(notificationText), timeout);
|
||||
await this.waitNotificationAndClickOnButton(notificationText, 'Open Link', timeout);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -115,22 +115,22 @@ suite('Language server validation', async () => {
|
|||
});
|
||||
|
||||
test('Error highlighting', async () => {
|
||||
const textForErrorDisplaying: string = '$#%@#';
|
||||
|
||||
await driverHelper.getDriver().sleep(TimeoutConstants.TS_SUGGESTION_TIMEOUT); // workaround https://github.com/eclipse/che/issues/19004
|
||||
|
||||
const textForErrorDisplaying: string = '$';
|
||||
await editor.type(javaFileName, textForErrorDisplaying, 30);
|
||||
|
||||
try {
|
||||
await editor.waitErrorInLine(30, TimeoutConstants.TS_ERROR_HIGHLIGHTING_TIMEOUT * 3);
|
||||
await editor.waitErrorInLine(30, TimeoutConstants.TS_ERROR_HIGHLIGHTING_TIMEOUT);
|
||||
} catch (err) {
|
||||
Logger.debug('Workaround for the https://github.com/eclipse/che/issues/18974 issue.');
|
||||
await (await driverHelper.getDriver()).navigate().refresh();
|
||||
|
||||
Logger.debug('Workaround for the https://github.com/eclipse/che/issues/18974.');
|
||||
await driverHelper.reloadPage();
|
||||
await ide.waitAndSwitchToIdeFrame();
|
||||
await editor.selectTab(javaFileName);
|
||||
await editor.waitErrorInLine(30, TimeoutConstants.TS_ERROR_HIGHLIGHTING_TIMEOUT * 3);
|
||||
await ide.waitIde();
|
||||
await editor.waitErrorInLine(30, TimeoutConstants.TS_ERROR_HIGHLIGHTING_TIMEOUT * 2);
|
||||
}
|
||||
|
||||
await editor.performKeyCombination(javaFileName, Key.chord(Key.BACK_SPACE, Key.BACK_SPACE, Key.BACK_SPACE, Key.BACK_SPACE, Key.BACK_SPACE));
|
||||
await editor.performKeyCombination(javaFileName, Key.chord(Key.BACK_SPACE));
|
||||
await editor.waitErrorInLineDisappearance(30);
|
||||
});
|
||||
|
||||
|
|
@ -170,10 +170,6 @@ suite('Validation of workspace build and run', async () => {
|
|||
test('Build application', async () => {
|
||||
let buildTaskName: string = 'build-file-output';
|
||||
await topMenu.runTask('build-file-output');
|
||||
|
||||
// workaround for issue: https://github.com/eclipse/che/issues/14771
|
||||
|
||||
// await projectTree.expandPathAndOpenFileInAssociatedWorkspace(projectName, 'build-output.txt');
|
||||
await terminal.waitIconSuccess(buildTaskName, 250_000);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue