-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: adds more identifying information for node executions #70
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
13dd7a2
feat: show workflow node name beneath node execution ids
schottra 5bc3abb
feat: updating DetailsPanel info for NodeExecutions
schottra dab599f
fix lint errors
schottra eea4719
adding tests for new formatter function
schottra 8283b39
test: adding new test for NodeExecutionDetails
schottra db723c6
test: adding test for new code in NodeExecutionsTable
schottra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/components/Executions/ExecutionDetails/test/NodeExecutionDetails.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { render, waitFor } from '@testing-library/react'; | ||
import { mockAPIContextValue } from 'components/data/__mocks__/apiContext'; | ||
import { APIContext } from 'components/data/apiContext'; | ||
import { | ||
DetailedNodeExecution, | ||
NodeExecutionDisplayType | ||
} from 'components/Executions/types'; | ||
import { createMockNodeExecutions } from 'models/Execution/__mocks__/mockNodeExecutionsData'; | ||
import { listTaskExecutions } from 'models/Execution/api'; | ||
import * as React from 'react'; | ||
import { NodeExecutionDetails } from '../NodeExecutionDetails'; | ||
|
||
describe('NodeExecutionDetails', () => { | ||
let execution: DetailedNodeExecution; | ||
let mockListTaskExecutions: jest.Mock<ReturnType< | ||
typeof listTaskExecutions | ||
>>; | ||
beforeEach(() => { | ||
const { executions } = createMockNodeExecutions(1); | ||
execution = { | ||
...executions[0], | ||
displayType: NodeExecutionDisplayType.PythonTask, | ||
displayId: 'com.flyte.testTask', | ||
cacheKey: 'abcdefg' | ||
}; | ||
mockListTaskExecutions = jest.fn().mockResolvedValue({ entities: [] }); | ||
}); | ||
|
||
const renderComponent = () => | ||
render( | ||
<APIContext.Provider | ||
value={mockAPIContextValue({ | ||
listTaskExecutions: mockListTaskExecutions | ||
})} | ||
> | ||
<NodeExecutionDetails execution={execution} /> | ||
</APIContext.Provider> | ||
); | ||
|
||
it('renders displayId', async () => { | ||
const { queryByText } = renderComponent(); | ||
await waitFor(() => {}); | ||
expect(queryByText(execution.displayId)).toBeInTheDocument(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
src/components/Executions/Tables/test/NodeExecutionsTable.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import { render, waitFor } from '@testing-library/react'; | ||
import { mapNodeExecutionDetails } from 'components'; | ||
import { mockAPIContextValue } from 'components/data/__mocks__/apiContext'; | ||
import { APIContext } from 'components/data/apiContext'; | ||
import { DetailedNodeExecution } from 'components/Executions/types'; | ||
import { | ||
createMockWorkflow, | ||
createMockWorkflowClosure | ||
} from 'models/__mocks__/workflowData'; | ||
import { createMockNodeExecutions } from 'models/Execution/__mocks__/mockNodeExecutionsData'; | ||
import { listTaskExecutions } from 'models/Execution/api'; | ||
import { mockTasks } from 'models/Task/__mocks__/mockTaskData'; | ||
import * as React from 'react'; | ||
import { | ||
NodeExecutionsTable, | ||
NodeExecutionsTableProps | ||
} from '../NodeExecutionsTable'; | ||
|
||
describe('NodeExecutionsTable', () => { | ||
let props: NodeExecutionsTableProps; | ||
let mockNodeExecutions: DetailedNodeExecution[]; | ||
let mockListTaskExecutions: jest.Mock<ReturnType< | ||
typeof listTaskExecutions | ||
>>; | ||
|
||
beforeEach(() => { | ||
mockListTaskExecutions = jest.fn().mockResolvedValue({ entities: [] }); | ||
const { | ||
executions: mockExecutions, | ||
nodes: mockNodes | ||
} = createMockNodeExecutions(1); | ||
|
||
const mockWorkflow = createMockWorkflow('SampleWorkflow'); | ||
const mockWorkflowClosure = createMockWorkflowClosure(); | ||
const compiledWorkflow = mockWorkflowClosure.compiledWorkflow!; | ||
const { | ||
primary: { template }, | ||
tasks | ||
} = compiledWorkflow; | ||
template.nodes = template.nodes.concat(mockNodes); | ||
compiledWorkflow.tasks = tasks.concat(mockTasks); | ||
mockWorkflow.closure = mockWorkflowClosure; | ||
|
||
mockNodeExecutions = mapNodeExecutionDetails( | ||
mockExecutions, | ||
mockWorkflow | ||
); | ||
|
||
props = { | ||
value: mockNodeExecutions, | ||
lastError: null, | ||
loading: false, | ||
moreItemsAvailable: false, | ||
fetch: jest.fn() | ||
}; | ||
}); | ||
|
||
const renderTable = () => | ||
render( | ||
<APIContext.Provider | ||
value={mockAPIContextValue({ | ||
listTaskExecutions: mockListTaskExecutions | ||
})} | ||
> | ||
<NodeExecutionsTable {...props} /> | ||
</APIContext.Provider> | ||
); | ||
|
||
it('renders displayId for nodes', async () => { | ||
const { queryByText } = renderTable(); | ||
await waitFor(() => {}); | ||
|
||
const node = mockNodeExecutions[0]; | ||
expect(queryByText(node.displayId)).toBeInTheDocument(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
{ | ||
"compilerOptions": { | ||
"allowSyntheticDefaultImports": true, | ||
"allowJs": true, | ||
"baseUrl": "src", | ||
"checkJs": false, | ||
"downlevelIteration": true, | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"importHelpers": true, | ||
"jsx": "react", | ||
"lib": ["es2015", "es2017", "dom", "dom.iterable"], | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"noFallthroughCasesInSwitch": true, | ||
"noImplicitReturns": true, | ||
"noUnusedLocals": false, | ||
"noUnusedParameters": false, | ||
"outDir": "./dist", | ||
"removeComments": false, | ||
"resolveJsonModule": true, | ||
"skipLibCheck": true, | ||
"sourceMap": true, | ||
"strict": true, | ||
"target": "es6", | ||
"types": ["node", "webpack-env", "jest"] | ||
} | ||
"compilerOptions": { | ||
"allowSyntheticDefaultImports": true, | ||
"allowJs": true, | ||
"baseUrl": "src", | ||
"checkJs": false, | ||
"downlevelIteration": true, | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"importHelpers": true, | ||
"jsx": "react", | ||
"lib": ["es2015", "es2017", "dom", "dom.iterable"], | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"noFallthroughCasesInSwitch": true, | ||
"noImplicitReturns": true, | ||
"noUnusedLocals": false, | ||
"noUnusedParameters": false, | ||
"outDir": "./dist", | ||
"removeComments": false, | ||
"resolveJsonModule": true, | ||
"skipLibCheck": true, | ||
"sourceMap": true, | ||
"strict": true, | ||
"target": "es6", | ||
"types": ["node", "webpack-env", "jest"] | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a result of running
yarn lint-fix
manually on one of my commits, which processed all JSON files in the repo to get them in line with ourprettier
config :-)