Skip to content

Commit

Permalink
Fix broken AndroidConfigurationTest.kt on main
Browse files Browse the repository at this point in the history
Summary:
The bump of AGP to 7.2 caused the tests inside `AndroidConfigurationTest.kt` to fail.

As we're now running `buildAll` both on Sandcastle and on CircleCI, this is now failing
on both CIs. The issue is that AGP 7.2 change the way to introspect resValues and
requires now to specify a type when querying for a value. I'm updating the tests here.

Changelog:
[Internal] [Fixed] - Fix broken AndroidConfigurationTest.kt on main

Reviewed By: cipolleschi

Differential Revision: D36437875

fbshipit-source-id: 58f457a78eae861e86808e58c23f5d04fb196d45
  • Loading branch information
cortinico authored and facebook-github-bot committed May 17, 2022
1 parent d5a6bee commit d51534a
Showing 1 changed file with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ class AndroidConfigurationTest {

project.configureDevPorts(androidExtension)

assertEquals("8081", debug?.resValues?.get("react_native_dev_server_port")?.value)
assertEquals("8081", debug?.resValues?.get("react_native_inspector_proxy_port")?.value)
assertEquals("8081", release?.resValues?.get("react_native_dev_server_port")?.value)
assertEquals("8081", release?.resValues?.get("react_native_inspector_proxy_port")?.value)
assertEquals("8081", debug?.resValues?.get("integer/react_native_dev_server_port")?.value)
assertEquals("8081", debug?.resValues?.get("integer/react_native_inspector_proxy_port")?.value)
assertEquals("8081", release?.resValues?.get("integer/react_native_dev_server_port")?.value)
assertEquals(
"8081", release?.resValues?.get("integer/react_native_inspector_proxy_port")?.value)
}

@Test
Expand All @@ -42,10 +43,11 @@ class AndroidConfigurationTest {

project.configureDevPorts(androidExtension)

assertEquals("42424", debug?.resValues?.get("react_native_dev_server_port")?.value)
assertEquals("42424", debug?.resValues?.get("react_native_inspector_proxy_port")?.value)
assertEquals("42424", release?.resValues?.get("react_native_dev_server_port")?.value)
assertEquals("42424", release?.resValues?.get("react_native_inspector_proxy_port")?.value)
assertEquals("42424", debug?.resValues?.get("integer/react_native_dev_server_port")?.value)
assertEquals("42424", debug?.resValues?.get("integer/react_native_inspector_proxy_port")?.value)
assertEquals("42424", release?.resValues?.get("integer/react_native_dev_server_port")?.value)
assertEquals(
"42424", release?.resValues?.get("integer/react_native_inspector_proxy_port")?.value)
}

@Test
Expand All @@ -60,9 +62,10 @@ class AndroidConfigurationTest {

project.configureDevPorts(androidExtension)

assertEquals("8081", debug?.resValues?.get("react_native_dev_server_port")?.value)
assertEquals("42424", debug?.resValues?.get("react_native_inspector_proxy_port")?.value)
assertEquals("8081", release?.resValues?.get("react_native_dev_server_port")?.value)
assertEquals("42424", release?.resValues?.get("react_native_inspector_proxy_port")?.value)
assertEquals("8081", debug?.resValues?.get("integer/react_native_dev_server_port")?.value)
assertEquals("42424", debug?.resValues?.get("integer/react_native_inspector_proxy_port")?.value)
assertEquals("8081", release?.resValues?.get("integer/react_native_dev_server_port")?.value)
assertEquals(
"42424", release?.resValues?.get("integer/react_native_inspector_proxy_port")?.value)
}
}

0 comments on commit d51534a

Please sign in to comment.