Skip to content

Clean up functional test MacTODO categories and Windows-only option#421

Merged
derrickstolee merged 5 commits intomicrosoft:mainfrom
chrisd8088:func-test-cleanups
Aug 17, 2020
Merged

Clean up functional test MacTODO categories and Windows-only option#421
derrickstolee merged 5 commits intomicrosoft:mainfrom
chrisd8088:func-test-cleanups

Conversation

@chrisd8088
Copy link
Contributor

Prior to starting work to support runs of the functional test suite on Linux, we can simplify some of the tests marked MacTODO as no longer needing that designation and also simplify some of the Windows-related configuration and options.

On the Windows side of thing, we can remove the second invocation of excludeCategories.Add(Categories.MacOnly) because it is always performed on Windows in the if/else block just above it.

We also only parse the --windows-only functional test command-line option when running on Windows, as it has no effect on macOS since the WindowsOnly tests are always excluded there.

On the macOS side of things, there is one test still marked MacTODO.NeedsServiceVerb which appears to have been missed in PR #216, where that category was removed from many other tests. This SecondCloneSucceedsWithMissingTrees test succeeds on macOS as written, so it seems OK to remove the MacTODO flag on it.

The other macOS change we make is to remove the MacTODO.NeedsScalarConfig category, which currently applies to all the tests in MultiEnlistmentTests/ConfigVerbTests.cs. These tests are also marked with NeedsUpdatesForNonVirtualizedMode and therefore will continue to not run even after this change. (However, limited testing by disabling the config verb's "elevated privileges" checks and removing NeedsUpdatesForNonVirtualizedMode from the ConfigVerbTests indicates that, in fact, these tests would all succeed on macOS/Linux with some further adjustments. But for now we just remove the "extra" MacTODO exclusion on these tests.)

These two changes allow us to remove two of the three MacTODO categories entirely.

We also do minor housekeeping by fixing one typo in the Watchman shutdown-server command.

When the temporary clear() calls were removed from the
functional test category lists in PR microsoft#50 (see commit
7e67496), this following
block to re-exclude tests marked MacOnly became redundant,
so we can remove it now.
In PR microsoft#216 extensive work was done to remove some of the repository
registry support of the Scalar service, and many tests no longer
required the MacTODO.NeedsServiceVerb category flag and could be
successfully executed on the Mac.

One test which appears to have been missed was the
SecondCloneSucceedsWithMissingTrees() test in SharedCacheTests.cs;
however, it also succeeds on the Mac now and so we can remove
this functional test category entirely.
In the VFSForGit project, support for upgrading was added in
stages, and at first the Mac platform did not have a full
implementation of the local config class and "config" verb,
so the relevant tests were marked to be excluded on the Mac.

Subsequently, full support for the "config" verb was added,
but the tests were not enabled on the Mac.  So this test
category is no longer meaningful, and the tests would succeed
on the Mac if several other changes were made (i.e., the
NeedsUpdatesForNonVirtualizedMode category was also removed
from these tests, and the functional test suite is run as
root).

While there may not be an intention to ever run these tests,
at a minimum we can simplify the test configuration by
removing this category.

See microsoft/VFSForGit@77fa996
and microsoft/VFSForGit@7511528.
The --windows-only functional test command-line option causes
only tests in the WindowsOnly category to be run; since this
makes sense on Windows exclusively, we move the parsing of this
command-line argument into a Windows-only block, so it will be
ignored on other platforms.
// Shutdown the watchman server now that the tests are complete.
// Allows deleting the unwatched directories.
ProcessHelper.Run("watchman", "shudown-server");
ProcessHelper.Run("watchman", "shutdown-server");
Copy link
Contributor

Choose a reason for hiding this comment

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

👀 Good find!

@derrickstolee derrickstolee merged commit 245d7ee into microsoft:main Aug 17, 2020
@chrisd8088 chrisd8088 deleted the func-test-cleanups branch August 17, 2020 17:30
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