Skip to content

Commit

Permalink
Merge branch 'release/0.0.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackjacx committed Aug 31, 2021
2 parents 7a92d49 + b8b0001 commit 3563cb9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## [Unreleased]

## [0.0.9] - 2021-08-31Z
* Add more log statements - [@blackjacx](https://github.com/blackjacx).

## [0.0.8] - 2021-08-30Z
* Specify zipFileName for Snap (https://github.com/Blackjacx/Assist/commit/a10d0f9f561de2d62d1aceace20a09a4a13a503a) - [@blackjacx](https://github.com/blackjacx).

Expand Down
17 changes: 15 additions & 2 deletions Sources/Core/Simulator/Simctl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,33 @@ public extension Simctl {
return deviceIDs
}

static func killAllSimulators(logInset: Int = 0) {
Logger.shared.info("Killing all open simulators", inset: logInset)

run(bash: "killall Simulator")
run(bash: "killall iPhone Simulator")
}

static func createDevice(name: String, id: String, runtime: Runtime) throws -> String {
Logger.shared.info("Create device \(id) with name \"\(name)\" and runtime \(runtime)", inset: 1)

let deviceId = try Simctl.createDevice(name: name, id: id, runtime: runtime)
return deviceId
}

static func updateStyle(_ style: Style, deviceIds: [String]) throws {
try deviceIds.forEach {
Logger.shared.info("Set style \(style) for devices \(deviceIds)", inset: 1)

try _boot(deviceId: $0)
try _setAppearance(for: $0, style: style)
}
}

static func updateStatusBar(deviceIds: [String]) throws {
try deviceIds.forEach {
Logger.shared.info("Set statusbar for devices \(deviceIds)", inset: 1)

try _boot(deviceId: $0)
try _updateStatusBar(deviceId: $0)
}
Expand All @@ -93,7 +106,7 @@ public extension Simctl {
let screensURL = currentURL.appendingPathComponent("screens")
let testPlanName = "\(scheme)-Screenshots"

Logger.shared.info("Running test plan for scheme '\(scheme)' and style '\(style)'. Test plan name expected: \(testPlanName)", inset: 1)
Logger.shared.info("Running test plan '\(testPlanName)' for scheme '\(scheme)' and style '\(style)'", inset: 1)

// This command just needs the binaries and the path to the xctestrun file created before the actual
// testing. There everything can be configured to run the tests without needing the source code,
Expand All @@ -106,7 +119,7 @@ public extension Simctl {
testPlan: testPlanName,
resultsBundleURL: resultsBundleURL)

Logger.shared.info("Extracting screenshots from xcresult bundle '\(resultsBundleURL.path)' for scheme '\(scheme)' and style '\(style)'", inset: 1)
Logger.shared.info("Extracting screenshots from xcresult bundle '\(resultsBundleURL.path)' for scheme '\(scheme)' and style '\(style)'", inset: 2)

try FileManager.default.createDirectory(at: screensURL, withIntermediateDirectories: true, attributes: nil)
try Mint.screenshots(resultsBundleURL: resultsBundleURL, screensURL: screensURL)
Expand Down
3 changes: 1 addition & 2 deletions Sources/Snap/commands/sub/Run.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ extension Snap {
"""
Logger.shared.info(configMessage)

Logger.shared.info("Killing all open simulators")
SwiftShell.run("killall", ["simulator"])
Simctl.killAllSimulators()

Logger.shared.info("Finding runtime for platform \(platform)")
let runtime = try Simctl.runtimeForPlatform(platform)
Expand Down

0 comments on commit 3563cb9

Please sign in to comment.