Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RUM-5555 Add job to build benchmarks runner #2006

Merged
merged 4 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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: │
Expand All @@ -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: │
Expand Down
12 changes: 12 additions & 0 deletions BenchmarkTests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)'"
Expand Down
2 changes: 1 addition & 1 deletion BenchmarkTests/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
17 changes: 11 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand Down