Skip to content

Commit

Permalink
chore: Added CI for UI (#77)
Browse files Browse the repository at this point in the history
* Added ui and changed image names

Signed-off-by: Krithika Vijayakumar <krithika_vijayakumar@intuit.com>

* Removed junit

Signed-off-by: Krithika Vijayakumar <krithika_vijayakumar@intuit.com>

* Added timeout

Signed-off-by: Krithika Vijayakumar <krithika_vijayakumar@intuit.com>

* Added some additional changes

Signed-off-by: Krithika Vijayakumar <krithika_vijayakumar@intuit.com>

* Added check to determine if folders changed

Signed-off-by: Krithika Vijayakumar <krithika_vijayakumar@intuit.com>

* chore: Added check to determine if UI dir is built or not

Signed-off-by: Krithika Vijayakumar <krithika_vijayakumar@intuit.com>

* chore: removed log line in ci.yaml

Signed-off-by: Krithika Vijayakumar <krithika_vijayakumar@intuit.com>

* chore: Fixed vulnerability

Signed-off-by: Krithika Vijayakumar <krithika_vijayakumar@intuit.com>

* chore: Fixed yarn.lock

Signed-off-by: Krithika Vijayakumar <krithika_vijayakumar@intuit.com>

* chore: Fixed some other minor issues

Signed-off-by: Krithika Vijayakumar <krithika_vijayakumar@intuit.com>

* chore: Added favicon and fixed warnings

Signed-off-by: Krithika Vijayakumar <krithika_vijayakumar@intuit.com>

* chore: Fixed any warning

Signed-off-by: Krithika Vijayakumar <krithika_vijayakumar@intuit.com>

* chore: Fixed some warnings

Signed-off-by: Krithika Vijayakumar <krithika_vijayakumar@intuit.com>

Co-authored-by: Krithika Vijayakumar <krithika_vijayakumar@intuit.com>
Signed-off-by: Derek Wang <whynowy@gmail.com>
  • Loading branch information
2 people authored and whynowy committed Jul 8, 2022
1 parent 06a3df2 commit ac1814d
Show file tree
Hide file tree
Showing 18 changed files with 2,778 additions and 2,719 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,31 @@ on:
pull_request:
branches: [ main ]
jobs:
ui:
name: UI
runs-on: ubuntu-latest
timeout-minutes: 6
env:
NODE_OPTIONS: --max-old-space-size=4096
CI: ""
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16"
- uses: actions/cache@v3
with:
path: ui/node_modules
key: ${{ runner.os }}-node-dep-v1-${{ hashFiles('**/yarn.lock') }}
- run: yarn --cwd ui install
- run: yarn --cwd ui build
- run: yarn --cwd ui test
- run: yarn --cwd ui lint
- run: git diff --exit-code
# check to see if it'll start (but not if it'll render)
- run: yarn --cwd ui start &
- run: until curl http://localhost:3000 > /dev/null ; do sleep 10s ; done
timeout-minutes: 1
codegen:
name: Codegen
runs-on: ubuntu-latest
Expand Down
143 changes: 0 additions & 143 deletions ui/junit.xml

This file was deleted.

5 changes: 4 additions & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"react-flow-renderer": "^10.0.7",
"react-json-view": "^1.21.3",
"react-router-dom": "6",
"react-scripts": "5.0.1",
"typescript": "^4.4.2",
"web-vitals": "^2.1.0",
"@visx/responsive": "^2.8.0",
Expand Down Expand Up @@ -60,6 +59,7 @@
]
},
"devDependencies": {
"react-scripts": "5.0.1",
"@typescript-eslint/eslint-plugin": "^5.20.0",
"@typescript-eslint/parser": "^5.20.0",
"eslint-config-prettier": "7.2.0",
Expand All @@ -68,6 +68,9 @@
"prettier": "2.5.1",
"jest-junit": "^12.0.0"
},
"resolutions": {
"nth-check": "^2.0.1"
},
"jest": {
"transformIgnorePatterns": [
"/node_modules/(?!d3|d3-array|internmap|delaunator|robust-predicates)"
Expand Down
Binary file modified ui/public/favicon.ico
Binary file not shown.
4 changes: 1 addition & 3 deletions ui/src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import App from "./App"
import {render, screen} from "@testing-library/react";
import {render} from "@testing-library/react";
import { BrowserRouter } from "react-router-dom";

jest.mock("react-router-dom", () => ({
Expand All @@ -13,7 +13,5 @@ describe("Breadcrumbs", () => {
it("loads pipeline screen", () => {
render(<BrowserRouter>
<App/></BrowserRouter>)
// expect(screen.getByTestId("pipeline-breadcrumb")).toBeInTheDocument();
// expect(screen.getByTestId("mui-breadcrumbs")).toBeInTheDocument();
})
})
2 changes: 1 addition & 1 deletion ui/src/components/namespaces/NamespaceRowContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface NamespaceRowContentProps {

export function NamespaceRowContent(props: NamespaceRowContentProps) {
const { namespaceId } = props;
const { pipelines, loading, error } = useNamespaceFetch(namespaceId);
const { pipelines } = useNamespaceFetch(namespaceId);
return (
<div className={"NamespaceRowContent"} data-testid="namespace-row-content">
<Box
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/namespaces/Namespaces.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { NamespaceRow } from "./NamespaceRow";
import "./Namespaces.css";

export function Namespaces() {
const { data, error, loading } = useFetch("/api/v1/namespaces");
const { data } = useFetch("/api/v1/namespaces");

return (
<div className="Namespaces">
Expand Down
36 changes: 24 additions & 12 deletions ui/src/components/pipeline/Pipeline.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ describe("Pipeline", () => {
"totalMessages": 8233,
"bufferUsageLimit": 0.8,
"bufferUsage": 0.8233,
"isFull": true
"isFull": true,
"bufferLength": 10000
}, {
"fromVertex": "preproc",
"toVertex": "infer",
Expand All @@ -126,7 +127,8 @@ describe("Pipeline", () => {
"totalMessages": 8146,
"bufferUsageLimit": 0.8,
"bufferUsage": 0.8146,
"isFull": true
"isFull": true,
"bufferLength": 10000
}, {
"fromVertex": "infer",
"toVertex": "train",
Expand All @@ -135,7 +137,8 @@ describe("Pipeline", () => {
"totalMessages": 0,
"bufferUsageLimit": 0.8,
"bufferUsage": 0,
"isFull": false
"isFull": false,
"bufferLength": 10000
}, {
"fromVertex": "infer",
"toVertex": "postproc",
Expand All @@ -144,7 +147,8 @@ describe("Pipeline", () => {
"totalMessages": 8198,
"bufferUsageLimit": 0.8,
"bufferUsage": 0.8101,
"isFull": true
"isFull": true,
"bufferLength": 10000
}, {
"fromVertex": "postproc",
"toVertex": "log-output",
Expand All @@ -153,7 +157,8 @@ describe("Pipeline", () => {
"totalMessages": 13641,
"bufferUsageLimit": 0.8,
"bufferUsage": 1.3641,
"isFull": true
"isFull": true,
"bufferLength": 10000
}, {
"fromVertex": "postproc",
"toVertex": "publisher",
Expand All @@ -162,7 +167,8 @@ describe("Pipeline", () => {
"totalMessages": 0,
"bufferUsageLimit": 0.8,
"bufferUsage": 0,
"isFull": false
"isFull": false,
"bufferLength": 10000
}], error: false, loading: false
})
render(<Pipeline/>)
Expand Down Expand Up @@ -267,7 +273,8 @@ describe("Pipeline", () => {
"totalMessages": 8233,
"bufferUsageLimit": 0.8,
"bufferUsage": 0.8233,
"isFull": true
"isFull": true,
"bufferLength": 10000
}, {
"fromVertex": "preproc",
"toVertex": "infer",
Expand All @@ -276,7 +283,8 @@ describe("Pipeline", () => {
"totalMessages": 8146,
"bufferUsageLimit": 0.8,
"bufferUsage": 0.8146,
"isFull": true
"isFull": true,
"bufferLength": 10000
}, {
"fromVertex": "infer",
"toVertex": "train",
Expand All @@ -285,7 +293,8 @@ describe("Pipeline", () => {
"totalMessages": 0,
"bufferUsageLimit": 0.8,
"bufferUsage": 0,
"isFull": false
"isFull": false,
"bufferLength": 10000
}, {
"fromVertex": "infer",
"toVertex": "postproc",
Expand All @@ -294,7 +303,8 @@ describe("Pipeline", () => {
"totalMessages": 8198,
"bufferUsageLimit": 0.8,
"bufferUsage": 0.8101,
"isFull": true
"isFull": true,
"bufferLength": 10000
}, {
"fromVertex": "postproc",
"toVertex": "log-output",
Expand All @@ -303,7 +313,8 @@ describe("Pipeline", () => {
"totalMessages": 13641,
"bufferUsageLimit": 0.8,
"bufferUsage": 1.3641,
"isFull": true
"isFull": true,
"bufferLength": 10000
}, {
"fromVertex": "postproc",
"toVertex": "publisher",
Expand All @@ -312,7 +323,8 @@ describe("Pipeline", () => {
"totalMessages": 0,
"bufferUsageLimit": 0.8,
"bufferUsage": 0,
"isFull": false
"isFull": false,
"bufferLength": 10000
}], error: false, loading: false
})
render(<Pipeline/>)
Expand Down
2 changes: 0 additions & 2 deletions ui/src/components/pipeline/Pipeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export function Pipeline() {
const {
pipeline,
error: pipelineError,
loading: pipelineLoading,
} = usePipelineFetch(namespaceId, pipelineId, pipelineRequestKey);

const [edgesInfoRequestKey, setEdgesInfoRequestKey] = useState(
Expand All @@ -27,7 +26,6 @@ export function Pipeline() {
const {
edgesInfo,
error: edgesInfoError,
loading: edgesInfoLoading,
} = useEdgesInfoFetch(namespaceId, pipelineId, edgesInfoRequestKey);

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/pipeline/graph/Graph.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {Position} from "react-flow-renderer";

global.ResizeObserver = require('resize-observer-polyfill')

describe("Graph screen", () => {
describe("Graph screen test", () => {

const data = {
"vertices": [{
Expand Down
1 change: 0 additions & 1 deletion ui/src/components/pipeline/graph/Graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ export default function Graph(props: GraphProps) {
onEdgeClick={handleEdgeClick}
onNodeClick={handleNodeClick}
onPaneClick={handlePaneClick}
onNodeMouse
fitView
zoomOnScroll={false}
panOnDrag={false}
Expand Down
Loading

0 comments on commit ac1814d

Please sign in to comment.