Skip to content

Commit

Permalink
chore: disable service tests (redhat-developer#948)
Browse files Browse the repository at this point in the history
* chore: update to latest IJ 2024.3

Signed-off-by: Stephane Bouchet <[email protected]>

* chore: update to latest IJ 2024.3

Signed-off-by: Stephane Bouchet <[email protected]>

* chore: update to latest IJ 2024.3

Signed-off-by: Stephane Bouchet <[email protected]>

* chore: update to latest IJ 2024.3

Signed-off-by: Stephane Bouchet <[email protected]>

* chore: update to latest IJ 2024.3

Signed-off-by: Stephane Bouchet <[email protected]>

* chore: disable services tests

Signed-off-by: Stephane Bouchet <[email protected]>

* chore: disable services tests

Signed-off-by: Stephane Bouchet <[email protected]>

* chore: disable services tests

Signed-off-by: Stephane Bouchet <[email protected]>

* chore: disable services tests

Signed-off-by: Stephane Bouchet <[email protected]>

* chore: disable services tests

Signed-off-by: Stephane Bouchet <[email protected]>

* chore: disable services tests

Signed-off-by: Stephane Bouchet <[email protected]>

---------

Signed-off-by: Stephane Bouchet <[email protected]>
  • Loading branch information
sbouchet authored Dec 9, 2024
1 parent 05fc702 commit 20de3d6
Show file tree
Hide file tree
Showing 17 changed files with 126 additions and 63 deletions.
30 changes: 17 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
pull_request:
branches: [ main ]

permissions:
pull-requests: write

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
Expand Down Expand Up @@ -75,19 +78,20 @@ jobs:
validate-wrappers: true
- uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde #v1.10.0
name: Start cluster
- name: Setup cluster
run: |
curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.26.0/install.sh | bash -s v0.26.0
kubectl create -f https://operatorhub.io/install/service-binding-operator.yaml
kubectl create -f https://operatorhub.io/install/stable/cloud-native-postgresql.yaml
nb=0
echo -n "Waiting for operator to show up "
while [ "$nb" != "2" ]
do
echo -n "."
sleep 1
nb=`kubectl get pods -n operators --no-headers --ignore-not-found | grep Running | wc -l`
done
# service setup disabled along with service test because service binding operator is deprecated, and postgres service isn't available anymore
# - name: Setup cluster
# run: |
# curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.26.0/install.sh | bash -s v0.26.0
# kubectl create -f https://operatorhub.io/install/service-binding-operator.yaml
# kubectl create -f https://operatorhub.io/install/stable/cloud-native-postgresql.yaml
# nb=0
# echo -n "Waiting for operator to show up "
# while [ "$nb" != "2" ]
# do
# echo -n "."
# sleep 1
# nb=`kubectl get pods -n operators --no-headers --ignore-not-found | grep Running | wc -l`
# done
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Play integration tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cluster_integration_ui_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
validate-wrappers: true
- uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde #v1.10.0
name: Start cluster
# service setup disabled along with service test
# service setup disabled along with service test because service binding operator is deprecated, and postgres service isn't available anymore
# - name: Setup cluster
# run: |
# curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.26.0/install.sh | bash -s v0.26.0
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/conventionalCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ on:
- opened
- edited
- synchronize
- reopened

permissions:
pull-requests: read

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 #v5.5.3
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ jobs:
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
distribution: 'temurin'
cache: 'gradle'

# Setup Gradle
- name: Setup Gradle
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate_IJ_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
IJ: [ 2022.3, 2023.1, 2023.2, 2023.3, 2024.1, 2024.2 ]
IJ: [ 2022.3, 2023.1, 2023.2, 2023.3, 2024.1, 2024.2, 2024.3 ]

steps:
- name: Checkout Code
Expand Down
46 changes: 30 additions & 16 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
import org.jetbrains.intellij.platform.gradle.models.ProductRelease

plugins {
id("idea")
id("java") // Java support
alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin
alias(libs.plugins.testLogger) // Nice test logs
id("jacoco") // Code coverage
alias(libs.plugins.sonarqube) // SonarQube
}
Expand Down Expand Up @@ -127,6 +130,13 @@ tasks {
test {
systemProperty("com.redhat.devtools.intellij.telemetry.mode", "disabled")
jvmArgs("-Djava.awt.headless=true")
useJUnit()
testLogging {
events(TestLogEvent.FAILED)
exceptionFormat = TestExceptionFormat.FULL
showStackTraces = true
showStandardStreams = false
}
}

withType<Test> {
Expand Down Expand Up @@ -165,6 +175,11 @@ tasks {
mainClass.set("org.jboss.tools.intellij.openshift.ui.sandbox.SandboxRegistrationServerMock")
}

printProductsReleases {
channels = listOf(ProductRelease.Channel.EAP)
types = listOf(IntelliJPlatformType.IntellijIdeaCommunity)
untilBuild = provider { null }
}
}

sourceSets {
Expand All @@ -191,22 +206,22 @@ val integrationTest by intellijPlatformTesting.testIde.registering {
group = "verification"
testClassesDirs = sourceSets["it"].output.classesDirs
classpath = sourceSets["it"].runtimeClasspath
testlogger {
showStandardStreams = true
showPassedStandardStreams = false
showSkippedStandardStreams = false
showFailedStandardStreams = true
showFullStackTraces = true
testLogging {
events(TestLogEvent.FAILED)
exceptionFormat = TestExceptionFormat.FULL
showStackTraces = true
showStandardStreams = false
}
jvmArgs("-Djava.awt.headless=true")
useJUnitPlatform {
includeEngines("junit-vintage")
excludeEngines("junit-jupiter")
}
shouldRunAfter(tasks["test"])
}

plugins {
robotServerPlugin()
}

dependencies {
testRuntimeOnly(libs.junit.vintage.engine)
testImplementation(libs.junit.platform.launcher)
testImplementation(libs.junit.platform.suite)
testImplementation(libs.junit.jupiter)
Expand All @@ -228,12 +243,11 @@ val integrationUITest by intellijPlatformTesting.testIde.registering {
group = "verification"
testClassesDirs = sourceSets["it"].output.classesDirs
classpath = sourceSets["it"].runtimeClasspath
testlogger {
testLogging {
events(TestLogEvent.FAILED)
exceptionFormat = TestExceptionFormat.FULL
showStackTraces = true
showStandardStreams = true
showPassedStandardStreams = false
showSkippedStandardStreams = false
showFailedStandardStreams = true
showFullStackTraces = true
}
jvmArgs("-Djava.awt.headless=false") // use of clipboard in AboutPublicTest, set to false
val includes = if (System.getenv("CLUSTER_ALREADY_LOGGED_IN") == null) "**/PublicTestsSuite.class" else "**/ClusterTestsSuite.class"
Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ jetBrainsChannel=stable
platformVersion=2024.3

# Gradle Releases -> https://github.com/gradle/gradle/releases
gradleVersion = 8.5
gradleVersion=8.5

# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
platformBundledPlugins = com.intellij.java, org.jetbrains.plugins.yaml, org.jetbrains.plugins.terminal
platformPlugins = com.redhat.devtools.intellij.telemetry:1.2.1.62, com.redhat.devtools.intellij.kubernetes:1.4.0.4
platformBundledPlugins=com.intellij.java, org.jetbrains.plugins.yaml, org.jetbrains.plugins.terminal
platformPlugins=com.redhat.devtools.intellij.telemetry:1.2.1.62, com.redhat.devtools.intellij.kubernetes:1.4.0.4

# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 223
pluginSinceBuild=223

# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
kotlin.stdlib.default.dependency = false
kotlin.stdlib.default.dependency=false

# Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html
org.gradle.configuration-cache = true
org.gradle.configuration-cache=true

# Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html
org.gradle.caching = true
org.gradle.caching=true

org.gradle.jvmargs=-XX\:MaxHeapSize\=512m -Xmx4g -Xms1g
3 changes: 1 addition & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ annotations = "24.0.0"

# plugins
gradleIntelliJPlugin = "2.0.1"
testlogger = "4.0.0"
sonarqube = "5.1.0.4882"

[libraries]
Expand All @@ -37,11 +36,11 @@ junit-platform-suite = { group = "org.junit.platform", name = "junit-platform-su
junit-jupiter = { group = "org.junit.jupiter", name = "junit-jupiter", version.ref = "junit-jupiter" }
junit-jupiter-api = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junit-jupiter" }
junit-jupiter-engine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junit-jupiter" }
junit-vintage-engine = { group = "org.junit.vintage", name = "junit-vintage-engine", version.ref = "junit-jupiter" }
devtools-common-ui-test = { group = "com.redhat.devtools.intellij", name = "intellij-common-ui-test-library", version.ref = "devtools-common-ui-test" }
awaitility = { group = "org.awaitility", name = "awaitility", version.ref = "awaitility" }
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }

[plugins]
gradleIntelliJPlugin = { id = "org.jetbrains.intellij.platform", version.ref = "gradleIntelliJPlugin" }
testLogger = { id = "com.adarshr.test-logger", version.ref = "testlogger" }
sonarqube = { id = "org.sonarqube", version.ref = "sonarqube" }
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ public class Charts {
public static final String CHART_KUBEROS = "kuberos";
public static final String CHART_SYSDIG = "sysdig";

public static final Pair<String, String> REPOSITORY_STABLE = new Pair("stable", "https://charts.helm.sh/stable");
public static final Pair<String, String> REPOSITORY_OPENSHIFT = new Pair("openshift", "https://charts.openshift.io/");
public static final Pair<String, String> REPOSITORY_STABLE = new Pair<>("stable", "https://charts.helm.sh/stable");

public static Chart get(String name, Helm helm) throws Exception {
Optional<Chart> found = helm.search(name).stream().findFirst();
Expand All @@ -35,4 +34,8 @@ public static void addRepository(Pair<String, String> pair, Helm helm) throws IO
helm.addRepo(pair.first, pair.second, null);
}

public static void removeRepository(Pair<String, String> pair, Helm helm) throws IOException {
helm.removeRepos(pair.first);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
import java.io.IOException;
import java.util.List;

import static org.assertj.core.api.Assertions.assertThat;

public class HelmCliRepoTest extends HelmCliTest {

public void testListRepos_should_list_repo_that_was_added() throws IOException {
Expand Down Expand Up @@ -47,14 +45,16 @@ public void testRemoveRepos_should_remove_repo_that_was_added() throws IOExcepti
List<String> helmRepositoryNames = helm.listRepos().stream()
.map(HelmRepository::getName)
.toList();
assertThat(helmRepositoryNames).contains(name, name2);
assertTrue(helmRepositoryNames.contains(name));
assertTrue(helmRepositoryNames.contains(name2));
// when
helm.removeRepos(name, name2);
// then
helmRepositoryNames = helm.listRepos().stream()
.map(HelmRepository::getName)
.toList();
assertThat(helmRepositoryNames).doesNotContain(name, name2);
assertFalse(helmRepositoryNames.contains(name));
assertFalse(helmRepositoryNames.contains(name2));
} finally {
silentlyRemoveRepos(name, name2);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected void tearDown() throws Exception {
if (tool != null) {
tool.get().deleteProject(projectName);
}
Charts.removeRepository(Charts.REPOSITORY_STABLE, helm);
super.tearDown();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.intellij.openshift.utils.odo;

import org.junit.Ignore;
import org.junit.Test;

import java.io.IOException;
import java.util.List;
import java.util.concurrent.ExecutionException;
Expand All @@ -19,6 +22,7 @@

public class OdoCliCatalogTest extends OdoCliTest {

@Test
public void testCheckGetComponentTypes() throws IOException, ExecutionException, InterruptedException {
String project = PROJECT_PREFIX + random.nextInt();
try {
Expand All @@ -30,6 +34,8 @@ public void testCheckGetComponentTypes() throws IOException, ExecutionException,
}
}

@Test
@Ignore("Service operator is deprecated")
public void testCheckGetServiceTemplates() throws IOException, ExecutionException, InterruptedException {
String project = PROJECT_PREFIX + random.nextInt();
try {
Expand All @@ -42,6 +48,8 @@ public void testCheckGetServiceTemplates() throws IOException, ExecutionExceptio
}
}

@Test
@Ignore("Service operator is deprecated")
public void testCheckMultiPlansServiceTemplates() throws IOException, ExecutionException, InterruptedException {
String project = PROJECT_PREFIX + random.nextInt();
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
Expand Down Expand Up @@ -131,6 +132,7 @@ public void checkCreateAndDeleteComponent() throws IOException, ExecutionExcepti
}

@Test
@Ignore("Service operator is deprecated")
public void checkCreateComponentAndLinkService() throws IOException, ExecutionException, InterruptedException {
createComponent(project, component, projectPath);
ServiceTemplate serviceTemplate = getServiceTemplate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,35 @@
******************************************************************************/
package org.jboss.tools.intellij.openshift.utils.odo;

import org.junit.Test;

import java.io.IOException;
import java.util.List;
import java.util.concurrent.ExecutionException;

public class OdoCliProjectTest extends OdoCliTest {

@Test
public void testCheckCreateProject() throws IOException, ExecutionException, InterruptedException {
String project = PROJECT_PREFIX + random.nextInt();
try {
List<String> projects = odo.getNamespaces();
assertFalse(projects.isEmpty());
createProject(project);
assertEquals(projects.size()+1, odo.getNamespaces().size());
} finally {
odo.deleteProject(project);
}
}

@Test
public void testCheckListProjects() throws IOException, ExecutionException, InterruptedException {
String project = PROJECT_PREFIX + random.nextInt();
try {
createProject(project);
List<String> projects = odo.getNamespaces();
assertFalse(projects.isEmpty());
assertTrue(projects.contains(project));
} finally {
odo.deleteProject(project);
}
Expand Down
Loading

0 comments on commit 20de3d6

Please sign in to comment.