From 377756ca02fc3f1a0fd5786e0270b1691a81b4ef Mon Sep 17 00:00:00 2001 From: Jesse Wilson Date: Tue, 19 Nov 2024 22:11:30 -0500 Subject: [PATCH 1/4] Upload test reports --- .github/workflows/build.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7f4cc23069..8fc64ccab1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -27,6 +27,13 @@ jobs: - run: ./scripts/enforce_git_lfs.sh - run: ./gradlew kotlinUpgradeYarnLock build -PredwoodNoApps -x dokkaHtml + - uses: actions/upload-artifact@v4 + if: ${{ always() }} + with: + name: test-report + path: '**/build/reports/tests/**' + retention-days: 1 + emulator-tests: runs-on: ubuntu-latest steps: From 148e8822656215e4ec2df4aebcf9f4304b627036 Mon Sep 17 00:00:00 2001 From: Jesse Wilson Date: Wed, 20 Nov 2024 11:51:40 -0500 Subject: [PATCH 2/4] Run all the tests even when one fails --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8fc64ccab1..550ff4b756 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -25,7 +25,7 @@ jobs: - uses: gradle/actions/setup-gradle@v4 - run: ./scripts/enforce_git_lfs.sh - - run: ./gradlew kotlinUpgradeYarnLock build -PredwoodNoApps -x dokkaHtml + - run: ./gradlew kotlinUpgradeYarnLock build -PredwoodNoApps -x dokkaHtml --continue - uses: actions/upload-artifact@v4 if: ${{ always() }} From ec94e41b754a318874f250cacc407632184ba8d3 Mon Sep 17 00:00:00 2001 From: Jesse Wilson Date: Wed, 20 Nov 2024 13:52:47 -0500 Subject: [PATCH 3/4] WIP --- .github/workflows/build.yaml | 3 +- .../cash/redwood/widget/RedwoodUIViewTest.kt | 55 ++++++++++--------- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 550ff4b756..b0c2364f58 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -25,7 +25,8 @@ jobs: - uses: gradle/actions/setup-gradle@v4 - run: ./scripts/enforce_git_lfs.sh - - run: ./gradlew kotlinUpgradeYarnLock build -PredwoodNoApps -x dokkaHtml --continue +# - run: ./gradlew kotlinUpgradeYarnLock build -PredwoodNoApps -x dokkaHtml --continue + - run: ./gradlew :redwood-widget:iosSimulatorArm64Test -PredwoodNoApps -x dokkaHtml --continue - uses: actions/upload-artifact@v4 if: ${{ always() }} diff --git a/redwood-widget/src/iosTest/kotlin/app/cash/redwood/widget/RedwoodUIViewTest.kt b/redwood-widget/src/iosTest/kotlin/app/cash/redwood/widget/RedwoodUIViewTest.kt index 2d051d98a8..6942cccc0e 100644 --- a/redwood-widget/src/iosTest/kotlin/app/cash/redwood/widget/RedwoodUIViewTest.kt +++ b/redwood-widget/src/iosTest/kotlin/app/cash/redwood/widget/RedwoodUIViewTest.kt @@ -31,16 +31,16 @@ import platform.UIKit.UIWindow import platform.UIKit.additionalSafeAreaInsets class RedwoodUIViewTest { - @Test - fun widgetsAddChildViews() { - val redwoodUIView = RedwoodUIView() - - val label = UILabel() - redwoodUIView.children.insert(0, UIViewWidget(label)) - - assertThat(redwoodUIView.value.subviews).containsExactly(label) - } - +// @Test +// fun widgetsAddChildViews() { +// val redwoodUIView = RedwoodUIView() +// +// val label = UILabel() +// redwoodUIView.children.insert(0, UIViewWidget(label)) +// +// assertThat(redwoodUIView.value.subviews).containsExactly(label) +// } +// /** * Confirm we accept and propagates insets through [RedwoodUIView.uiConfiguration]. * @@ -49,26 +49,29 @@ class RedwoodUIViewTest { */ @Test fun viewInsets() { - val redwoodUIView = RedwoodUIView() - val viewController = object : UIViewController(null, null) { - override fun loadView() { - view = redwoodUIView.value - } - } - +// val redwoodUIView = RedwoodUIView() +// val viewController = object : UIViewController(null, null) { +// override fun loadView() { +// view = redwoodUIView.value +// } +// } +// + println("MAKING A WINDOW") val window = UIWindow( CGRectMake(0.0, 0.0, 390.0, 844.0), // iPhone 14. ) + println("makeKeyAndVisible") window.makeKeyAndVisible() - window.rootViewController = viewController - - assertThat(redwoodUIView.uiConfiguration.value.viewInsets) - .isEqualTo(Margin.Zero) - - viewController.additionalSafeAreaInsets = UIEdgeInsetsMake(10.0, 20.0, 30.0, 40.0) - - assertThat(redwoodUIView.uiConfiguration.value.viewInsets) - .isEqualTo(Margin(top = 10.0.dp, start = 20.0.dp, bottom = 30.0.dp, end = 40.0.dp)) + println("SUCCESS") +// window.rootViewController = viewController +// +// assertThat(redwoodUIView.uiConfiguration.value.viewInsets) +// .isEqualTo(Margin.Zero) +// +// viewController.additionalSafeAreaInsets = UIEdgeInsetsMake(10.0, 20.0, 30.0, 40.0) +// +// assertThat(redwoodUIView.uiConfiguration.value.viewInsets) +// .isEqualTo(Margin(top = 10.0.dp, start = 20.0.dp, bottom = 30.0.dp, end = 40.0.dp)) } class UIViewWidget( From ade0a01a9b24d9df598fd1a5552656240c384334 Mon Sep 17 00:00:00 2001 From: Jesse Wilson Date: Wed, 20 Nov 2024 14:10:48 -0500 Subject: [PATCH 4/4] setHidden(false) --- .../kotlin/app/cash/redwood/widget/RedwoodUIViewTest.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redwood-widget/src/iosTest/kotlin/app/cash/redwood/widget/RedwoodUIViewTest.kt b/redwood-widget/src/iosTest/kotlin/app/cash/redwood/widget/RedwoodUIViewTest.kt index 6942cccc0e..6fb9e3b15e 100644 --- a/redwood-widget/src/iosTest/kotlin/app/cash/redwood/widget/RedwoodUIViewTest.kt +++ b/redwood-widget/src/iosTest/kotlin/app/cash/redwood/widget/RedwoodUIViewTest.kt @@ -60,8 +60,8 @@ class RedwoodUIViewTest { val window = UIWindow( CGRectMake(0.0, 0.0, 390.0, 844.0), // iPhone 14. ) - println("makeKeyAndVisible") - window.makeKeyAndVisible() + println("setHidden(false)") + window.setHidden(false) println("SUCCESS") // window.rootViewController = viewController //