Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: replace pptr with pw #643

Merged
merged 3 commits into from
Jan 25, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 4 additions & 4 deletions .ci/node10/Dockerfile.linux
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/*

# Add user so we don't need --no-sandbox.
RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \
&& mkdir -p /home/pptruser/Downloads \
&& chown -R pptruser:pptruser /home/pptruser
RUN groupadd -r pwuser && useradd -r -g pwuser -G audio,video pwuser \
&& mkdir -p /home/pwuser/Downloads \
&& chown -R pwuser:pwuser /home/pwuser

# Run everything after as non-privileged user.
USER pptruser
USER pwuser
8 changes: 4 additions & 4 deletions .ci/node12/Dockerfile.linux
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/*

# Add user so we don't need --no-sandbox.
RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \
&& mkdir -p /home/pptruser/Downloads \
&& chown -R pptruser:pptruser /home/pptruser
RUN groupadd -r pwuser && useradd -r -g pwuser -G audio,video pwuser \
&& mkdir -p /home/pwuser/Downloads \
&& chown -R pwuser:pwuser /home/pwuser

# Run everything after as non-privileged user.
USER pptruser
USER pwuser
8 changes: 4 additions & 4 deletions .ci/node8/Dockerfile.linux
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/*

# Add user so we don't need --no-sandbox.
RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \
&& mkdir -p /home/pptruser/Downloads \
&& chown -R pptruser:pptruser /home/pptruser
RUN groupadd -r pwuser && useradd -r -g pwuser -G audio,video pwuser \
&& mkdir -p /home/pwuser/Downloads \
&& chown -R pwuser:pwuser /home/pwuser

# Run everything after as non-privileged user.
USER pptruser
USER pwuser
2 changes: 1 addition & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ This will write shared memory files into `/tmp` instead of `/dev/shm`. See [crbu

Seeing other weird errors when launching Chrome? Try running your container
with `docker run --cap-add=SYS_ADMIN` when developing locally. Since the Dockerfile
adds a `pptr` user as a non-privileged user, it may not have all the necessary privileges.
adds a `pwuser` user as a non-privileged user, it may not have all the necessary privileges.

[dumb-init](https://github.com/Yelp/dumb-init) is worth checking out if you're
experiencing a lot of zombies Chrome processes sticking around. There's special
Expand Down
2 changes: 1 addition & 1 deletion test/chromium/coverage.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROMIUM, WEBKIT})
expect(coverage.find(entry => entry.url.startsWith('debugger://'))).not.toBe(null);
expect(coverage.length).toBe(2);
});
it('should ignore pptr internal scripts if reportAnonymousScripts is true', async function({page, server}) {
it('should ignore playwright internal scripts if reportAnonymousScripts is true', async function({page, server}) {
await page.coverage.startJSCoverage({reportAnonymousScripts: true});
await page.goto(server.EMPTY_PAGE);
await page.evaluate('console.log("foo")');
Expand Down
2 changes: 1 addition & 1 deletion test/chromium/headful.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const util = require('util');
const rmAsync = util.promisify(require('rimraf'));
const mkdtempAsync = util.promisify(fs.mkdtemp);

const TMP_FOLDER = path.join(os.tmpdir(), 'pptr_tmp_folder-');
const TMP_FOLDER = path.join(os.tmpdir(), 'pw_tmp_folder-');

module.exports.describe = function({testRunner, expect, playwright, defaultBrowserOptions, FFOX, CHROMIUM, WEBKIT}) {
const {describe, xdescribe, fdescribe} = testRunner;
Expand Down
2 changes: 1 addition & 1 deletion test/chromium/launcher.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const rmAsync = util.promisify(require('rimraf'));
const mkdtempAsync = util.promisify(fs.mkdtemp);
const statAsync = util.promisify(fs.stat);

const TMP_FOLDER = path.join(os.tmpdir(), 'pptr_tmp_folder-');
const TMP_FOLDER = path.join(os.tmpdir(), 'pw_tmp_folder-');

module.exports.describe = function({testRunner, expect, defaultBrowserOptions, playwright, WIN}) {
const {describe, xdescribe, fdescribe} = testRunner;
Expand Down
4 changes: 2 additions & 2 deletions test/elementhandle.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROMIUM, WEBKIT})
</svg>
`);
const element = await page.$('#therect');
const pptrBoundingBox = await element.boundingBox();
const pwBoundingBox = await element.boundingBox();
const webBoundingBox = await page.evaluate(e => {
const rect = e.getBoundingClientRect();
return {x: rect.x, y: rect.y, width: rect.width, height: rect.height};
}, element);
expect(pptrBoundingBox).toEqual(webBoundingBox);
expect(pwBoundingBox).toEqual(webBoundingBox);
});
});

Expand Down
2 changes: 1 addition & 1 deletion test/launcher.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const utils = require('./utils');
const rmAsync = util.promisify(require('rimraf'));
const mkdtempAsync = util.promisify(fs.mkdtemp);

const TMP_FOLDER = path.join(os.tmpdir(), 'pptr_tmp_folder-');
const TMP_FOLDER = path.join(os.tmpdir(), 'pw_tmp_folder-');

module.exports.describe = function({testRunner, expect, defaultBrowserOptions, playwright, playwrightPath, product, CHROMIUM, FFOX, WEBKIT}) {
const {describe, xdescribe, fdescribe} = testRunner;
Expand Down
4 changes: 2 additions & 2 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const {TestRunner, Reporter} = require('../utils/testrunner/');
const utils = require('./utils');

let parallel = 1;
if (process.env.PPTR_PARALLEL_TESTS)
parallel = parseInt(process.env.PPTR_PARALLEL_TESTS.trim(), 10);
if (process.env.PW_PARALLEL_TESTS)
parallel = parseInt(process.env.PW_PARALLEL_TESTS.trim(), 10);
const parallelArgIndex = process.argv.indexOf('-j');
if (parallelArgIndex !== -1)
parallel = parseInt(process.argv[parallelArgIndex + 1], 10);
Expand Down
4 changes: 2 additions & 2 deletions utils/testrunner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This test runner is used internally by Playwright to test Playwright itself.
### Installation

```sh
npm install --save-dev @pptr/testrunner
npm install --save-dev @playwright/testrunner
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can remove the installation part as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

```

### Example
Expand All @@ -23,7 +23,7 @@ node test.js
```

```js
const {TestRunner, Reporter, Matchers} = require('@pptr/testrunner');
const {TestRunner, Reporter, Matchers} = require('@playwright/testrunner');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

require('.')

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


// Runner holds and runs all the tests
const runner = new TestRunner({
Expand Down
2 changes: 1 addition & 1 deletion utils/testrunner/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@pptr/testrunner",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's remove package.json - we don't publish it atm

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

"name": "@playwright/testrunner",
"version": "0.8.0",
"description": "Playwright testrunner",
"main": "index.js",
Expand Down
2 changes: 1 addition & 1 deletion utils/testserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This test server is used internally by Playwright to test Playwright itself.
### Example

```js
const {TestServer} = require('@pptr/testserver');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's require require('.')

const {TestServer} = require('@playwright/testrunner');

(async(() => {
const httpServer = await TestServer.create(__dirname, 8000),
Expand Down
2 changes: 1 addition & 1 deletion utils/testserver/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@pptr/testserver",
"name": "@playwright/testrunner",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's drop package.json

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

"version": "0.5.0",
"description": "testing server",
"main": "index.js",
Expand Down