Skip to content

Commit d639ec8

Browse files
authored
Merge pull request #107 from CatalystCode/thcao/code-coverage-ios
Enable code coverage report for iOS
2 parents 11f3ec7 + 4ab97c8 commit d639ec8

File tree

4 files changed

+54
-16
lines changed

4 files changed

+54
-16
lines changed

.slather.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
coverage_service: cobertura_xml
2+
xcodeproj: ios/ReactNativeAzureNotificationHubSample.xcodeproj
3+
workspace: ios/ReactNativeAzureNotificationHubSample.xcworkspace
4+
scheme: ReactNativeAzureNotificationHubSample
5+
output_directory: .
6+
ignore:
7+
- node_modules/*
8+
- ios/Pods/Folly/*
9+
- ios/Pods/DoubleConversion/*
10+
- ios/Pods/glog/*
11+
- ios/Pods/WindowsAzureMessaging/*
12+
- ios/Pods/boost-for-react-native/*
13+
- ios/ReactNativeAzureNotificationHubSample/*

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ React Native module to support Azure Notification Hub push notifications on Andr
66
![npm](https://img.shields.io/npm/dm/react-native-azurenotificationhub)
77
[![Build Status](https://dev.azure.com/phongthaicao/react-native-azurenotificationhub/_apis/build/status/CatalystCode.react-native-azurenotificationhub?branchName=master)](https://dev.azure.com/phongthaicao/react-native-azurenotificationhub/_apis/build/status/CatalystCode.react-native-azurenotificationhub?branchName=master)
88

9+
![Platform iOS](https://img.shields.io/badge/-iOS-blue)
10+
![Azure DevOps coverage](https://img.shields.io/azure-devops/coverage/phongthaicao/react-native-azurenotificationhub/1)
11+
912
# Platform-specific Guides
1013
- [Android](docs/android-installation.md)
1114
- [iOS](docs/ios-installation.md)

azure-pipelines.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,18 @@ steps:
1919
versionSpec: '10.15.3'
2020
displayName: 'Install Node'
2121

22+
- script: gem install slather
23+
displayName: 'Install slather'
24+
workingDirectory: '../sample'
25+
2226
- script: npm install
2327
displayName: 'Install dependencies'
2428
workingDirectory: '../sample'
2529

2630
- script: |
2731
rm -R ./node_modules/react-native-azurenotificationhub/*
2832
cp -R ../s/* ./node_modules/react-native-azurenotificationhub/
33+
cp ../s/.slather.yml .
2934
displayName: 'Copying react-native-azurenotificationhub'
3035
workingDirectory: '../sample'
3136

@@ -71,7 +76,7 @@ steps:
7176
xcWorkspacePath: '../sample/ios/ReactNativeAzureNotificationHubSample.xcworkspace'
7277
xcodeVersion: '10'
7378
signingOption: 'nosign'
74-
useXcpretty: 'false'
79+
useXcpretty: 'true'
7580

7681
- task: Xcode@5
7782
displayName: 'Running iOS unit tests'
@@ -83,8 +88,18 @@ steps:
8388
xcWorkspacePath: '../sample/ios/ReactNativeAzureNotificationHubSample.xcworkspace'
8489
xcodeVersion: '10'
8590
signingOption: 'nosign'
86-
useXcpretty: 'false'
91+
useXcpretty: 'true'
8792
destination: 'platform=iOS Simulator, name=iPhone 8'
8893
destinationPlatformOption: 'iOS'
8994
destinationTypeOption: 'simulators'
9095
destinationSimulators: 'iPhone 8'
96+
publishJUnitResults: 'true'
97+
98+
- script: slather
99+
displayName: 'Running slather'
100+
workingDirectory: '../sample'
101+
102+
- task: PublishCodeCoverageResults@1
103+
inputs:
104+
codeCoverageTool: 'Cobertura'
105+
summaryFileLocation: '../sample/cobertura.xml'

sample/ios/ReactNativeAzureNotificationHubSample.xcodeproj/xcshareddata/xcschemes/ReactNativeAzureNotificationHubSample.xcscheme

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,27 @@
5454
buildConfiguration = "Debug"
5555
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5656
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
57-
shouldUseLaunchSchemeArgsEnv = "YES">
57+
shouldUseLaunchSchemeArgsEnv = "YES"
58+
codeCoverageEnabled = "YES"
59+
onlyGenerateCoverageForSpecifiedTargets = "YES">
60+
<MacroExpansion>
61+
<BuildableReference
62+
BuildableIdentifier = "primary"
63+
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
64+
BuildableName = "ReactNativeAzureNotificationHubSample.app"
65+
BlueprintName = "ReactNativeAzureNotificationHubSample"
66+
ReferencedContainer = "container:ReactNativeAzureNotificationHubSample.xcodeproj">
67+
</BuildableReference>
68+
</MacroExpansion>
69+
<CodeCoverageTargets>
70+
<BuildableReference
71+
BuildableIdentifier = "primary"
72+
BlueprintIdentifier = "7042E8979137E506A4A55134D9E39B67"
73+
BuildableName = "libRNAzureNotificationHub.a"
74+
BlueprintName = "RNAzureNotificationHub"
75+
ReferencedContainer = "container:Pods/Pods.xcodeproj">
76+
</BuildableReference>
77+
</CodeCoverageTargets>
5878
<Testables>
5979
<TestableReference
6080
skipped = "NO">
@@ -67,17 +87,6 @@
6787
</BuildableReference>
6888
</TestableReference>
6989
</Testables>
70-
<MacroExpansion>
71-
<BuildableReference
72-
BuildableIdentifier = "primary"
73-
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
74-
BuildableName = "ReactNativeAzureNotificationHubSample.app"
75-
BlueprintName = "ReactNativeAzureNotificationHubSample"
76-
ReferencedContainer = "container:ReactNativeAzureNotificationHubSample.xcodeproj">
77-
</BuildableReference>
78-
</MacroExpansion>
79-
<AdditionalOptions>
80-
</AdditionalOptions>
8190
</TestAction>
8291
<LaunchAction
8392
buildConfiguration = "Debug"
@@ -99,8 +108,6 @@
99108
ReferencedContainer = "container:ReactNativeAzureNotificationHubSample.xcodeproj">
100109
</BuildableReference>
101110
</BuildableProductRunnable>
102-
<AdditionalOptions>
103-
</AdditionalOptions>
104111
</LaunchAction>
105112
<ProfileAction
106113
buildConfiguration = "Release"

0 commit comments

Comments
 (0)