8000 [PM-14033] Configure test workflow simulator type and iOS version with config files by KatherineInCode · Pull Request #1080 · bitwarden/ios · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[PM-14033] Configure test workflow simulator type and iOS version with config files #1080

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

Merged
merged 5 commits into from
Oct 25, 2024

Conversation

KatherineInCode
Copy link
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-14033

📔 Objective

Similar to how we now have an .xcode-version file to denote which version of Xcode should be used when building/testing, this creates .test-simulator-device-name and .test-simulator-ios-version files to denote which device tests should be run against and which iOS version on that device, respectively.

I went back and forth on whether to make this two files like this, or one file with the full name=[blah],OS=[blah] string; I went with the former because it's more straightforward, and easier to potentially use in other workflows/tools in the future.

It would be nice if there were a way to use this in BitwardenTestCase as well, but I don't think that's readily possible without pre-build cleverness unfortunately.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

Copy link
Contributor
github-actions bot commented Oct 25, 2024

Logo
Checkmarx One – Scan Summary & Details08e0c715-f040-4308-b2ea-dad2dc0d775b

No New Or Fixed Issues Found

Copy link
codecov bot commented Oct 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.49%. Comparing base (396a641) to head (08efe26).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1080   +/-   ##
=======================================
  Coverage   89.49%   89.49%           
=======================================
  Files         675      675           
  Lines       42560    42560           
=======================================
+ Hits        38088    38090    +2     
+ Misses       4472     4470    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member
@fedemkr fedemkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Looks good! About the configuration being in different files I was thinking that most likely these files will be updated alongside when the Xcode version changes so IMO we could have everything on one file and use the source / . command to load if the file looks something like this:

XCODE_VERSION=15.4
SIMULATOR_NAME=iPhone 15 Pro
SIMULATOR_VERSION=18.0

So we just do . /path/to/theconfigfile and the variables will be automatically available and ready for use in the step to be added to $GITHUB_ENV without needing to do any cat or sed commands.
Thoughts?

Comment on lines 72 to 76
- name: Read default Xcode version
run: |
echo "DEFAULT_XCODE_VERSION=$(cat .xcode-version | tr -d '\n')" >> "$GITHUB_ENV"
echo "DEFAULT_SIMULATOR_NAME=$(cat .test-simulator-device-name | tr -d '\n')" >> "$GITHUB_ENV"
echo "DEFAULT_SIMULATOR_VERSION=$(cat .test-simulator-ios-version | tr -d '\n')" >> "$GITHUB_ENV"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Maybe the name of the step should be u 8000 pdated given that it does more than just the Xcode version. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦🏼‍♀️ It is in the Xcode 16 branch, I just didn't bring it over here

@KatherineInCode
Copy link
Contributor Author

🤔 Looks good! About the configuration being in different files I was thinking that most likely these files will be updated alongside when the Xcode version changes so IMO we could have everything on one file and use the source / . command to load if the file looks something like this:

I considered that option, too, and went down a long rabbit hole of how to import environment variables from a file into GitHub actions.

The thing is, the .xcode-version file is something of a standard, and used by other things in the ecosystem (particularly Fastlane). So there's benefit to having that as a standalone file itself, which is why ultimately I did it that way.

Ultimately it's probably six of one, half dozen of another. If I had a good reason for abandoning the .xcode-version standard, then yeah, I'd be inclined to put them all in one file.

Copy link
Member
@fedemkr fedemkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree makes total sense, thanks for explaining @KatherineInCode ! 🎉

@KatherineInCode KatherineInCode merged commit cfd75cd into main Oct 25, 2024
9 checks passed
@KatherineInCode KatherineInCode deleted the pm-14033/simulator-config branch October 25, 2024 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0