Skip to content

Commit

Permalink
refresh liberty in singleMod
Browse files Browse the repository at this point in the history
  • Loading branch information
anusreelakshmi934 committed Jan 14, 2025
1 parent 75d3bf7 commit 7ee3961
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 41 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,14 @@ jobs:
strategy:
fail-fast: false
matrix:
runtime: [ linux, mac, windows ]
os: [ubuntu-latest, macOS-latest, windows-latest]
iteration: [1, 2, 3, 4]
include:
- runtime: linux
os: ubuntu-latest
- os: ubuntu-latest
reportName: linux-test-report
- runtime: mac
os: macOS-latest
- os: macOS-latest
reportName: mac-test-report
- runtime: windows
os: windows-latest
- os: windows-latest
reportName: windows-test-report
env:
USE_LOCAL_PLUGIN: ${{ inputs.useLocalPlugin || false }}
Expand Down Expand Up @@ -108,7 +106,7 @@ jobs:
if: ${{ runner.os == 'Linux' && !failure() }}
uses: actions/[email protected]
with:
name: liberty-tools-intellij-LTI-${{ env.REF_LTI_TAG || 'default' }}-LSP4IJ-${{ env.LSP4IJ_BRANCH }}
name: liberty-tools-intellij-LTI-${{ env.REF_LTI_TAG || 'default' }}-LSP4IJ-${{ env.LSP4IJ_BRANCH }}-${{ matrix.iteration }}
path: |
./**/*liberty-tools-intellij*.zip
./**/libs/*liberty-tools-intellij*.jar
Expand All @@ -122,6 +120,6 @@ jobs:
if: ${{ failure() && steps.run_tests.conclusion == 'failure' }}
uses: actions/[email protected]
with:
name: ${{ matrix.reportName }}-LTI-${{ env.REF_LTI_TAG || 'default' }}-LSP4IJ-${{ env.LSP4IJ_BRANCH }}
name: ${{ matrix.reportName }}-LTI-${{ env.REF_LTI_TAG || 'default' }}-LSP4IJ-${{ env.LSP4IJ_BRANCH }}-${{ matrix.iteration }}
path: |
liberty-tools-intellij/build/reports/
liberty-tools-intellij/build/reports/
Original file line number Diff line number Diff line change
Expand Up @@ -1144,6 +1144,8 @@ public static void prepareEnv(String projectPath, String projectName) {
// IntelliJ does not start building and indexing until the Project View is open
UIBotTestUtils.waitForIndexing(remoteRobot);
UIBotTestUtils.openAndValidateLibertyToolWindow(remoteRobot, projectName);
// Refresh the Liberty tool window using the refresh icon on the toolbar.
UIBotTestUtils.refreshLibertyToolWindow(remoteRobot);
UIBotTestUtils.expandLibertyToolWindowProjectTree(remoteRobot, projectName);

// Close all open editors.
Expand Down
38 changes: 7 additions & 31 deletions src/test/java/io/openliberty/tools/intellij/it/UIBotTestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -2201,39 +2201,15 @@ public static Map<String, String> getOpenedLibertyConfigDataAndCloseOnExit(Remot
public static void selectConfigUsingToolbar(RemoteRobot remoteRobot, String cfgName) {
ProjectFrameFixture projectFrame = remoteRobot.find(ProjectFrameFixture.class, Duration.ofSeconds(10));
ComponentFixture cfgSelectBox = projectFrame.getRunConfigurationsComboBoxButton();

boolean configFound = false;
int retryCount = 0;
int maxRetries = 5;

while (!configFound && retryCount < maxRetries) {
cfgSelectBox.click();

ComponentFixture cfgSelectPaneList = projectFrame.getMyList();
List<RemoteText> configs = cfgSelectPaneList.getData().getAll();

if (configs != null && !configs.isEmpty()) {
for (RemoteText cfg : configs) {
if (cfg.getText().equals(cfgName)) {
cfg.click();
configFound = true;
break;
}
}
}
if (!configFound) {
retryCount++;
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException("Thread interrupted while waiting for configuration list", e);
}
cfgSelectBox.click();
ComponentFixture cfgSelectPaneList = projectFrame.getMyList();
List<RemoteText> configs = cfgSelectPaneList.getData().getAll();
for (RemoteText cfg : configs) {
if (cfg.getText().equals(cfgName)) {
cfg.click();
break;
}
}
if (!configFound) {
throw new RuntimeException("Configuration '" + cfgName + "' not found after " + maxRetries + " attempts.");
}
}

/**
Expand Down

0 comments on commit 7ee3961

Please sign in to comment.