Skip to content

Commit

Permalink
Merge pull request DataDog#2006 from DataDog/maxep/RUM-5555/add-bench…
Browse files Browse the repository at this point in the history
…mark-job

RUM-5555 Add job to build benchmarks runner
  • Loading branch information
maxep authored Aug 26, 2024
2 parents fb15873 + 2cafed9 commit 93c5d1e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 8 deletions.
15 changes: 13 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,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 @@ -279,7 +290,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 @@ -297,7 +308,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
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 @@ -267,17 +267,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

0 comments on commit 93c5d1e

Please sign in to comment.