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

LMBQ-323: Adding OS based visual verification option #368

Merged
merged 5 commits into from May 13, 2024
Merged

Conversation

DemeSzabolcs
Copy link
Member

@DemeSzabolcs DemeSzabolcs commented May 11, 2024

…nsions.cs

Co-authored-by: Zoltán Máté <99020631+MZole@users.noreply.github.com>
@MZole MZole merged commit 798b78a into dev May 13, 2024
1 check passed

if (checkOS)
{
var oS = OperatingSystem.IsWindows() ? "Windows" : "Unix";
Copy link
Member

Choose a reason for hiding this comment

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

There are more than two OSes ;). Also, didn't we have something similar already?

Copy link
Member Author

Choose a reason for hiding this comment

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

I will correct the variable name. We had something similiar, but insted of using this configuration, in multiple places, I added it here with a bool this way it's DRY. If you look at the OSOCE PR now it's just this bool, instead of the configuration, also in our private project.

Copy link
Member

Choose a reason for hiding this comment

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

Ah OK, good! It's not about the variable name, but that this only supports Windows and *nix, both of which can have many different editions, and the latter can contain Linux and Mac OS (among others) too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, but we don't have a use case in any project, where we would differentiate between OS verions, or Mac OS, so that would just add unnecessary complexities for now.

Copy link
Member

Choose a reason for hiding this comment

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

It's simply incorrect. It's not that every OS that is not Windows is Unix. This feature thus have a limited use case, because if we want to do anything more fine grained, which includes multiple distros of Linux, then we'll need to change this. Suffixing with the OS name would be better, for example.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can check for the whole OS name and version, but in that case, the VV test will fail locally, if the user does not have the same version as the CI. For example, somebody uses Windows 11, and tests are running on Windows 10.

Copy link
Member

Choose a reason for hiding this comment

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

Now I checked the code, and we have WithUsePlatformAsSuffix() for this (see

for an example). That should be used and this new implementation removed.

If you want to have a shortcut for that, you can add something like an AssertVisualVerificationApprovedWithPlatformSuffix() that uses that by default, but there's no need for a new distinguishing logic.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, I checked the generated suffixes with this. It matches with the local ones (Win32NT).

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.

None yet

3 participants