From 6bce558d2b6188d29e7ab14e57af8968ef6aeeaa Mon Sep 17 00:00:00 2001 From: Dmitrii Gridnev Date: Fri, 7 Jun 2024 16:15:01 +0200 Subject: [PATCH] qase-javascript-commons: support enterprise environment Rename `baseUrl` to `host` in config --- qase-javascript-commons/README.md | 1 + qase-javascript-commons/changelog.md | 22 +++++++++++++++++++ qase-javascript-commons/package.json | 2 +- .../src/config/config-validation-schema.ts | 2 +- qase-javascript-commons/src/env/env-enum.ts | 2 +- .../src/env/env-to-config.ts | 2 +- qase-javascript-commons/src/env/env-type.ts | 2 +- .../src/env/env-validation-schema.ts | 2 +- 8 files changed, 29 insertions(+), 6 deletions(-) diff --git a/qase-javascript-commons/README.md b/qase-javascript-commons/README.md index bcdd5ef4..6aa42ca8 100644 --- a/qase-javascript-commons/README.md +++ b/qase-javascript-commons/README.md @@ -46,6 +46,7 @@ All configuration options are listed in the table below: | **Qase TestOps configuration** | | | | | | | Token for [API access](https://developers.qase.io/#authentication) | `testops.api.token` | `QASE_TESTOPS_API_TOKEN` | | Yes | Any string | | Qase API host | `testops.api.host` | `QASE_TESTOPS_API_HOST` | `qase.io` | No | Any string | +| Qase enterprise environment | `testops.api.enterprise` | `QASE_TESTOPS_API_ENTERPRISE` | `False` | No | `True`, `False` | | Code of your project, which you can take from the URL: `https://app.qase.io/project/DEMOTR` - `DEMOTR` is the project code | `testops.project` | `QASE_TESTOPS_PROJECT` | | Yes | Any string | | Qase test run ID | `testops.run.id` | `QASE_TESTOPS_RUN_ID` | | No | Any integer | | Qase test run title | `testops.run.title` | `QASE_TESTOPS_RUN_TITLE` | `Automated run ` | No | Any string | diff --git a/qase-javascript-commons/changelog.md b/qase-javascript-commons/changelog.md index c451fe1b..0a30887f 100644 --- a/qase-javascript-commons/changelog.md +++ b/qase-javascript-commons/changelog.md @@ -1,3 +1,25 @@ +# qase-javascript-commons@2.0.9 + +## What's new + +Added new configuration options `enterprise` for the Qase TestOps reporter in the `qase.config.json` file and environment variables. +Support enterprise API URL. Now the reporters will upload test results to your own Qase instance. + +```diff +{ + ... + "testops": { + "api": { + "token": "token", + "host": "qase.io", ++ "enterprise": true + } + ... + }, + ... +} +``` + # qase-javascript-commons@2.0.8 ## What's new diff --git a/qase-javascript-commons/package.json b/qase-javascript-commons/package.json index 9018e630..f0493274 100644 --- a/qase-javascript-commons/package.json +++ b/qase-javascript-commons/package.json @@ -1,6 +1,6 @@ { "name": "qase-javascript-commons", - "version": "2.0.8", + "version": "2.0.9", "description": "Qase JS Reporters", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/qase-javascript-commons/src/config/config-validation-schema.ts b/qase-javascript-commons/src/config/config-validation-schema.ts index d30bed95..5cac8c26 100644 --- a/qase-javascript-commons/src/config/config-validation-schema.ts +++ b/qase-javascript-commons/src/config/config-validation-schema.ts @@ -49,7 +49,7 @@ export const configValidationSchema: JSONSchemaType = { nullable: true, }, - baseUrl: { + host: { type: 'string', nullable: true, }, diff --git a/qase-javascript-commons/src/env/env-enum.ts b/qase-javascript-commons/src/env/env-enum.ts index 1934924b..564a1e61 100644 --- a/qase-javascript-commons/src/env/env-enum.ts +++ b/qase-javascript-commons/src/env/env-enum.ts @@ -24,7 +24,7 @@ export enum EnvTestOpsEnum { */ export enum EnvApiEnum { token = 'QASE_TESTOPS_API_TOKEN', - baseUrl = 'QASE_TESTOPS_API_HOST', + host = 'QASE_TESTOPS_API_HOST', } /** diff --git a/qase-javascript-commons/src/env/env-to-config.ts b/qase-javascript-commons/src/env/env-to-config.ts index 6ca33e2a..31a9af53 100644 --- a/qase-javascript-commons/src/env/env-to-config.ts +++ b/qase-javascript-commons/src/env/env-to-config.ts @@ -27,7 +27,7 @@ export const envToConfig = (env: EnvType): ConfigType => ({ api: { token: env[EnvApiEnum.token], - baseUrl: env[EnvApiEnum.baseUrl], + host: env[EnvApiEnum.host], }, run: { diff --git a/qase-javascript-commons/src/env/env-type.ts b/qase-javascript-commons/src/env/env-type.ts index d0dc45b0..208b0c16 100644 --- a/qase-javascript-commons/src/env/env-type.ts +++ b/qase-javascript-commons/src/env/env-type.ts @@ -23,7 +23,7 @@ export type EnvType = { [EnvTestOpsEnum.useV2]?: boolean; [EnvApiEnum.token]?: string; - [EnvApiEnum.baseUrl]?: string; + [EnvApiEnum.host]?: string; [EnvRunEnum.id]?: number; [EnvRunEnum.title]?: string; diff --git a/qase-javascript-commons/src/env/env-validation-schema.ts b/qase-javascript-commons/src/env/env-validation-schema.ts index 6311d74f..3eac4752 100644 --- a/qase-javascript-commons/src/env/env-validation-schema.ts +++ b/qase-javascript-commons/src/env/env-validation-schema.ts @@ -64,7 +64,7 @@ export const envValidationSchema: JSONSchemaType = { type: 'string', nullable: true, }, - [EnvApiEnum.baseUrl]: { + [EnvApiEnum.host]: { type: 'string', nullable: true, },