Skip to content

Feat show testplane config in ui - #806

Open
sonic16x wants to merge 4 commits into
masterfrom
testplane-config-ui
Open

Feat show testplane config in ui#806
sonic16x wants to merge 4 commits into
masterfrom
testplane-config-ui

Conversation

@sonic16x

@sonic16x sonic16x commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Now you can see testplane config in Info section of sidebar menu.

Screenshot 2026-09-11 at 06 34 00

@sonic16x
sonic16x force-pushed the testplane-config-ui branch from 27f793c to acd5867 Compare September 7, 2026 16:04
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

✅ Component tests succeed

Report

@sonic16x
sonic16x force-pushed the testplane-config-ui branch from acd5867 to 320a644 Compare September 7, 2026 16:10
@pkg-pr-new

pkg-pr-new Bot commented Sep 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/html-reporter@806

commit: 09da993

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

✅ E2E tests succeed

Report

@sonic16x
sonic16x force-pushed the testplane-config-ui branch 3 times, most recently from 953d4ff to 98d3f1a Compare September 8, 2026 19:12

@shadowusr shadowusr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Exceptionally wonderful and long-awaited feature! 🔥

I've listed a couple of issues in comments, though, that would be nice to fix.

Comment thread lib/adapters/tool/testplane/index.ts Outdated
this._config = TestplaneConfigAdapter.create(this._tool.config);
this._browserConfigs = _.map(this._config.browserIds, (id) => this._config.getBrowserConfig(id));
this._htmlReporter = HtmlReporter.create(this._reporterConfig, {toolName: ToolName.Testplane});
this._htmlReporter.testplaneConfig = this._config.getUserConfig();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do we name this field testplaneConfig? I see that currently we support only Testplane, but nothing stops us of adding this feature to other tools as well. I would give it a generic name, like toolConfig or userConfig, etc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed, toolConfig now

hasCloseButton={true}
onClose={(): void => setIsOpen(false)}
>
<Dialog.Header caption={'Testplane config'}/>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This results in an inconsistent text style, let's use either panel heading style or section heading style:

Image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Comment thread lib/adapters/config/testplane.ts Outdated
import type {ConfigAdapter} from './';
import type {TestplaneTestAdapter} from '../test/testplane';

export const maskTokenValues = (value: unknown): unknown => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm, I see a pretty important issue here:

  • we only look at the field name over here, "token", specifically
  • if user has sensitive data in any other field, they have absolutely zero way to fix that

So, with this update, we unconditionally expose sensitive data in all fields not named "token" and user has no way to fix this.

I see two ways of improving this:

  1. Look not only at the field name, but at the contents, too, for example strings containing y1__, AQAD, etc.

  2. Provide a way for users to customize this behavior, either turn it off completely or provide their own sanitizer. We should think hard, what's best in this case: trying to avoid adding too many difficult to use options yet providing an escape hatch if user needs it.

We can also look how other providers solve this, for example, pwt.

And this 100% should be tested on large projects, to check that at least for them, it works out of the box.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed, added new func secretConfigFilter, user can configure it, but by default used internal filter for keys token, secret etc...

Comment thread lib/adapters/config/testplane.ts Outdated
return this._config.forBrowser(browserId);
}

getUserConfig(): Record<string, unknown> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think configPath should not be displayed as part of the config object. Because it's not actually in user config, it's a side-effect of how we work with config. But it's actually a good idea to display it as a separate field in the dialog!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed, now separate filed in ui

Comment thread lib/adapters/config/testplane.ts Outdated
}

// eslint-disable-next-line @typescript-eslint/no-var-requires
const configModule: unknown = require(path.resolve(this._config.configPath));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmmm, this discards all env and CLI args overrides.

In fact, simply return maskTokenValues(this._config.serialize()) as Record<string, unknown>; gives a more correct config, doesn't it?

It gives a fully resolved config, with all values filled, including unchanged defaults. Yes, it's pretty long, but probably much more useful? And we could post-process it to make it smaller, for example, by omitting values inside browser specifications if they match root level values, etc.

We can discuss in a team chat, if you want.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

First I did it, but config with default values too big, and as I think we want see only user config

</Button>
</div>
<div className={classNames(styles.config, {[styles.breakLines]: breakLines})}>
<JsonNode value={config} depth={0} areAllNestedExpanded={areAllNestedExpanded}/>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

While I don't suggest fixing it right away, but it's just sad that we have 3 different code block styles across the report: this one, error stack traces, and critical error stack traces :(

At some point, it would be nice to unify them.

@shadowusr

Copy link
Copy Markdown
Member

Also, let's add at least a couple of e2e tests on this new feature. They should be honest, representing how users would interact with the app. For example open config and check that it contains expected values.

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.

2 participants