Skip to content

Commit

Permalink
Merge pull request #88 from DataDog/buranmert/RUMM-301-shopist
Browse files Browse the repository at this point in the history
RUMM-301 Shopist project created
  • Loading branch information
buranmert authored Apr 23, 2020
2 parents 237926f + c81b021 commit 2364512
Show file tree
Hide file tree
Showing 60 changed files with 678 additions and 2,362 deletions.
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
all: tools dependencies xcodeproj-httpservermock templates examples benchmark
all: tools dependencies xcodeproj-httpservermock templates
.PHONY : examples tools

tools:
Expand All @@ -25,11 +25,6 @@ templates:
./tools/xcode-templates/install-xcode-templates.sh
@echo "OK 👌"

examples:
@echo "⚙️ Generating 'examples/examples-secret.xcconfig' file..."
./tools/config/generate-examples-config-template.sh
@echo "OK 👌"

# Tests if current branch ships a valid SPM package.
test-spm:
@cd dependency-manager-tests/spm && $(MAKE)
Expand Down
15 changes: 15 additions & 0 deletions Shopist/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
all: secret

LOCAL_XCCONFIG="./Shopist/shopist-secrets.local.xcconfig"
ifeq ($(secret),)
secret="my-secret-token"
endif

secret:
ifeq (,$(wildcard ./Shopist/shopist-secrets.local.xcconfig))
@echo "Creating shopist-secrets.local.xcconfig..." ;
@echo DATADOG_CLIENT_TOKEN="$(secret)" >> $(LOCAL_XCCONFIG)
@echo "🔑 Your token is set: $(secret)"
@echo "🛠 You can change it in $(LOCAL_XCCONFIG)"
endif
@echo "All good 👌"
589 changes: 589 additions & 0 deletions Shopist/Shopist.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1120"
LastUpgradeVersion = "1140"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -14,10 +14,10 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6166E73123D05E9C00A47A75"
BuildableName = "iOS-app-example-cocoapods.app"
BlueprintName = "iOS-app-example-cocoapods"
ReferencedContainer = "container:iOS-app-example-cocoapods.xcodeproj">
BlueprintIdentifier = "9EE2A9ED244F38DE00A2C252"
BuildableName = "Shopist.app"
BlueprintName = "Shopist"
ReferencedContainer = "container:Shopist.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
Expand All @@ -32,10 +32,20 @@
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "617AA41323D1100F0073EC69"
BuildableName = "iOS-app-example-cocoapods-UITests.xctest"
BlueprintName = "iOS-app-example-cocoapods-UITests"
ReferencedContainer = "container:iOS-app-example-cocoapods.xcodeproj">
BlueprintIdentifier = "9EE2AA03244F38DF00A2C252"
BuildableName = "ShopistTests.xctest"
BlueprintName = "ShopistTests"
ReferencedContainer = "container:Shopist.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9EE2AA0E244F38E000A2C252"
BuildableName = "ShopistUITests.xctest"
BlueprintName = "ShopistUITests"
ReferencedContainer = "container:Shopist.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
Expand All @@ -54,10 +64,10 @@
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6166E73123D05E9C00A47A75"
BuildableName = "iOS-app-example-cocoapods.app"
BlueprintName = "iOS-app-example-cocoapods"
ReferencedContainer = "container:iOS-app-example-cocoapods.xcodeproj">
BlueprintIdentifier = "9EE2A9ED244F38DE00A2C252"
BuildableName = "Shopist.app"
BlueprintName = "Shopist"
ReferencedContainer = "container:Shopist.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
Expand All @@ -71,10 +81,10 @@
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6166E73123D05E9C00A47A75"
BuildableName = "iOS-app-example-cocoapods.app"
BlueprintName = "iOS-app-example-cocoapods"
ReferencedContainer = "container:iOS-app-example-cocoapods.xcodeproj">
BlueprintIdentifier = "9EE2A9ED244F38DE00A2C252"
BuildableName = "Shopist.app"
BlueprintName = "Shopist"
ReferencedContainer = "container:Shopist.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ struct ExampleAppConfig {
// to create it.
fatalError("""
✋⛔️ Cannot read `DATADOG_CLIENT_TOKEN` from `Info.plist` dictionary.
See your configuration of `examples-secret.xcconfig` or refer to `README.md` if you haven't created this file yet.
Please create `shopist-secrets.local.xcconfig` in the same folder with `Shopist.xcconfig`
and declare your `DATADOG_CLIENT_TOKEN="your-client-token"`
You might need to run `Product > Clean Build Folder` before retrying.
""")
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions Shopist/Shopist/Shopist.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include? "shopist-secrets.local.xcconfig"
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
* Copyright 2019-2020 Datadog, Inc.
*/

