Skip to content

Conversation

@Phuong-Le-NN
Copy link
Collaborator

@Phuong-Le-NN Phuong-Le-NN commented Nov 26, 2025

Description

Async test result when one buddy click Run button of Leetcode

Screenshots

image

Test

Click Run code on one buddy and wait a bit to see the Test Result tab filled out on the other.

Checklist

If you're making changes to the extension, please run through the following checklist to make sure that we don't have
any regressions. Note that we plan to add integration tests in the future!

  • Create room and join room on at least 2 browsers
  • Ensure that code and tests are correctly stream
  • Verify that when reloading, user can automatically join the room

Possible Downsides

Additional Documentations

@Phuong-Le-NN Phuong-Le-NN marked this pull request as ready for review November 29, 2025 19:29

const countScrapedResult = testResults.length;

//testResults[0] is the test cases (not test results) most of the time but not always
Copy link
Owner

Choose a reason for hiding this comment

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

If users were to do a print statement, this would mess with the computation right?

Copy link
Owner

Choose a reason for hiding this comment

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

This implementation also currently assumes that we don't have other results type such as runtime errors / memory exceeded, etc. Did you plan to do this as a follow up?

testExpectedOutputs.length !== numCases
) {
console.error(
"Variables are undefined or tests do not match up",
Copy link
Owner

Choose a reason for hiding this comment

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

A bit confusing since the log line is the same as groupTestCases.

}

interface ResultAssignment {
input: Record<string, string>;
Copy link
Owner

Choose a reason for hiding this comment

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

Can we perhaps reuse the same interface? https://github.com/nickbar01234/codebuddy/pull/549/files#diff-96d91a7cf927d8a78ffc02453d6987162a4f8d07c9ffe8c1269a3ee75c168652R13-R16. I also think some problems do not have variables, i.e OOP-related questions

{selected ? (
passed ? (
<button className="bg-fill-3 dark:bg-dark-fill-3 hover:bg-fill-2 dark:hover:bg-dark-fill-2 hover:text-label-1 dark:hover:text-dark-label-1 text-label-1 dark:text-dark-label-1 relative inline-flex items-center whitespace-nowrap rounded-lg px-4 py-1 text-sm font-semibold focus:outline-none">
V Case {idx + 1}
Copy link
Owner

Choose a reason for hiding this comment

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

What is V? May be we can use an icon component instead?

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.

3 participants