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

Move some failing tests from pre-built fixtures to scenario-tester #919

Merged
merged 33 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
e9a12df
add a classic-app-template for test scenarios
mansona May 29, 2023
6e0460f
add a basic test scenario
mansona May 29, 2023
e329579
add scenario-tester CI
mansona May 29, 2023
eaf63d1
add .npmrc file
mansona Sep 1, 2023
ad4911c
move a shoebox test out of pre-built fixtures
mansona Sep 1, 2023
d542f21
make sure the request is optional in the fastboot service
mansona Oct 27, 2023
9beeeb7
simplify scenario setup
mansona Oct 27, 2023
ed2719f
move onerror-per-visit test to scenario-tester
mansona Oct 27, 2023
c6bfc39
remove duplicate lint
mansona Oct 27, 2023
dd577e9
move multivalue-headers test to scenario-tester
mansona Oct 28, 2023
75c297a
move app-with-metadata tests to scenario-tester
mansona Oct 29, 2023
8934363
move integration tests to scenario-tester
mansona Oct 30, 2023
d3855ab
remove integration test from github workflow
mansona Oct 30, 2023
0711385
fix lints
mansona Oct 30, 2023
f6cd7fe
fix dependencies of some test packages
mansona Oct 30, 2023
f7c13d8
Fix discover matrix
mansona Oct 30, 2023
c398422
move fastboot-config-test to scenario tester
mansona Feb 10, 2024
f54651d
move fastboot-location-config to scenario-tester
mansona Feb 11, 2024
418c133
update action versions
mansona Feb 11, 2024
b6d08f7
remove linking package script
mansona Feb 11, 2024
b49ff5c
rename fastboot-config-location test
mansona Feb 11, 2024
60d6ce7
move fastboot-location-test to scenario-tester
mansona Feb 11, 2024
0ec0334
move custom-output-paths test to scenario-tester
mansona Feb 13, 2024
d7e3735
fix webpack crash on modern node
mansona Feb 13, 2024
4ef1801
fix package.json test
mansona Feb 13, 2024
c2699ef
move request-details test to scenario-tester
mansona Feb 13, 2024
5abf0a6
fix config-location test
mansona Feb 13, 2024
19f6f16
move root-url test to scenario-tester
mansona Feb 13, 2024
a5dbdf0
don't lint node_modules in test scenarios
mansona Feb 13, 2024
aafe01f
fix webpack dependency in ember-cli-fastboot
mansona Feb 13, 2024
52ba4fd
add @ember/string for tests
mansona Feb 13, 2024
dbb25cd
update embroider/test-setup
mansona Feb 13, 2024
74b5508
reset blueprint using ember-cli-update
mansona Feb 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
69 changes: 44 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,31 +65,6 @@ jobs:
- run: pnpm test:fastboot-express-middleware
- run: pnpm test:fastboot-app-server

integration-tests:
name: Integration Tests
runs-on: ${{ matrix.os }}
timeout-minutes: 15

strategy:
fail-fast: false
matrix:
node-version: [16.x, 14.x]
os: [ubuntu-latest, windows-latest]

steps:
- name: Checkout Code
uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm test:integration

test-packages:
name: Test Packages
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -177,3 +152,47 @@ jobs:
- run: pnpm install --frozen-lockfile
- name: test
run: pnpm --filter ember-cli-fastboot exec ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup

discover_matrix:
runs-on: ubuntu-latest

outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 7
- uses: actions/setup-node@v4
with:
node-version: 16
cache: pnpm
- run: pnpm install --frozen-lockfile
- id: set-matrix
working-directory: test-packages/test-scenarios
run: echo "matrix=$(npm run --silent test:list -- --matrix 'npm run test -- --filter %s:')" >> $GITHUB_OUTPUT

scenario-tester:
needs: discover_matrix
name: ${{ matrix.name }}
runs-on: ubuntu-latest
timeout-minutes: 7

