Skip to content
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

Update robolectric install script to work with alternative CI #6032

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

spwoodcock
Copy link
Member

@spwoodcock spwoodcock commented Mar 22, 2024

Issue Solved

  • The download-robolectric-deps.sh script uses the _ environment variable in the shell.
  • Usage of $_ clearly works fine in CircleCI.
  • However, it does not work within Github Workflows.
  • I wasn't able to pin down the exact cause, as $_ should work in most shells.

Solution Provided

  • I replaced usage of $_ with a simple variable dest_dir="src/test/resources"
  • This variable is used to specify the path to copy to, instead of $_.
  • The script now works for Github Workflows.

Why is this the best possible solution? Were any other approaches considered?

  • Original script was not working for Github Workflows.
  • When the CircleCI workflow runs in this PR, it will test the script still works with CircleCI.
  • This change improves the script robustness, in case environments do not support $_ and facilitates a change of CI tool in the future.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

  • No change.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

  • None.

Before submitting this PR, please make sure you have:

  • added or modified tests for any new or changed behavior
  • run ./gradlew connectedAndroidTest (or ./gradlew testLab) and confirmed all checks still pass
  • added a comment above any new strings describing it for translators
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • verified that any new UI elements use theme colors. UI Components Style guidelines

@spwoodcock
Copy link
Member Author

The CI passed, so this works fine in CircleCI too 👍

@seadowg
Copy link
Member

seadowg commented Mar 25, 2024

This is also just way more readable 👍. Thanks!

@seadowg seadowg merged commit 8a13212 into getodk:master Mar 25, 2024
6 checks passed
@spwoodcock spwoodcock deleted the build/robolectric-install branch March 25, 2024 14:20
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