Skip to content

Commit 1c768fa

Browse files
authored
Merge pull request #919 from ember-fastboot/scenario-tester
Move some failing tests from pre-built fixtures to scenario-tester
2 parents 242683f + 74b5508 commit 1c768fa

File tree

330 files changed

+5215
-333826
lines changed

Some content is hidden

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

330 files changed

+5215
-333826
lines changed

.github/workflows/ci.yml

+44-25
Original file line numberDiff line numberDiff line change
@@ -65,31 +65,6 @@ jobs:
6565
- run: pnpm test:fastboot-express-middleware
6666
- run: pnpm test:fastboot-app-server
6767

68-
integration-tests:
69-
name: Integration Tests
70-
runs-on: ${{ matrix.os }}
71-
timeout-minutes: 15
72-
73-
strategy:
74-
fail-fast: false
75-
matrix:
76-
node-version: [16.x, 14.x]
77-
os: [ubuntu-latest, windows-latest]
78-
79-
steps:
80-
- name: Checkout Code
81-
uses: actions/checkout@v4
82-
- uses: pnpm/action-setup@v3
83-
with:
84-
version: 7
85-
- name: Use Node.js ${{ matrix.node-version }}
86-
uses: actions/setup-node@v4
87-
with:
88-
node-version: ${{ matrix.node-version }}
89-
cache: pnpm
90-
- run: pnpm install --frozen-lockfile
91-
- run: pnpm test:integration
92-
9368
test-packages:
9469
name: Test Packages
9570
runs-on: ${{ matrix.os }}
@@ -177,3 +152,47 @@ jobs:
177152
- run: pnpm install --frozen-lockfile
178153
- name: test
179154
run: pnpm --filter ember-cli-fastboot exec ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup
155+
156+
discover_matrix:
157+
runs-on: ubuntu-latest
158+
159+
outputs:
160+
matrix: ${{ steps.set-matrix.outputs.matrix }}
161+
162+
steps:
163+
- uses: actions/checkout@v4
164+
- uses: pnpm/action-setup@v3
165+
with:
166+
version: 7
167+
- uses: actions/setup-node@v4
168+
with:
169+
node-version: 16
170+
cache: pnpm
171+
- run: pnpm install --frozen-lockfile
172+
- id: set-matrix
173+
working-directory: test-packages/test-scenarios
174+
run: echo "matrix=$(npm run --silent test:list -- --matrix 'npm run test -- --filter %s:')" >> $GITHUB_OUTPUT
175+
176+
scenario-tester:
177+
needs: discover_matrix
178+
name: ${{ matrix.name }}
179+
runs-on: ubuntu-latest
180+
timeout-minutes: 7
181+
182+
strategy:
183+
fail-fast: false
184+
matrix: ${{fromJson(needs.discover_matrix.outputs.matrix)}}
185+
186+
steps:
187+
- uses: actions/checkout@v4
188+
- uses: pnpm/action-setup@v3
189+
with:
190+
version: 7
191+
- uses: actions/setup-node@v4
192+
with:
193+
node-version: 16
194+
cache: pnpm
195+
- run: pnpm install --frozen-lockfile
196+
- name: test
197+
run: ${{ matrix.command }}
198+
working-directory: test-packages/test-scenarios

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
auto-install-peers=false

README.md

-7
Original file line numberDiff line numberDiff line change
@@ -742,13 +742,6 @@ Make sure you have `.vscode/launch.json` with minimal configuration that looks l
742742
743743
Run the automated tests by running `npm test`.
744744
745-
Note that the integration tests create new Ember applications via `ember
746-
new` and thus have to run an `npm install`, which can take several
747-
minutes, particularly on slow connections.
748-
749-
To speed up test runs you can run `npm run test:precook` to "precook" a
750-
`node_modules` directory that will be reused across test runs.
751-
752745
### Debugging Integration Tests
753746
754747
Run the tests with the `DEBUG` environment variable set to

packages/ember-cli-fastboot/.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# misc
1414
/coverage/
1515
!.*
16+
.*/
1617
.eslintcache
1718

1819
# ember-try
+16-23
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-dupe-keys, prettier/prettier */
21
'use strict';
32

