Skip to content

Add E2E test for workspace backup and restore functionality#23911

Open
artaleks9 wants to merge 5 commits into
mainfrom
crw-10952
Open

Add E2E test for workspace backup and restore functionality#23911
artaleks9 wants to merge 5 commits into
mainfrom
crw-10952

Conversation

@artaleks9

Copy link
Copy Markdown
Contributor

What does this PR do?

  • The test covers points 2-7 from the Jira issue CRW-10952:
2. Enter User Dashboard as a non-admin user, create a workspace from FactoryURL and add some files/changes.
> Workspace is running with user content
You can add some files/changes by executing the next command in workspace pod through API:
echo "123" > /projects/<project-name>/file.txt
3. Stop workspaces and wait until backup is created following BackupTimeuot parameter.
> Backup completes successfully
4. Get backup image URL from Workspace Details > Backup page.
5.Delete the workspace
> Workspace is removed
6.Restore the workspace from internal registry backup list.
> Workspace is restored with all previous content intact
You can check that files/changes are persisted by running the next command in workspace pod through API:
cat /projects/<project-name>/file.txt | grep "123"
7.Restore the workspace from backup image URL copied from step 4.
> Workspace is restored with all previous content intact and another name
  • Added new methods
  • Added new locators (using id/css where possible):

Screenshot/screencast of this PR

What issues does this PR fix or reference?

https://redhat.atlassian.net/browse/CRW-10952

How to test this PR?

Run the WorkspaceBackupRestore E2E test as usually

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

artaleks9 and others added 4 commits July 9, 2026 00:12
- Enhanced workspace pod discovery with fallback to prefix matching for restored workspaces
- Added detailed logging for pod and container name resolution
- Fixed workspace restoration from external registry
- Added methods for setting backup image URL and workspace name
- Improved error handling and debugging capabilities

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The issue occurs when a workspace is restored from backup - the DevWorkspace
object gets a random suffix (e.g., 'test-workspace-2-4fnq'), while the
dashboard shows the original name ('test-workspace-2'). This causes
workspace deletion to fail because the API URL is constructed with the
name without the suffix.

Added resolveWorkspaceName() method to ApiUrlResolver that:
1. First tries exact name match (fast path for normal workspaces)
2. If not found, searches for DevWorkspace with pattern: name + '-' + alphanumeric suffix
3. Validates suffix format to prevent false matches (e.g., won't match 'test-workspace-20')
4. Returns error if multiple matches found (prevents accidental deletions)

This fix maintains backward compatibility - existing tests are unaffected
as exact matches are resolved immediately without additional API calls.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Comment thread tests/e2e/utils/KubernetesCommandLineToolsExecutor.ts Dismissed
@tolusha

tolusha commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Hi! I'm che-ai-assistant — I help with your pull requests.

Available commands:

  • /che-ai-assistant generate-che-doc — Generate a documentation PR based on this PR's changes
  • /che-ai-assistant ok-pr-review — Run a comprehensive PR review (summary, code review, deep review, impact analysis)
  • /che-ai-assistant check-pr-test-failures — Analyze failing CI checks, identify root causes, and suggest fixes
  • /che-ai-assistant update-che-e2e-tests — Update Eclipse Che e2e tests
  • /che-ai-assistant help — Show this help message

@artaleks9 artaleks9 changed the title [Test] Add E2E test for workspace backup and restore functionality [WIP] [Test] Add E2E test for workspace backup and restore functionality Jul 10, 2026
…ber ordering

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@artaleks9 artaleks9 changed the title [WIP] [Test] Add E2E test for workspace backup and restore functionality [Test] Add E2E test for workspace backup and restore functionality Jul 10, 2026
@artaleks9 artaleks9 changed the title [Test] Add E2E test for workspace backup and restore functionality Add E2E test for workspace backup and restore functionality Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants