-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI for UI Tests Infrastructure Update (#88)
CLOSE https://linear.app/sourcegraph/issue/CODY-2816/ci-for-visual-studio-integration-tests-based-on-vsixtesting UI Tests infrastructure (`Cody.VisualStudio.Tests`) updated to allow running them, not only locally which were running fine from the very beginning, but also using GitHub Actions. ### Fixed threading issues only seen in GitHub Actions: - VsixTesting runner exception: `Call was Rejected By Callee` ([more about it](https://learn.microsoft.com/en-us/previous-versions/ms228772(v=vs.140)?redirectedfrom=MSDN)), caused PlaywrightTestsBase.InitializeAsync() was called multiple times, which internally tries to call VS API, when XUnit was creating instances of all involved test classes - Removed calls to VS API from TestBase constructor, which have the same effect as above ### Other Updates - Added logging via XUnit logger, which calls our Logger internally and gives us detailed logs from tests (including all logs that are logged in the VS Cody output pane during run-time) - Getting IDE to the front when "Start Window" appears (call to DismissStartWindow()) - WaitForAsync() waits maximum 2 minutes (for the chat loading) - Added CollectionBehavior.CollectionPerAssembly and DisableTestParallelization = true for XUnit Improved PlaywrightTestsBase: - Introduced SemaphoreSlim() for synchronization - Playwright related properties (Browser, Context, Page and Playwright) are now static
- Loading branch information
1 parent
a524ee1
commit c93eb6e
Showing
13 changed files
with
248 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Cake Build | ||
name: Cake Build | ||
|
||
on: | ||
push: | ||
|
@@ -17,6 +17,9 @@ jobs: | |
- name: Add msbuild to PATH | ||
uses: microsoft/[email protected] | ||
|
||
- name: ⚙️ Prepare Visual Studio | ||
run: '&"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.exe" /RootSuffix Exp /ResetSettings General.vssettings' | ||
|
||
- name: Install Cake.Tool | ||
run: dotnet tool install --global Cake.Tool | ||
|
||
|
@@ -31,7 +34,8 @@ jobs: | |
corepack install --global [email protected] | ||
dotnet cake | ||
#- name: Tests | ||
# run: | | ||
# cd src | ||
# dotnet cake --target Tests | ||
- name: Tests | ||
run: | | ||
cd src | ||
dotnet cake --target Tests | ||
dotnet test .\Cody.VisualStudio.Tests\bin\Debug\Cody.VisualStudio.Tests.dll -v detailed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.Runtime.CompilerServices; | ||
|
||
namespace Cody.Core.Logging | ||
{ | ||
public interface ITestLogger | ||
{ | ||
void WriteLog(string message, string type = "", [CallerMemberName] string callerName = ""); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.