Skip to content

Commit

Permalink
Merge pull request #919 from ember-fastboot/scenario-tester
Browse files Browse the repository at this point in the history
Move some failing tests from pre-built fixtures to scenario-tester
  • Loading branch information
mansona authored Apr 30, 2024
2 parents 242683f + 74b5508 commit 1c768fa
Show file tree
Hide file tree
Showing 330 changed files with 5,215 additions and 333,826 deletions.
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'],
},
],
};
File renamed without changes.
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

0 comments on commit 1c768fa

Please sign in to comment.