Skip to content

Commit

Permalink
chore: Support IJ 2023.2 (#656)
Browse files Browse the repository at this point in the history
* chore: Support IJ 2023.2

Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>

* chore: Support IJ 2023.2

Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>

* chore: Support IJ 2023.2

fix tests

Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>

* chore: Support IJ 2023.2

revert

Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>

* chore: Support IJ 2023.2

fix tests

Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>

* chore: Support IJ 2023.2

update telemetry version

Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>

* chore: Support IJ 2023.2

fix tests

Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>

---------

Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>
  • Loading branch information
sbouchet authored Oct 25, 2023
1 parent ef2068c commit 6147944
Show file tree
Hide file tree
Showing 45 changed files with 345 additions and 645 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/IJ.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
IJ: [IU-2021.1, IU-2021.2, IU-2021.3, IU-2022.1, IU-2022.2, IU-2022.3]
IJ: [IU-2022.1, IU-2022.2, IU-2022.3, IU-2023.1, IU-2023.2]

steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

[![JetBrains Marketplace](https://img.shields.io/jetbrains/plugin/v/14096-tekton-pipelines-by-red-hat?label=Jet%20Brains%20Marketplace&style=for-the-badge)](https://plugins.jetbrains.com/plugin/14096-tekton-pipelines-by-red-hat)
[![Downloads](https://img.shields.io/jetbrains/plugin/d/14096-tekton-pipelines-by-red-hat?logo=jetbrains&style=for-the-badge)](https://plugins.jetbrains.com/plugin/14096-tekton-pipelines-by-red-hat)
[![Java CI with Gradle](https://img.shields.io/github/workflow/status/redhat-developer/intellij-tekton/Java%20CI%20with%20Gradle?label=Java%20CI%20with%20Gradle&style=for-the-badge)](https://github.com/redhat-developer/intellij-tekton/actions/workflows/ci.yml?query=workflow%3ACI)
[![Validate against IJ versions](https://img.shields.io/github/workflow/status/redhat-developer/intellij-tekton/Validate%20against%20IJ%20versions?label=IJ%20Versions&style=for-the-badge)](https://github.com/redhat-developer/intellij-tekton/actions/workflows/IJ.yml)
[![Java CI with Gradle](https://img.shields.io/github/actions/workflow/status/redhat-developer/intellij-tekton/ci.yml?label=Java%20CI%20with%20Gradle&style=for-the-badge)](https://github.com/redhat-developer/intellij-tekton/actions/workflows/ci.yml?query=workflow%3ACI)
[![Validate against IJ versions](https://img.shields.io/github/actions/workflow/status/redhat-developer/intellij-tekton/IJ.yml?label=IJ%20Versions&style=for-the-badge)](https://github.com/redhat-developer/intellij-tekton/actions/workflows/IJ.yml)
[![License](https://img.shields.io/github/license/redhat-developer/intellij-tekton?style=for-the-badge)](https://github.com/redhat-developer/intellij-tekton/blob/main/LICENSE)

# IntelliJ Tekton
Expand Down
65 changes: 45 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform

buildscript {
ext {
ijGradlePluginVersion = (DefaultNativePlatform.currentOperatingSystem.isMacOsX() ? "1.7.0" : "1.12.0")
/*
* for more complex conversion ideaVersion -> sinceIdeaBuild
* see https://github.com/rhdunn/xquery-intellij-plugin/blob/master/build.gradle#L1-L47
*/
def since = ideaVersion =~ /I.-20(\d\d)\.([1-3])(\.\d+)?$/
if (since.matches()) {
ext.sinceIdeaBuild = "${since.group(1)}${since.group(2)}".toInteger()
} else {
ext.sinceIdeaBuild = 0
}

if (ext.sinceIdeaBuild >= 223) {
ext.java_version = "17"
} else {
ext.java_version = "11"
}
}


plugins {
id "org.jetbrains.intellij" version "${ijGradlePluginVersion}"
id "org.jetbrains.intellij" version "1.16.0"
id "idea"
id "java"
id "jacoco"
Expand All @@ -21,10 +33,14 @@ repositories {
maven { url 'https://jitpack.io' }
}

sourceCompatibility = '11'
targetCompatibility = '11'
configurations {
compileOptions {
sourceCompatibility = java_version
targetCompatibility = java_version
}
}

def versionsMap = ['IU-2021.1':'211.6693.108', 'IU-2021.2':'212.4746.57', 'IU-2021.3':'213.5744.122', 'IU-2022.1':'221.5080.1', 'IU-2022.2':'222.3345.16', 'IU-2022.3':'223.7571.175']
def versionsMap = ['IU-2022.1':'221.5080.1', 'IU-2022.2':'222.3345.16', 'IU-2022.3':'223.7571.175', 'IU-2023.1':'231.8109.91', 'IU-2023.2':'232.8660.158']

intellij {
version = ideaVersion //for a full list of IntelliJ IDEA releases please see https://www.jetbrains.com/intellij-repository/releases
Expand All @@ -34,9 +50,9 @@ intellij {
'terminal',
'yaml',
'markdown',
'com.redhat.devtools.intellij.telemetry:0.0.3.33',
'com.redhat.devtools.intellij.telemetry:1.0.0.44',
'com.intellij.kubernetes:' + versionsMap[ideaVersion],
'com.redhat.devtools.intellij.kubernetes:0.7.1.208'
'com.redhat.devtools.intellij.kubernetes:1.2.0.271'
]
updateSinceUntilBuild = false
}
Expand All @@ -49,24 +65,27 @@ runIdeForUiTests {
systemProperties['com.redhat.devtools.intellij.telemetry.mode'] = 'debug'
}

//with this option enabled, build will fail about IDEA expiration builds
buildSearchableOptions.enabled = false

dependencies {
implementation 'io.fabric8:openshift-client:6.4.0'
implementation 'io.fabric8:tekton-client:6.4.0'
implementation 'com.redhat.devtools.intellij:intellij-common:1.9.0'
implementation 'io.fabric8:openshift-client:6.4.1'
implementation 'io.fabric8:tekton-client:6.4.1'
implementation 'com.redhat.devtools.intellij:intellij-common:1.9.1'
implementation 'com.redhat.devtools.alizer:alizer-api:0.1.0'
testImplementation 'org.mockito:mockito-inline:4.6.1'
implementation 'com.github.vlsi.mxgraph:jgraphx:4.2.2'
testImplementation 'org.mockito:mockito-inline:4.6.1'
//Tekton Hub client dependencies
implementation 'io.swagger:swagger-annotations:1.6.6'
implementation 'io.swagger:swagger-annotations:1.6.11'
implementation 'io.gsonfire:gson-fire:1.8.5'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
//IntelliJ Kubernetes plugin brings old okio so we need
//to explicitely declare it here. If the Tekton F8 is
//to explicitly declare it here. If the Tekton F8 is
//updated check the version
implementation 'com.squareup.okio:okio:3.1.0'
// telemetry contributes annotations 13.0.0, so we need to declare newer version
implementation 'org.jetbrains:annotations:23.0.0'
testImplementation 'com.redhat.devtools.intellij:intellij-common:1.9.0:test'
testImplementation 'com.redhat.devtools.intellij:intellij-common:1.9.1:test'
}

configurations {
Expand All @@ -77,25 +96,31 @@ configurations {
integrationTestRuntimeOnly.extendsFrom testRuntimeOnly
}

test {
// Discover and execute JUnit4-based tests
useJUnit()
jvmArgs "-Djava.awt.headless=true"
}

sourceSets {
integrationTest {
java.srcDir file('src/it/java')
resources.srcDir file('src/it/resources')
compileClasspath += sourceSets.main.output + configurations.testRuntimeClasspath
compileClasspath += sourceSets.main.output + sourceSets.test.output + configurations.testRuntimeClasspath
runtimeClasspath += output + compileClasspath
}
main {
java.srcDirs += file("$buildDir/hubapi-java/src/main/java")
}
}

task integrationTest(type: Test) {
tasks.register('integrationTest', Test) {
description = 'Runs the integration tests.'
group = 'verification'
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
outputs.upToDateWhen { false }
mustRunAfter test
jvmArgs "-Djava.awt.headless=true"
}

publishPlugin {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ideaVersion = IU-2021.1
ideaVersion = IU-2023.2
projectVersion=1.4.1-SNAPSHOT
jetBrainsToken=invalid
jetBrainsChannel=stable
39 changes: 0 additions & 39 deletions src/it/java/com/redhat/devtools/intellij/tektoncd/BaseTest.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,32 @@

public class TknCliClusterTaskTest extends TknCliTest {

@Test
public void verifyCreateClusterTaskAndDelete() throws IOException {
public void testVerifyCreateClusterTaskAndDelete() throws IOException {
final String TASK_NAME = "ctfirst";
String resourceBody = TestUtils.load("clustertask1.yaml").replace("ctfoo", TASK_NAME);
TestUtils.saveResource(tkn, resourceBody, "", "clustertasks");
TestUtils.saveResource(getTkn(), resourceBody, "", "clustertasks");
// verify task has been created
List<String> tasks = tkn.getClusterTasks().stream().map(task -> task.getMetadata().getName()).collect(Collectors.toList());
List<String> tasks = getTkn().getClusterTasks().stream().map(task -> task.getMetadata().getName()).collect(Collectors.toList());
assertTrue(tasks.contains(TASK_NAME));
// clean up and verify cleaning succeed
tkn.deleteClusterTasks(tasks, false);
tasks = tkn.getClusterTasks().stream().map(task -> task.getMetadata().getName()).collect(Collectors.toList());
getTkn().deleteClusterTasks(tasks, false);
tasks = getTkn().getClusterTasks().stream().map(task -> task.getMetadata().getName()).collect(Collectors.toList());
assertFalse(tasks.contains(TASK_NAME));
}

@Test
public void verifyClusterTaskYAMLIsReturnedCorrectly() throws IOException {
public void testVerifyClusterTaskYAMLIsReturnedCorrectly() throws IOException {
final String TASK_NAME = "ctsecond";
String resourceBody = TestUtils.load("clustertask1.yaml").replace("ctfoo", TASK_NAME);
TestUtils.saveResource(tkn, resourceBody, "", "clustertasks");
TestUtils.saveResource(getTkn(), resourceBody, "", "clustertasks");
// verify pipeline has been created
List<String> tasks = tkn.getClusterTasks().stream().map(task -> task.getMetadata().getName()).collect(Collectors.toList());;
List<String> tasks = getTkn().getClusterTasks().stream().map(task -> task.getMetadata().getName()).collect(Collectors.toList());;
assertTrue(tasks.contains(TASK_NAME));
// get YAML from cluster and verify is the same uploaded
String resourceBodyFromCluster = tkn.getClusterTaskYAML(TASK_NAME);
String resourceBodyFromCluster = getTkn().getClusterTaskYAML(TASK_NAME);
assertEquals(TestUtils.getSpecFromResource(resourceBody), TestUtils.getSpecFromResource(resourceBodyFromCluster));
// clean up and verify cleaning succeed
tkn.deleteClusterTasks(tasks, false);
tasks = tkn.getClusterTasks().stream().map(task -> task.getMetadata().getName()).collect(Collectors.toList());;
getTkn().deleteClusterTasks(tasks, false);
tasks = getTkn().getClusterTasks().stream().map(task -> task.getMetadata().getName()).collect(Collectors.toList());;
assertFalse(tasks.contains(TASK_NAME));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,32 @@
public class TknCliClusterTriggerBindingTest extends TknCliTest {
private static final String CTB_PLURAL = "clustertriggerbindings";

@Test
public void verifyCreateClusterTriggerBindingAndDelete() throws IOException {
public void testVerifyCreateClusterTriggerBindingAndDelete() throws IOException {
final String CTB_NAME = "ctbfirst";
String resourceBody = TestUtils.load("clustertriggerbinding1.yaml").replace("ctbfoo", CTB_NAME);
TestUtils.saveResource(tkn, resourceBody, "", CTB_PLURAL);
TestUtils.saveResource(getTkn(), resourceBody, "", CTB_PLURAL);
// verify ctb has been created
List<String> ctbs = tkn.getClusterTriggerBindings();
List<String> ctbs = getTkn().getClusterTriggerBindings();
assertTrue(ctbs.contains(CTB_NAME));
// clean up and verify cleaning succeed
tkn.deleteClusterTriggerBindings(ctbs.stream().filter(ctb -> ctb.equalsIgnoreCase(CTB_NAME)).collect(Collectors.toList()));
ctbs = tkn.getClusterTriggerBindings();
getTkn().deleteClusterTriggerBindings(ctbs.stream().filter(ctb -> ctb.equalsIgnoreCase(CTB_NAME)).collect(Collectors.toList()));
ctbs = getTkn().getClusterTriggerBindings();
assertFalse(ctbs.contains(CTB_NAME));
}

@Test
public void verifyClusterTriggerBindingYAMLIsReturnedCorrectly() throws IOException {
public void testVerifyClusterTriggerBindingYAMLIsReturnedCorrectly() throws IOException {
final String CTB_NAME = "ctbsecond";
String resourceBody = TestUtils.load("clustertriggerbinding1.yaml").replace("ctbfoo", CTB_NAME);
TestUtils.saveResource(tkn, resourceBody, "", CTB_PLURAL);
TestUtils.saveResource(getTkn(), resourceBody, "", CTB_PLURAL);
// verify ctb has been created
List<String> ctbs = tkn.getClusterTriggerBindings();
List<String> ctbs = getTkn().getClusterTriggerBindings();
assertTrue(ctbs.contains(CTB_NAME));
// get YAML from cluster and verify is the same uploaded
String resourceBodyFromCluster = tkn.getClusterTriggerBindingYAML(CTB_NAME);
String resourceBodyFromCluster = getTkn().getClusterTriggerBindingYAML(CTB_NAME);
assertEquals(TestUtils.getSpecFromResource(resourceBody), TestUtils.getSpecFromResource(resourceBodyFromCluster));
/// clean up and verify cleaning succeed
tkn.deleteClusterTriggerBindings(ctbs.stream().filter(ctb -> ctb.equalsIgnoreCase(CTB_NAME)).collect(Collectors.toList()));
ctbs = tkn.getClusterTriggerBindings();
getTkn().deleteClusterTriggerBindings(ctbs.stream().filter(ctb -> ctb.equalsIgnoreCase(CTB_NAME)).collect(Collectors.toList()));
ctbs = getTkn().getClusterTriggerBindings();
assertFalse(ctbs.contains(CTB_NAME));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,39 +26,37 @@ public class TknCliEventListenerTest extends TknCliTest {
private static final String EL_PLURAL = "eventlisteners";
private static final String EL_NAME_IN_FILE = "elfoo";

@Test
public void verifyCreateEventListenerAndDelete() throws IOException, InterruptedException {
public void testVerifyCreateEventListenerAndDelete() throws IOException, InterruptedException {
final String EL_NAME = "elfirst";
String resourceBody = TestUtils.load("eventlistener1.yaml").replace(EL_NAME_IN_FILE, EL_NAME);
TestUtils.saveResource(tkn, resourceBody, NAMESPACE, EL_PLURAL);
TestUtils.saveResource(getTkn(), resourceBody, NAMESPACE, EL_PLURAL);
// verify el has been created
List<String> els = tkn.getEventListeners(NAMESPACE);
List<String> els = getTkn().getEventListeners(NAMESPACE);
assertTrue(els.contains(EL_NAME));
// clean up and verify cleaning succeed
tkn.deleteEventListeners(NAMESPACE, els.stream().filter(el -> el.equalsIgnoreCase(EL_NAME)).collect(Collectors.toList()));
getTkn().deleteEventListeners(NAMESPACE, els.stream().filter(el -> el.equalsIgnoreCase(EL_NAME)).collect(Collectors.toList()));
Thread.sleep(2000); // adding a bit delay to allow run to be created
els = tkn.getEventListeners(NAMESPACE);
els = getTkn().getEventListeners(NAMESPACE);
assertFalse(els.contains(EL_NAME));
}

@Test
public void verifyEventListenerYAMLIsReturnedCorrectly() throws IOException, InterruptedException {
public void testVerifyEventListenerYAMLIsReturnedCorrectly() throws IOException, InterruptedException {
final String EL_NAME = "elsecond";
String resourceBody = TestUtils.load("eventlistener1.yaml").replace(EL_NAME_IN_FILE, EL_NAME);
TestUtils.saveResource(tkn, resourceBody, NAMESPACE, EL_PLURAL);
TestUtils.saveResource(getTkn(), resourceBody, NAMESPACE, EL_PLURAL);
// verify tb has been created
List<String> els = tkn.getEventListeners(NAMESPACE);
List<String> els = getTkn().getEventListeners(NAMESPACE);
assertTrue(els.contains(EL_NAME));
// get YAML from cluster and verify is the same uploaded
String resourceBodyFromCluster = tkn.getEventListenerYAML(NAMESPACE, EL_NAME);
String resourceBodyFromCluster = getTkn().getEventListenerYAML(NAMESPACE, EL_NAME);
String[] triggersPath = new String[] {"spec", "triggers", "name"};
assertEquals(getValueFromResource(resourceBody, triggersPath), getValueFromResource(resourceBodyFromCluster, triggersPath));
String[] saPath = new String[] {"spec", "serviceAccountName"};
assertEquals(getValueFromResource(resourceBody, saPath), getValueFromResource(resourceBodyFromCluster, saPath));
/// clean up and verify cleaning succeed
tkn.deleteEventListeners(NAMESPACE, els.stream().filter(el -> el.equalsIgnoreCase(EL_NAME)).collect(Collectors.toList()));
getTkn().deleteEventListeners(NAMESPACE, els.stream().filter(el -> el.equalsIgnoreCase(EL_NAME)).collect(Collectors.toList()));
Thread.sleep(2000); // adding a bit delay to allow run to be created
els = tkn.getEventListeners(NAMESPACE);
els = getTkn().getEventListeners(NAMESPACE);
assertFalse(els.contains(EL_NAME));
}

Expand Down
Loading

0 comments on commit 6147944

Please sign in to comment.