From e6c00926a67af8c6e5f31013952b5686f1fd4b85 Mon Sep 17 00:00:00 2001 From: Abe Pazos Date: Thu, 17 Jul 2025 18:38:06 +0200 Subject: [PATCH] Revert problematic test --- .github/workflows/build.yml | 9 ---- .../kotlin-multiplatform.gradle.kts | 8 +-- karma-config.d/karma-config.js | 7 --- .../src/commonTest/kotlin/TestComposition.kt | 52 ------------------- 4 files changed, 1 insertion(+), 75 deletions(-) delete mode 100644 karma-config.d/karma-config.js diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac50c5e5..07546edd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,14 +49,5 @@ jobs: - name: Build ORX run: ./gradlew build - - name: Upload Test Report - if: ${{ failure() }} - uses: actions/upload-artifact@v4 - with: - name: reports - path: | - **/build/reports/ - **/build/test-results/ - - name: Collect screenshots without errors run: xvfb-run ./gradlew collectScreenshots diff --git a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts index 681b575e..38156852 100644 --- a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts +++ b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts @@ -76,13 +76,7 @@ kotlin { js(IR) { browser() - nodejs { - testTask { - useMocha { - timeout = "30s" - } - } - } + nodejs() } sourceSets { diff --git a/karma-config.d/karma-config.js b/karma-config.d/karma-config.js deleted file mode 100644 index cb6bd5a2..00000000 --- a/karma-config.d/karma-config.js +++ /dev/null @@ -1,7 +0,0 @@ -config.set({ - client: { - mocha: { - timeout: 300000 - } - } -}); diff --git a/orx-composition/src/commonTest/kotlin/TestComposition.kt b/orx-composition/src/commonTest/kotlin/TestComposition.kt index 266d030d..b7374f19 100644 --- a/orx-composition/src/commonTest/kotlin/TestComposition.kt +++ b/orx-composition/src/commonTest/kotlin/TestComposition.kt @@ -1,14 +1,9 @@ package org.openrndr.extra.composition -import org.openrndr.math.Vector2 -import org.openrndr.shape.Circle -import org.openrndr.shape.LineSegment -import org.openrndr.shape.Rectangle import org.openrndr.shape.Shape import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertNull -import kotlin.test.assertTrue class TestComposition { val composition = let { _ -> @@ -43,50 +38,3 @@ class TestComposition { assertNull(composition.findImage("shape")) } } - -class TestCompositionIntersections { - @Test - fun `use a shape as a mask for line segments`() { - // Make sure intersections do not fail randomly, which was fixed in - // https://github.com/openrndr/orx/commit/e8f50b3dd153ed82de121e9017cf42f6ea95ac8e - val bounds = Rectangle(Vector2.ZERO, 640.0, 480.0) - - // Create a 2D torus - val outline = Shape( - listOf( - Circle(bounds.center, 70.0).contour.reversed, - Circle(bounds.center, 100.0).contour, - ) - ) - - val radius = outline.bounds.dimensions.length / 2 - val off = outline.bounds.center - - val compositions = List(100) { - // Create compositions featuring horizontal lines - // visible inside the torus shape. Change the number of - // lines to make sure the calculations are not cached. - val num = radius.toInt() + it - drawComposition { - lineSegments(List(num) { segNum -> - val yNorm = (segNum / (num - 1.0)) - val x = ((segNum % 2) * 2.0 - 1.0) * radius - val y = (yNorm * 2.0 - 1.0) * radius - val start = Vector2(-x, y) + off - val end = Vector2(x, y) + off - LineSegment(start, end) - }) - clipMode = ClipMode.INTERSECT - shape(outline) - } - } - - val shapes = compositions.last().findShapes() - val dimensions = compositions.last().bounds.dimensions - - assertTrue(shapes.isNotEmpty(), "shapes should not be empty") - assertTrue(shapes.first().shape.contours.isNotEmpty(), "contour should not be empty") - assertTrue(dimensions.x > 0.0, "dimensions.x should be greater than 0.0") - assertTrue(dimensions.y > 0.0, "dimensions.y should be greater than 0.0") - } -}