Skip to content
This repository has been archived by the owner on Sep 19, 2018. It is now read-only.

Automatically add an environement prefix to test name #168

Closed
abreton opened this issue Dec 15, 2015 · 5 comments
Closed

Automatically add an environement prefix to test name #168

abreton opened this issue Dec 15, 2015 · 5 comments

Comments

@abreton
Copy link

abreton commented Dec 15, 2015

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
@Ms2ger
Copy link
Contributor

Ms2ger commented Dec 15, 2015

I'm not sure I agree that putting them in the same file necessarily is a good idea.

@abreton
Copy link
Author

abreton commented Dec 15, 2015

I agree it is not always relevant or suitable, but in some cases it could be interesting not to duplicate html files whereas they are almost identical.

@youennf
Copy link
Contributor

youennf commented Dec 16, 2015

In general, it seems to me like a good idea for tests which run in XXWorkers to have their names automatically prefixed.

Streams API tests are currently putting all tests (worker, shared worker, service worker) in the same file, see whatwg/streams#411.

That said, within WebKit, we generally prefer splitting tests in different files.
This is more authoring work but this reduces the risk for flakiness, timeouts...

@youennf
Copy link
Contributor

youennf commented Jan 7, 2016

I created a PR that we did with Antoine here: #175
@wanderview, it may help when uploading streams API whatwg tests in WPT.

@wpt-issue-mover
Copy link
Collaborator

This issue has been moved to web-platform-tests/wpt#7166; please continue all discussion there.

@w3c w3c locked and limited conversation to collaborators Aug 31, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants