web-platform-tests / web-platform-tests/wpt

Automatically add an environement prefix to test name

Open
#7,166 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

infra priority:backlog testharness.js
Dominant language
HTML
Stars
6.2k
Forks
3.9k
Avg merge
1d 6h
Merged PRs (30d)
586

Description

Originally posted as https://github.com/w3c/testharness.js/issues/168 by @abreton on 15 Dec 2015, 13:37 UTC:

It would be nice to run some javascript tests in different environments (windows, workers, service workers) without duplicating html files. The idea is to have a js file with all the tests written in it and then running them in different environment from the same html file.
For example if we use a test.js which has a test named test1. We could have something like this in the html file:

    <script src="test.js"></script>
    <script>
      fetch_tests_from_worker(new Worker("test.js"));
      fetch_tests_from_worker(new SharedWorker("test.js", "mySharedWorker" ));
    </script>

Then testharness could rename each test in order to have different names depending on environment, e.g.:

Result Test Name Message
PASS Test1
PASS [Worker] Test1
PASS [SharedWorker] Test1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the issue's proposed test.js usage and the fetch_tests_from_worker calls for Worker and SharedWorker environments. Trace how test names are collected and reported, then verify that each environment receives the requested prefix while the original test keeps its existing name. Done means the result table distinguishes the environments without duplicating HTML files.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.