8000 Fix unsaved in progress reports by iSevenDays · Pull Request #605 · danielpaulus/go-ios · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix unsaved in progress reports #605

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions ios/testmanagerd/testlistener.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ func (t *TestListener) TestRunnerKilled() {
}

func (t *TestListener) FinishWithError(err error) {
if t.runningTestSuite != nil {
t.TestSuites = append(t.TestSuites, *t.runningTestSuite)
t.runningTestSuite = nil
}
t.err = err
t.executionFinished()
}
Expand Down
13 changes: 13 additions & 0 deletions ios/testmanagerd/testlistener_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package testmanagerd

import (
"errors"
"io"
"os"
"sync"
Expand Down Expand Up @@ -148,6 +149,18 @@ func TestFinishExecutingTestPlan(t *testing.T) {
testListener.testCaseDidStartForClass("mysuite", "mymethod")
testListener.testCaseDidFinishForTest("mysuite", "mymethod", "passed", 1.0)

t.Run("Check running test suite is saved on FinishWithError", func(t *testing.T) {
testListener := NewTestListener(io.Discard, io.Discard, os.TempDir())

testListener.testSuiteDidStart("mysuite", "2024-01-16 15:36:43 +0000")
testListener.testCaseDidStartForClass("mysuite", "mymethod")
testListener.FinishWithError(errors.New("test error"))

assert.Equal(t, 1, len(testListener.TestSuites))
assert.Equal(t, "mysuite", testListener.TestSuites[0].Name)
assert.Equal(t, 1, len(testListener.TestSuites[0].TestCases))
})

assert.Equal(t, 1, len(testListener.runningTestSuite.TestCases), "TestCase must be appended to list of test cases")
assert.Equal(t, TestCaseStatus("passed"), testListener.runningTestSuite.TestCases[0].Status)
assert.Equal(t, 1.0, testListener.runningTestSuite.TestCases[0].Duration.Seconds())
Expand Down
2 changes: 1 addition & 1 deletion ios/testmanagerd/xcuitestrunner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func signAndInstall(device ios.DeviceEntry) error {
svc, _ := installationproxy.New(device)
response, err := svc.BrowseUserApps()
for _, info := range response {
if bundleId == info.CFBundleIdentifier {
if bundleId == info.CFBundleIdentifier() {
log.Info("wda installed, skipping installation")
return nil
}
Expand Down
0