#if DEBUG

/// Below `@testable import` is only for SDK debug purposes, to easily override internal `consolePrint` function and display
/// the output of the `Logger` in UI. Should be never used in client's application code.
@testable import Datadog
import Foundation
import UIKit

class ConsoleOutputInterceptor {
Expand Down Expand Up @@ -49,3 +50,12 @@ func startDisplayingDebugInfo(in textView: UITextView) {
textView?.text = newContents
}
}

#else

import UIKit.UITextView

func installConsoleOutputInterceptor() { }
func startDisplayingDebugInfo(in textView: UITextView) { }

#endif
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@
* Copyright 2019-2020 Datadog, Inc.
*/

#import <UIKit/UIKit.h>
import XCTest

@interface AppDelegate : UIResponder <UIApplicationDelegate>
class ShopistUITests: XCTestCase {
override func setUp() {
continueAfterFailure = false
}

@end
func testAppCanBeLaunched() {
let app = XCUIApplication()
app.launch()
}
}
59 changes: 21 additions & 38 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ workflows:
- _make_dependencies
- run_linter
- run_unit_tests
- run_ui_tests
- run_integration_tests
- check_dependency_managers
# I disable it for now, as this would require supporting local pod installation
# of `DatadogSDK.podspec` in CP example project. This effort will be lost as in `RUMM-334`
# we're going to re-do sample apps layout and not use local pod anymore.
# - check_example_projects
- _deploy_artifacts

_make_dependencies:
Expand Down Expand Up @@ -94,6 +91,26 @@ workflows:
- destination: platform=OS X,arch=x86_64
- project_path: instrumented-tests/http-server-mock/HTTPServerMock.xcodeproj

run_ui_tests:
description: |-
Runs UI tests for Shopist app on iOS Simulator.
steps:
- [email protected]:
title: Generate client token for Shopist
inputs:
- content: |-
#!/usr/bin/env bash
set -e
cd Shopist && make
- [email protected]:
title: Run UI tests for Shopist - iOS Simulator
inputs:
- scheme: Shopist
- simulator_device: iPhone 11
- generate_code_coverage_files: 'yes'
- project_path: Shopist/Shopist.xcodeproj
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/Shopist-UI-tests.html"

run_integration_tests:
description: |-
Runs integration tests from Datadog.xcworkspace.
Expand Down Expand Up @@ -158,37 +175,3 @@ workflows:
- cache_level: none
- project_path: "$BITRISE_SOURCE_DIR/dependency-manager-tests/cocoapods/CPProject.xcworkspace"
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/CPProject-tests.html"

check_example_projects:
description: |-
Links SDK to example projects using supported dependency
managers (SPM and Cocoapods). With UITests it checks if example apps start with
no dylib error.
steps:
- cocoapods-install:
inputs:
- is_cache_disabled: 'true'
- source_root_path: "$BITRISE_SOURCE_DIR/examples/iOS-app-example-cocoapods"
- [email protected]:
title: Generate fake Client Token
inputs:
- content: |-
#!/usr/bin/env bash
set -e
make examples
- xcode-test:
title: Run CP's example UITests
inputs:
- scheme: iOS-app-example-cocoapods
- is_clean_build: 'yes'
- cache_level: none
- project_path: "$BITRISE_SOURCE_DIR/examples/iOS-app-example-cocoapods/iOS-app-example-cocoapods.xcworkspace"
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/Cocoapods-example-ui-tests.html"
- xcode-test:
title: Run SPM's example UITests
inputs:
- scheme: iOS-app-example-spm
- is_clean_build: 'yes'
- cache_level: none
- project_path: "$BITRISE_SOURCE_DIR/examples/iOS-app-example-spm/iOS-app-example-spm.xcodeproj"
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/SPM-example-ui-tests.html"
2 changes: 0 additions & 2 deletions examples/.gitignore

This file was deleted.

18 changes: 0 additions & 18 deletions examples/examples-shared-uitests/iOS_app_example_spm_UITests.swift

This file was deleted.

7 changes: 0 additions & 7 deletions examples/iOS-app-example-cocoapods/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions examples/iOS-app-example-cocoapods/Podfile

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 2364512

Please sign in to comment.