Skip to content

Commit 56e8b3e

Browse files
meanmailclaude
andauthored
Fix test-framework resolution and hs-Cpp compilation across platforms (#31)
* Fix test-framework resolution and hs-Cpp compilation across platforms - Remove explicit version from testFramework() — let the plugin resolve it automatically from the configured platform dependency - Extract makeCmakeExecutable() into platform-specific branches: 252/253 use getBundledCMakeToolBinary(Boolean, ToolKind) API, 261 uses getBundledCMakeToolBinary(ToolKind) API Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * CI: run specific test tasks to avoid module classpath issues Module tests (hs-core, hs-Java, etc.) cannot run directly because prepareSandbox is disabled in modules, leaving IntelliJ Platform jars off the test runtime classpath. Run :intellij-plugin:test (which includes hs-core tests) plus standalone module tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Remove ignoreFailures=true so CI fails on test failures Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent aa3aa50 commit 56e8b3e

7 files changed

Lines changed: 37 additions & 11 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
echo "VERSION=${BASE_VERSION}.${{ github.run_number }}" >> $GITHUB_ENV
4343
4444
- name: Run tests
45-
run: ./gradlew test -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }}
45+
run: ./gradlew :intellij-plugin:test :hs-edu-format:test :hs-framework-storage:test -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }}
4646

4747
- name: Verify plugin
4848
run: ./gradlew verifyPlugin -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }}

buildSrc/src/main/kotlin/common-conventions.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ tasks {
6868
withType<Test> {
6969
withProp("excludeTests") { exclude(it) }
7070

71-
ignoreFailures = true
7271
filter {
7372
isFailOnNoMatchingTests = false
7473
}

buildSrc/src/main/kotlin/intellijUtils.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@ fun IntelliJPlatformDependenciesExtension.testIntellijPlugins(notations: List<St
186186
}
187187

188188
fun IntelliJPlatformDependenciesExtension.testIntellijPlatformFramework(
189-
project: Project,
189+
@Suppress("unused") project: Project,
190190
frameworkType: TestFrameworkType = TestFrameworkType.Platform,
191191
) {
192-
testFramework(frameworkType, project.baseVersion.toTypeWithVersion().version)
192+
testFramework(frameworkType)
193193
}
194194

195195
// Since 2024.1 CLion has two sets of incompatible plugins: based on classic language engine and new one (AKA Radler).
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package org.hyperskill.academy.cpp
2+
3+
import com.jetbrains.cidr.cpp.toolchains.CMakeExecutableTool
4+
5+
// BACKCOMPAT: 252. In 2025.2 getBundledCMakeToolBinary takes (Boolean, ToolKind) parameters
6+
internal fun makeCmakeExecutable() {
7+
@Suppress("DEPRECATION")
8+
val cmakeFile = CMakeExecutableTool.getBundledCMakeToolBinary(false, CMakeExecutableTool.ToolKind.CMAKE)
9+
if (cmakeFile.exists() && !cmakeFile.canExecute()) {
10+
cmakeFile.setExecutable(true)
11+
}
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package org.hyperskill.academy.cpp
2+
3+
import com.jetbrains.cidr.cpp.toolchains.CMakeExecutableTool
4+
5+
// BACKCOMPAT: 253. In 2025.3 getBundledCMakeToolBinary takes (Boolean, ToolKind) parameters
6+
internal fun makeCmakeExecutable() {
7+
@Suppress("DEPRECATION")
8+
val cmakeFile = CMakeExecutableTool.getBundledCMakeToolBinary(false, CMakeExecutableTool.ToolKind.CMAKE)
9+
if (cmakeFile.exists() && !cmakeFile.canExecute()) {
10+
cmakeFile.setExecutable(true)
11+
}
12+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package org.hyperskill.academy.cpp
2+
3+
import com.jetbrains.cidr.cpp.toolchains.CMakeExecutableTool
4+
5+
internal fun makeCmakeExecutable() {
6+
val cmakeFile = CMakeExecutableTool.getBundledCMakeToolBinary(CMakeExecutableTool.ToolKind.CMAKE)
7+
if (cmakeFile.exists() && !cmakeFile.canExecute()) {
8+
cmakeFile.setExecutable(true)
9+
}
10+
}

intellij-plugin/hs-Cpp/src/org/hyperskill/academy/cpp/CppConstantsPool.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,6 @@ val CMAKE_MINIMUM_REQUIRED_LINE_VALUE: String by lazy {
4747
}
4848
}
4949

50-
private fun makeCmakeExecutable() {
51-
val cmakeFile = CMakeExecutableTool.getBundledCMakeToolBinary(CMakeExecutableTool.ToolKind.CMAKE)
52-
if (cmakeFile.exists() && !cmakeFile.canExecute()) {
53-
cmakeFile.setExecutable(true)
54-
}
55-
}
56-
5750
const val CMAKE_PROJECT_NAME_KEY: String = "PROJECT_NAME"
5851

5952
const val CMAKE_CPP_STANDARD_KEY: String = "CPP_STANDARD"

0 commit comments

Comments
 (0)