Skip to content

Commit c410d58

Browse files
committed
Merge branch 'main' into archetype-component-id-removal
2 parents 5c598c2 + 284b1f1 commit c410d58

File tree

642 files changed

+46346
-18465
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

642 files changed

+46346
-18465
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
contact_links:
2+
- name: Question
3+
url: https://github.com/bevyengine/bevy/discussions/categories/q-a
4+
about: Questions about how to use or contribute to Bevy belong in Github Discussions.
5+
You can use the search to check if someone already answered your question!

.github/bors.toml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
status = [
2-
"build (stable, windows-latest)",
3-
"build (stable, ubuntu-latest)",
4-
"build (stable, macos-latest)",
5-
"build (nightly, ubuntu-latest)",
6-
"build-wasm (stable, ubuntu-latest)",
7-
"build-wasm (nightly, ubuntu-latest)",
2+
"build (windows-latest)",
3+
"build (ubuntu-latest)",
4+
"build (macos-latest)",
5+
"build-wasm",
86
"build-android",
97
"markdownlint",
108
"run-examples",
9+
"run-examples-on-wasm",
1110
"check-doc",
1211
"check-missing-examples-in-docs",
13-
"check-unused-dependencies",
12+
# "check-unused-dependencies",
1413
"ci",
15-
"miri",
1614
"check-compiles",
1715
"build-and-install-on-iOS",
18-
"run-examples-on-windows",
16+
"run-examples-on-windows-dx12",
17+
"build-without-default-features (bevy)",
18+
"build-without-default-features (bevy_ecs)",
19+
"build-without-default-features (bevy_reflect)",
1920
]
2021

2122
use_squash_merge = true

.github/start-wasm-example/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules/
2+
/test-results/
3+
/playwright-report/
4+
/playwright/.cache/

.github/start-wasm-example/package-lock.json

Lines changed: 76 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "start-wasm-example",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {},
7+
"keywords": [],
8+
"author": "",
9+
"license": "ISC",
10+
"devDependencies": {
11+
"@playwright/test": "^1.22.1"
12+
},
13+
"dependencies": {
14+
"dotenv": "^16.0.1"
15+
}
16+
}
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
import type { PlaywrightTestConfig } from '@playwright/test';
2+
import { devices } from '@playwright/test';
3+
4+
/**
5+
* Read environment variables from file.
6+
* https://github.com/motdotla/dotenv
7+
*/
8+
require('dotenv').config();
9+
10+
/**
11+
* See https://playwright.dev/docs/test-configuration.
12+
*/
13+
const config: PlaywrightTestConfig = {
14+
testDir: './tests',
15+
/* Maximum time one test can run for. */
16+
timeout: 300_000,
17+
expect: {
18+
/**
19+
* Maximum time expect() should wait for the condition to be met.
20+
* For example in `await expect(locator).toHaveText();`
21+
*/
22+
timeout: 5000
23+
},
24+
/* Run tests in files in parallel */
25+
fullyParallel: true,
26+
/* Fail the build on CI if you accidentally left test.only in the source code. */
27+
forbidOnly: !!process.env.CI,
28+
/* Retry on CI only */
29+
retries: 0,
30+
/* Opt out of parallel tests on CI. */
31+
workers: 1,
32+
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
33+
reporter: 'list',
34+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
35+
use: {
36+
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
37+
actionTimeout: 0,
38+
/* Base URL to use in actions like `await page.goto('/')`. */
39+
// baseURL: 'http://localhost:3000',
40+
41+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
42+
trace: 'on-first-retry',
43+
},
44+
45+
/* Configure projects for major browsers */
46+
projects: [
47+
{
48+
name: 'chromium',
49+
use: {
50+
...devices['Desktop Chrome'],
51+
},
52+
},
53+
54+
{
55+
name: 'firefox',
56+
use: {
57+
...devices['Desktop Firefox'],
58+
},
59+
},
60+
61+
{
62+
name: 'webkit',
63+
use: {
64+
...devices['Desktop Safari'],
65+
},
66+
},
67+
68+
/* Test against mobile viewports. */
69+
// {
70+
// name: 'Mobile Chrome',
71+
// use: {
72+
// ...devices['Pixel 5'],
73+
// },
74+
// },
75+
// {
76+
// name: 'Mobile Safari',
77+
// use: {
78+
// ...devices['iPhone 12'],
79+
// },
80+
// },
81+
82+
/* Test against branded browsers. */
83+
// {
84+
// name: 'Microsoft Edge',
85+
// use: {
86+
// channel: 'msedge',
87+
// },
88+
// },
89+
// {
90+
// name: 'Google Chrome',
91+
// use: {
92+
// channel: 'chrome',
93+
// },
94+
// },
95+
],
96+
97+
/* Folder for test artifacts such as screenshots, videos, traces, etc. */
98+
// outputDir: 'test-results/',
99+
100+
/* Run your local dev server before starting the tests */
101+
// webServer: {
102+
// command: 'npm run start',
103+
// port: 3000,
104+
// },
105+
};
106+
107+
export default config;
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import { test, expect, Page } from '@playwright/test';
2+
3+
test.beforeEach(async ({ page }) => {
4+
await page.goto('http://localhost:8000/');
5+
});
6+
7+
const MAX_TIMEOUT_FOR_TEST = 300_000;
8+
9+
test.describe('WASM example', () => {
10+
test('Wait for success', async ({ page }, test_info) => {
11+
let start = new Date().getTime();
12+
13+
let found = false;
14+
while (new Date().getTime() - start < MAX_TIMEOUT_FOR_TEST) {
15+
let msg = await promise_with_timeout(100, on_console(page), "no log found");
16+
if (msg.includes("no log found")) {
17+
continue;
18+
}
19+
console.log(msg);
20+
if (msg.includes("Test successful")) {
21+
let prefix = process.env.SCREENSHOT_PREFIX === undefined ? "screenshot" : process.env.SCREENSHOT_PREFIX;
22+
await page.screenshot({ path: `${prefix}-${test_info.project.name}.png`, fullPage: true });
23+
found = true;
24+
break;
25+
}
26+
}
27+
28+
expect(found).toBe(true);
29+
});
30+
31+
});
32+
33+
function on_console(page) {
34+
return new Promise(resolve => {
35+
page.on('console', msg => resolve(msg.text()));
36+
});
37+
}
38+
39+
async function promise_with_timeout(time_limit, task, failure_value) {
40+
let timeout;
41+
const timeout_promise = new Promise((resolve, reject) => {
42+
timeout = setTimeout(() => {
43+
resolve(failure_value);
44+
}, time_limit);
45+
});
46+
const response = await Promise.race([task, timeout_promise]);
47+
if (timeout) {
48+
clearTimeout(timeout);
49+
}
50+
return response;
51+
}

0 commit comments

Comments
 (0)