Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/playwright/src/runner/reporters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import fs from 'fs';
import { calculateSha1 } from 'playwright-core/lib/utils';

import { loadReporter } from './loadUtils';
Expand Down Expand Up @@ -127,6 +127,10 @@ function computeCommandHash(config: FullConfigInternal) {
command.cliOnlyChanged = config.cliOnlyChanged;
if (config.config.tags.length)
command.tags = config.config.tags.join(' ');
if (config.cliTestList)
command.cliTestList = calculateSha1(fs.readFileSync(config.cliTestList));
if (config.cliTestListInvert)
command.cliTestListInvert = calculateSha1(fs.readFileSync(config.cliTestListInvert));
if (Object.keys(command).length)
parts.push(calculateSha1(JSON.stringify(command)).substring(0, 7));
return parts.join('-');
Expand Down
12 changes: 12 additions & 0 deletions tests/playwright-test/reporter-blob.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2196,6 +2196,18 @@ test('project filter in report name', async ({ runInlineTest }) => {
const reportFiles = await fs.promises.readdir(reportDir);
expect(reportFiles.sort()).toEqual(['report-foo-b-r-6d9d49e-1.zip']);
}

{
const result = await runInlineTest({ ...files, 'test-list.txt': `foo` }, { 'test-list': 'test-list.txt' });
expect(result.exitCode).toBe(0);
const reportFiles = await fs.promises.readdir(reportDir);

const result2 = await runInlineTest({ ...files, 'test-list.txt': `bar` }, { 'test-list': 'test-list.txt' });
expect(result2.exitCode).toBe(0);
const reportFiles2 = await fs.promises.readdir(reportDir);

expect(reportFiles2.sort()).not.toEqual(reportFiles.sort());
}
});

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