Skip to content

Commit

Permalink
Adding tekton results utils
Browse files Browse the repository at this point in the history
  • Loading branch information
lokanandaprabhu committed Jun 18, 2024
1 parent a4be6bd commit d1f7e6a
Show file tree
Hide file tree
Showing 33 changed files with 2,669 additions and 9 deletions.
6 changes: 6 additions & 0 deletions packages/pipelines/__mocks__/console-dynamic-plugin-sdk.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
useK8sWatchResource: jest.fn(),
useFlag: jest.fn(),
getGroupVersionKindForModel: jest.fn(),
k8sGet: jest.fn(),
};
6 changes: 6 additions & 0 deletions packages/pipelines/jest-resolver.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = (request, options) => {
if (request.startsWith('@console/internal') || request.startsWith('@openshift-console')) {
return `${options.rootDir}/__mocks__/console-dynamic-plugin-sdk.js`;
}
return options.defaultResolver(request, options);
};
4 changes: 3 additions & 1 deletion packages/pipelines/jest.config.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module.exports = {
...require('@aonic-ui/jest-config/jest.config.cjs')
...require('@aonic-ui/jest-config/jest.config.cjs'),
resolver: '<rootDir>/jest-resolver.cjs',
transformIgnorePatterns: ['<rootDir>/node_modules/(?!lodash-es)'],
};
17 changes: 11 additions & 6 deletions packages/pipelines/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,31 @@
"@aonic-ui/jest-config": "*",
"@aonic-ui/rollup-config": "*",
"@aonic-ui/typescript-config": "*",
"@testing-library/react": "^14.1.2",
"@testing-library/jest-dom": "^6.2.0",
"@openshift-console/dynamic-plugin-sdk": "1.2.0",
"@openshift-console/dynamic-plugin-sdk-webpack": "1.1.0",
"@patternfly/react-core": "^5.1.2",
"@patternfly/react-icons": "^5.1.2",
"@patternfly/react-tokens": "^5.1.2",
"@testing-library/jest-dom": "^6.2.0",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.5.1",
"@types/jest": "^29.5.11",
"@types/react": "^18.2.47",
"@types/js-yaml": "^4.0.5",
"@types/lodash-es": "4.17.x",
"@types/react": "^18.2.47",
"jest": "^29.7.0",
"react": "^18.2.0",
"rollup": "^4.9.5",
"ts-jest": "^29.1.4",
"typescript": "^5.3.3"
},
"peerDependencies": {
"react": "^18.2.0",
"@testing-library/jest-dom": "^6.2.0",
"@patternfly/react-core": "^5.1.2",
"@patternfly/react-icons": "^5.1.2",
"@patternfly/react-table": "^5.1.2",
"@patternfly/react-tokens": "^5.1.2"
"@patternfly/react-tokens": "^5.1.2",
"@testing-library/jest-dom": "^6.2.0",
"react": "^18.2.0"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 4 additions & 0 deletions packages/pipelines/src/const.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const DELETED_RESOURCE_IN_K8S_ANNOTATION = 'resource.deleted.in.k8s';
export const RESOURCE_LOADED_FROM_RESULTS_ANNOTATION = 'resource.loaded.from.tektonResults';
export const ALL_NAMESPACES_KEY = '#ALL_NS#';
export const FLAG_PIPELINE_TEKTON_RESULT_INSTALLED = 'PIPELINE_TEKTON_RESULT_INSTALLED';
Loading

0 comments on commit d1f7e6a

Please sign in to comment.