Skip to content

Commit 734ccb6

Browse files
authored
fix: test-list should update blob hash (#39262)
1 parent c318688 commit 734ccb6

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

packages/playwright/src/runner/reporters.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
16+
import fs from 'fs';
1717
import { calculateSha1 } from 'playwright-core/lib/utils';
1818

1919
import { loadReporter } from './loadUtils';
@@ -127,6 +127,10 @@ function computeCommandHash(config: FullConfigInternal) {
127127
command.cliOnlyChanged = config.cliOnlyChanged;
128128
if (config.config.tags.length)
129129
command.tags = config.config.tags.join(' ');
130+
if (config.cliTestList)
131+
command.cliTestList = calculateSha1(fs.readFileSync(config.cliTestList));
132+
if (config.cliTestListInvert)
133+
command.cliTestListInvert = calculateSha1(fs.readFileSync(config.cliTestListInvert));
130134
if (Object.keys(command).length)
131135
parts.push(calculateSha1(JSON.stringify(command)).substring(0, 7));
132136
return parts.join('-');

tests/playwright-test/reporter-blob.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2196,6 +2196,18 @@ test('project filter in report name', async ({ runInlineTest }) => {
21962196
const reportFiles = await fs.promises.readdir(reportDir);
21972197
expect(reportFiles.sort()).toEqual(['report-foo-b-r-6d9d49e-1.zip']);
21982198
}
2199+
2200+
{
2201+
const result = await runInlineTest({ ...files, 'test-list.txt': `foo` }, { 'test-list': 'test-list.txt' });
2202+
expect(result.exitCode).toBe(0);
2203+
const reportFiles = await fs.promises.readdir(reportDir);
2204+
2205+
const result2 = await runInlineTest({ ...files, 'test-list.txt': `bar` }, { 'test-list': 'test-list.txt' });
2206+
expect(result2.exitCode).toBe(0);
2207+
const reportFiles2 = await fs.promises.readdir(reportDir);
2208+
2209+
expect(reportFiles2.sort()).not.toEqual(reportFiles.sort());
2210+
}
21992211
});
22002212

22012213
test('should report duration across all shards', async ({ runInlineTest, mergeReports }) => {

0 commit comments

Comments
 (0)