Skip to content

Commit

Permalink
Features/2023.1 update (#19)
Browse files Browse the repository at this point in the history
* disable dynamic plugin

* fix ui tests
  • Loading branch information
cschar committed Mar 22, 2023
1 parent e6845de commit 53ac793
Show file tree
Hide file tree
Showing 13 changed files with 108 additions and 59 deletions.
37 changes: 32 additions & 5 deletions .github/workflows/run-ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,24 @@ jobs:
fail-fast: false
matrix:
include:
# - os: windows-latest
# runIde: start gradlew.bat runIdeForUiTests
# - os: macos-latest
# runIde: ./gradlew runIdeForUiTests &
# runTest: |
# export TEST_TYPE=UI
# ./gradlew :test --info --tests "com.cschar.pmode3.uitest.OpenSettingsJavaTest.opens_project"

- os: ubuntu-latest
runIde: |
export DISPLAY=:99.0
Xvfb -ac :99 -screen 0 1920x1080x16 &
gradle runIdeForUiTests &
- os: windows-latest
runIde: start gradlew.bat runIdeForUiTests
- os: macos-latest
runIde: ./gradlew runIdeForUiTests &
runUITest: |
export TEST_TYPE=UI
export DISPLAY=:99.0
Xvfb -ac :99 -screen 0 1920x1080x16 &
./gradlew :test --info --tests "com.cschar.pmode3.uitest.OpenSettingsJavaTest.opens_project"
steps:

Expand All @@ -51,9 +60,27 @@ jobs:
uses: jtalk/url-health-check-action@v3
with:
url: http://127.0.0.1:8082
max-attempts: 15
max-attempts: 30
retry-delay: 30s

# Run tests
- name: Tests
run: ./gradlew test

- name: Run UI Tests
run: ${{ matrix.runUITest }}

# - name: Tests IDE
# env:
# TEST_TYPE: UI
# run: |
# ./gradlew :test --info --tests "com.cschar.pmode3.uitest.OpenSettingsJavaTest.opens_project"
#
## linux broken
# - name: Tests IDE
# env:
# TEST_TYPE: UI
# DISPLAY: ":99"
# run: |
# Xvfb -ac :99 -screen 0 1920x1080x16 &
# ./gradlew :test --info --tests "com.cschar.pmode3.uitest.OpenSettingsJavaTest.opens_project"
17 changes: 11 additions & 6 deletions .github/workflows/runTest.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run UI Tests (old version)
name: Run UI Tests v1


on:
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 11
java-version: 17
- name: Setup FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v1
with:
Expand All @@ -83,14 +83,19 @@ jobs:
run: gradle :clean

- name: Run Idea
run: start gradlew.bat :runIdeForUiTests
run: |
pwd
ls
./gradlew runIdeForUiTests
# run: start gradlew.bat :runIdeForUiTests

- name: Wait for Idea started
uses: jtalk/url-health-check-action@v1.5
uses: jtalk/url-health-check-action@v3
with:
url: http://localhost:8082
max-attempts: 15
retry-delay: 30s
max-attempts: 30
# retry-delay: 30s
retry-delay: 15s

- name: Tests
run: gradle :test
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
# power-mode-zeranthium Changelog

## [Unreleased]
- 2023.1 eap update
- 2023.1 update
- basic particles now show on first time startup
- disable lizard on first time startup


## [3.1.0] - 2023-03-13
- 2022.3 update
- quieter logs
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# power-mode-zeranthium

[![Build](https://github.com/cschar/power-mode-zeranthium/actions/workflows/runTest.yaml/badge.svg)](https://github.com/cschar/power-mode-zeranthium/actions/workflows/runTest.yaml)
[![Build](https://github.com/cschar/power-mode-zeranthium/actions/workflows/run-ui-tests.yml/badge.svg)](https://github.com/cschar/power-mode-zeranthium/actions/workflows/run-ui-tests.yaml)
[![Version](https://img.shields.io/jetbrains/plugin/v/13176-power-mode--zeranthium.svg)](https://plugins.jetbrains.com/plugin/13176-power-mode--zeranthium)
[![Downloads](https://img.shields.io/jetbrains/plugin/d/13176-power-mode--zeranthium.svg)](https://plugins.jetbrains.com/plugin/13176-power-mode--zeranthium)

Expand Down
5 changes: 1 addition & 4 deletions README_dev_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ add in Help > diagnostic Tools > Debug Log Settings
#com.cschar.pmode3:all (including # at start)


# upgrading gradle
https://tomgregory.com/how-to-update-gradle/
./gradlew wrapper --gradle-version 7.6.1
./gradlew --version


# logo design

Expand Down
9 changes: 5 additions & 4 deletions README_dev_refactor.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ links to
[1] https://github.com/krasa/StringManipulation/commit/43a4bc5e99f63663a7b2c5d8d75b1550a3e0a408
[2] https://github.com/krasa/StringManipulation/commit/08422d714ce70126093c051bd5147c8f9dbcdd3f

# TODO

RE-enable memory monitor UI

## DIAGNOSTICS
#com.cschar.pmode3:all
Expand All @@ -31,17 +33,16 @@ links to

## BUGS ?


-- Dyanmic Plugin memory when shutting down
-- HeapDump debug with VisualVM, start VM with same JDK that Sandbox IDe is running
-- Use VisualVMPlugin extension tool to start it with same JDK
-- When stopping with CTRL+SHIFT+Z.... particles/dinos still float away instead of immediatly disappearing
-- in Droste, moving caret with arrow keys doesnt resize cover

## upgrade
put docs on astro site
https://docs.astro.build/en/guides/deploy/github/

# potentially..
- dynamic plugin enable/disable
- pack loaders now use Modal UIs when fetching packs from github

/opt/jdk/11/bin/javadoc \
-docletpath -docletpath ./build/classes/java/main \
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ tasks {
patchPluginXml {
version.set(properties("pluginVersion"))
sinceBuild.set(properties("pluginSinceBuild"))
untilBuild.set(properties("pluginUntilBuild"))
// untilBuild.set(properties("pluginUntilBuild"))

// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
pluginDescription.set(providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ pluginGroup = com.github.cschar.pmode3
pluginName = power-mode-zeranthium
pluginRepositoryUrl = https://github.com/cschar/power-mode-zeranthium
# SemVer format -> https://semver.org
pluginVersion = 3.2.0-eap.2
#pluginVersion = 3.2.0-eap.2
pluginVersion = 3.2.0

# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 231
# Not specifying until-build means it will include all future builds (including unreleased IDE versions, which might impact compatibility later).
pluginUntilBuild = 231.*

# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,26 +340,26 @@ public void actionPerformed(ActionEvent e) {
LOGGER.debug("launching Git Clone task");

//TODO Add this task to a hashmap to keep track of it.
Task.Modal modalTask2 = new Task.Modal(null, downloadBUtton,
"Cloning "+customRepoName+"...",
true) {
// Task.Backgroundable bgTask2 = new Task.Backgroundable(null,
// "Cloning "+customRepoName+"...",
// true, null) {
// Task.Modal task = new Task.Modal(null, downloadBUtton,
// "Cloning "+customRepoName+"...",
// true) {
Task.Backgroundable task = new Task.Backgroundable(null,
"Cloning "+customRepoName+"...",
true, null) {

@Override
public void onCancel() {
super.onCancel();
GitPackLoaderService gitService = ApplicationManager.getApplication().getService(GitPackLoaderService.class);
gitService.runningMonitors.remove(customRepoName);
gitService.backgroundTasks.remove(customRepoName);
// gitService.backgroundTasks.remove(customRepoName);
}

@Override
public void onFinished() {
GitPackLoaderService gitService = ApplicationManager.getApplication().getService(GitPackLoaderService.class);
gitService.runningMonitors.remove(customRepoName);
gitService.backgroundTasks.remove(customRepoName);
// gitService.backgroundTasks.remove(customRepoName);
super.onFinished();
}

Expand Down Expand Up @@ -403,7 +403,7 @@ public void run(@NotNull ProgressIndicator progressIndicator) {
LOGGER.trace("Launching cloning task from thread " + Thread.currentThread().toString());
// ProgressManager.getInstance().run(bgTask2);
// gitService.backgroundTasks.put(customRepoName, bgTask2);
ProgressManager.getInstance().run(modalTask2);
ProgressManager.getInstance().run(task);



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public GitPackLoaderService()
{
//
runningMonitors = new HashMap<>();
backgroundTasks = new HashMap<>();
// backgroundTasks = new HashMap<>();
}


Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--https://plugins.jetbrains.com/docs/intellij/plugin-configuration-file.html-->
<!--<idea-plugin url="https://github.com/cschar/power-mode-zeranthium" require-restart="true" >-->
<idea-plugin url="https://github.com/cschar/power-mode-zeranthium" >
<idea-plugin url="https://github.com/cschar/power-mode-zeranthium" require-restart="true" >
<!--<idea-plugin url="https://github.com/cschar/power-mode-zeranthium" >-->

<id>com.cschar.power.mode3.zeranthium</id>
<name>Power Mode - Zeranthium</name>
Expand All @@ -21,7 +21,7 @@
groupWeight="20"
instance="com.cschar.pmode4.AppSettingsConfigurable"
id="power.mode3.zeranthium"
displayName="PowerMode Zeranthium"/>
displayName="Power Mode - Zeranthium"/>

<applicationService serviceImplementation="com.cschar.pmode3.services.GitPackLoaderService"/>
<applicationService serviceInterface="com.cschar.pmode3.services.MemoryMonitorService"
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/cschar/pmode3/PowerMode3Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
//
//
//
// Test Failing with similar error
// https://youtrack.jetbrains.com/issue/IDEA-313397
//// Test Failing with similar error
//// https://youtrack.jetbrains.com/issue/IDEA-313397
//
////The BasePlatformTestcase seems to be from Junit3... so gradle's test task, using Junit4 Vintage enigne can't seem to run it...
////public class PowerMode3Test extends BasePlatformTestCase {
Expand Down
58 changes: 37 additions & 21 deletions src/test/java/com/cschar/pmode3/uitest/OpenSettingsJavaTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@

import com.intellij.ui.components.JBTabbedPane;
import org.assertj.swing.fixture.JTabbedPaneFixture;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.*;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import org.junit.jupiter.api.extension.ExtendWith;

Expand Down Expand Up @@ -70,6 +67,7 @@ public static void initLogging() {

@Test
@Video
@Order(1)
void opens_project(final RemoteRobot remoteRobot) {
System.out.println("starting..");

Expand Down Expand Up @@ -101,7 +99,7 @@ void opens_project(final RemoteRobot remoteRobot) {
System.out.println("found Ideaframe, waiting to exit dumb mode...");
waitFor(ofMinutes(5), () -> !idea.isDumbMode());

System.out.println("opening settings..");
System.out.println("opening settings...");

if (remoteRobot.isMac()) {
keyboard.hotKey(VK_META, VK_COMMA);
Expand Down Expand Up @@ -130,23 +128,25 @@ void opens_project(final RemoteRobot remoteRobot) {
byXpath("//div[@text.key='button.cancel']"),
Duration.ofSeconds(5)).click();

System.out.println("Closing the project...");

step("Close the project", () -> {
if (remoteRobot.isMac()) {
keyboard.hotKey(VK_SHIFT, VK_META, VK_A);
keyboard.enterText("Close Project");
keyboard.enter();
} else {
actionMenu(remoteRobot, "File").click();
actionMenuItem(remoteRobot, "Close Project").click();
}
});
//Don't close so next test can run
// System.out.println("Closing the project...");
//
// step("Close the project", () -> {
// if (remoteRobot.isMac()) {
// keyboard.hotKey(VK_SHIFT, VK_META, VK_A);
// keyboard.enterText("Close Project");
// keyboard.enter();
// } else {
// actionMenu(remoteRobot, "File").click();
// actionMenuItem(remoteRobot, "Close Project").click();
// }
// });

// assert 5 == 3;
}

@Test
@Order(2)
void createDownloadAndCancel_ReopeningShows_ReadyStatus(final RemoteRobot remoteRobot) {
// sharedSteps.createNewCommandLineProject();
// sharedSteps.closeTipOfTheDay();
Expand Down Expand Up @@ -184,7 +184,8 @@ void createDownloadAndCancel_ReopeningShows_ReadyStatus(final RemoteRobot remote

settingsDialog.find(ComponentFixture.class,
// byXpath("//div[@accessiblename.key='icon.nodes.nodePlaceholder.tooltip' and @class='JLabel']"),
byXpath("//div[@text='packs']"),
// byXpath("//div[@text='packs']"),
byXpath("//div[@text='|']"),
Duration.ofSeconds((3))).click();

settingsDialog.find(ComponentFixture.class,
Expand Down Expand Up @@ -216,13 +217,25 @@ void createDownloadAndCancel_ReopeningShows_ReadyStatus(final RemoteRobot remote
// assert(gitService.runningMonitors.size() == 1);

idea.find(ComponentFixture.class,
byXpath("//div[@mytext='Cloning zeranthium-extras-vol1...']"),
// byXpath("//div[@mytext='Cloning zeranthium-extras-vol1...']"),
//2023.1 elements...
byXpath("//div[@accessiblename='Cloning zeranthium-extras-vol1...' and @class='TextPanel' and @text='Cloning zeranthium-extras-vol1...']"),
Duration.ofSeconds(LONG_WAIT_5s)).click();



idea.find(ComponentFixture.class,
byXpath("//div[@myicon='stop.svg']"),
Duration.ofSeconds(2)).click();

//incase we click it too fast... try to click again
try {
idea.find(ComponentFixture.class,
byXpath("//div[@myicon='stop.svg']"),
Duration.ofSeconds(5)).click();
}catch (Exception e){

}
// waitFor(ofSeconds(3), () -> gitService.runningMonitors.size() == 0);
// assert(gitService.runningMonitors.size() == 0);

Expand All @@ -243,8 +256,8 @@ void createDownloadAndCancel_ReopeningShows_ReadyStatus(final RemoteRobot remote
Duration.ofSeconds(LONG_WAIT_5s)).click();

settingsRentry.find(ComponentFixture.class,
byXpath("//div[@text='packs']"),
// byXpath("//div[@accessiblename.key='icon.nodes.nodePlaceholder.tooltip' and @class='JLabel']"),
// byXpath("//div[@text='packs']"),
byXpath("//div[@text='|']"),
Duration.ofSeconds((LONG_WAIT_5s))).click();

settingsRentry.find(ComponentFixture.class,
Expand All @@ -266,8 +279,11 @@ void createDownloadAndCancel_ReopeningShows_ReadyStatus(final RemoteRobot remote


@Test
@Order(3)
@Disabled()
void createDownload_ReopeningShows_DownloadLabel(final RemoteRobot remoteRobot) {

//This frame is an open project,not the home screen
final IdeaFrame idea = remoteRobot.find(IdeaFrame.class, ofSeconds(10));
waitFor(ofMinutes(5), () -> !idea.isDumbMode());

Expand Down

0 comments on commit 53ac793

Please sign in to comment.