@red-hat-developer-hub/e2e-test-utils 1.1.10 → 1.1.11
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import KeycloakAdminClient from "@keycloak/keycloak-admin-client";
|
|
2
2
|
import { KubernetesClientHelper } from "../../utils/kubernetes-client.js";
|
|
3
|
-
import {
|
|
3
|
+
import { $, runQuietUnlessFailure } from "../../utils/bash.js";
|
|
4
4
|
import { DEFAULT_KEYCLOAK_CONFIG, BITNAMI_CHART_REPO, BITNAMI_CHART_NAME, DEFAULT_CONFIG_PATHS, DEFAULT_RHDH_CLIENT, SERVICE_ACCOUNT_ROLES, DEFAULT_USERS, DEFAULT_GROUPS, } from "./constants.js";
|
|
5
5
|
export class KeycloakHelper {
|
|
6
6
|
k8sClient = new KubernetesClientHelper();
|
|
@@ -310,10 +310,10 @@ export class KeycloakHelper {
|
|
|
310
310
|
}
|
|
311
311
|
async _deployWithHelm() {
|
|
312
312
|
await $ `helm repo add bitnami ${BITNAMI_CHART_REPO} || true`;
|
|
313
|
-
await
|
|
314
|
-
await
|
|
313
|
+
await runQuietUnlessFailure `helm repo update`;
|
|
314
|
+
await runQuietUnlessFailure `helm upgrade --install ${this.deploymentConfig.releaseName} ${BITNAMI_CHART_NAME} \
|
|
315
315
|
--namespace ${this.deploymentConfig.namespace} \
|
|
316
|
-
--values ${this.deploymentConfig.valuesFile}
|
|
316
|
+
--values ${this.deploymentConfig.valuesFile}`;
|
|
317
317
|
await this.waitUntilReady();
|
|
318
318
|
}
|
|
319
319
|
async _createRoute() {
|
package/dist/utils/bash.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import { $ } from "zx";
|
|
2
|
+
/**
|
|
3
|
+
* Runs a shell command with stdout/stderr captured. On success, output is not printed.
|
|
4
|
+
* On non-zero exit, stdout and stderr are written to console.error and an error is thrown.
|
|
5
|
+
* Use for noisy commands that should stay quiet on success but show output when they fail.
|
|
6
|
+
*/
|
|
7
|
+
export declare function runQuietUnlessFailure(strings: TemplateStringsArray, ...values: unknown[]): Promise<void>;
|
|
2
8
|
export { $ };
|
|
3
9
|
//# sourceMappingURL=bash.d.ts.map
|
package/dist/utils/bash.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../src/utils/bash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../src/utils/bash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC;AAYvB;;;;GAIG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,oBAAoB,EAC7B,GAAG,MAAM,EAAE,OAAO,EAAE,GACnB,OAAO,CAAC,IAAI,CAAC,CAuBf;AAED,OAAO,EAAE,CAAC,EAAE,CAAC"}
|
package/dist/utils/bash.js
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
import { $ } from "zx";
|
|
2
2
|
$.quiet = true;
|
|
3
3
|
$.stdio = ["inherit", "inherit", "inherit"];
|
|
4
|
+
/**
|
|
5
|
+
* Runs a shell command with stdout/stderr captured. On success, output is not printed.
|
|
6
|
+
* On non-zero exit, stdout and stderr are written to console.error and an error is thrown.
|
|
7
|
+
* Use for noisy commands that should stay quiet on success but show output when they fail.
|
|
8
|
+
*/
|
|
9
|
+
export async function runQuietUnlessFailure(strings, ...values) {
|
|
10
|
+
const runWithPipe = $({
|
|
11
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
12
|
+
nothrow: true,
|
|
13
|
+
});
|
|
14
|
+
const result = (await runWithPipe(strings, ...values));
|
|
15
|
+
if (result.exitCode !== 0) {
|
|
16
|
+
if (result.stdout?.trim()) {
|
|
17
|
+
console.error("[command stdout]:", result.stdout.trim());
|
|
18
|
+
}
|
|
19
|
+
if (result.stderr?.trim()) {
|
|
20
|
+
console.error("[command stderr]:", result.stderr.trim());
|
|
21
|
+
}
|
|
22
|
+
throw new Error(`Command failed with exit code ${result.exitCode}. Output above.`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
4
25
|
export { $ };
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { envsubst } from "./common.js";
|
|
2
|
-
export {
|
|
2
|
+
export { $, runQuietUnlessFailure } from "./bash.js";
|
|
3
3
|
export { mergeYamlFiles, mergeYamlFilesIfExists, mergeYamlFilesToFile, } from "./merge-yamls.js";
|
|
4
4
|
export { KubernetesClientHelper } from "./kubernetes-client.js";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,CAAC,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/utils/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { envsubst } from "./common.js";
|
|
2
|
-
export {
|
|
2
|
+
export { $, runQuietUnlessFailure } from "./bash.js";
|
|
3
3
|
export { mergeYamlFiles, mergeYamlFilesIfExists, mergeYamlFilesToFile, } from "./merge-yamls.js";
|
|
4
4
|
export { KubernetesClientHelper } from "./kubernetes-client.js";
|