-
Notifications
You must be signed in to change notification settings - Fork 133
WIP: SWTBot test case: Debug flow Test #795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,209 @@ | ||||||
| /******************************************************************************* | ||||||
| * Copyright 2025 Espressif Systems (Shanghai) PTE LTD. | ||||||
| * All rights reserved. Use is subject to license terms. | ||||||
| *******************************************************************************/ | ||||||
|
|
||||||
| package com.espressif.idf.ui.test.executable.cases.project; | ||||||
|
|
||||||
| import java.io.IOException; | ||||||
|
|
||||||
| import org.apache.commons.lang3.SystemUtils; | ||||||
| import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; | ||||||
| import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner; | ||||||
| import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox; | ||||||
| import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; | ||||||
| import org.junit.After; | ||||||
| import org.junit.BeforeClass; | ||||||
| import org.junit.FixMethodOrder; | ||||||
| import org.junit.Test; | ||||||
| import org.junit.runner.RunWith; | ||||||
| import org.junit.runners.MethodSorters; | ||||||
|
|
||||||
| import com.espressif.idf.ui.test.common.WorkBenchSWTBot; | ||||||
| import static org.eclipse.swtbot.swt.finder.waits.Conditions.*; | ||||||
| import static org.junit.Assert.assertTrue; | ||||||
|
|
||||||
| import com.espressif.idf.ui.test.common.utility.TestWidgetWaitUtility; | ||||||
| import com.espressif.idf.ui.test.operations.EnvSetupOperations; | ||||||
| import com.espressif.idf.ui.test.operations.ProjectTestOperations; | ||||||
| import com.espressif.idf.ui.test.operations.selectors.LaunchBarConfigSelector; | ||||||
| import com.espressif.idf.ui.test.operations.selectors.LaunchBarTargetSelector; | ||||||
|
|
||||||
| /** | ||||||
| * Test class to test Debug Process | ||||||
| * | ||||||
| * @author Andrii Filippov | ||||||
| * | ||||||
| */ | ||||||
|
|
||||||
| @SuppressWarnings("restriction") | ||||||
| @RunWith(SWTBotJunit4ClassRunner.class) | ||||||
| @FixMethodOrder(MethodSorters.NAME_ASCENDING) | ||||||
| public class IDFProjectDebugProcessTest | ||||||
| { | ||||||
| @BeforeClass | ||||||
| public static void beforeTestClass() throws Exception | ||||||
| { | ||||||
| Fixture.loadEnv(); | ||||||
| } | ||||||
|
|
||||||
| @After | ||||||
| public void afterEachTest() | ||||||
| { | ||||||
| try | ||||||
| { | ||||||
| Fixture.cleanTestEnv(); | ||||||
| } | ||||||
| catch (Exception e) | ||||||
| { | ||||||
| System.err.println("Error during cleanup: " + e.getMessage()); | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| @Test | ||||||
| public void givenNewProjectCreatedWhenFlashedAndDebuggedThenDebuggingWorks() throws Exception | ||||||
| { | ||||||
| if (SystemUtils.IS_OS_LINUX) //temporary solution until new ESP boards arrive for Windows | ||||||
| { | ||||||
| Fixture.givenNewEspressifIDFProjectIsSelected("EspressIf", "Espressif IDF Project"); | ||||||
| Fixture.givenProjectNameIs("NewProjecDebugTest"); | ||||||
|
||||||
| Fixture.givenProjectNameIs("NewProjecDebugTest"); | |
| Fixture.givenProjectNameIs("NewProjectDebugTest"); |
🤖 Prompt for AI Agents
In
tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/executable/cases/project/IDFProjectDebugProcessTest.java
around line 69, the project name string has a typo "NewProjecDebugTest"; update
the string literal to "NewProjectDebugTest" so the fixture uses the correctly
spelled project name.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Incomplete test implementation with commented debug steps.
The core debugging functionality is commented out, which means this test doesn't fully validate the debugging workflow as described in the PR objectives. The test stops at configuration selection rather than actual debugging verification.
The PR description mentions verifying "the match of the project name, Actual Executable, and SVD Path in the New ESP-IDF GDB OpenOCD Debugging Launch Configuration", but the actual debugging verification steps are commented out. Can you confirm whether this is intentional for this iteration, or if the debugging steps should be implemented to meet the PR objectives?
🏁 Script executed:
#!/bin/bash
# Search for any other debug-related test implementations that might provide guidance
rg -n "Debug.*Configuration" --type=java -C 3Length of output: 45763
Test selects the debug config but does not verify or launch it — implement verification or clarify intent
- The commented calls (Fixture.whenDebugProject / Fixture.whenSwitchPerspective at tests/.../IDFProjectDebugProcessTest.java) appear to be replaced by helper code: whenDebugProject() in tests/com.espressif.idf.ui.test/.../IDFProjectDebugProcessTest.java (≈lines 124–131) and ProjectTestOperations.createDebugConfiguration(...) in tests/com.espressif.idf.ui.test/.../ProjectTestOperations.java (≈lines 124–135); both only open/select the "ESP‑IDF GDB OpenOCD Debugging" node.
- There is no evidence these helpers click "Debug" or assert the PR-required fields ("project name", "Actual Executable", "SVD Path"). Implement assertions (or start the debug and inspect the launch configuration) to meet the PR objective, or update the PR to state that full debug verification is intentionally omitted.
🤖 Prompt for AI Agents
In
tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/executable/cases/project/IDFProjectDebugProcessTest.java
around lines 78–80, the test selects the "ESP‑IDF GDB OpenOCD Debugging" node
but never verifies or launches the debug configuration; update the test to
either (A) assert the selected launch configuration's required fields (validate
the launch config name/project name, Actual Executable path, and SVD Path) by
retrieving the ILaunchConfiguration (or equivalent helper) and asserting those
properties, or (B) actually start the debug launch and assert the expected
debugger/launch behavior; alternatively, if full verification is intentionally
omitted, update the PR description and test comments to state that deliberate
omission. Ensure new assertions fail on missing/incorrect values and keep helper
usage in ProjectTestOperations or whenDebugProject() to obtain the selected
configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Category label typo will break the wizard selection
"EspressIf" should be "Espressif" to match the UI category and avoid widget lookup failures.
📝 Committable suggestion
🤖 Prompt for AI Agents