-
-
Notifications
You must be signed in to change notification settings - Fork 341
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
ref(ci): use sentry-xcodebuild.sh to wrap more xcodebuild usages #4818
base: main
Are you sure you want to change the base?
Conversation
5c3ce20
to
be6ae95
Compare
a0f8f73
to
bd51ce0
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## armcknight/ci/rename-xcode-test #4818 +/- ##
=====================================================================
+ Coverage 91.399% 91.405% +0.005%
=====================================================================
Files 627 627
Lines 74569 74569
Branches 26802 26804 +2
=====================================================================
+ Hits 68156 68160 +4
+ Misses 6314 6310 -4
Partials 99 99 see 4 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
;; | ||
esac | ||
|
||
if [ "$CI" == true ]; then | ||
if [ "${CI-false}" == true ]; 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.
l
: why the fallback to false? isn't "" == true
also falsy?
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.
the script fails here if you run it locally if your machine doesn't define the CI
environment variable at all
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.
Why does it fail when a variable is not set? shouldn't it just evaluate to an empty string?
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.
hm, after trying another minimal example it does. i was getting an unbound variable error at some point. i'll fix this.
scripts/sentry-xcodebuild.sh
Outdated
RUBY_ENV_ARGS="" | ||
else | ||
RUBY_ENV_ARGS="rbenv exec bundle exec" | ||
fi | ||
|
||
if [ $RUN_BUILD == true ]; then | ||
set -o pipefail && env NSUnbufferedIO=YES xcodebuild \ | ||
set -o pipefail && env NSUnbufferedIO=YES CODE_SIGN_IDENTITY=\"\" CODE_SIGNING_REQUIRED=NO xcodebuild \ |
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.
I am not sure if we can add these env values here, as we are also building signed versions of the sample apps.
| tee thread-sanitizer.log \ | ||
| xcpretty -t | ||
|
||
testStatus=$? |
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.
m
: Correct me if I am wrong, but I think this will not be executed because the entire script will exit if the xcodebuild command fails
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.
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.
@philipphofmann it looks like you introduced the test-with-thread-sanitizer.sh
. Any insights here?
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.
Could it be that it used to work, but then the addition of && set -o pipefail
at the beginning of the pipeline would cause it to no longer propagate the $?
the same way? we also already had that at the top of the script, but i think that wouldn't have applied to the pipeline, which is why it was added there?
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.
I can't recall any specific reasons why I added it like that. If it's broken, feel free to fix it.
be6ae95
to
dc54c51
Compare
…rap more xcodebuild usages
a27134e
to
e36230a
Compare
honestly every time i make an edit to sentry-xcodebuild.sh at this point, it feels wrong to continue with it as a bash script. rewriting it in swift would be a huge improvement. |
We can simplify some places where there's a long complicated xcodebuild invocation, and instead place that in the existing wrapper script we have for it, where it can benefit from some other tricks we've learned over time.
There's still a few clunky invocations of the wrapper script itself that should improve after #4808
I stared at the one in the fastfile for a while but i'm not immediately sure what to do with it. I kinda feel like that step just shouldn't be done with fastlane, but i'll save that for another PR.
#skip-changelog