Skip to content

Add tools for C++ integration tests #103

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 4 commits into from
Aug 3, 2020
Merged

Conversation

anonymous-akorn
Copy link
Contributor

@anonymous-akorn anonymous-akorn commented Jul 27, 2020

Adds the tools needed to build and run C++ integration tests.

These derive from the corresponding tools in the internal repo, with some changes and exceptions:

  • build_testapps.py and build_desktop_testapps.py have been merged into a single, simpler build_testapps.py.
  • restore_secrets.py is a new script that decrypts the secret files in scripts/gha-encrypted and restores all the files/values that were stripped out when pushing the integration source code to Github. Except for the reverse ids in the Info.plists needed for iOS, which are not present yet.
  • xcodebuild.py, provisioning.py and xcode_tool.rb are all for iOS, which is not yet supported until signing is figured out.

This also includes a change to .gitignore to ignore temporary Python files, as well as unencrypted secrets.

There are still a few things I think I could improved, as we take this stuff out of the internal repo.

  • The main reason for the JSON file (as opposed to putting that data in Python) was to allow configuration changes without needing to get Python readability. That's no longer the case, so we could just do it all in Python and get rid of the config_reader nonsense (which isn't implemented as well as I'd like anyway).
  • The reason for refactoring the logic for xcodebuild, provisioning, etc. out into separate modules was to share it between both the Unity and C++ projects. It's unclear how/whether we'll do this for the github repos, or whether we really need to.

I'm open to making other large scale changes as well.

Another question is where we should be putting this stuff. testing/integration_testing might not be the best place, especially for restore_secrets.py, which should probably go into scripts/

Adds the tools needed to build and run C++ integration tests.

These derive from the corresponding tools in google3, with some changes and exceptions:

build_testapps.py and build_desktop_testapps.py have been merged into a single, simpler build_testapps.py.

restore_secrets.py is a new script that decrypts the secret files in scripts/gha-encrypted and restores all the files/values that were stripped out when pushing the integration source code to Github. Except for the reverse ids in the Info.plists needed for iOS, which are not present yet.

xcodebuild.py, provisioning.py and xcode_tool.rb are all for iOS, which is not yet supported until signing is figured out.

This also includes a change to .gitignore to ignore temporary Python files, as well as unencrypted secrets.
Copy link
Contributor

@vimanyu vimanyu left a comment

Choose a reason for hiding this comment

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

Looks pretty good!
Probably worth discussing overall style guide we follow to keep things consistent in this repo

  • documentation style
  • absl-py as you mentioned

@jonsimantov
Copy link
Contributor

The reversed client ID can be extracted from GoogleService-Info.plist and google-services.json, if you want to just do that.

@anonymous-akorn
Copy link
Contributor Author

The reversed client ID can be extracted from GoogleService-Info.plist and google-services.json, if you want to just do that.

Yeah that's a good call, simple to do and results in one fewer thing to maintain.

The following changes have been made:

- config_reader.py has been simplified to just return a plain data object containing all the needed config upfront. Thus it's only needed to call one function from the module once.

- Added types to args in docstrings.

- restore_secrets now restores the reverse id in Info.plists, using the value from the decrypted GoogleService-Info.plist as the source of truth.
We've decided to use absl.flags as the flag-parsing library for Python in the repo.

Also removed reverse id patching from the xcode tool, since that's being handled by the secret restoration script.
@DellaBitta DellaBitta merged commit 98f5d19 into dev Aug 3, 2020
@anonymous-akorn anonymous-akorn deleted the feature/ak-integration-tests branch August 3, 2020 19:50
@firebase firebase locked and limited conversation to collaborators Sep 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants