Skip to content

Remove ASSETS_DIR from Android test infrastructure - #121720

Merged
sbomer merged 3 commits into
mainfrom
copilot/remove-assets-dir-variable
Nov 20, 2025
Merged

sbomer merged 3 commits into
mainfrom
copilot/remove-assets-dir-variable

Conversation

Copilot AI commented Nov 17, 2025 •

Copy link
Copy Markdown
Contributor

Clean up ASSETS_DIR from Android test infrastructure

The ASSETS_DIR environment variable is no longer needed now that we set up the AppContext.BaseDirectory in the NativeAOT test host (as per commit aec646f).

Changes Made

  • Remove ASSETS_DIR environment variable setup from MonoRunner.java
  • Update TestFiles.cs to use AppContext.BaseDirectory directly instead of falling back to ASSETS_DIR
  • Inline TestDataRoot - removed intermediate field and use AppContext.BaseDirectory directly in TestDataFolder
  • Verify no other code depends on ASSETS_DIR
  • Build and test the changes - AndroidAppBuilder and System.Security.Cryptography.Tests both build successfully
Original prompt

Clean up ASSETS_DIR from android test infrastructure. This variable should no longer be needed now that we set up the appcontext base directory in the nativeaot test host.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Remove ASSETS_DIR from android test infrastructure Remove ASSETS_DIR from Android test infrastructure Nov 17, 2025
Copilot AI requested a review from sbomer November 17, 2025 23:59
@sbomer

sbomer commented Nov 18, 2025

Copy link
Copy Markdown
Member

/azp run runtime-androidemulator

@sbomer

sbomer commented Nov 18, 2025

Copy link
Copy Markdown
Member

/azp run runtime-android

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@sbomer
sbomer marked this pull request as ready for review November 18, 2025 22:36
Copilot AI review requested due to automatic review settings November 18, 2025 22:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes the no-longer-needed ASSETS_DIR environment variable from the Android test infrastructure. With the NativeAOT test host now properly setting AppContext.BaseDirectory, tests can access their data files directly without the fallback environment variable.

  • Removed ASSETS_DIR environment variable setup from Android test runner
  • Simplified test file path resolution to use AppContext.BaseDirectory directly
  • Eliminated unnecessary intermediate TestDataRoot field

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/tasks/AndroidAppBuilder/Templates/MonoRunner.java Removed setEnv("ASSETS_DIR", filesDir) call from runtime initialization
src/libraries/System.Security.Cryptography/tests/X509Certificates/TestFiles.cs Simplified TestDataFolder to use AppContext.BaseDirectory directly, removing the TestDataRoot field and ASSETS_DIR fallback

@sbomer
sbomer merged commit 195bab1 into main Nov 20, 2025
@akoeplinger
akoeplinger deleted the copilot/remove-assets-dir-variable branch November 21, 2025 12:07
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants