Skip to content

Commit 49f1d30

Browse files
Merge pull request #8 from Iterable/feature/ITBL-5386-add-ci-codecov
[ITBL-5386]-add-ci-codecov
2 parents 3662ef3 + 63c7170 commit 49f1d30

File tree

13 files changed

+383
-6
lines changed

13 files changed

+383
-6
lines changed

.codecov.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ignore:
2+
- "Tests"
3+
- "host-app"

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ Pods/
1010

1111
scripts/
1212

13-
dev.config
13+
dev.config
14+
15+
Build/

.travis.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
osx_image: xcode9.4
2+
language: swift
3+
4+
before_install:
5+
- gem install xcpretty xcpretty-travis-formatter
6+
7+
script:
8+
- xcodebuild test -workspace swift-sdk.xcworkspace -scheme notification-extension -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone X' -enableCodeCoverage YES CODE_SIGNING_REQUIRED=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty -f `xcpretty-travis-formatter`
9+
- bash <(curl -s https://codecov.io/bash)
10+
- xcodebuild test -workspace swift-sdk.xcworkspace -scheme swift-sdk -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone X' -enableCodeCoverage YES CODE_SIGNING_REQUIRED=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty -f `xcpretty-travis-formatter`
11+
- bash <(curl -s https://codecov.io/bash)
12+
- xcodebuild test -workspace swift-sdk.xcworkspace -scheme swift-sdk -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6s,OS=9.0' -enableCodeCoverage YES CODE_SIGNING_REQUIRED=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty -f `xcpretty-travis-formatter`
13+
- bash <(curl -s https://codecov.io/bash)
14+
- pod lib lint
15+

IterableAppExtensions.podspec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616
#
1717

1818
s.name = "IterableAppExtensions"
19-
s.version = "4.4.7"
19+
s.version = "6.0.0"
2020
s.summary = "App Extensions for Iterable SDK"
2121

2222
s.description = <<-DESC
@@ -94,6 +94,8 @@ Pod::Spec.new do |s|
9494
'SWIFT_VERSION' => '4.1'
9595
}
9696

97+
s.swift_version = '4.1'
98+
9799
# ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
98100
#
99101
# A list of resources included with the Pod. These are copied into the

IterableSDK.podspec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616
#
1717

1818
s.name = "IterableSDK"
19-
s.version = "1.0.0"
19+
s.version = "6.0.0"
2020
s.summary = "Iterable's official SDK for iOS"
2121

2222
s.description = <<-DESC
@@ -77,6 +77,8 @@ Pod::Spec.new do |s|
7777
'SWIFT_VERSION' => '4.1'
7878
}
7979

80+
s.swift_version = '4.1'
81+
8082
# ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
8183
#
8284
# A list of resources included with the Pod. These are copied into the

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 Iterable Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//
2+
// TestFileTests.swift
3+
// notification-extension-tests
4+
//
5+
// We need this file due to a codecov.io bug where no coverage is generated if
6+
// we have just one swift file. We add this file to generate coverage.
7+
// TODO: in future remove this file when the codecov bug is fixed.
8+
9+
// Created by Tapash Majumder on 7/9/18.
10+
// Copyright © 2018 Iterable. All rights reserved.
11+
//
12+
13+
import XCTest
14+
15+
@testable import IterableAppExtensions
16+
17+
class TestFileTests: XCTestCase {
18+
19+
override func setUp() {
20+
super.setUp()
21+
// Put setup code here. This method is called before the invocation of each test method in the class.
22+
}
23+
24+
override func tearDown() {
25+
// Put teardown code here. This method is called after the invocation of each test method in the class.
26+
super.tearDown()
27+
}
28+
29+
// This is just a test so that
30+
func testSayHello() {
31+
let testFile = TestFile()
32+
testFile.sayHello()
33+
}
34+
}

Tests/swift-sdk-swift-tests/IterableNotificationResponseTests.swift

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ class IterableNotificationResponseTests: XCTestCase {
3131
}
3232

3333
func testTrackOpenPushWithCustomAction() {
34+
guard #available(iOS 10.0, *) else {
35+
return
36+
}
37+
3438
let messageId = UUID().uuidString
3539
let userInfo: [AnyHashable : Any] = [
3640
"itbl": [
@@ -63,6 +67,10 @@ class IterableNotificationResponseTests: XCTestCase {
6367
}
6468

6569
func testActionButtonDismiss() {
70+
guard #available(iOS 10.0, *) else {
71+
return
72+
}
73+
6674
let messageId = UUID().uuidString
6775
let userInfo = [
6876
"itbl": [
@@ -198,8 +206,11 @@ class IterableNotificationResponseTests: XCTestCase {
198206
XCTAssertNil(api.attributionInfo)
199207
}
200208

201-
@available(iOS 10, *)
202209
func testLegacyDeeplinkPayload() {
210+
guard #available(iOS 10.0, *) else {
211+
return
212+
}
213+
203214
let messageId = UUID().uuidString
204215
let userInfo: [AnyHashable : Any] = [
205216
"itbl" : [

Tests/swift-sdk-swift-tests/Mocks.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import UserNotifications
1111

1212
import IterableSDK
1313

14+
@available(iOS 10.0, *)
1415
struct MockNotificationResponse : NotificationResponseProtocol {
1516
let userInfo: [AnyHashable : Any]
1617
let actionIdentifier: String

notification-extension/TestFile.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// TestFile.swift
3+
// notification-extension
4+
//
5+
// We need this file due to a codecov.io bug where no coverage is generated if
6+
// we have just one swift file. We add this file to generate coverage.
7+
// TODO: in future remove this file when the codecov bug is fixed.
8+
//
9+
// Created by Victor Babenko on 7/6/18.
10+
// Copyright © 2018 Iterable. All rights reserved.
11+
//
12+
import Foundation
13+
14+
class TestFile {
15+
func sayHello() {
16+
NSLog("Hello, World!")
17+
}
18+
}

0 commit comments

Comments
 (0)