Skip to content

Commit

Permalink
remove extra tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jjspace committed Mar 28, 2024
1 parent d64b1d1 commit 9ca17b5
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 62 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Thumbs.db
# playwright
/playwright/.cache/
/Specs/e2e/*-snapshots/
/Specs/e2e/webgl-check/

/Tools/jsdoc/cesium_template/static/javascript/prism.js
/Tools/jsdoc/cesium_template/static/styles/prism.css
Expand All @@ -43,4 +42,4 @@ yarn.lock
.idea/shelf

# Used in the CLA checking GitHub workflow
GoogleConfig.json
GoogleConfig.json
6 changes: 4 additions & 2 deletions .markdownlint.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@
"ol-prefix": {
"style": "ordered"
},
"no-inline-html": true
}
"no-inline-html": {
"allowed_elements": ["details", "summary"]
}
}
58 changes: 58 additions & 0 deletions Documentation/Contributors/TestingGuide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,64 @@ When new Sandcastle is added, or behavior is intentionally changed, the screensh
npm run test-e2e-update -- -g "3D Tiles Clipping Planes"
```

#### End to End test performance

The vast majority of our end to end tests should run in about 2-5 seconds across any machine (a few may still be above 15 seconds but most should not). If they are taking longer than that you should look to speed them up. We've previously noticed certain browsers not using the GPU under Playwright resulting in slower tests.

The first step to checking for WebGL related issues should be to add an extra test or two to load the WebGL report under the Playwright environment to see if anything (like the wrong GPU) pops out. Expand the details below for an example of these tests

<details><summary>WebGL check example</summary>

```js
// tests/example1.test.js
import { test } from "./test.js";

function waitFor(delay) {
return new Promise((resolve) => setTimeout(resolve, delay));
}

const screenshotPath = "Specs/e2e/webgl-check";

const chromeGpu = "chrome://gpu/"; // only works for chrome not firefox
const webGlReport1 = "https://webglreport.com/?v=1";
const webGlReport2 = "https://webglreport.com/?v=2";

/**
* This is used to check how WebGL is running in the testing environment to spot things like
* not using the correct gpu that may affect performace and run time of the tests themselves
* Based off of https://www.createit.com/blog/headless-chrome-testing-webgl-using-playwright/
*/
test.describe("WebGL verification", () => {
// Check if hardware acceleration is enabled. Without it, our tests will be much slower.
test("GPU hardware acceleration", async ({ page }) => {
await page.goto(chromeGpu);
await waitFor(2000);
await page.screenshot({
path: `${screenshotPath}/screenshot_hardware.png`,
fullPage: true,
});
});
test("webgl report v1", async ({ page }) => {
await page.goto(webGlReport1);
await waitFor(2000);
await page.screenshot({
path: `${screenshotPath}/screenshot_webgl1.png`,
fullPage: true,
});
});
test("webgl report v2", async ({ page }) => {
await page.goto(webGlReport2);
await waitFor(2000);
await page.screenshot({
path: `${screenshotPath}/screenshot_webgl2.png`,
fullPage: true,
});
});
});
```

</details>

## `testfailure` Label for Issues

Despite our best efforts, sometimes tests fail. This is often due to a new browser, OS, or driver bug that breaks a test that previously passed. If this indicates a bug in CesiumJS, we strive to quickly fix it. Likewise, if it indicates that CesiumJS needs to work around the issue (for example, as we [did for Safari 9](https://github.com/CesiumGS/cesium/issues/2989)), we also strive to quickly fix it.
Expand Down
58 changes: 0 additions & 58 deletions Specs/e2e/webgl-check.spec.js

This file was deleted.

0 comments on commit 9ca17b5

Please sign in to comment.