@eclipse-che/che-e2e 7.122.0-next → 7.122.0-next-4d9831f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/configs/inversify.config.js +121 -0
- package/dist/configs/inversify.config.js.map +1 -0
- package/dist/configs/inversify.types.js +73 -0
- package/dist/configs/inversify.types.js.map +1 -0
- package/dist/configs/mocharc.js +42 -0
- package/dist/configs/mocharc.js.map +1 -0
- package/dist/constants/API_TEST_CONSTANTS.js +60 -0
- package/dist/constants/API_TEST_CONSTANTS.js.map +1 -0
- package/dist/constants/BASE_TEST_CONSTANTS.js +109 -0
- package/dist/constants/BASE_TEST_CONSTANTS.js.map +1 -0
- package/dist/constants/CHROME_DRIVER_CONSTANTS.js +40 -0
- package/dist/constants/CHROME_DRIVER_CONSTANTS.js.map +1 -0
- package/dist/constants/EDITOR_CONSTANTS.js +114 -0
- package/dist/constants/EDITOR_CONSTANTS.js.map +1 -0
- package/dist/constants/FACTORY_TEST_CONSTANTS.js +87 -0
- package/dist/constants/FACTORY_TEST_CONSTANTS.js.map +1 -0
- package/dist/constants/MOCHA_CONSTANTS.js +24 -0
- package/dist/constants/MOCHA_CONSTANTS.js.map +1 -0
- package/dist/constants/MONACO_CONSTANTS.js +25 -0
- package/dist/constants/MONACO_CONSTANTS.js.map +1 -0
- package/dist/constants/OAUTH_CONSTANTS.js +53 -0
- package/dist/constants/OAUTH_CONSTANTS.js.map +1 -0
- package/dist/constants/PLUGIN_TEST_CONSTANTS.js +19 -0
- package/dist/constants/PLUGIN_TEST_CONSTANTS.js.map +1 -0
- package/dist/constants/REPORTER_CONSTANTS.js +123 -0
- package/dist/constants/REPORTER_CONSTANTS.js.map +1 -0
- package/dist/constants/TIMEOUT_CONSTANTS.js +101 -0
- package/dist/constants/TIMEOUT_CONSTANTS.js.map +1 -0
- package/dist/driver/ChromeDriver.js +77 -0
- package/dist/driver/ChromeDriver.js.map +1 -0
- package/dist/driver/IDriver.js +3 -0
- package/dist/driver/IDriver.js.map +1 -0
- package/dist/index.js +98 -0
- package/dist/index.js.map +1 -0
- package/dist/pageobjects/dashboard/CreateWorkspace.js +181 -0
- package/dist/pageobjects/dashboard/CreateWorkspace.js.map +1 -0
- package/dist/pageobjects/dashboard/Dashboard.js +208 -0
- package/dist/pageobjects/dashboard/Dashboard.js.map +1 -0
- package/dist/pageobjects/dashboard/TrustAuthorPopup.js +61 -0
- package/dist/pageobjects/dashboard/TrustAuthorPopup.js.map +1 -0
- package/dist/pageobjects/dashboard/UserPreferences.js +268 -0
- package/dist/pageobjects/dashboard/UserPreferences.js.map +1 -0
- package/dist/pageobjects/dashboard/Workspaces.js +242 -0
- package/dist/pageobjects/dashboard/Workspaces.js.map +1 -0
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js +186 -0
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +1 -0
- package/dist/pageobjects/git-providers/OauthPage.js +218 -0
- package/dist/pageobjects/git-providers/OauthPage.js.map +1 -0
- package/dist/pageobjects/ide/AiCodeSignInDialog.js +55 -0
- package/dist/pageobjects/ide/AiCodeSignInDialog.js.map +1 -0
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js +108 -0
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js.map +1 -0
- package/dist/pageobjects/ide/CommandPalette.js +117 -0
- package/dist/pageobjects/ide/CommandPalette.js.map +1 -0
- package/dist/pageobjects/ide/ExplorerView.js +108 -0
- package/dist/pageobjects/ide/ExplorerView.js.map +1 -0
- package/dist/pageobjects/ide/ExtensionsView.js +162 -0
- package/dist/pageobjects/ide/ExtensionsView.js.map +1 -0
- package/dist/pageobjects/ide/GitHubExtensionDialog.js +66 -0
- package/dist/pageobjects/ide/GitHubExtensionDialog.js.map +1 -0
- package/dist/pageobjects/ide/NotificationHandler.js +83 -0
- package/dist/pageobjects/ide/NotificationHandler.js.map +1 -0
- package/dist/pageobjects/ide/RestrictedModeButton.js +57 -0
- package/dist/pageobjects/ide/RestrictedModeButton.js.map +1 -0
- package/dist/pageobjects/ide/SourceControlView.js +52 -0
- package/dist/pageobjects/ide/SourceControlView.js.map +1 -0
- package/dist/pageobjects/ide/ViewsMoreActionsButton.js +73 -0
- package/dist/pageobjects/ide/ViewsMoreActionsButton.js.map +1 -0
- package/dist/pageobjects/login/interfaces/ICheLoginPage.js +12 -0
- package/dist/pageobjects/login/interfaces/ICheLoginPage.js.map +1 -0
- package/dist/pageobjects/login/interfaces/IOcpLoginPage.js +12 -0
- package/dist/pageobjects/login/interfaces/IOcpLoginPage.js.map +1 -0
- package/dist/pageobjects/login/kubernetes/DexLoginPage.js +69 -0
- package/dist/pageobjects/login/kubernetes/DexLoginPage.js.map +1 -0
- package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js +50 -0
- package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js.map +1 -0
- package/dist/pageobjects/login/openshift/OcpLoginPage.js +88 -0
- package/dist/pageobjects/login/openshift/OcpLoginPage.js.map +1 -0
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js +73 -0
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js.map +1 -0
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js +53 -0
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js.map +1 -0
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js +85 -0
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js.map +1 -0
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js +65 -0
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js.map +1 -0
- package/dist/pageobjects/openshift/OcpApplicationPage.js +60 -0
- package/dist/pageobjects/openshift/OcpApplicationPage.js.map +1 -0
- package/dist/pageobjects/openshift/OcpImportFromGitPage.js +92 -0
- package/dist/pageobjects/openshift/OcpImportFromGitPage.js.map +1 -0
- package/dist/pageobjects/openshift/OcpMainPage.js +140 -0
- package/dist/pageobjects/openshift/OcpMainPage.js.map +1 -0
- package/dist/pageobjects/webterminal/WebTerminalPage.js +182 -0
- package/dist/pageobjects/webterminal/WebTerminalPage.js.map +1 -0
- package/dist/specs/MochaHooks.js +142 -0
- package/dist/specs/MochaHooks.js.map +1 -0
- package/dist/specs/SmokeTest.spec.js +58 -0
- package/dist/specs/SmokeTest.spec.js.map +1 -0
- package/dist/specs/api/AnsibleDevFileAPI.spec.js +263 -0
- package/dist/specs/api/AnsibleDevFileAPI.spec.js.map +1 -0
- package/dist/specs/api/BuildPushRunPodmanContainerAPI.spec.js +147 -0
- package/dist/specs/api/BuildPushRunPodmanContainerAPI.spec.js.map +1 -0
- package/dist/specs/api/ContainerOverridesAPI.spec.js +40 -0
- package/dist/specs/api/ContainerOverridesAPI.spec.js.map +1 -0
- package/dist/specs/api/CppDevFileAPI.spec.js +87 -0
- package/dist/specs/api/CppDevFileAPI.spec.js.map +1 -0
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js +99 -0
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js.map +1 -0
- package/dist/specs/api/DotnetDevFileAPI.spec.js +89 -0
- package/dist/specs/api/DotnetDevFileAPI.spec.js.map +1 -0
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js +60 -0
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js.map +1 -0
- package/dist/specs/api/GoDevFileAPI.spec.js +82 -0
- package/dist/specs/api/GoDevFileAPI.spec.js.map +1 -0
- package/dist/specs/api/InbuiltApplicationDevWorkspacesAPI.spec.js +97 -0
- package/dist/specs/api/InbuiltApplicationDevWorkspacesAPI.spec.js.map +1 -0
- package/dist/specs/api/JBossEapDevFileAPI.spec.js +127 -0
- package/dist/specs/api/JBossEapDevFileAPI.spec.js.map +1 -0
- package/dist/specs/api/LombokDevFileAPI.spec.js +81 -0
- package/dist/specs/api/LombokDevFileAPI.spec.js.map +1 -0
- package/dist/specs/api/NodeJSMongoDBDevFileAPI.spec.js +81 -0
- package/dist/specs/api/NodeJSMongoDBDevFileAPI.spec.js.map +1 -0
- package/dist/specs/api/NodeJsExpressDevFileAPI.spec.js +130 -0
- package/dist/specs/api/NodeJsExpressDevFileAPI.spec.js.map +1 -0
- package/dist/specs/api/PhpDevFileAPI.spec.js +71 -0
- package/dist/specs/api/PhpDevFileAPI.spec.js.map +1 -0
- package/dist/specs/api/PodOverridesAPI.spec.js +46 -0
- package/dist/specs/api/PodOverridesAPI.spec.js.map +1 -0
- package/dist/specs/api/PythonDevFileAPI.spec.js +71 -0
- package/dist/specs/api/PythonDevFileAPI.spec.js.map +1 -0
- package/dist/specs/api/QuarkusDevFileAPI.spec.js +97 -0
- package/dist/specs/api/QuarkusDevFileAPI.spec.js.map +1 -0
- package/dist/specs/dashboard-samples/Documentation.spec.js +118 -0
- package/dist/specs/dashboard-samples/Documentation.spec.js.map +1 -0
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js +60 -0
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js.map +1 -0
- package/dist/specs/dashboard-samples/Quarkus.spec.js +64 -0
- package/dist/specs/dashboard-samples/Quarkus.spec.js.map +1 -0
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js +345 -0
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js.map +1 -0
- package/dist/specs/dashboard-samples/StartWorkspaceUsingDesktopEditors.spec.js +171 -0
- package/dist/specs/dashboard-samples/StartWorkspaceUsingDesktopEditors.spec.js.map +1 -0
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js +155 -0
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js.map +1 -0
- package/dist/specs/factory/Factory.spec.js +183 -0
- package/dist/specs/factory/Factory.spec.js.map +1 -0
- package/dist/specs/factory/FactoryWithGitRepoOptions.spec.js +63 -0
- package/dist/specs/factory/FactoryWithGitRepoOptions.spec.js.map +1 -0
- package/dist/specs/factory/NoSetupRepoFactory.spec.js +212 -0
- package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -0
- package/dist/specs/factory/RefusedOAuthFactory.spec.js +239 -0
- package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -0
- package/dist/specs/factory/SshUrlNoOauthPatFactory.spec.js +202 -0
- package/dist/specs/factory/SshUrlNoOauthPatFactory.spec.js.map +1 -0
- package/dist/specs/miscellaneous/CreateWorkspaceWithExistedName.spec.js +77 -0
- package/dist/specs/miscellaneous/CreateWorkspaceWithExistedName.spec.js.map +1 -0
- package/dist/specs/miscellaneous/CreateWorkspaceWithExistingNameFromEmptyWorkspaceSample.spec.js +106 -0
- package/dist/specs/miscellaneous/CreateWorkspaceWithExistingNameFromEmptyWorkspaceSample.spec.js.map +1 -0
- package/dist/specs/miscellaneous/CreateWorkspaceWithExistingNameFromGitUrl.spec.js +113 -0
- package/dist/specs/miscellaneous/CreateWorkspaceWithExistingNameFromGitUrl.spec.js.map +1 -0
- package/dist/specs/miscellaneous/CreateWorkspaceWithExistingNameFromSample.spec.js +116 -0
- package/dist/specs/miscellaneous/CreateWorkspaceWithExistingNameFromSample.spec.js.map +1 -0
- package/dist/specs/miscellaneous/CustomOpenVSXRegistry.spec.js +205 -0
- package/dist/specs/miscellaneous/CustomOpenVSXRegistry.spec.js.map +1 -0
- package/dist/specs/miscellaneous/ExtensionActivationTest.spec.js +129 -0
- package/dist/specs/miscellaneous/ExtensionActivationTest.spec.js.map +1 -0
- package/dist/specs/miscellaneous/KubedockPodmanPersistUserHomeTest.spec.js +121 -0
- package/dist/specs/miscellaneous/KubedockPodmanPersistUserHomeTest.spec.js.map +1 -0
- package/dist/specs/miscellaneous/KubedockPodmanTest.spec.js +103 -0
- package/dist/specs/miscellaneous/KubedockPodmanTest.spec.js.map +1 -0
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js +111 -0
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js.map +1 -0
- package/dist/specs/miscellaneous/RenameWorkspace.spec.js +116 -0
- package/dist/specs/miscellaneous/RenameWorkspace.spec.js.map +1 -0
- package/dist/specs/miscellaneous/RevokeOauth.spec.js +29 -0
- package/dist/specs/miscellaneous/RevokeOauth.spec.js.map +1 -0
- package/dist/specs/miscellaneous/UserPreferencesTest.spec.js +26 -0
- package/dist/specs/miscellaneous/UserPreferencesTest.spec.js.map +1 -0
- package/dist/specs/miscellaneous/UserSecretsInWorkspace.spec.js +78 -0
- package/dist/specs/miscellaneous/UserSecretsInWorkspace.spec.js.map +1 -0
- package/dist/specs/miscellaneous/VsixInstallationDisableTest.spec.js +196 -0
- package/dist/specs/miscellaneous/VsixInstallationDisableTest.spec.js.map +1 -0
- package/dist/specs/miscellaneous/WorkspaceBackupRestore.spec.js +208 -0
- package/dist/specs/miscellaneous/WorkspaceBackupRestore.spec.js.map +1 -0
- package/dist/specs/miscellaneous/WorkspaceIdleTimeout.spec.js +84 -0
- package/dist/specs/miscellaneous/WorkspaceIdleTimeout.spec.js.map +1 -0
- package/dist/specs/miscellaneous/WorkspaceRunTimeout.spec.js +84 -0
- package/dist/specs/miscellaneous/WorkspaceRunTimeout.spec.js.map +1 -0
- package/dist/specs/miscellaneous/WorkspaceWithParent.spec.js +101 -0
- package/dist/specs/miscellaneous/WorkspaceWithParent.spec.js.map +1 -0
- package/dist/specs/web-terminal/WebTerminalTest.spec.js +47 -0
- package/dist/specs/web-terminal/WebTerminalTest.spec.js.map +1 -0
- package/dist/specs/web-terminal/WebTerminalUnderAdmin.spec.js +82 -0
- package/dist/specs/web-terminal/WebTerminalUnderAdmin.spec.js.map +1 -0
- package/dist/specs/web-terminal/WebTerminalUnderRegularUser.spec.js +78 -0
- package/dist/specs/web-terminal/WebTerminalUnderRegularUser.spec.js.map +1 -0
- package/dist/suites/devfile-acceptance-test-suite/DynamicallyGeneratingAPITest.suite.js +13 -0
- package/dist/suites/devfile-acceptance-test-suite/DynamicallyGeneratingAPITest.suite.js.map +1 -0
- package/dist/suites/disconnected-ocp/APITest.suite.js +14 -0
- package/dist/suites/disconnected-ocp/APITest.suite.js.map +1 -0
- package/dist/suites/disconnected-ocp/DynamicallyGeneratingAPITest.suite.js +13 -0
- package/dist/suites/disconnected-ocp/DynamicallyGeneratingAPITest.suite.js.map +1 -0
- package/dist/suites/disconnected-ocp/UITest.suite.js +19 -0
- package/dist/suites/disconnected-ocp/UITest.suite.js.map +1 -0
- package/dist/suites/online-ocp/APITest.suite.js +15 -0
- package/dist/suites/online-ocp/APITest.suite.js.map +1 -0
- package/dist/suites/online-ocp/DynamicallyGeneratingAPITest.suite.js +13 -0
- package/dist/suites/online-ocp/DynamicallyGeneratingAPITest.suite.js.map +1 -0
- package/dist/suites/online-ocp/UITest.suite.js +23 -0
- package/dist/suites/online-ocp/UITest.suite.js.map +1 -0
- package/dist/tests-library/LoginTests.js +76 -0
- package/dist/tests-library/LoginTests.js.map +1 -0
- package/dist/tests-library/ProjectAndFileTests.js +230 -0
- package/dist/tests-library/ProjectAndFileTests.js.map +1 -0
- package/dist/tests-library/WorkspaceHandlingTests.js +219 -0
- package/dist/tests-library/WorkspaceHandlingTests.js.map +1 -0
- package/dist/utils/BrowserTabsUtil.js +124 -0
- package/dist/utils/BrowserTabsUtil.js.map +1 -0
- package/dist/utils/CheReporter.js +238 -0
- package/dist/utils/CheReporter.js.map +1 -0
- package/dist/utils/DevWorkspaceConfigurationHelper.js +145 -0
- package/dist/utils/DevWorkspaceConfigurationHelper.js.map +1 -0
- package/dist/utils/DevfilesHelper.js +177 -0
- package/dist/utils/DevfilesHelper.js.map +1 -0
- package/dist/utils/DriverHelper.js +609 -0
- package/dist/utils/DriverHelper.js.map +1 -0
- package/dist/utils/IContextParams.js +12 -0
- package/dist/utils/IContextParams.js.map +1 -0
- package/dist/utils/IKubernetesCommandLineToolsExecutor.js +3 -0
- package/dist/utils/IKubernetesCommandLineToolsExecutor.js.map +1 -0
- package/dist/utils/KubernetesCommandLineToolsExecutor.js +338 -0
- package/dist/utils/KubernetesCommandLineToolsExecutor.js.map +1 -0
- package/dist/utils/Logger.js +146 -0
- package/dist/utils/Logger.js.map +1 -0
- package/dist/utils/ScreenCatcher.js +114 -0
- package/dist/utils/ScreenCatcher.js.map +1 -0
- package/dist/utils/ShellExecutor.js +47 -0
- package/dist/utils/ShellExecutor.js.map +1 -0
- package/dist/utils/StringUtil.js +107 -0
- package/dist/utils/StringUtil.js.map +1 -0
- package/dist/utils/request-handlers/CheApiRequestHandler.js +128 -0
- package/dist/utils/request-handlers/CheApiRequestHandler.js.map +1 -0
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js +55 -0
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js.map +1 -0
- package/dist/utils/request-handlers/headers/IAuthorizationHeaderHandler.js +12 -0
- package/dist/utils/request-handlers/headers/IAuthorizationHeaderHandler.js.map +1 -0
- package/dist/utils/workspace/ApiUrlResolver.js +117 -0
- package/dist/utils/workspace/ApiUrlResolver.js.map +1 -0
- package/dist/utils/workspace/ITestWorkspaceUtil.js +12 -0
- package/dist/utils/workspace/ITestWorkspaceUtil.js.map +1 -0
- package/dist/utils/workspace/TestWorkspaceUtil.js +202 -0
- package/dist/utils/workspace/TestWorkspaceUtil.js.map +1 -0
- package/dist/utils/workspace/WorkspaceStatus.js +19 -0
- package/dist/utils/workspace/WorkspaceStatus.js.map +1 -0
- package/index.ts +5 -5
- package/package.json +1 -1
- package/specs/api/AnsibleDevFileAPI.spec.ts +36 -24
- package/utils/KubernetesCommandLineToolsExecutor.ts +1 -1
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/** *******************************************************************
|
|
3
|
+
* copyright (c) 2019-2023 Red Hat, Inc.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made
|
|
6
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
7
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
8
|
+
*
|
|
9
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
10
|
+
**********************************************************************/
|
|
11
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
12
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
13
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
14
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
15
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16
|
+
};
|
|
17
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
18
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
19
|
+
};
|
|
20
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
21
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
22
|
+
};
|
|
23
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
24
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.TestWorkspaceUtil = void 0;
|
|
28
|
+
require("reflect-metadata");
|
|
29
|
+
const inversify_1 = require("inversify");
|
|
30
|
+
const DriverHelper_1 = require("../DriverHelper");
|
|
31
|
+
const WorkspaceStatus_1 = require("./WorkspaceStatus");
|
|
32
|
+
const selenium_webdriver_1 = require("selenium-webdriver");
|
|
33
|
+
const CheApiRequestHandler_1 = require("../request-handlers/CheApiRequestHandler");
|
|
34
|
+
const inversify_types_1 = require("../../configs/inversify.types");
|
|
35
|
+
const Logger_1 = require("../Logger");
|
|
36
|
+
const axios_1 = __importDefault(require("axios"));
|
|
37
|
+
const ApiUrlResolver_1 = require("./ApiUrlResolver");
|
|
38
|
+
const TIMEOUT_CONSTANTS_1 = require("../../constants/TIMEOUT_CONSTANTS");
|
|
39
|
+
let TestWorkspaceUtil = class TestWorkspaceUtil {
|
|
40
|
+
constructor(driverHelper, processRequestHandler, apiUrlResolver) {
|
|
41
|
+
this.driverHelper = driverHelper;
|
|
42
|
+
this.processRequestHandler = processRequestHandler;
|
|
43
|
+
this.apiUrlResolver = apiUrlResolver;
|
|
44
|
+
this.polling = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING;
|
|
45
|
+
this.attempts = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_DASHBOARD_WORKSPACE_STOP_TIMEOUT / this.polling;
|
|
46
|
+
}
|
|
47
|
+
async waitWorkspaceStatus(workspaceName, expectedWorkspaceStatus) {
|
|
48
|
+
Logger_1.Logger.debug();
|
|
49
|
+
let workspaceStatus = '';
|
|
50
|
+
let expectedStatus = false;
|
|
51
|
+
for (let i = 0; i < this.attempts; i++) {
|
|
52
|
+
const response = await this.processRequestHandler.get(await this.apiUrlResolver.getWorkspaceApiUrl(workspaceName));
|
|
53
|
+
if (response.status !== 200) {
|
|
54
|
+
throw new Error(`Can not get status of a workspace. Code: ${response.status} Data: ${response.data}`);
|
|
55
|
+
}
|
|
56
|
+
workspaceStatus = await response.data.status.phase;
|
|
57
|
+
if (workspaceStatus === expectedWorkspaceStatus) {
|
|
58
|
+
expectedStatus = true;
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
await this.driverHelper.wait(this.polling);
|
|
62
|
+
}
|
|
63
|
+
if (!expectedStatus) {
|
|
64
|
+
const waitTime = this.attempts * this.polling;
|
|
65
|
+
throw new selenium_webdriver_1.error.TimeoutError(`The workspace was not stopped in ${waitTime} ms. Current status is: ${workspaceStatus}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
async stopWorkspaceByName(workspaceName) {
|
|
69
|
+
Logger_1.Logger.debug(`${workspaceName}`);
|
|
70
|
+
const stopWorkspaceApiUrl = await this.apiUrlResolver.getWorkspaceApiUrl(workspaceName);
|
|
71
|
+
let stopWorkspaceResponse;
|
|
72
|
+
try {
|
|
73
|
+
stopWorkspaceResponse = await this.processRequestHandler.patch(stopWorkspaceApiUrl, [
|
|
74
|
+
{
|
|
75
|
+
op: 'replace',
|
|
76
|
+
path: '/spec/started',
|
|
77
|
+
value: false
|
|
78
|
+
}
|
|
79
|
+
]);
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
Logger_1.Logger.error(`stop workspace call failed. URL used: ${stopWorkspaceApiUrl}`);
|
|
83
|
+
throw err;
|
|
84
|
+
}
|
|
85
|
+
if (stopWorkspaceResponse.status !== 200) {
|
|
86
|
+
throw new Error(`Cannot stop workspace. Code: ${stopWorkspaceResponse.status} Data: ${stopWorkspaceResponse.data}`);
|
|
87
|
+
}
|
|
88
|
+
await this.waitWorkspaceStatus(workspaceName, WorkspaceStatus_1.WorkspaceStatus.STOPPED);
|
|
89
|
+
Logger_1.Logger.debug(`${workspaceName} stopped successfully`);
|
|
90
|
+
}
|
|
91
|
+
// delete a workspace without stopping phase (similar with force deleting)
|
|
92
|
+
async deleteWorkspaceByName(workspaceName) {
|
|
93
|
+
Logger_1.Logger.debug(`${workspaceName}`);
|
|
94
|
+
const deleteWorkspaceApiUrl = await this.apiUrlResolver.getWorkspaceApiUrl(workspaceName);
|
|
95
|
+
let deleteWorkspaceResponse;
|
|
96
|
+
let deleteWorkspaceStatus = false;
|
|
97
|
+
try {
|
|
98
|
+
deleteWorkspaceResponse = await this.processRequestHandler.delete(deleteWorkspaceApiUrl);
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
if (axios_1.default.isAxiosError(error) && error.response?.status === 404) {
|
|
102
|
+
Logger_1.Logger.info(`Workspace ${workspaceName} not found, already deleted`);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
Logger_1.Logger.error(`delete workspace call failed. URL used: ${deleteWorkspaceApiUrl}`);
|
|
106
|
+
throw error;
|
|
107
|
+
}
|
|
108
|
+
if (deleteWorkspaceResponse.status !== 204) {
|
|
109
|
+
throw new Error(`Can not delete workspace. Code: ${deleteWorkspaceResponse.status} Data: ${deleteWorkspaceResponse.data}`);
|
|
110
|
+
}
|
|
111
|
+
for (let i = 0; i < this.attempts; i++) {
|
|
112
|
+
try {
|
|
113
|
+
deleteWorkspaceResponse = await this.processRequestHandler.get(deleteWorkspaceApiUrl);
|
|
114
|
+
Logger_1.Logger.trace(`GET ${deleteWorkspaceApiUrl} returned status: ${deleteWorkspaceResponse.status}; data: ${deleteWorkspaceResponse.data}`);
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
if (axios_1.default.isAxiosError(error) && (error.response?.status === 404 || error.response?.status === 500)) {
|
|
118
|
+
deleteWorkspaceStatus = true;
|
|
119
|
+
Logger_1.Logger.debug(`${workspaceName} deleted successfully`);
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
Logger_1.Logger.trace(`GET ${deleteWorkspaceApiUrl} threw error: ${error}`);
|
|
123
|
+
}
|
|
124
|
+
await this.driverHelper.wait(this.polling);
|
|
125
|
+
}
|
|
126
|
+
if (!deleteWorkspaceStatus) {
|
|
127
|
+
const waitTime = this.attempts * this.polling;
|
|
128
|
+
throw new selenium_webdriver_1.error.TimeoutError(`The workspace was not deleted in ${waitTime} ms.`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// stop workspace before deleting with checking stopping phase
|
|
132
|
+
async stopAndDeleteWorkspaceByName(workspaceName) {
|
|
133
|
+
Logger_1.Logger.debug();
|
|
134
|
+
await this.stopWorkspaceByName(workspaceName);
|
|
135
|
+
await this.deleteWorkspaceByName(workspaceName);
|
|
136
|
+
}
|
|
137
|
+
// stop all run workspaces in the namespace
|
|
138
|
+
async stopAllRunningWorkspaces() {
|
|
139
|
+
Logger_1.Logger.debug();
|
|
140
|
+
const response = await this.processRequestHandler.get(await this.apiUrlResolver.getWorkspacesApiUrl());
|
|
141
|
+
for (let i = 0; i < response.data.items.length; i++) {
|
|
142
|
+
Logger_1.Logger.info('the project is being stopped: ' + response.data.items[i].metadata.name);
|
|
143
|
+
await this.stopWorkspaceByName(response.data.items[i].metadata.name);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
// stop all run workspaces, check statuses and remove the workspaces
|
|
147
|
+
async stopAndDeleteAllRunningWorkspaces() {
|
|
148
|
+
Logger_1.Logger.debug();
|
|
149
|
+
const response = await this.processRequestHandler.get(await this.apiUrlResolver.getWorkspacesApiUrl());
|
|
150
|
+
await this.stopAllRunningWorkspaces();
|
|
151
|
+
for (let i = 0; i < response.data.items.length; i++) {
|
|
152
|
+
Logger_1.Logger.info('the project is being deleted: ' + response.data.items[i].metadata.name);
|
|
153
|
+
await this.deleteWorkspaceByName(response.data.items[i].metadata.name);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
// stop all run workspaces without stopping and waiting for of 'Stopped' phase
|
|
157
|
+
// similar with 'force' deleting
|
|
158
|
+
async deleteAllWorkspaces() {
|
|
159
|
+
Logger_1.Logger.debug();
|
|
160
|
+
const response = await this.processRequestHandler.get(await this.apiUrlResolver.getWorkspacesApiUrl());
|
|
161
|
+
for (let i = 0; i < response.data.items.length; i++) {
|
|
162
|
+
Logger_1.Logger.info('the project is being deleted .......: ' + response.data.items[i].metadata.name);
|
|
163
|
+
await this.deleteWorkspaceByName(response.data.items[i].metadata.name);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* set user preferences for Che "security.workspace.trust.enabled": false using JS. in background mode
|
|
168
|
+
*/
|
|
169
|
+
async switchOffTrustDialogWithJavaScript() {
|
|
170
|
+
const javaScriptExecCode = '(async function importData() {\n' +
|
|
171
|
+
' const stub = "{\\"vscode-web-db\\":{\\"vscode-userdata-store\\":{\\"/User/settings.json\\":{\\"type\\":\\"Uint8Array\\",\\"value\\":\\"%7B%0A%20%20%20%20%22security.workspace.trust.enabled%22%3A%20false%0A%7D\\"}}}}";\n' +
|
|
172
|
+
' for (const [dbName, dbData] of Object.entries(JSON.parse(stub))) {\n' +
|
|
173
|
+
' const req = indexedDB.open(dbName);\n' +
|
|
174
|
+
' req.onupgradeneeded = ({ target: { result: db } }) =>\n' +
|
|
175
|
+
' Object.keys(dbData).forEach((name) => db.createObjectStore(name));\n' +
|
|
176
|
+
' await new Promise((r) => (req.onsuccess = r));\n' +
|
|
177
|
+
' for (const [storeName, storeData] of Object.entries(dbData)) {\n' +
|
|
178
|
+
' const transaction = req.result.transaction(storeName, "readwrite");\n' +
|
|
179
|
+
' const store = transaction.objectStore(storeName);\n' +
|
|
180
|
+
' store.clear();\n' +
|
|
181
|
+
' for (const [key, { type, value }] of Object.entries(storeData)) {\n' +
|
|
182
|
+
' const str = decodeURIComponent(value);\n' +
|
|
183
|
+
' store.put(type === "String" ? str : new TextEncoder().encode(str), key);\n' +
|
|
184
|
+
' }\n' +
|
|
185
|
+
' await new Promise((r) => (transaction.oncomplete = r));\n' +
|
|
186
|
+
' }\n' +
|
|
187
|
+
' }\n' +
|
|
188
|
+
'})().then(() => {});';
|
|
189
|
+
await this.driverHelper.getDriver().executeScript(javaScriptExecCode);
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
TestWorkspaceUtil = __decorate([
|
|
193
|
+
(0, inversify_1.injectable)(),
|
|
194
|
+
__param(0, (0, inversify_1.inject)(inversify_types_1.CLASSES.DriverHelper)),
|
|
195
|
+
__param(1, (0, inversify_1.inject)(inversify_types_1.CLASSES.CheApiRequestHandler)),
|
|
196
|
+
__param(2, (0, inversify_1.inject)(inversify_types_1.CLASSES.ApiUrlResolver)),
|
|
197
|
+
__metadata("design:paramtypes", [DriverHelper_1.DriverHelper,
|
|
198
|
+
CheApiRequestHandler_1.CheApiRequestHandler,
|
|
199
|
+
ApiUrlResolver_1.ApiUrlResolver])
|
|
200
|
+
], TestWorkspaceUtil);
|
|
201
|
+
exports.TestWorkspaceUtil = TestWorkspaceUtil;
|
|
202
|
+
//# sourceMappingURL=TestWorkspaceUtil.js.map
|
|
@@ -0,0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AAM,CAAC,IAAI,CAAC,wCAAwC,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC7F,MAAM,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;SACvE;IACF,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,kCAAkC;QACvC,MAAM,kBAAkB,GACvB,kCAAkC;YAClC,+NAA+N;YAC/N,wEAAwE;YACxE,2CAA2C;YAC3C,6DAA6D;YAC7D,4EAA4E;YAC5E,sDAAsD;YACtD,sEAAsE;YACtE,6EAA6E;YAC7E,2DAA2D;YAC3D,wBAAwB;YACxB,2EAA2E;YAC3E,kDAAkD;YAClD,oFAAoF;YACpF,WAAW;YACX,iEAAiE;YACjE,SAAS;YACT,OAAO;YACP,sBAAsB,CAAC;QACxB,MAAM,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;IACvE,CAAC;CACD,CAAA;AAtLY,iBAAiB;IAD7B,IAAA,sBAAU,GAAE;IAMV,WAAA,IAAA,kBAAM,EAAC,yBAAO,CAAC,YAAY,CAAC,CAAA;IAE5B,WAAA,IAAA,kBAAM,EAAC,yBAAO,CAAC,oBAAoB,CAAC,CAAA;IAEpC,WAAA,IAAA,kBAAM,EAAC,yBAAO,CAAC,cAAc,CAAC,CAAA;qCAHA,2BAAY;QAEH,2CAAoB;QAE3B,+BAAc;GAVpC,iBAAiB,CAsL7B;AAtLY,8CAAiB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/** *******************************************************************
|
|
3
|
+
* copyright (c) 2019-2023 Red Hat, Inc.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made
|
|
6
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
7
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
8
|
+
*
|
|
9
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
10
|
+
**********************************************************************/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.WorkspaceStatus = void 0;
|
|
13
|
+
var WorkspaceStatus;
|
|
14
|
+
(function (WorkspaceStatus) {
|
|
15
|
+
WorkspaceStatus["RUNNING"] = "Running";
|
|
16
|
+
WorkspaceStatus["STOPPED"] = "Stopped";
|
|
17
|
+
WorkspaceStatus["STARTING"] = "Starting";
|
|
18
|
+
})(WorkspaceStatus = exports.WorkspaceStatus || (exports.WorkspaceStatus = {}));
|
|
19
|
+
//# sourceMappingURL=WorkspaceStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkspaceStatus.js","sourceRoot":"","sources":["../../../utils/workspace/WorkspaceStatus.ts"],"names":[],"mappings":";AAAA;;;;;;;;wEAQwE;;;AAExE,IAAY,eAIX;AAJD,WAAY,eAAe;IAC1B,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;IACnB,wCAAqB,CAAA;AACtB,CAAC,EAJW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAI1B"}
|
package/index.ts
CHANGED
|
@@ -5,19 +5,19 @@ export * from './configs/mocharc';
|
|
|
5
5
|
export * from './driver/ChromeDriver';
|
|
6
6
|
export * from './driver/IDriver';
|
|
7
7
|
export * from './utils/BrowserTabsUtil';
|
|
8
|
-
export * from './utils/DevfilesHelper';
|
|
9
8
|
export * from './utils/DevWorkspaceConfigurationHelper';
|
|
9
|
+
export * from './utils/DevfilesHelper';
|
|
10
10
|
export * from './utils/DriverHelper';
|
|
11
11
|
export * from './utils/IContextParams';
|
|
12
12
|
export * from './utils/IKubernetesCommandLineToolsExecutor';
|
|
13
13
|
export * from './utils/KubernetesCommandLineToolsExecutor';
|
|
14
14
|
export * from './utils/Logger';
|
|
15
|
-
export * from './utils/request-handlers/CheApiRequestHandler';
|
|
16
|
-
export * from './utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler';
|
|
17
|
-
export * from './utils/request-handlers/headers/IAuthorizationHeaderHandler';
|
|
18
15
|
export * from './utils/ScreenCatcher';
|
|
19
16
|
export * from './utils/ShellExecutor';
|
|
20
17
|
export * from './utils/StringUtil';
|
|
18
|
+
export * from './utils/request-handlers/CheApiRequestHandler';
|
|
19
|
+
export * from './utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler';
|
|
20
|
+
export * from './utils/request-handlers/headers/IAuthorizationHeaderHandler';
|
|
21
21
|
export * from './utils/workspace/ApiUrlResolver';
|
|
22
22
|
export * from './utils/workspace/ITestWorkspaceUtil';
|
|
23
23
|
export * from './utils/workspace/TestWorkspaceUtil';
|
|
@@ -26,8 +26,8 @@ export * from './pageobjects/dashboard/CreateWorkspace';
|
|
|
26
26
|
export * from './pageobjects/dashboard/Dashboard';
|
|
27
27
|
export * from './pageobjects/dashboard/TrustAuthorPopup';
|
|
28
28
|
export * from './pageobjects/dashboard/UserPreferences';
|
|
29
|
-
export * from './pageobjects/dashboard/workspace-details/WorkspaceDetails';
|
|
30
29
|
export * from './pageobjects/dashboard/Workspaces';
|
|
30
|
+
export * from './pageobjects/dashboard/workspace-details/WorkspaceDetails';
|
|
31
31
|
export * from './pageobjects/git-providers/OauthPage';
|
|
32
32
|
export * from './pageobjects/ide/AiCodeSignInDialog';
|
|
33
33
|
export * from './pageobjects/ide/CheCodeLocatorLoader';
|
package/package.json
CHANGED
|
@@ -91,14 +91,16 @@ suite('Ansible devfile API test', function (): void {
|
|
|
91
91
|
const output: ShellString = containerTerminal.execInContainerCommand(runCommandInBash, containerName);
|
|
92
92
|
expect(output.code).eqls(0);
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
// molecule may write its rich formatted output (box-drawing, ANSI codes) to stderr rather than stdout (CRW-12595)
|
|
95
|
+
const combinedOutput: string = (output.stdout + output.stderr).trim();
|
|
96
|
+
|
|
97
|
+
const recapBlocks: string[] = combinedOutput.split(/PLAY RECAP/g).slice(1);
|
|
95
98
|
recapBlocks.forEach((block): void => {
|
|
96
99
|
expect(block).match(/failed\s*=\s*0/);
|
|
97
100
|
});
|
|
98
101
|
|
|
99
|
-
|
|
100
|
-
expect(
|
|
101
|
-
expect(outputText).to.not.match(/failed\s*=\s*[1-9]\d*/);
|
|
102
|
+
expect(combinedOutput).to.include('was installed successfully');
|
|
103
|
+
expect(combinedOutput).to.not.match(/failed\s*=\s*[1-9]\d*/);
|
|
102
104
|
});
|
|
103
105
|
|
|
104
106
|
test('Check "molecule-list" command', function (): void {
|
|
@@ -123,7 +125,8 @@ suite('Ansible devfile API test', function (): void {
|
|
|
123
125
|
const output: ShellString = containerTerminal.execInContainerCommand(runCommandInBash, containerName);
|
|
124
126
|
expect(output.code).eqls(0);
|
|
125
127
|
|
|
126
|
-
|
|
128
|
+
// molecule may write its rich formatted output (box-drawing, ANSI codes) to stderr rather than stdout
|
|
129
|
+
const outputText: string = (output.stdout + output.stderr).trim();
|
|
127
130
|
expect(outputText).to.include('molecule');
|
|
128
131
|
expect(outputText).to.include('ansible');
|
|
129
132
|
expect(outputText).to.include('default');
|
|
@@ -152,14 +155,16 @@ suite('Ansible devfile API test', function (): void {
|
|
|
152
155
|
const output: ShellString = containerTerminal.execInContainerCommand(runCommandInBash, containerName);
|
|
153
156
|
expect(output.code).eqls(0);
|
|
154
157
|
|
|
155
|
-
|
|
158
|
+
// molecule may write its rich formatted output (box-drawing, ANSI codes) to stderr rather than stdout
|
|
159
|
+
const combinedOutput: string = (output.stdout + output.stderr).trim();
|
|
160
|
+
|
|
161
|
+
const recapBlocks: string[] = combinedOutput.split(/PLAY RECAP/g).slice(1);
|
|
156
162
|
recapBlocks.forEach((block): void => {
|
|
157
163
|
expect(block).match(/failed\s*=\s*0/);
|
|
158
164
|
});
|
|
159
165
|
|
|
160
|
-
|
|
161
|
-
expect(
|
|
162
|
-
expect(outputText).to.not.match(/failed\s*=\s*[1-9]\d*/);
|
|
166
|
+
expect(combinedOutput).to.include('PLAY [Converge]');
|
|
167
|
+
expect(combinedOutput).to.not.match(/failed\s*=\s*[1-9]\d*/);
|
|
163
168
|
});
|
|
164
169
|
|
|
165
170
|
test('Check "molecule-verify" command', function (): void {
|
|
@@ -184,14 +189,16 @@ suite('Ansible devfile API test', function (): void {
|
|
|
184
189
|
const output: ShellString = containerTerminal.execInContainerCommand(runCommandInBash, containerName);
|
|
185
190
|
expect(output.code).eqls(0);
|
|
186
191
|
|
|
187
|
-
|
|
192
|
+
// molecule may write its rich formatted output (box-drawing, ANSI codes) to stderr rather than stdout
|
|
193
|
+
const combinedOutput: string = (output.stdout + output.stderr).trim();
|
|
194
|
+
|
|
195
|
+
const recapBlocks: string[] = combinedOutput.split(/PLAY RECAP/g).slice(1);
|
|
188
196
|
recapBlocks.forEach((block): void => {
|
|
189
197
|
expect(block).match(/failed\s*=\s*0/);
|
|
190
198
|
});
|
|
191
199
|
|
|
192
|
-
|
|
193
|
-
expect(
|
|
194
|
-
expect(outputText).to.not.match(/failed\s*=\s*[1-9]\d*/);
|
|
200
|
+
expect(combinedOutput).to.include('PLAY [Verify]');
|
|
201
|
+
expect(combinedOutput).to.not.match(/failed\s*=\s*[1-9]\d*/);
|
|
195
202
|
});
|
|
196
203
|
|
|
197
204
|
test('Check "molecule-destroy" command', function (): void {
|
|
@@ -216,14 +223,16 @@ suite('Ansible devfile API test', function (): void {
|
|
|
216
223
|
const output: ShellString = containerTerminal.execInContainerCommand(runCommandInBash, containerName);
|
|
217
224
|
expect(output.code).eqls(0);
|
|
218
225
|
|
|
219
|
-
|
|
226
|
+
// molecule may write its rich formatted output (box-drawing, ANSI codes) to stderr rather than stdout
|
|
227
|
+
const combinedOutput: string = (output.stdout + output.stderr).trim();
|
|
228
|
+
|
|
229
|
+
const recapBlocks: string[] = combinedOutput.split(/PLAY RECAP/g).slice(1);
|
|
220
230
|
recapBlocks.forEach((block): void => {
|
|
221
231
|
expect(block).match(/failed\s*=\s*0/);
|
|
222
232
|
});
|
|
223
233
|
|
|
224
|
-
|
|
225
|
-
expect(
|
|
226
|
-
expect(outputText).to.not.match(/failed\s*=\s*[1-9]\d*/);
|
|
234
|
+
expect(combinedOutput).to.include('PLAY [Destroy]');
|
|
235
|
+
expect(combinedOutput).to.not.match(/failed\s*=\s*[1-9]\d*/);
|
|
227
236
|
});
|
|
228
237
|
|
|
229
238
|
test('Check "molecule-test" command', function (): void {
|
|
@@ -248,16 +257,18 @@ suite('Ansible devfile API test', function (): void {
|
|
|
248
257
|
const output: ShellString = containerTerminal.execInContainerCommand(runCommandInBash, containerName);
|
|
249
258
|
expect(output.code).eqls(0);
|
|
250
259
|
|
|
251
|
-
|
|
260
|
+
// molecule may write its rich formatted output (box-drawing, ANSI codes) to stderr rather than stdout
|
|
261
|
+
const combinedOutput: string = (output.stdout + output.stderr).trim();
|
|
262
|
+
|
|
263
|
+
const recapBlocks: string[] = combinedOutput.split(/PLAY RECAP/g).slice(1);
|
|
252
264
|
recapBlocks.forEach((block): void => {
|
|
253
265
|
expect(block).match(/failed\s*=\s*0/);
|
|
254
266
|
});
|
|
255
267
|
|
|
256
|
-
|
|
257
|
-
expect(
|
|
258
|
-
expect(
|
|
259
|
-
expect(
|
|
260
|
-
expect(outputText).to.not.match(/failed\s*=\s*[1-9]\d*/);
|
|
268
|
+
expect(combinedOutput).to.include('PLAY [Create]');
|
|
269
|
+
expect(combinedOutput).to.include('PLAY [Converge]');
|
|
270
|
+
expect(combinedOutput).to.include('PLAY [Verify]');
|
|
271
|
+
expect(combinedOutput).to.not.match(/failed\s*=\s*[1-9]\d*/);
|
|
261
272
|
});
|
|
262
273
|
|
|
263
274
|
test('Check "ansible-navigator" command', function (): void {
|
|
@@ -298,7 +309,8 @@ suite('Ansible devfile API test', function (): void {
|
|
|
298
309
|
const output: ShellString = containerTerminal.execInContainerCommand(runCommandInBash, containerName);
|
|
299
310
|
expect(output.code).eqls(0);
|
|
300
311
|
|
|
301
|
-
|
|
312
|
+
// ansible-navigator may write output to stderr depending on terminal detection
|
|
313
|
+
const outputText: string = (output.stdout + output.stderr).trim();
|
|
302
314
|
expect(outputText).to.include('ansible-navigator');
|
|
303
315
|
expect(outputText).to.include('collections');
|
|
304
316
|
expect(outputText).to.include('config');
|
|
@@ -176,7 +176,7 @@ export class KubernetesCommandLineToolsExecutor implements IKubernetesCommandLin
|
|
|
176
176
|
Logger.debug(`${this.kubernetesCommandLineTool}`);
|
|
177
177
|
|
|
178
178
|
return this.shellExecutor.executeCommand(
|
|
179
|
-
`${this.kubernetesCommandLineTool} exec -i
|
|
179
|
+
`${this.kubernetesCommandLineTool} exec -i ${KubernetesCommandLineToolsExecutor.pod} -n ${this.namespace} -c ${container} -- sh -c '${commandToExecute}'`
|
|
180
180
|
);
|
|
181
181
|
}
|
|
182
182
|
|