strategy:
fail-fast: false
matrix: ${{fromJson(needs.discover_matrix.outputs.matrix)}}

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 7
- uses: actions/setup-node@v4
with:
node-version: 16
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: test
run: ${{ matrix.command }}
working-directory: test-packages/test-scenarios
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
auto-install-peers=false
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -742,13 +742,6 @@ Make sure you have `.vscode/launch.json` with minimal configuration that looks l

Run the automated tests by running `npm test`.

Note that the integration tests create new Ember applications via `ember
new` and thus have to run an `npm install`, which can take several
minutes, particularly on slow connections.

To speed up test runs you can run `npm run test:precook` to "precook" a
`node_modules` directory that will be reused across test runs.

### Debugging Integration Tests

Run the tests with the `DEBUG` environment variable set to
Expand Down
1 change: 1 addition & 0 deletions packages/ember-cli-fastboot/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# misc
/coverage/
!.*
.*/
.eslintcache

# ember-try
Expand Down
39 changes: 16 additions & 23 deletions packages/ember-cli-fastboot/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-dupe-keys, prettier/prettier */
'use strict';

module.exports = {
Expand All @@ -18,34 +17,23 @@ module.exports = {
'plugin:prettier/recommended',
],
env: {
browser: true
},
rules: {
'ember/no-get': 'warn',
'ember/require-computed-property-dependencies': 'warn'
browser: true,
},
rules: {},
overrides: [
// node files
{
files: [
'.eslintrc.js',
'.prettierrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'index.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'tests/dummy/config/**/*.js',
'lib/**/*.js'
],
excludedFiles: [
'app/**',
'addon/**',
'addon-test-support/**',
'app/**',
'tests/dummy/app/**',
'./.eslintrc.js',
'./.prettierrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./index.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./tests/dummy/config/**/*.js',
'./lib/**/*.js',
],
parserOptions: {
sourceType: 'script',
Expand All @@ -57,5 +45,10 @@ module.exports = {
plugins: ['node'],
extends: ['plugin:node/recommended'],
},
{
// Test files:
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
};
1 change: 1 addition & 0 deletions packages/ember-cli-fastboot/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
/testem.js
/test/
/tests/
/yarn-error.log
/yarn.lock
.gitkeep

Expand Down
2 changes: 1 addition & 1 deletion packages/ember-cli-fastboot/.template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

module.exports = {
extends: 'octane',
extends: 'recommended',
};
9 changes: 9 additions & 0 deletions packages/ember-cli-fastboot/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The MIT License (MIT)

Copyright (c) 2024

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:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

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.
16 changes: 8 additions & 8 deletions packages/ember-cli-fastboot/addon/services/fastboot.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ const RequestObject = EObject.extend({
let request = this.request;
delete this.request;

this.method = request.method;
this.body = request.body;
this.cookies = request.cookies;
this.headers = request.headers;
this.queryParams = request.queryParams;
this.path = request.path;
this.protocol = request.protocol;
this.method = request?.method;
this.body = request?.body;
this.cookies = request?.cookies;
this.headers = request?.headers;
this.queryParams = request?.queryParams;
this.path = request?.path;
this.protocol = request?.protocol;
this._host = function() {
return request.host();
return request?.host();
};
},

Expand Down
10 changes: 1 addition & 9 deletions packages/ember-cli-fastboot/config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = async function () {
name: 'ember-lts-3.24',
npm: {
devDependencies: {
'ember-source': '~3.24.0',
'ember-source': '~3.24.3',
},
},
},
Expand All @@ -39,14 +39,6 @@ module.exports = async function () {
},
},
},
{
name: 'ember-lts-4.4',
npm: {
devDependencies: {
'ember-source': '~4.4.0',
},
},
},
{
name: 'ember-release',
npm: {
Expand Down
8 changes: 7 additions & 1 deletion packages/ember-cli-fastboot/ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,11 @@ module.exports = function (defaults) {
*/

const { maybeEmbroider } = require('@embroider/test-setup');
return maybeEmbroider(app);
return maybeEmbroider(app, {
skipBabel: [
{
package: 'qunit',
},
],
});
};
46 changes: 0 additions & 46 deletions packages/ember-cli-fastboot/fix-node-modules.mjs

This file was deleted.

Loading
Loading