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: support stress testing #1031

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

feat: support stress testing #1031

wants to merge 7 commits into from

Conversation

swiftqwq
Copy link
Member

@swiftqwq swiftqwq commented Jan 1, 2022

Description

Support stress testing.

Related Issues / Pull Requests

Closes #917

Motivation and Context

How Has This Been Tested?

macOS 12.0.1

Screenshots (if appropriate)

Screen.Recording.2022-01-01.at.8.42.27.PM.mov

Checklist

  • If the key of a setting is changed, the old attribute is updated or it is resolved in SettingsUpdater.
  • If there are changes of the text displayed in the UI, they are wrapped in tr() or QCoreApplication::translate().
  • If needed, I have opened a pull request or an issue to update the documentation.
  • If these changes are notable, they are documented in CHANGELOG.md.

Additional text

It is almost the same as Polygon's, so only testilb style generators are supported.

Copy link
Member

@coder3101 coder3101 left a comment

Choose a reason for hiding this comment

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

Awesome! Left some comments please provide your feedback

src/Widgets/StressTesting.cpp Outdated Show resolved Hide resolved
src/Widgets/StressTesting.cpp Outdated Show resolved Hide resolved
src/Widgets/StressTesting.cpp Outdated Show resolved Hide resolved
in = out;

QString language = mainWindow->getLanguage();
stdRunner = new Core::Runner(1);
Copy link
Member

Choose a reason for hiding this comment

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

You can modify or inherit from Runner a class StressRunner and move these logic inside it. That way you can also change enum types.

Copy link
Member Author

Choose a reason for hiding this comment

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

Why do we need a new class?

Copy link
Member

Choose a reason for hiding this comment

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

If you make SourceType as enum class it cannot be implicitly converted to int type. Runner takes an int argument hence to make it work you might have to inherit it. Since you used normal enum its fine.

Comment on lines +279 to +282
if (compiledCount == 3)
{
nextTest();
}
Copy link
Member

Choose a reason for hiding this comment

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

Could there be a better way for it?

@swiftqwq swiftqwq added the work in progress The work has been started and is in progress. label Jan 2, 2022
@ouuan
Copy link
Member

ouuan commented Feb 16, 2022

I haven't tested it at local yet. But from the screen record, it seems that more features are needed to make it more useful than a shell script. See #162 (comment).

  • A button to add the counterexample in the test cases.
  • Be able to choose gen and std from editor tabs (as well as local files).
  • Be able to use a code template dedicated to generators.

It is almost the same as Polygon's, so only testilb style generators are supported.

By "testlib style", do you mean generators that take command-line arguments? I don't think we need to force this style. Now we provide the Polygon functionality to feed random arguments to the generator, and testlib-style generators can make use of these arguments. But the user can keep the arguments empty and generate different test cases with the same empty arguments. And if we don't restrict the style, we can also support Python/Java generators.

@anHiep anHiep mentioned this pull request Mar 11, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
work in progress The work has been started and is in progress.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stress testing
3 participants