Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
fscarponi committed Mar 5, 2024
1 parent d721220 commit 45bce6a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: testResult-${{ matrix.os }}-${{ matrix.gradle-versions }}
path: /Users/runner/work/package-search-intellij-plugin/plugin/build/testData
path: /home/runner/work/package-search-intellij-plugin/package-search-intellij-plugin/plugin/build/testData
27 changes: 17 additions & 10 deletions plugin/src/test/kotlin/E2ETests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ class E2ETests {

System.getenv("GRADLE_VERSION")?.let {
Log.warn("patching project's gradle version to $it")
patchGradleVersion(it, projectDir)?.let {
it.copyTo(PKGS_TEST_DATA_OUTPUT_DIR.resolve("patched-gradle-wrapper.properties"), overwrite = true)
}
val pachedGradleFile= patchGradleVersion(it, projectDir)

pachedGradleFile?.copyTo(PKGS_TEST_DATA_OUTPUT_DIR.resolve("patched-gradle-wrapper.properties"), overwrite = true)
}

val testContext = buildIdeContext(projectDir)
Expand Down Expand Up @@ -130,24 +130,31 @@ class E2ETests {
?: error { "assertion data not found for project $projectName" }
)

assertNotNull(expected.value) {
assertNotNull(expected.value,
"deserialization of expected result failed or is null for project $projectName"
}
)
assertNotNull(
result.value,
"deserialization of test result failed or is null for project $projectName"
)


assert(expected.value?.keys?.any { it !in (result.value?.keys ?: emptySet()) } ?: false) {
"expected MODULE keys differ from result keys"
buildString{
appendLine("expected MODULE keys differ from result keys")
appendLine("expected: ${expected.value?.keys}")
appendLine("result: ${result.value?.keys}")
}
}

expected.value?.forEach { (key, value) ->
assertNotNull(result.value?.get(key),
"expected module $key not found in result modules" +
" ( result module: ${result.value?.keys} )" +
" ( expected module: ${expected.value?.keys} )"
assertNotNull(
result.value?.get(key),
buildString {
appendLine("expected module $key not found in result modules")
appendLine(" ( result module: ${result.value?.keys} )")
appendLine(" ( expected module: ${expected.value?.keys} )")
}
)
result.value?.get(key)?.let {
validateModule(value, it)
Expand Down

0 comments on commit 45bce6a

Please sign in to comment.