From ba4a9de407eede9e91c47ba2a1a101ccd970bcca Mon Sep 17 00:00:00 2001 From: Caleb Kleveter Date: Wed, 3 Oct 2018 16:46:43 -0500 Subject: [PATCH 1/8] swift package update --- Package.resolved | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Package.resolved b/Package.resolved index df54258..893637d 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/vapor/core.git", "state": { "branch": null, - "revision": "ad776ec35f0a811672128eaf796fb3de10a46d3f", - "version": "3.4.2" + "revision": "eb876a758733166a4fb20f3f0a17b480c5ea563e", + "version": "3.4.3" } }, { @@ -15,8 +15,8 @@ "repositoryURL": "https://github.com/vapor/crypto.git", "state": { "branch": null, - "revision": "4b85405430df1892ee3aa1554bdb477e96cf46ad", - "version": "3.2.0" + "revision": "5605334590affd4785a5839806b4504407e054ac", + "version": "3.3.0" } }, { @@ -42,8 +42,8 @@ "repositoryURL": "https://github.com/vapor/http.git", "state": { "branch": null, - "revision": "f3641659867edfa7db1a939d1e38ece7f3766e25", - "version": "3.1.2" + "revision": "272b22be8cb3364e42a4701c2e0676e37480ec5a", + "version": "3.1.5" } }, { @@ -87,8 +87,8 @@ "repositoryURL": "https://github.com/apple/swift-nio.git", "state": { "branch": null, - "revision": "f42c836ba58e3e38688acdb75df986dff02717f1", - "version": "1.9.4" + "revision": "5d8148c8b45dfb449276557f22120694567dd1d2", + "version": "1.9.5" } }, { @@ -96,8 +96,8 @@ "repositoryURL": "https://github.com/apple/swift-nio-ssl.git", "state": { "branch": null, - "revision": "6617eb0d3afcb12170594968df01ca63afb58ac5", - "version": "1.2.0" + "revision": "8380fa29a2af784b067d8ee01c956626ca29f172", + "version": "1.3.1" } }, { @@ -132,8 +132,8 @@ "repositoryURL": "https://github.com/vapor/url-encoded-form.git", "state": { "branch": null, - "revision": "cbfe7ef6301557d3f2d0807a98165232ae06e1c6", - "version": "1.0.4" + "revision": "932024f363ee5ff59059cf7d67194a1c271d3d0c", + "version": "1.0.5" } }, { @@ -150,8 +150,8 @@ "repositoryURL": "https://github.com/vapor/vapor.git", "state": { "branch": null, - "revision": "54632a6c1e7ecd9923c0d00b612de936de1c4745", - "version": "3.0.8" + "revision": "157d3b15336caa882662cc75024dd04b2e225246", + "version": "3.1.0" } }, { @@ -159,8 +159,8 @@ "repositoryURL": "https://github.com/vapor/websocket.git", "state": { "branch": null, - "revision": "141cb4d3814dc8062cb0b2f43e72801b5dfcf272", - "version": "1.0.1" + "revision": "149af03348f60ac8b84defdf277112d62fd8c704", + "version": "1.0.2" } }, { From 402a63ff583136a1788aed6ace0b7beaa2e8f409 Mon Sep 17 00:00:00 2001 From: Caleb Kleveter Date: Wed, 3 Oct 2018 16:48:23 -0500 Subject: [PATCH 2/8] Fixed release page used for uploading executable --- publish.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/publish.sh b/publish.sh index 90de0ea..8e655ed 100644 --- a/publish.sh +++ b/publish.sh @@ -32,7 +32,7 @@ cp .build/release/Executable ./$PACKAGE_NAME/$EXEC_NAME tar -cvzf macOS-sierra.tar.gz ./$PACKAGE_NAME HASH=$(shasum -a 256 macOS-sierra.tar.gz | cut -d " " -f 1) -echo "📦 Drag and drop $PWD/macOS-sierra.tar.gz into https://github.com/vapor/toolbox/releases/edit/$TAG" +echo "📦 Drag and drop $PWD/macOS-sierra.tar.gz into https://github.com/Ether-CLI/Ether/releases/edit/$TAG" while true; do read -p "Have you finished uploading? [y/n]" yn From 50ce6f99ed56f5ed681b6439a7930f139b3b9a5e Mon Sep 17 00:00:00 2001 From: Caleb Kleveter Date: Tue, 9 Oct 2018 17:37:29 -0500 Subject: [PATCH 3/8] Renamed ISSUE_TEMPLATE file to ISSUE_TEMPLATE.md --- .github/{ISSUE_TEMPLATE => ISSUE_TEMPLATE.md}/issue_template.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{ISSUE_TEMPLATE => ISSUE_TEMPLATE.md}/issue_template.md (100%) diff --git a/.github/ISSUE_TEMPLATE/issue_template.md b/.github/ISSUE_TEMPLATE.md/issue_template.md similarity index 100% rename from .github/ISSUE_TEMPLATE/issue_template.md rename to .github/ISSUE_TEMPLATE.md/issue_template.md From bdc720e3626d89605204bbe803fe695f68754d49 Mon Sep 17 00:00:00 2001 From: Caleb Kleveter Date: Tue, 9 Oct 2018 17:39:54 -0500 Subject: [PATCH 4/8] Moved CODE_OF_CONDUCT.md file to .github directory --- CODE_OF_CONDUCT.md => .github/CODE_OF_CONDUCT.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename CODE_OF_CONDUCT.md => .github/CODE_OF_CONDUCT.md (100%) diff --git a/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md similarity index 100% rename from CODE_OF_CONDUCT.md rename to .github/CODE_OF_CONDUCT.md From 6df53855b16a84c30a7c14010402e5588d32ca71 Mon Sep 17 00:00:00 2001 From: Caleb Kleveter Date: Fri, 12 Oct 2018 16:20:52 -0500 Subject: [PATCH 5/8] Added '--case' flag to Test command, for specifying a test case to run --- Sources/Ether/Test.swift | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Sources/Ether/Test.swift b/Sources/Ether/Test.swift index c9f5630..0fd331f 100644 --- a/Sources/Ether/Test.swift +++ b/Sources/Ether/Test.swift @@ -27,6 +27,12 @@ public final class Test: Command { public var arguments: [CommandArgument] = [] public var options: [CommandOption] = [ + CommandOption.value(name: "case", short: "c", help: [ + "Specifies the test case to run. Valid values look like this:", + "- `EtherTests`", + "- `EtherTests.EtherTests`", + "- `EtherTests.EtherTests.testSomething" + ]), CommandOption.flag(name: "verbose", short: "v", help: ["Outputs raw stdout from `swift test`"]), CommandOption.flag(name: "release", short: "r", help: ["Runs tests in release mode"]) ] @@ -36,8 +42,19 @@ public final class Test: Command { public init() {} public func run(using context: CommandContext) throws -> EventLoopFuture { + var command = ["test"] + if let `case` = context.options["case"] { + let filters = `case`.split(separator: ".").map(String.init) + if filters.count < 3 { + command.append(contentsOf: ["--filter", `case`]) + } else { + let filter = filters[0] + "." + filters[1] + "/" + filters[2] + command.append(contentsOf: ["--filter", filter]) + } + } + let stdout = self.output() - let exit = Process.asyncExecute("swift", "test", on: context.container) { output in + let exit = Process.asyncExecute("swift", command, on: context.container) { output in switch output { case let .stdout(data): self.log(data, on: context, with: stdout) case let .stderr(data): self.log(data, on: context, with: stdout) From 19bb97e27c24f00eca47d648d5c4d4b488ba7b19 Mon Sep 17 00:00:00 2001 From: Caleb Kleveter Date: Fri, 12 Oct 2018 16:22:22 -0500 Subject: [PATCH 6/8] Added '--case' entry to CHANGELOG --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 76e6e19..837626f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [2018.X.X] + +### Added +- `--case` flag to the `test` command, to specify which test case to run. + ## [2018.10.03] ### Added From 2667c982e57d61dde3760f79e001a512345e119a Mon Sep 17 00:00:00 2001 From: Caleb Kleveter Date: Fri, 12 Oct 2018 16:22:55 -0500 Subject: [PATCH 7/8] Created EtherTests test target --- Package.swift | 3 ++- Tests/EtherTests/EtherTests.swift | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 Tests/EtherTests/EtherTests.swift diff --git a/Package.swift b/Package.swift index a232b12..a2d3b74 100644 --- a/Package.swift +++ b/Package.swift @@ -18,6 +18,7 @@ let package = Package( targets: [ .target(name: "Helpers", dependencies: ["Core", "Console"]), .target(name: "Ether", dependencies: ["Vapor", "Helpers", "Console", "Command", "Manifest", "Core", "Xgen"]), - .target(name: "Executable", dependencies: ["Vapor", "Ether", "Console"]) + .target(name: "Executable", dependencies: ["Vapor", "Ether", "Console"]), + .testTarget(name: "EtherTests", dependencies: ["Ether", "Executable"]) ] ) diff --git a/Tests/EtherTests/EtherTests.swift b/Tests/EtherTests/EtherTests.swift new file mode 100644 index 0000000..0b88705 --- /dev/null +++ b/Tests/EtherTests/EtherTests.swift @@ -0,0 +1,26 @@ +@testable import Ether +import XCTest + +class EtherTests: XCTestCase { + func testPrint() { + print("hello") + } + + static var allTests: [(String, (EtherTests) -> ()throws -> ())] { + return [ + ("testPrint", testPrint) + ] + } +} + +class AnotherTests: XCTestCase { + func testOut() { + print("bye") + } + + static var allTests: [(String, (AnotherTests) -> ()throws -> ())] { + return [ + ("testOut", testOut) + ] + } +} From c868179ee7f50f806e684e7d12e2d7962f2fcc9c Mon Sep 17 00:00:00 2001 From: Caleb Kleveter Date: Sat, 1 Dec 2018 17:05:05 -0600 Subject: [PATCH 8/8] Added 'brew update' call to publish script if Homebrew is installed --- publish.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/publish.sh b/publish.sh index 8e655ed..cf3c968 100644 --- a/publish.sh +++ b/publish.sh @@ -1,8 +1,23 @@ +if brew gdate 2>/dev/null; then + echo "🍺 Updating Homebrew Formulae" + brew upgrade +else + echo "Make sure you have the latest version of LibreSSL installed" + + while true; do + read -p "Continue? [Y/n]" yn + case $yn in + [Yy]* ) break;; + [Nn]* ) exit;; + * ) echo "Please answer yes or no.";; + esac + done +fi + echo "📦 Updating Swift packages..." swift package update swift package resolve - echo "📦 Determining latest Git tag..." TAG=$(git describe --abbrev=0 --tags);