Skip to content
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: enable basic runner #7835

Closed
wants to merge 19 commits into from
Closed

Conversation

ihexxa
Copy link
Contributor

@ihexxa ihexxa commented Aug 14, 2024

Background

This PR enables basic runner by commenting out some dependencies.

Changes

  • Added runner, runner menu items
  • Integrated runner to the request pane
  • Updated timer to support updating step name in place
  • Refactored sendAction to make it can be reused

image

Ref: INS-4197, INS-4222, INS-4223

@ihexxa ihexxa self-assigned this Aug 14, 2024
@ihexxa ihexxa requested a review from a team August 14, 2024 08:21
results: RequestTestResult[];
}

export const sendActionImp = async ({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original sendAction logic are copied to this imp function although there seems lots of changes below.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit complext, I would like some explanation here on a call. I think it may be a good idea for us to hop on a call to go over all the PR. I will reserve 1-2 hrs time in my evening. Please let me know when you are available.

import { HelpTooltip } from '../components/help-tooltip';
import { Icon } from '../components/icon';
import { Pane, PaneBody, PaneHeader } from '../components/panes/pane';
// import { RequestTestResultPane } from '../components/panes/request-test-result-pane';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some changes are commented out to avoid introducing too many changes.

ihexxa and others added 2 commits August 15, 2024 11:25
…SDK[INS-4298][INS-4299] (#7846)

* Add upload CSV/JSON support for collection runner
* Modify SDK to allow access and modify IterationData
* Fix typos and feedbacks from PR
@marckong
Copy link
Contributor

marckong commented Aug 22, 2024

@ihexxa was running this locally and one thing I noticed is that when you just boot it up, and create a design doc, it restarts the app when navigating to the collection page. Please see the Loom link - https://www.loom.com/share/f6f851ca31964ff2b0bee118c28ecd63?sid=e9a9c9c3-4e18-4852-95b6-2f7c3bc84d6c

Steps to reproduce:
1. run Insomnia locally
2. create a design doc
3. navigate to the collection page

Expected result:
- it should be navigated to Collection page without restarting the app

Actual result:
- it restarts the app
- it stays in the Design page instead of navigating to Collection page

I wonder if this is related to this branch or not.

It happens in the latest dev as well

Copy link
Contributor

@marckong marckong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reviewed this PR without much context. I may need your help to unpack lots of things as the collection runner is complex scope. I suggest we hop on a call to go over each PR in order of your suggestion.

@@ -30,7 +30,7 @@ import { ImportModal } from '../modals/import-modal';
import { WorkspaceDuplicateModal } from '../modals/workspace-duplicate-modal';
import { WorkspaceSettingsModal } from '../modals/workspace-settings-modal';

export const WorkspaceDropdown: FC = () => {
export const WorkspaceDropdown: FC<{}> = () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FC has the default type for its prop, so I think P = {} is not necessary here unless we want to actually pass prop type

@@ -37,3 +36,19 @@ export function completeExecutionStep(requestId: string) {
window.webContents.send(`syncTimers.${requestId}`, { executions: executions.get(requestId) });
}
}

export function updateLatestStepName(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind explaining a bit here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is for updating the timing record in place (in the response pane), as originally it just allows appending records.

@@ -149,7 +150,8 @@ export const loader: LoaderFunction = async ({ params }) => {
invariant(activeWorkspaceMeta, 'Workspace meta not found');
const activeRequestId = activeWorkspaceMeta.activeRequestId;
const activeRequest = activeRequestId ? await models.request.getById(activeRequestId) : null;
if (activeRequest) {
const isDisplayingRunner = request.url.endsWith('/runner') || request.url.endsWith('/runner?test-end');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like to understand more on this url pattern

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is mainly for triggering refreshing when returning from the react router action.

<WorkspaceDropdown />
</Breadcrumb>
<Breadcrumb className="flex text-sm truncate select-none items-center justify-self-end ml-auto mr-2.5 gap-2 text-[--color-font] h-full outline-none data-[focused]:outline-none">
<Icon icon='circle-play' onClick={onRunCollection} className="cursor-pointer" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh i see. It navigates to a different page

results: RequestTestResult[];
}

export const sendActionImp = async ({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit complext, I would like some explanation here on a call. I think it may be a good idea for us to hop on a call to go over all the PR. I will reserve 1-2 hrs time in my evening. Please let me know when you are available.

const [iterationFilePath, setIterationFilePath] = useState<File | undefined>(undefined);

const [direction, setDirection] = useState<'horizontal' | 'vertical'>(settings.forceVerticalLayout ? 'vertical' : 'horizontal');
useEffect(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there another way to do it without useEffect?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is copied from another component for consistent layout behavior, probably it could be deduplicated.
And all content of sendActionImp is copied from the sendAction for reusing. I can introduce it later.

@ihexxa
Copy link
Contributor Author

ihexxa commented Aug 23, 2024

@marckong Let me schedule a sync at sometime.

ihexxa and others added 4 commits August 23, 2024 17:21
* feat:enable serialized script execution

* fix: smoke test failed

* fix: app tests and vite dep optimization

* chore: remove unused line

* fix: some minor fixes (#7864)

* fix: some minor fixes

* fix: lint error
… (#7859)

* check-in for more SDK expose
* fix issues from comment and add unit test
@jackkav
Copy link
Contributor

jackkav commented Aug 26, 2024

Note: abstracts the send action in order to use different exception handling.

cwangsmv and others added 3 commits August 27, 2024 16:52
* Fix issues from first round collection runner feedback
* Match last found request with same request name rather than first found request in collection runner
* feat: add result pane for runner with iteration dividers

* feat: enable runner cancellation

* refactor: some minor fixes and enhancements

* fix: minor fixes
@ihexxa ihexxa force-pushed the feat/test-result-pane branch from 3c7a123 to 359b005 Compare August 28, 2024 03:20
@filfreire
Copy link
Member

@ihexxa is this one still needed or we can close it?

@ihexxa
Copy link
Contributor Author

ihexxa commented Sep 2, 2024

@filfreire It is no longer needed, let me close it.

@ihexxa ihexxa closed this Sep 2, 2024
@jackkav jackkav deleted the feat/runner-pr-1 branch January 29, 2025 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants