diff --git a/i18n-scripts/build-i18n.sh b/i18n-scripts/build-i18n.sh index e206270b..e9319055 100755 --- a/i18n-scripts/build-i18n.sh +++ b/i18n-scripts/build-i18n.sh @@ -4,4 +4,4 @@ set -exuo pipefail FILE_PATTERN="{!(dist|node_modules)/**/*.{js,jsx,ts,tsx,json},*.{js,jsx,ts,tsx,json}}" -i18next "${FILE_PATTERN}" [-oc] -c "./i18next-parser.config.js" -o "locales/\$LOCALE/\$NAMESPACE.json" +./node_modules/.bin/i18next "${FILE_PATTERN}" [-oc] -c "./i18next-parser.config.js" -o "locales/\$LOCALE/\$NAMESPACE.json" diff --git a/package.json b/package.json index 7928d7a9..b2c27df9 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "eslint-plugin-react": "^7.29.1", "i18next-parser": "^3.11.0", "jest": "^27.4.5", + "jest-junit": "^16.0.0", "mocha-junit-reporter": "^2.2.0", "mochawesome": "^7.1.3", "mochawesome-merge": "^4.3.0", diff --git a/src/components/pipelines-overview/PipelineRunsStatusCard.tsx b/src/components/pipelines-overview/PipelineRunsStatusCard.tsx index 722f01db..bf038a49 100644 --- a/src/components/pipelines-overview/PipelineRunsStatusCard.tsx +++ b/src/components/pipelines-overview/PipelineRunsStatusCard.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; -import * as _ from 'lodash'; import * as classNames from 'classnames'; import { useTranslation } from 'react-i18next'; import { DomainPropType, DomainTuple } from 'victory-core'; diff --git a/src/components/pipelines-overview/utils.ts b/src/components/pipelines-overview/utils.ts index 6a01c050..4b19368b 100644 --- a/src/components/pipelines-overview/utils.ts +++ b/src/components/pipelines-overview/utils.ts @@ -1,10 +1,10 @@ -import * as React from 'react'; -import { useTranslation } from 'react-i18next'; import { K8sGroupVersionKind, K8sModel, K8sResourceKindReference, } from '@openshift-console/dynamic-plugin-sdk'; +import * as React from 'react'; +import { useTranslation } from 'react-i18next'; export const alphanumericCompare = (a: string, b: string): number => { return a.localeCompare(b, undefined, { @@ -168,12 +168,18 @@ export const sortTimeStrings = ( }); }; -export const sortByTimestamp = (items: SummaryProps[], prop: string,direction: string) => { +export const sortByTimestamp = ( + items: SummaryProps[], + prop: string, + direction: string, +) => { const compareTimestamps = (a: SummaryProps, b: SummaryProps) => { - const timestampA = a[prop]; - const timestampB = b[prop]; + const timestampA = a[prop]; + const timestampB = b[prop]; - return direction === 'asc' ? timestampA - timestampB : timestampB - timestampA; + return direction === 'asc' + ? timestampA - timestampB + : timestampB - timestampA; }; const sortedItems = [...items].sort(compareTimestamps); diff --git a/test-frontend.sh b/test-frontend.sh index bc813212..e54cc885 100755 --- a/test-frontend.sh +++ b/test-frontend.sh @@ -6,7 +6,9 @@ set -euo pipefail OPENSHIFT_CI=${OPENSHIFT_CI:=false} ARTIFACT_DIR=${ARTIFACT_DIR:=/tmp/artifacts} -yarn install +if [ ! -d node_modules ]; then + yarn install +fi # Check for outdated yarn.lock file if [[ -n "$(git status --porcelain -- yarn.lock)" ]]; then @@ -15,6 +17,7 @@ if [[ -n "$(git status --porcelain -- yarn.lock)" ]]; then exit 1 fi +# Check for outdated i18n files yarn i18n GIT_STATUS="$(git status --short --untracked-files -- locales)" if [ -n "$GIT_STATUS" ]; then @@ -24,6 +27,7 @@ if [ -n "$GIT_STATUS" ]; then fi yarn run lint + if [ "$OPENSHIFT_CI" = true ]; then JEST_SUITE_NAME="Pipeline Console Plugin Unit Tests" JEST_JUNIT_OUTPUT_DIR="$ARTIFACT_DIR" yarn run test --ci --maxWorkers=2 --reporters=default --reporters=jest-junit else diff --git a/test-prow-e2e.sh b/test-prow-e2e.sh index f8308c0c..2ae95016 100755 --- a/test-prow-e2e.sh +++ b/test-prow-e2e.sh @@ -21,17 +21,16 @@ trap copyArtifacts EXIT # don't log kubeadmin-password -set +x -BRIDGE_KUBEADMIN_PASSWORD="$(cat "${KUBEADMIN_PASSWORD_FILE:-${INSTALLER_DIR}/auth/kubeadmin-password}")" -export BRIDGE_KUBEADMIN_PASSWORD -set -x -BRIDGE_BASE_ADDRESS="$(oc get consoles.config.openshift.io cluster -o jsonpath='{.status.consoleURL}')" -export BRIDGE_BASE_ADDRESS - -echo "Install dependencies" +#set +x +#BRIDGE_KUBEADMIN_PASSWORD="$(cat "${KUBEADMIN_PASSWORD_FILE:-${INSTALLER_DIR}/auth/kubeadmin-password}")" +#export BRIDGE_KUBEADMIN_PASSWORD +#set -x +#BRIDGE_BASE_ADDRESS="$(oc get consoles.config.openshift.io cluster -o jsonpath='{.status.consoleURL}')" +#export BRIDGE_BASE_ADDRESS + if [ ! -d node_modules ]; then yarn install fi echo "Runs Cypress tests in headless mode" -# yarn run test-cypress-headless \ No newline at end of file +# yarn run test-cypress-headless diff --git a/yarn.lock b/yarn.lock index b0ec8bb1..b99b668f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6541,6 +6541,16 @@ jest-jasmine2@^27.5.1: pretty-format "^27.5.1" throat "^6.0.1" +jest-junit@^16.0.0: + version "16.0.0" + resolved "https://registry.yarnpkg.com/jest-junit/-/jest-junit-16.0.0.tgz#d838e8c561cf9fdd7eb54f63020777eee4136785" + integrity sha512-A94mmw6NfJab4Fg/BlvVOUXzXgF0XIH6EmTgJ5NDPp4xoKq0Kr7sErb+4Xs9nZvu58pJojz5RFGpqnZYJTrRfQ== + dependencies: + mkdirp "^1.0.4" + strip-ansi "^6.0.1" + uuid "^8.3.2" + xml "^1.0.1" + jest-leak-detector@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.5.1.tgz#6ec9d54c3579dd6e3e66d70e3498adf80fde3fb8"