Skip to content

Commit 8f05d77

Browse files
authored
feat: Refines project exclusion logic so it actually works. (#1185)
1 parent d01cbb7 commit 8f05d77

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

e2e/samples.spec.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const getAllSampleFolders = () => {
3636
// Ensure we are only looking at directories within samplesDir, excluding find-changes.sh itself if it's a file
3737
const filePath = path.join(samplesDir, file);
3838
return fs.statSync(filePath).isDirectory();
39-
});
39+
}).filter(sampleFolder => !isExcluded(sampleFolder));
4040
};
4141

4242
// Function to return only changed sample folders.
@@ -87,19 +87,16 @@ const getChangedSampleFolders = (): string[] => {
8787
const folderPath = path.join(samplesDir, folderName);
8888
return fs.existsSync(folderPath) && fs.statSync(folderPath).isDirectory();
8989
});
90-
91-
// Apply the global exclusion filter to the valid changed folders.
92-
const fullyFilteredFolders = validChangedFolders.filter(f => !isExcluded(f));
9390

94-
if (fullyFilteredFolders.length === 0) {
91+
if (validChangedFolders.length === 0) {
9592
console.warn("Folders were found, but none were valid sample directories. Skipping tests.");
9693
console.log("Extracted folder names that were considered invalid:", changedFolders);
9794
console.log("Full output from find-changes.sh for debugging:\n", output);
9895
return []; // Fallback to do nothing
9996
}
10097

101-
console.log("Running tests only for changed samples: ", fullyFilteredFolders);
102-
return fullyFilteredFolders;
98+
console.log("Running tests only for changed samples: ", validChangedFolders);
99+
return validChangedFolders;
103100

104101
} catch (error) {
105102
console.error("Error running find-changes.sh. Skipping tests:", error);

0 commit comments

Comments
 (0)