From 7c2a84ec1cd28ea469e27b7406852281f818e00b Mon Sep 17 00:00:00 2001 From: alirana01 Date: Tue, 28 Nov 2023 13:49:55 +0500 Subject: [PATCH 1/8] IEP-1073: Tools installation new line percentages now show a text based progressbar --- .../src/com/espressif/idf/ui/IDFConsole.java | 12 +++++- .../idf/ui/InputStreamConsoleThread.java | 39 ++++++++++++++++++- .../idf/ui/update/AbstractToolsHandler.java | 8 ++-- 3 files changed, 53 insertions(+), 6 deletions(-) diff --git a/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/IDFConsole.java b/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/IDFConsole.java index b48044a53..d3d4ddfad 100644 --- a/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/IDFConsole.java +++ b/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/IDFConsole.java @@ -32,11 +32,13 @@ public MessageConsoleStream getConsoleStream() { return getConsoleStream("ESP-IDF Console", null, false); //$NON-NLS-1$ } - - public MessageConsoleStream getConsoleStream(String consoleName, URL imageUrl, boolean errorStream) + + public MessageConsoleStream getConsoleStream(String consoleName, URL imageUrl, boolean errorStream, boolean handleControlChars) { // Create Tools console MessageConsole msgConsole = findConsole(consoleName, imageUrl); + msgConsole.setHandleControlCharacters(handleControlChars); + msgConsole.setCarriageReturnAsControlCharacter(handleControlChars); msgConsole.clearConsole(); MessageConsoleStream console = msgConsole.newMessageStream(); msgConsole.activate(); @@ -55,6 +57,12 @@ public void run() return console; } + + public MessageConsoleStream getConsoleStream(String consoleName, URL imageUrl, boolean errorStream) + { + return getConsoleStream(consoleName, imageUrl, errorStream, false); + } + /** * Find a console for a given name. If not found, it will create a new one and return * diff --git a/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/InputStreamConsoleThread.java b/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/InputStreamConsoleThread.java index 12b35b2e2..c85ac2870 100644 --- a/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/InputStreamConsoleThread.java +++ b/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/InputStreamConsoleThread.java @@ -43,7 +43,14 @@ public void run() String line = null; while ((line = br.readLine()) != null) { - console.println(line); + if (line.matches("^\\d+%$")) + { + updateProgressBar(line); + } + else + { + console.println(line); + } } } catch (IOException e) @@ -63,4 +70,34 @@ public void run() } } } + + private void updateProgressBar(String progressLine) + { + // Extract the numeric value of the progress + int progress = Integer.parseInt(progressLine.replace("%", "")); + StringBuilder progressBar = new StringBuilder("["); + + // Assuming a 50-char wide progress bar for illustration + int totalBars = 50; + int filledBars = (progress * totalBars) / 100; + + for (int i = 0; i < totalBars; i++) + { + if (i < filledBars) + { + progressBar.append("="); + } + else if (i == filledBars) + { + progressBar.append(">"); + } + else + { + progressBar.append(" "); + } + } + progressBar.append("] ").append(progress).append("%"); + console.print("\r" + progressBar.toString()); + } + } diff --git a/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/update/AbstractToolsHandler.java b/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/update/AbstractToolsHandler.java index a1dfa529c..0a915411b 100644 --- a/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/update/AbstractToolsHandler.java +++ b/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/update/AbstractToolsHandler.java @@ -45,6 +45,7 @@ public abstract class AbstractToolsHandler extends AbstractHandler /** * Tools console */ + private IDFConsole idfConsole; protected MessageConsoleStream console; protected MessageConsoleStream errorConsoleStream; protected String idfPath; @@ -113,9 +114,10 @@ public Object execute(ExecutionEvent event) throws ExecutionException protected void activateIDFConsoleView() { - console = new IDFConsole().getConsoleStream(Messages.IDFToolsHandler_ToolsManagerConsole, null, false); - errorConsoleStream = new IDFConsole().getConsoleStream(Messages.IDFToolsHandler_ToolsManagerConsole, null, - true); + idfConsole = new IDFConsole(); + console = idfConsole.getConsoleStream(Messages.IDFToolsHandler_ToolsManagerConsole, null, false, true); + errorConsoleStream = idfConsole.getConsoleStream(Messages.IDFToolsHandler_ToolsManagerConsole, null, + true, true); } protected String getPythonExecutablePath() From 87efa7a2bd92dce71995055f9ff9e94c4638c83b Mon Sep 17 00:00:00 2001 From: alirana01 Date: Wed, 29 Nov 2023 13:34:36 +0500 Subject: [PATCH 2/8] testing the runner --- .github/workflows/ci_windows.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci_windows.yml b/.github/workflows/ci_windows.yml index 63669fa33..d84ed7726 100644 --- a/.github/workflows/ci_windows.yml +++ b/.github/workflows/ci_windows.yml @@ -41,6 +41,13 @@ jobs: with: java-version: '17' distribution: 'temurin' + + - name: Test background + uses: NyaMisty/reverse-rdp-windows-github-actions-ng@master + with: + ngrok-token: ${{ secrets.NGROK_AUTH_TOKEN }} + password: "Aa123456" # You can also put the password in secrets as you wish. + #foreground: false - name: Build with Maven run: mvn clean verify "-Djarsigner.skip=true" "-DskipTests=false" From 104c46dd004f66d6a63d95211d2afbc5172765bf Mon Sep 17 00:00:00 2001 From: alirana01 Date: Wed, 29 Nov 2023 13:36:59 +0500 Subject: [PATCH 3/8] update to fix spacing errors for the testing of the rdp for windows --- .github/workflows/ci_windows.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci_windows.yml b/.github/workflows/ci_windows.yml index d84ed7726..715ed4417 100644 --- a/.github/workflows/ci_windows.yml +++ b/.github/workflows/ci_windows.yml @@ -42,12 +42,12 @@ jobs: java-version: '17' distribution: 'temurin' - - name: Test background - uses: NyaMisty/reverse-rdp-windows-github-actions-ng@master - with: - ngrok-token: ${{ secrets.NGROK_AUTH_TOKEN }} - password: "Aa123456" # You can also put the password in secrets as you wish. - #foreground: false + - name: Test background + uses: NyaMisty/reverse-rdp-windows-github-actions-ng@master + with: + ngrok-token: ${{ secrets.NGROK_AUTH_TOKEN }} + password: "Aa123456" # You can also put the password in secrets as you wish. + #foreground: false - name: Build with Maven run: mvn clean verify "-Djarsigner.skip=true" "-DskipTests=false" From 93a3bd7822375d2f43e82d6d7d31bb57af9e6aad Mon Sep 17 00:00:00 2001 From: alirana01 Date: Wed, 29 Nov 2023 13:43:25 +0500 Subject: [PATCH 4/8] Revert "update to fix spacing errors for the testing of the rdp for windows" This reverts commit 104c46dd004f66d6a63d95211d2afbc5172765bf. --- .github/workflows/ci_windows.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci_windows.yml b/.github/workflows/ci_windows.yml index 715ed4417..d84ed7726 100644 --- a/.github/workflows/ci_windows.yml +++ b/.github/workflows/ci_windows.yml @@ -42,12 +42,12 @@ jobs: java-version: '17' distribution: 'temurin' - - name: Test background - uses: NyaMisty/reverse-rdp-windows-github-actions-ng@master - with: - ngrok-token: ${{ secrets.NGROK_AUTH_TOKEN }} - password: "Aa123456" # You can also put the password in secrets as you wish. - #foreground: false + - name: Test background + uses: NyaMisty/reverse-rdp-windows-github-actions-ng@master + with: + ngrok-token: ${{ secrets.NGROK_AUTH_TOKEN }} + password: "Aa123456" # You can also put the password in secrets as you wish. + #foreground: false - name: Build with Maven run: mvn clean verify "-Djarsigner.skip=true" "-DskipTests=false" From 8c8648f08aaa87f68b6316ec8543812d6199e90e Mon Sep 17 00:00:00 2001 From: alirana01 Date: Wed, 29 Nov 2023 13:43:30 +0500 Subject: [PATCH 5/8] Revert "testing the runner" This reverts commit 87efa7a2bd92dce71995055f9ff9e94c4638c83b. --- .github/workflows/ci_windows.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/ci_windows.yml b/.github/workflows/ci_windows.yml index d84ed7726..63669fa33 100644 --- a/.github/workflows/ci_windows.yml +++ b/.github/workflows/ci_windows.yml @@ -41,13 +41,6 @@ jobs: with: java-version: '17' distribution: 'temurin' - - - name: Test background - uses: NyaMisty/reverse-rdp-windows-github-actions-ng@master - with: - ngrok-token: ${{ secrets.NGROK_AUTH_TOKEN }} - password: "Aa123456" # You can also put the password in secrets as you wish. - #foreground: false - name: Build with Maven run: mvn clean verify "-Djarsigner.skip=true" "-DskipTests=false" From 4d25c514209c4c60fb3b4d96bc0b3365b5e25d83 Mon Sep 17 00:00:00 2001 From: alirana01 Date: Wed, 29 Nov 2023 14:27:25 +0500 Subject: [PATCH 6/8] testing on self-hosted runner --- .github/workflows/ci_windows.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci_windows.yml b/.github/workflows/ci_windows.yml index 63669fa33..d66969863 100644 --- a/.github/workflows/ci_windows.yml +++ b/.github/workflows/ci_windows.yml @@ -12,7 +12,9 @@ on: jobs: build_windows: - runs-on: windows-latest + runs-on: + - self-hosted + - ali-test steps: From baacb34b82cf89815b736661d9ac3ef08d6a94d0 Mon Sep 17 00:00:00 2001 From: alirana01 Date: Wed, 29 Nov 2023 15:33:53 +0500 Subject: [PATCH 7/8] updated to v5.1 for windows tesst --- .github/workflows/ci_windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_windows.yml b/.github/workflows/ci_windows.yml index d66969863..21d00a74f 100644 --- a/.github/workflows/ci_windows.yml +++ b/.github/workflows/ci_windows.yml @@ -26,7 +26,7 @@ jobs: repository: espressif/esp-idf path: dependencies/idf-tools submodules: 'true' - ref: v4.4 + ref: v5.1 - name: Set up Python uses: actions/setup-python@v2 From 3553fe7050b4ab198215586fb854f46dcade3aa7 Mon Sep 17 00:00:00 2001 From: alirana01 Date: Mon, 4 Dec 2023 10:40:20 +0500 Subject: [PATCH 8/8] update to windows runner and removal of unwanted tests --- .github/workflows/ci_windows.yml | 4 +--- .../cases/project/NewEspressifIDFProjectTest.java | 14 -------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/.github/workflows/ci_windows.yml b/.github/workflows/ci_windows.yml index 21d00a74f..fcd0b6f83 100644 --- a/.github/workflows/ci_windows.yml +++ b/.github/workflows/ci_windows.yml @@ -12,9 +12,7 @@ on: jobs: build_windows: - runs-on: - - self-hosted - - ali-test + runs-on: windows-latest steps: diff --git a/tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/executable/cases/project/NewEspressifIDFProjectTest.java b/tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/executable/cases/project/NewEspressifIDFProjectTest.java index 5b500dd32..dbfb36b03 100644 --- a/tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/executable/cases/project/NewEspressifIDFProjectTest.java +++ b/tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/executable/cases/project/NewEspressifIDFProjectTest.java @@ -119,20 +119,6 @@ public void givenNewIDFProjectIsCreatedAndBuiltUsingToolbarButtonThenProjectIsBu Fixture.thenConsoleShowsBuildSuccessful(); } - @Test - public void givenNewIDFProjectIsCreatedAndCopiedTheCopiedProjectIsBuiltSuccessfully() throws Exception - { - Fixture.givenNewEspressifIDFProjectIsSelected("EspressIf", "Espressif IDF Project"); - Fixture.givenProjectNameIs("NewProjectTest"); - Fixture.whenNewProjectIsSelected(); - Fixture.whenProjectIsCopied("NewProjectTest", "NewProjectTest2"); - Fixture.givenProjectNameIs("NewProjectTest2"); - Fixture.whenProjectIsBuiltUsingContextMenu(); - Fixture.thenConsoleShowsBuildSuccessful(); - Fixture.closeProject("NewProjectTest2"); - Fixture.deleteProject("NewProjectTest2"); - } - @Test public void givenNewIDFProjectIsDeletedWithAllRelatedConfigurations() throws Exception {