-
Notifications
You must be signed in to change notification settings - Fork 437
RI-8004 Add decompression setting E2E test #5600
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
Open
pd-redis
wants to merge
8
commits into
main
Choose a base branch
from
e2e/RI-8004/decompression
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+133
−4
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c1bc615
test(e2e): add decompression setting E2E test
pd-redis 6dc98ec
test(e2e): enhance decompression E2E test with search functionality
pd-redis abe74ef
fix(tests): fix decompression E2E test to select compressor format
pd-redis addb624
test(e2e): add GZIP decompression verification in Browser
pd-redis ffe2478
checkpoint before checking out e2e/RI-7997/connection-security
pd-redis d348d49
Remove continual learning state files and unused compressor method fr…
pd-redis 9935c2e
Remove outdated guidelines from AGENTS.md regarding user preferences …
pd-redis 442ba78
refactor(api): simplify createDatabase method by removing unused opti…
pd-redis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
tests/e2e-playwright/tests/main/databases/decompression/decompression.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| import { gzipSync } from 'zlib'; | ||
| import { test, expect } from 'e2eSrc/fixtures/base'; | ||
| import { StandaloneConfigFactory } from 'e2eSrc/test-data/databases'; | ||
| import { DatabaseInstance } from 'e2eSrc/types'; | ||
|
|
||
| /** | ||
| * Decompression Tests (TEST_PLAN.md: 1.8 Decompression) | ||
| * | ||
| * Tests for configuring automatic data decompression on database connections. | ||
| */ | ||
| test.describe('Decompression', () => { | ||
| let database: DatabaseInstance; | ||
|
|
||
| test.beforeAll(async ({ apiHelper }) => { | ||
| const config = StandaloneConfigFactory.build(); | ||
| database = await apiHelper.createDatabase(config); | ||
| }); | ||
|
|
||
| test.afterAll(async ({ apiHelper }) => { | ||
| if (database?.id) { | ||
| await apiHelper.deleteDatabase(database.id); | ||
| } | ||
| }); | ||
|
|
||
| test.beforeEach(async ({ databasesPage }) => { | ||
| await databasesPage.goto(); | ||
| }); | ||
|
|
||
| test('should confirm setting a decompression type works', async ({ databasesPage }) => { | ||
| const { databaseList, addDatabaseDialog } = databasesPage; | ||
| const compressorFormat = 'GZIP'; | ||
|
|
||
| // Open edit dialog for the database | ||
| await databaseList.search(database.name); | ||
| await databaseList.edit(database.name); | ||
cursor[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const editDialog = databasesPage.page.getByRole('dialog', { name: /edit database/i }); | ||
| await expect(editDialog).toBeVisible(); | ||
|
|
||
| // Enable decompression with GZIP format | ||
| await addDatabaseDialog.enableDecompression(compressorFormat); | ||
| await expect(addDatabaseDialog.enableDecompressionCheckbox).toBeChecked(); | ||
|
|
||
| // Save the changes | ||
| await addDatabaseDialog.generalTab.click(); | ||
| await addDatabaseDialog.submit(); | ||
| await editDialog.waitFor({ state: 'hidden' }); | ||
|
|
||
| // Reopen edit dialog and verify the setting persisted | ||
| await databaseList.search(database.name); | ||
| await databaseList.edit(database.name); | ||
| await expect(editDialog).toBeVisible(); | ||
| await addDatabaseDialog.decompressionTab.click(); | ||
| await expect(addDatabaseDialog.enableDecompressionCheckbox).toBeChecked(); | ||
| await expect(addDatabaseDialog.compressorDropdown).toContainText(compressorFormat); | ||
|
|
||
| // Clean up: disable decompression and save | ||
| await addDatabaseDialog.enableDecompressionCheckbox.click(); | ||
| await addDatabaseDialog.generalTab.click(); | ||
| await addDatabaseDialog.submit(); | ||
| await editDialog.waitFor({ state: 'hidden' }); | ||
| }); | ||
|
|
||
| test('should decompress GZIP-compressed key values in Browser', async ({ | ||
| apiHelper, | ||
| browserPage, | ||
| }) => { | ||
| const originalText = 'Hello, this is decompressed data!'; | ||
| const keyName = `decompression-test:${Date.now()}`; | ||
| const compressedBuffer = gzipSync(Buffer.from(originalText)); | ||
|
|
||
| // Seed a GZIP-compressed key into the database | ||
| await apiHelper.createStringKey(database.id, keyName, { | ||
| type: 'Buffer', | ||
| data: Array.from(compressedBuffer), | ||
| }); | ||
|
|
||
| // Enable GZIP decompression on the database via API | ||
| await apiHelper.updateDatabase(database.id, { compressor: 'GZIP' }); | ||
|
|
||
| try { | ||
| // Navigate to Browser and verify decompressed value | ||
| await browserPage.goto(database.id); | ||
| await browserPage.keyList.searchKeys(keyName); | ||
| await browserPage.keyList.clickKey(keyName); | ||
| await browserPage.keyDetails.waitForKeyDetails(); | ||
|
|
||
| const displayedValue = await browserPage.keyDetails.getStringValue(); | ||
| expect(displayedValue).toContain(originalText); | ||
| } finally { | ||
| // Clean up: remove compressor and delete test key | ||
| await apiHelper.updateDatabase(database.id, { compressor: 'NONE' }); | ||
| await apiHelper.deleteKeysByPattern(database.id, keyName); | ||
| } | ||
| }); | ||
| }); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Does it make sense to actually verify decompression works?