diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 143c90cb0e..a50100b5b8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -164,6 +164,17 @@ Tools Tests: - make clean repo-setup ENV=ci - make tools-test +Benchmark Build: + stage: smoke-test + rules: + - if: '$CI_COMMIT_BRANCH' # when on branch with following changes compared to develop + changes: + paths: + - "BenchmarkTests/**/*" + compare_to: 'develop' + script: + - make benchmark-build + Smoke Tests (iOS): stage: smoke-test rules: @@ -265,7 +276,7 @@ E2E Test (upload to s8s): - ./tools/runner-setup.sh --xcode "$DEFAULT_XCODE" --datadog-ci - make clean - export DRY_RUN=${DRY_RUN:-0} # default to 0 if not specified - - make e2e-build-upload ARTIFACTS_PATH="artifacts/e2e" + - make e2e-upload ARTIFACTS_PATH="artifacts/e2e" # ┌────────────────────────────┐ # │ Benchmark Test app upload: │ @@ -283,7 +294,7 @@ Benchmark Test (upload to s8s): - ./tools/runner-setup.sh --xcode "$DEFAULT_XCODE" --datadog-ci - make clean - export DRY_RUN=${DRY_RUN:-0} # default to 0 if not specified - - make benchmark-build-upload ARTIFACTS_PATH="artifacts/benchmark" + - make benchmark-upload ARTIFACTS_PATH="artifacts/benchmark" # ┌─────────────────┐ # │ SDK dogfooding: │ diff --git a/BenchmarkTests/Makefile b/BenchmarkTests/Makefile index 9606e4187f..1d024baa8a 100644 --- a/BenchmarkTests/Makefile +++ b/BenchmarkTests/Makefile @@ -14,6 +14,18 @@ ifdef ARTIFACTS_PATH rm -rf "$(IPA_PATH)" endif +build: + @$(ECHO_SUBTITLE2) "make build" + set -eo pipefail; \ + OTEL_SWIFT=1 xcodebuild \ + -project BenchmarkTests.xcodeproj \ + -scheme Runner \ + -sdk iphonesimulator \ + -configuration Release \ + -destination generic/platform=iOS\ Simulator \ + | xcbeautify + @$(ECHO_SUCCESS) "BenchmarkTests compiles" + archive: @:$(eval VERSION ?= $(CURRENT_GIT_COMMIT_SHORT)) @$(ECHO_SUBTITLE2) "make archive VERSION='$(VERSION)'" diff --git a/BenchmarkTests/Runner/AppDelegate.swift b/BenchmarkTests/Runner/AppDelegate.swift index a476311e3f..24d1de2147 100644 --- a/BenchmarkTests/Runner/AppDelegate.swift +++ b/BenchmarkTests/Runner/AppDelegate.swift @@ -23,7 +23,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { let applicationInfo = try! AppInfo() // crash if info are missing or malformed switch run { - case .baseline, .metrics: + case .baseline, .instrumented: // measure metrics during baseline and metrics runs Benchmarks.metrics( with: Benchmarks.Configuration( diff --git a/Makefile b/Makefile index e6fd5172d3..dcd46ce6f1 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,8 @@ all: env-check repo-setup templates tools-test \ smoke-test smoke-test-ios smoke-test-ios-all smoke-test-tvos smoke-test-tvos-all \ spm-build spm-build-ios spm-build-tvos spm-build-visionos spm-build-macos spm-build-watchos \ - e2e-build-upload \ - benchmark-build-upload \ + e2e-upload \ + benchmark-build benchmark-upload \ models-generate rum-models-generate sr-models-generate models-verify rum-models-verify sr-models-verify \ dogfood-shopist dogfood-datadog-app \ release-build release-validate release-publish-github \ @@ -263,17 +263,22 @@ spm-build-macos: @$(MAKE) spm-build DESTINATION="platform=macOS" SCHEME="DatadogCrashReporting" # Builds a new version of the E2E app and publishes it to synthetics. -e2e-build-upload: +e2e-upload: @$(call require_param,ARTIFACTS_PATH) @:$(eval DRY_RUN ?= 1) - @$(ECHO_TITLE) "make e2e-build-upload ARTIFACTS_PATH='$(ARTIFACTS_PATH)' DRY_RUN='$(DRY_RUN)'" + @$(ECHO_TITLE) "make e2e-upload ARTIFACTS_PATH='$(ARTIFACTS_PATH)' DRY_RUN='$(DRY_RUN)'" DRY_RUN=$(DRY_RUN) ./tools/e2e-build-upload.sh --artifacts-path "$(ARTIFACTS_PATH)" +# Builds the Benchmark app. +benchmark-build: + @$(ECHO_TITLE) "make benchmark-build" + @$(MAKE) -C BenchmarkTests build + # Builds a new version of the Benchmark app and publishes it to synthetics. -benchmark-build-upload: +benchmark-upload: @$(call require_param,ARTIFACTS_PATH) @:$(eval DRY_RUN ?= 1) - @$(ECHO_TITLE) "make benchmark-build-upload ARTIFACTS_PATH='$(ARTIFACTS_PATH)' DRY_RUN='$(DRY_RUN)'" + @$(ECHO_TITLE) "make benchmark-upload ARTIFACTS_PATH='$(ARTIFACTS_PATH)' DRY_RUN='$(DRY_RUN)'" DRY_RUN=$(DRY_RUN) ./tools/benchmark-build-upload.sh --artifacts-path "$(ARTIFACTS_PATH)" # Opens `BenchmarkTests` project with passing required ENV variables