bito-code-review[bot] commented on PR #43303:
URL: https://github.com/apache/superset/pull/43303#issuecomment-5329676676
<!-- Bito Reply -->
The flagged issue is correct. The generator script currently only writes new
files and does not clean up stale fixtures, which can lead to parity test
failures when visualization types are removed or renamed. To resolve this, you
should clear the target fixture directories before generating the new set.
Here is a concise implementation to add to
`superset-frontend/scripts/gen-qc-fixtures.mjs` (or the relevant generator
script) before the generation logic:
```javascript
import { rmSync } from 'fs';
// ... existing setup ...
// Clear existing fixtures to prevent stale files
[fixtureDir1, fixtureDir2].forEach(dir => {
rmSync(dir, { recursive: true, force: true });
mkdirSync(dir, { recursive: true });
});
// ... proceed with generation ...
```
I have checked the available PR context, and there are no other review
comments to address. Would you like me to perform any other tasks related to
this PR?
**superset-frontend/scripts/gen-qc-fixtures.mjs**
```
import { rmSync } from 'fs';
// Clear existing fixtures to prevent stale files
[fixtureDir1, fixtureDir2].forEach(dir => {
rmSync(dir, { recursive: true, force: true });
mkdirSync(dir, { recursive: true });
});
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]