43
module.exports = {
@@ -18,34 +17,23 @@ module.exports = {
1817
'plugin:prettier/recommended',
1918
],
2019
env: {
21-
browser: true
22-
},
23-
rules: {
24-
'ember/no-get': 'warn',
25-
'ember/require-computed-property-dependencies': 'warn'
20+
browser: true,
2621
},
2722
rules: {},
2823
overrides: [
2924
// node files
3025
{
3126
files: [
32-
'.eslintrc.js',
33-
'.prettierrc.js',
34-
'.template-lintrc.js',
35-
'ember-cli-build.js',
36-
'index.js',
37-
'testem.js',
38-
'blueprints/*/index.js',
39-
'config/**/*.js',
40-
'tests/dummy/config/**/*.js',
41-
'lib/**/*.js'
42-
],
43-
excludedFiles: [
44-
'app/**',
45-
'addon/**',
46-
'addon-test-support/**',
47-
'app/**',
48-
'tests/dummy/app/**',
27+
'./.eslintrc.js',
28+
'./.prettierrc.js',
29+
'./.template-lintrc.js',
30+
'./ember-cli-build.js',
31+
'./index.js',
32+
'./testem.js',
33+
'./blueprints/*/index.js',
34+
'./config/**/*.js',
35+
'./tests/dummy/config/**/*.js',
36+
'./lib/**/*.js',
4937
],
5038
parserOptions: {
5139
sourceType: 'script',
@@ -57,5 +45,10 @@ module.exports = {
5745
plugins: ['node'],
5846
extends: ['plugin:node/recommended'],
5947
},
48+
{
49+
// Test files:
50+
files: ['tests/**/*-test.{js,ts}'],
51+
extends: ['plugin:qunit/recommended'],
52+
},
6053
],
6154
};
File renamed without changes.

packages/ember-cli-fastboot/.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
/testem.js
2828
/test/
2929
/tests/
30+
/yarn-error.log
3031
/yarn.lock
3132
.gitkeep
3233

Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
22

33
module.exports = {
4-
extends: 'octane',
4+
extends: 'recommended',
55
};
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2024
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

packages/ember-cli-fastboot/addon/services/fastboot.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ const RequestObject = EObject.extend({
1414
let request = this.request;
1515
delete this.request;
1616

17-
this.method = request.method;
18-
this.body = request.body;
19-
this.cookies = request.cookies;
20-
this.headers = request.headers;
21-
this.queryParams = request.queryParams;
22-
this.path = request.path;
23-
this.protocol = request.protocol;
17+
this.method = request?.method;
18+
this.body = request?.body;
19+
this.cookies = request?.cookies;
20+
this.headers = request?.headers;
21+
this.queryParams = request?.queryParams;
22+
this.path = request?.path;
23+
this.protocol = request?.protocol;
2424
this._host = function() {
25-
return request.host();
25+
return request?.host();
2626
};
2727
},
2828

packages/ember-cli-fastboot/config/ember-try.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module.exports = async function () {
2727
name: 'ember-lts-3.24',
2828
npm: {
2929
devDependencies: {
30-
'ember-source': '~3.24.0',
30+
'ember-source': '~3.24.3',
3131
},
3232
},
3333
},
@@ -39,14 +39,6 @@ module.exports = async function () {
3939
},
4040
},
4141
},
42-
{
43-
name: 'ember-lts-4.4',
44-
npm: {
45-
devDependencies: {
46-
'ember-source': '~4.4.0',
47-
},
48-
},
49-
},
5042
{
5143
name: 'ember-release',
5244
npm: {

packages/ember-cli-fastboot/ember-cli-build.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,11 @@ module.exports = function (defaults) {
1515
*/
1616

1717
const { maybeEmbroider } = require('@embroider/test-setup');
18-
return maybeEmbroider(app);
18+
return maybeEmbroider(app, {
19+
skipBabel: [
20+
{
21+
package: 'qunit',
22+
},
23+
],
24+
});
1925
};

packages/ember-cli-fastboot/fix-node-modules.mjs

-46
This file was deleted.

0 commit comments

Comments
 (0)