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

ci(gui): Add end-to-end test scenarios where GUI plays a role #306

Merged
merged 31 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d2b587e
Allows selecting the Flutter entry point
CarlosNihelton Oct 4, 2023
373f1c9
Allows building the msix in Debug mode
CarlosNihelton Oct 4, 2023
02e25eb
Sync stdio if attaching to a parent console app
CarlosNihelton Sep 29, 2023
851741f
FlutterWindow to be notified of test completion
CarlosNihelton Oct 4, 2023
ed38b26
Implements the Flutter automation for e2e
CarlosNihelton Oct 4, 2023
b7956cb
Moves some test utilities for sharing
CarlosNihelton Oct 4, 2023
fbe5497
Implements getCurrentFuncName
CarlosNihelton Oct 4, 2023
92628a0
Allows CLI args and env overrides to startAgent
CarlosNihelton Oct 4, 2023
15c14e2
Updates org token test to use the CLI arg
CarlosNihelton Oct 4, 2023
87226c0
Implements the manual token input test case
CarlosNihelton Oct 4, 2023
a2c9191
Corrects the path of the built artifacts
CarlosNihelton Oct 4, 2023
54e7aae
Hard coded pat to VCLibs Debug appx
CarlosNihelton Oct 4, 2023
0b32a40
getCurrentFuncName() not needed due t.Name()
CarlosNihelton Oct 6, 2023
3ac6d0e
Ensures the same wait time on both test paths
CarlosNihelton Oct 6, 2023
45046f7
Reduces the amount of time sleeping
CarlosNihelton Oct 6, 2023
3a2f6b5
Print journal only if test failed
CarlosNihelton Oct 6, 2023
339e39b
CI now builds both Debug and Release modes in matrix
CarlosNihelton Oct 6, 2023
bae0864
OverrideEntrypoint property to recognize 'false'
CarlosNihelton Oct 6, 2023
003b7ed
Updates the build Appx tool to support build modes
CarlosNihelton Oct 6, 2023
c2fe805
Updates installation docs
CarlosNihelton Oct 6, 2023
cfec9cb
Fix grammar in the download artifacts step comment
CarlosNihelton Oct 6, 2023
2fce225
Setup debug vclibs to its own step
CarlosNihelton Oct 6, 2023
800bfb3
Leave download artifacts without the 'name' parameter
CarlosNihelton Oct 6, 2023
072b42a
Remove .deb and .msix* extensions in install doc
CarlosNihelton Oct 6, 2023
61e6ee2
Context as parameter for distroIsProAttached()
CarlosNihelton Oct 6, 2023
a4ecd04
Fix Debug vs Release logic in the msix build
CarlosNihelton Oct 6, 2023
3aa4177
Del tasks.json commited by mistake :)
CarlosNihelton Oct 9, 2023
f85c2a1
Restores time.Sleep in the no-attach case.
CarlosNihelton Oct 9, 2023
9090edd
Only logs journal from the current boot
CarlosNihelton Oct 11, 2023
a84f602
Unify 15s timeout in the end of tests
CarlosNihelton Oct 9, 2023
d394180
30s max timeout
CarlosNihelton Oct 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions end-to-end/manual_token_input_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,16 @@ func TestManualTokenInput(t *testing.T) {

maxTimeout := 15 * time.Second
if !tc.wantAttached {
time.Sleep(maxTimeout)
attached, err := distroIsProAttached(t, d)
proCtx, cancel := context.WithTimeout(ctx, 5*time.Second)
defer cancel()
attached, err := distroIsProAttached(t, proCtx, d)
require.NoError(t, err, "could not determine if distro is attached")
EduardGomezEscandell marked this conversation as resolved.
Show resolved Hide resolved
require.False(t, attached, "distro should not have been Pro attached")
return
}

require.Eventually(t, func() bool {
attached, err := distroIsProAttached(t, d)
attached, err := distroIsProAttached(t, ctx, d)
if err != nil {
t.Logf("could not determine if distro is attached: %v", err)
}
Expand Down
6 changes: 4 additions & 2 deletions end-to-end/organization_token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,16 @@ func TestOrganizationProvidedToken(t *testing.T) {

if !tc.wantAttached {
time.Sleep(maxTimeout)
attached, err := distroIsProAttached(t, d)
proCtx, cancel := context.WithTimeout(ctx, 5*time.Second)
defer cancel()
attached, err := distroIsProAttached(t, proCtx, d)
require.NoError(t, err, "could not determine if distro is attached")
require.False(t, attached, "distro should not have been Pro attached")
return
}

require.Eventually(t, func() bool {
attached, err := distroIsProAttached(t, d)
attached, err := distroIsProAttached(t, ctx, d)
if err != nil {
t.Logf("could not determine if distro is attached: %v", err)
}
Expand Down
6 changes: 2 additions & 4 deletions end-to-end/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,10 @@ func stopAgent(ctx context.Context) error {
return fmt.Errorf("could not stop process %q: %v. %s", process, err, out)
}

func distroIsProAttached(t *testing.T, d wsl.Distro) (bool, error) {
//nolint:revive // testing.T must precede the context
func distroIsProAttached(t *testing.T, ctx context.Context, d wsl.Distro) (bool, error) {
t.Helper()

ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()

out, err := d.Command(ctx, "pro status --format=json").Output()
if err != nil {
return false, fmt.Errorf("could not call pro status: %v. %s", err, out)
Expand Down
Loading