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

Preserve logs from retries as they have data! #19341

Merged
merged 1 commit into from Dec 12, 2023
Merged

Preserve logs from retries as they have data! #19341

merged 1 commit into from Dec 12, 2023

Conversation

mattleibow
Copy link
Member

@mattleibow mattleibow commented Dec 11, 2023

Description of Change

Some logs have valuable data, so make sure to give them a unique name.

Part of #19038

Comment on lines +18 to +22
public interface IScreenshotSupportedApp : IApp
{
FileInfo Screenshot(string fileName);
byte[] Screenshot();
string ElementTree { get; }
}
Copy link
Member Author

Choose a reason for hiding this comment

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

"optional APIs" should not be forced on the core testing IApp. Things like device logs and screenshots are only available on some platforms and in somace situations.

Comment on lines -52 to 38
string filename = $"{fileName}.png";
Screenshot screenshot = _driver.GetScreenshot();
Copy link
Member Author

Choose a reason for hiding this comment

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

Don't force the .png here (even though it is a png) since this makes the other part of the code hard to reuse.

Comment on lines +127 to +128
string? GetGeneratedFilePath(string filename, string? note = null)
{
Copy link
Member Author

Choose a reason for hiding this comment

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

This new method makes sure to get a new filename per run so that all logs are preserved.

Copy link
Member

Choose a reason for hiding this comment

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

But can we have a way to pass the guid from the cake? so we can map to what is on ci ui display name?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure, there might be multiple guids per run. If the test run crashes or appium somehow needs a restart, then we may have 2 items per single cake run.

@mattleibow mattleibow added area-testing Unit tests, device tests testing-flakiness labels Dec 11, 2023
@mattleibow mattleibow enabled auto-merge (squash) December 11, 2023 21:59
Copy link
Member

@BretJohnson BretJohnson left a comment

Choose a reason for hiding this comment

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

LGTM, which the exception of the terminology thing I mentioned

src/TestUtils/src/UITest.NUnit/UITestBase.cs Outdated Show resolved Hide resolved
@mattleibow mattleibow merged commit 3c7b652 into main Dec 12, 2023
47 checks passed
@mattleibow mattleibow deleted the dev/uitests branch December 12, 2023 17:22
@github-actions github-actions bot locked and limited conversation to collaborators Jan 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing Unit tests, device tests testing-flakiness
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants