Skip to content

Commit

Permalink
perf(amazonq): Removing flaky test case in generateZipTestGen function (
Browse files Browse the repository at this point in the history
#6482)

## Problem
- Github issue:
#6160 (comment)

## Solution
- Not able to reproduce this in local machine. Double checked with team
and planned to disable this test for now to avoid hassle for partner
teams.

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
  • Loading branch information
laileni-aws authored Feb 4, 2025
1 parent a41ca7a commit 8533cf8
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions packages/amazonq/test/unit/codewhisperer/util/zipUtil.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,22 +195,5 @@ describe('zipUtil', function () {

await assert.rejects(() => zipUtil.generateZipTestGen(appRoot, false), /Zip failed/)
})

it('Should handle file copy to downloads folder error', async function () {
// Mock LSP client
sinon.stub(LspClient, 'instance').get(() => ({
getRepoMapJSON: sinon.stub().resolves('{"mock": "data"}'),
}))

const mkdirSpy = sinon.spy(fs, 'mkdir')
sinon.stub(fs, 'exists').resolves(true)
sinon.stub(fs, 'copy').rejects(new Error('Copy failed'))

await assert.rejects(() => zipUtil.generateZipTestGen(appRoot, false), /Copy failed/)

// Verify mkdir was called for all directories
assert(mkdirSpy.called, 'mkdir should have been called')
assert.strictEqual(mkdirSpy.callCount, 4, 'mkdir should have been called 4 times')
})
})
})

0 comments on commit 8533cf8

Please sign in to comment.