re-enable customer center tests in main#4170
Closed
aboedo wants to merge 2 commits into
Closed
Conversation
aboedo
commented
Aug 12, 2024
Comment on lines
+490
to
+499
| Find.find(project_root) do |path| | ||
| # process only Swift files | ||
| next unless File.file?(path) && File.extname(path) == ".swift" | ||
|
|
||
| content = File.read(path) | ||
|
|
||
| updated_content = content.gsub('CUSTOMER_CENTER_ENABLED', 'true') | ||
|
|
||
| File.write(path, updated_content) if content != updated_content | ||
| end |
Member
Author
There was a problem hiding this comment.
would have been shorter as a find + sed, but this is much easier to read IMO
Contributor
There was a problem hiding this comment.
Hmm I guess the fastlane commands to run tests are only run through CI normally, so this is probably ok... We could also make a sort of "block" so we restore it once tests finish, but I don't think it's worth it 👍
Member
Author
tonidero
approved these changes
Aug 12, 2024
Comment on lines
+490
to
+499
| Find.find(project_root) do |path| | ||
| # process only Swift files | ||
| next unless File.file?(path) && File.extname(path) == ".swift" | ||
|
|
||
| content = File.read(path) | ||
|
|
||
| updated_content = content.gsub('CUSTOMER_CENTER_ENABLED', 'true') | ||
|
|
||
| File.write(path, updated_content) if content != updated_content | ||
| end |
Contributor
There was a problem hiding this comment.
Hmm I guess the fastlane commands to run tests are only run through CI normally, so this is probably ok... We could also make a sort of "block" so we restore it once tests finish, but I don't think it's worth it 👍
| end | ||
|
|
||
| desc "Enable Customer Center" | ||
| lane :enable_customer_center do |
Contributor
There was a problem hiding this comment.
Nitpick but should we make this a private lane?
Suggested change
| lane :enable_customer_center do | |
| private_lane :enable_customer_center do |
Member
Author
|
closing in favor of #4171 |
jamesrb1
added a commit
that referenced
this pull request
Aug 12, 2024
Customer Center is currently `#ifdef`ed out via `CUSTOMER_CENTER_ENABLED` while it is under development, but we want to run its tests during development. This defines `CUSTOMER_CENTER_ENABLED` for `OTHER_SWIFT_FLAGS` via the command line build arguments for test lanes, which will override the project settings, so the tests are run. This PR can be reverted when the customer centre is released.‼️ This PR is not needed if we go for the [source-processing method](#4170) instead.
nyeu
pushed a commit
that referenced
this pull request
Oct 2, 2024
Customer Center is currently `#ifdef`ed out via `CUSTOMER_CENTER_ENABLED` while it is under development, but we want to run its tests during development. This defines `CUSTOMER_CENTER_ENABLED` for `OTHER_SWIFT_FLAGS` via the command line build arguments for test lanes, which will override the project settings, so the tests are run. This PR can be reverted when the customer centre is released.‼️ This PR is not needed if we go for the [source-processing method](#4170) instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

We weren't running tests for Customer Center in PRs, since the
CUSTOMER_CENTER_ENABLEDflag is disabled.This could be dangerous, so this PR enables the flag in the absolutely dumbest way I could think of: just replace the instances where the flag is used with
true, before running tests, i.e.:It's easy to extend to other test suites. It could also have been its own test suite but I felt like it wouldn't have added much, we would have ended up most tests twice for no real gain.