Skip to content

Commit

Permalink
Merge pull request openshift-pipelines#54 from jerolimov/fix-updated-…
Browse files Browse the repository at this point in the history
…ci-issues

Fix (hopefully some) issues with updated CI config
  • Loading branch information
openshift-merge-bot[bot] authored Jan 25, 2024
2 parents 071a999 + 09cd2a0 commit aa08fce
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 18 deletions.
2 changes: 1 addition & 1 deletion i18n-scripts/build-i18n.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
18 changes: 12 additions & 6 deletions src/components/pipelines-overview/utils.ts
Original file line number Diff line number Diff line change
@@ -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, {
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion test-frontend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
17 changes: 8 additions & 9 deletions test-prow-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
# yarn run test-cypress-headless
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit aa08fce

Please sign in to comment.