-
Notifications
You must be signed in to change notification settings - Fork 135
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-4079 chore: Migrate tools and smoke tests to GitLab #1921
RUM-4079 chore: Migrate tools and smoke tests to GitLab #1921
Conversation
as we now test macOS support through bare spm build
now moved to GitLab
|
||
# Helpers | ||
|
||
ECHO_TITLE=./tools/utils/echo_color.sh --title | ||
ECHO_ERROR=./tools/utils/echo_color.sh --err | ||
ECHO_WARNING=./tools/utils/echo_color.sh --warn | ||
ECHO_SUCCESS=./tools/utils/echo_color.sh --succ | ||
|
||
define require_param | ||
if [ -z "$${$(1)}" ]; then \ | ||
$(ECHO_ERROR) "Error:" "$(1) parameter is required but not provided."; \ | ||
exit 1; \ | ||
fi | ||
endef |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π‘ Moved to tools/utils/common.mk
as now being shared with Makefiles
used for smoke testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, a couple of questions nothing blocking.
fi | ||
} | ||
|
||
# Prints current git branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/question
what happens when HEAD doesn't point to a branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like in detached HEAD configuration? It will print just "HEAD"
in such case. Although, this code isn't new - we've been using it for years in existing smoke tests. I don't think GitLab setup changes anything significant to break it π€.
|
||
# Prints current git tag (if any) | ||
function current_git_tag() { | ||
if [[ -n "$CI_COMMIT_TAG" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/question
are these env variable populated via gitlab?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly π
echo_succ "Already using Xcode version '$version'." | ||
elif [[ -d "$XCODE_PATH" ]]; then | ||
echo "Found Xcode at '$XCODE_PATH'." | ||
if sudo xcode-select -s "$XCODE_PATH"; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/question
Is the runner user already in elevated/sudo mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is π - tested, it works π
@@ -13,5 +13,3 @@ A brief description of implementation details of this PR. | |||
|
|||
### Custom CI job configuration (optional) | |||
- [ ] Run unit tests for Session Replay | |||
- [ ] Run smoke tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
πͺ
REPO_ROOT := ../../ | ||
include ../../tools/utils/common.mk | ||
|
||
ifeq ($(PLATFORM), iOS Simulator) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/comment
IIRC, we updated SPM tests with macOS support, it not then we should include macOS and visionOS.
If you can do along with this PR :great else we can do as separate PT too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is already there, in this PR π. We distinguish:
- smoke tests - integrate SDK and run basic UI test (launch the app β check no crash)
- spm build tests - build SDK for all supported platforms
The SmokeTest/spm/Makefile
in question performs smoke testing. It integrates SDK into SPMProject
via Xcode's SPM (using current branch), then launches it to assert there is no runtime crash. We do it for iOS and tvOS.
The spm.sh
added earlier is renamed to spm-build.sh
and ran from .gitlab-ci.yml
:
make spm-build-ios
make spm-build-tvos
make spm-build-visionos
make spm-build-macos
It validates that Package.swift
builds for all these platforms. Both iOS and tvOS builds might be considered redundant considering SmokeTest/spm/Makefile
, but I wanted to avoid changing existing concepts.
What and why?
π¦ π§° Following #1910, this PR migrates next portion of CI setup to GitLab:
http-server-mock
,rum-models-generator
,sr-snapshots
and distribution package (python)The following integrations are still running on Bitrise:
I will address the remaining items in subsequent PR(s).
How?
General remarks:
smoke-test
stage usesmacos:ventura
runner (lower spec). This is to not consume parallelisation budget ofmacos:sonoma
which can runtest
andtest-ui
for other branches while smoke tests are still performed on the current branch.macos:ventura
, so I added an option torunner-setup.sh
to activate it. Ultimately, this will be done in the AMI (runner image).dependency-manager-tests
toSmokeTests
for clarity and to better fit our conventions.Makefiles
stored atSmokeTests/<dep manager>/Makefile
. This is not different from what we had before. To better streamline these tests, each smokeMakefile
now distinguishesmake clean install test
commands.instrumented-tests/http-server-mock
totools/http-server-mock
to better fit repo layout.Makefile
Same as in #1910, smoke and tool tests are ran from the main Makefile. List of new key commands:
make tools-test
- Runs tests for all repo tools.make smoke-test
- Runs smoke tests in specified TEST_DIRECTORY (using OS, PLATFORM and DEVICE)make smoke-test-ios-all
- Runs all smoke tests adequate for iOS.make smoke-test-tvos-all
- Runs all smoke tests adequate for tvOS.make spm-build
- BuildsPackage.swift
for specified SCHEME and DESTINATION.make spm-build-ios
- BuildsPackage.swift
for iOS.make spm-build-tvos
- BuildsPackage.swift
for tvOS.make spm-build-visionos
- BuildsPackage.swift
for visionOS.make spm-build-macos
- BuildsPackage.swift
for macOS and Mac Catalyst.Ultimately, the whole workflow for integrating branches will look this:
Review checklist
Custom CI job configuration (optional)