test: *.xyz include pattern
This commit is contained in:
parent
73c0511167
commit
84a088a42e
3 changed files with 14 additions and 2 deletions
|
|
@ -75,7 +75,7 @@ export const PathsSection = ({
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Textarea
|
<Textarea
|
||||||
{...field}
|
{...field}
|
||||||
placeholder="/data/** /config/*.json *.db"
|
placeholder="/data/** /config/*.json *.db **/*.log"
|
||||||
className="font-mono text-sm min-h-25"
|
className="font-mono text-sm min-h-25"
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
|
|
||||||
|
|
@ -158,6 +158,9 @@ test("backup respects include globs, exclusion patterns, and exclude-if-present"
|
||||||
const configIncludedFile = `config-${runId}.json`;
|
const configIncludedFile = `config-${runId}.json`;
|
||||||
const configExcludedFile = `secret-${runId}.json`;
|
const configExcludedFile = `secret-${runId}.json`;
|
||||||
const configNonJsonFile = `config-${runId}.txt`;
|
const configNonJsonFile = `config-${runId}.txt`;
|
||||||
|
const rootDbFile = `root-${runId}.db`;
|
||||||
|
const secondRootDbFile = `archive-${runId}.db`;
|
||||||
|
const rootNonDbFile = `root-${runId}.txt`;
|
||||||
|
|
||||||
const keptPath = path.join(testDataPath, keptDir);
|
const keptPath = path.join(testDataPath, keptDir);
|
||||||
const secondKeptPath = path.join(testDataPath, secondKeptDir);
|
const secondKeptPath = path.join(testDataPath, secondKeptDir);
|
||||||
|
|
@ -190,6 +193,10 @@ test("backup respects include globs, exclusion patterns, and exclude-if-present"
|
||||||
fs.writeFileSync(path.join(configPath, configExcludedFile), "json excluded by absolute exclude");
|
fs.writeFileSync(path.join(configPath, configExcludedFile), "json excluded by absolute exclude");
|
||||||
fs.writeFileSync(path.join(configPath, configNonJsonFile), "not included by /config/*.json");
|
fs.writeFileSync(path.join(configPath, configNonJsonFile), "not included by /config/*.json");
|
||||||
|
|
||||||
|
fs.writeFileSync(path.join(testDataPath, rootDbFile), "root db include");
|
||||||
|
fs.writeFileSync(path.join(testDataPath, secondRootDbFile), "second root db include");
|
||||||
|
fs.writeFileSync(path.join(testDataPath, rootNonDbFile), "root non-db exclude");
|
||||||
|
|
||||||
await gotoAndWaitForAppReady(page, "/");
|
await gotoAndWaitForAppReady(page, "/");
|
||||||
await expect(page).toHaveURL("/volumes");
|
await expect(page).toHaveURL("/volumes");
|
||||||
|
|
||||||
|
|
@ -200,6 +207,7 @@ test("backup respects include globs, exclusion patterns, and exclude-if-present"
|
||||||
`/${blockedDir}`,
|
`/${blockedDir}`,
|
||||||
`/${dataDir}/**`,
|
`/${dataDir}/**`,
|
||||||
`/${configDir}/*.json`,
|
`/${configDir}/*.json`,
|
||||||
|
"*.db",
|
||||||
"**/*.xyz",
|
"**/*.xyz",
|
||||||
].join("\n"),
|
].join("\n"),
|
||||||
excludePatterns: [".DS_Store", "*.tmp", `/${configDir}/secret*.json`].join("\n"),
|
excludePatterns: [".DS_Store", "*.tmp", `/${configDir}/secret*.json`].join("\n"),
|
||||||
|
|
@ -227,12 +235,15 @@ test("backup respects include globs, exclusion patterns, and exclude-if-present"
|
||||||
await expect(page.getByRole("button", { name: /glob-only\.xyz/ })).toBeVisible();
|
await expect(page.getByRole("button", { name: /glob-only\.xyz/ })).toBeVisible();
|
||||||
await expect(page.getByRole("button", { name: new RegExp(dataIncludedFile.replace(".", "\\.")) })).toBeVisible();
|
await expect(page.getByRole("button", { name: new RegExp(dataIncludedFile.replace(".", "\\.")) })).toBeVisible();
|
||||||
await expect(page.getByRole("button", { name: new RegExp(configIncludedFile.replace(".", "\\.")) })).toBeVisible();
|
await expect(page.getByRole("button", { name: new RegExp(configIncludedFile.replace(".", "\\.")) })).toBeVisible();
|
||||||
|
await expect(page.getByRole("button", { name: new RegExp(rootDbFile.replace(".", "\\.")) })).toBeVisible();
|
||||||
|
await expect(page.getByRole("button", { name: new RegExp(secondRootDbFile.replace(".", "\\.")) })).toBeVisible();
|
||||||
|
|
||||||
await expect(page.getByRole("button", { name: /\.DS_Store/ })).toHaveCount(0);
|
await expect(page.getByRole("button", { name: /\.DS_Store/ })).toHaveCount(0);
|
||||||
await expect(page.getByRole("button", { name: /skip\.tmp/ })).toHaveCount(0);
|
await expect(page.getByRole("button", { name: /skip\.tmp/ })).toHaveCount(0);
|
||||||
await expect(page.getByRole("button", { name: new RegExp(configExcludedFile.replace(".", "\\.")) })).toHaveCount(0);
|
await expect(page.getByRole("button", { name: new RegExp(configExcludedFile.replace(".", "\\.")) })).toHaveCount(0);
|
||||||
await expect(page.getByRole("button", { name: new RegExp(configNonJsonFile.replace(".", "\\.")) })).toHaveCount(0);
|
await expect(page.getByRole("button", { name: new RegExp(configNonJsonFile.replace(".", "\\.")) })).toHaveCount(0);
|
||||||
|
await expect(page.getByRole("button", { name: new RegExp(rootNonDbFile.replace(".", "\\.")) })).toHaveCount(0);
|
||||||
|
|
||||||
await expect(page.getByRole("button", { name: /\.nobackup/ })).toHaveCount(0);
|
await expect(page.getByRole("button", { name: /\.nobackup/ })).toBeVisible();
|
||||||
await expect(page.getByRole("button", { name: /blocked\.xyz/ })).toHaveCount(0);
|
await expect(page.getByRole("button", { name: /blocked\.xyz/ })).toHaveCount(0);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ export default defineConfig({
|
||||||
fullyParallel: true,
|
fullyParallel: true,
|
||||||
forbidOnly: !!process.env.CI,
|
forbidOnly: !!process.env.CI,
|
||||||
retries: 0,
|
retries: 0,
|
||||||
|
timeout: 60000,
|
||||||
reporter: "html",
|
reporter: "html",
|
||||||
use: {
|
use: {
|
||||||
baseURL: `http://${process.env.SERVER_IP}:4096`,
|
baseURL: `http://${process.env.SERVER_IP}:4096`,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue