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

Adding basic test app #775

Merged
merged 29 commits into from
Jul 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ecd17c8
adding basic app to test packages
kiwiupover Jul 27, 2020
bc89b0a
adding test packages to ci
kiwiupover Jul 28, 2020
27856a4
adding basic app
kiwiupover Jul 28, 2020
076fd05
replace the build test with new test in the test-package basic-app
kiwiupover Jul 28, 2020
5ef59b5
rename to the build test
kiwiupover Jul 28, 2020
f0e7b44
remove travis
kiwiupover Jul 28, 2020
437750e
fixed yml typo
kiwiupover Jul 28, 2020
e13b004
use frosen lockfile
kiwiupover Jul 28, 2020
8799079
adding basic-app to workspaces
kiwiupover Jul 28, 2020
6cd5fd5
remove tests packages so that NPM 4 :( doesn't add node_modules from …
kiwiupover Jul 28, 2020
e1326de
fixed typo
kiwiupover Jul 28, 2020
04b9069
fixed typo
kiwiupover Jul 28, 2020
44d2025
legacy test run better when run within the ember-cli-fastboot
kiwiupover Jul 29, 2020
077e034
legacy tests run better when run within the ember-cli-fastboot
kiwiupover Jul 29, 2020
85ad86e
testing again
kiwiupover Jul 29, 2020
c3e45ec
test again
kiwiupover Jul 29, 2020
0375141
what test work and what works
kiwiupover Jul 29, 2020
0875256
what is working
kiwiupover Jul 29, 2020
e00e2b3
all the tests
kiwiupover Jul 31, 2020
fa9c004
increase time for windows tests
kiwiupover Jul 31, 2020
c6a1b82
adding readme to the test-packages folder
kiwiupover Jul 31, 2020
bfec2c4
adding continue-on-error to ci yml
kiwiupover Jul 31, 2020
01465ae
yml syntax issue
kiwiupover Jul 31, 2020
eb357bd
making node 12 experimental
kiwiupover Jul 31, 2020
34e72ee
Adding Legacy to the mocha test title
kiwiupover Jul 31, 2020
dff448a
use volta to install npm 4
kiwiupover Jul 31, 2020
b4c4516
no need to remove test-packages folder
kiwiupover Jul 31, 2020
7e659c5
remove basic-app yarn.lock file
kiwiupover Jul 31, 2020
03efc43
don't leak test package modules
kiwiupover Jul 31, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 40 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,38 @@ on:
- cron: '0 6 * * 0'

jobs:
test-mocha:
name: Mocha Tests - ${{ matrix.node-version }}
test-legacy-mocha:
kiwiupover marked this conversation as resolved.
Show resolved Hide resolved
name: Legacy Mocha Tests - ${{ matrix.node-version }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: [12.x, 10.x]
node-version: ['10', '12']

steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: volta-cli/action@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install NPM version 4

# Remove test-packages folder so that we don't leak node_modules between apps
- name: Remove test-packages
run: |
npm config set spin false
npm install -g npm@4
rm -rf test-packages
- name: Yarn Install
run: yarn install --ignore-engines
working-directory: ./packages/ember-cli-fastboot
run: |
yarn install --ignore-engines --frozen-lockfile
- name: Run Mocha Tests
run: yarn workspace ember-cli-fastboot test:mocha
working-directory: ./packages/ember-cli-fastboot
run: |
volta install npm@4
npm --version
yarn test:mocha
test-ember:
name: Ember Tests
Expand All @@ -60,7 +69,28 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Yarn Install
run: yarn install --ignore-engines
run: yarn install --ignore-engines --frozen-lockfile
- name: Run Tests
run: yarn workspace ember-cli-fastboot test:ember


test-packages:
name: Test Packages
runs-on: ${{ matrix.os }}

strategy:
matrix:
node-version: [12.x, 10.x]
os: [ubuntu-latest, windows-latest]

steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Yarn Install
run: yarn install --ignore-engines --frozen-lockfile
- name: Basic App
run: yarn workspace basic-app test:mocha
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Ember FastBoot

[![npm version](https://badge.fury.io/js/ember-cli-fastboot.svg)](https://badge.fury.io/js/ember-cli-fastboot)
[![Actions Status](hhttps://github.com/ember-fastboot/ember-cli-fastboot/workflows/CI/badge.svg)](https://github.com/ember-fastboot/ember-cli-fastboot/actions)
[![Actions Status](https://github.com/ember-fastboot/ember-cli-fastboot/workflows/CI/badge.svg)](https://github.com/ember-fastboot/ember-cli-fastboot/actions)
kiwiupover marked this conversation as resolved.
Show resolved Hide resolved

An Ember CLI addon that allows you to render and serve Ember.js apps on
the server. Using FastBoot, you can serve rendered HTML to browsers and
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"private": true,
"workspaces": [
"packages/ember-cli-fastboot"
"packages/ember-cli-fastboot",
"test-packages/basic-app"
]
}
61 changes: 0 additions & 61 deletions packages/ember-cli-fastboot/test/build-test.js

This file was deleted.

3 changes: 3 additions & 0 deletions test-packages/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Test Packages App

- [Basic App](./test-packages/basic-app) This basic ember app that is fastbooted using ember-cli-fastboot. Most test will be against this basic-app. When an app needs custom ember-cli-fastboot setup another ember app should be added to the test-packages folder.
kiwiupover marked this conversation as resolved.
Show resolved Hide resolved
19 changes: 19 additions & 0 deletions test-packages/basic-app/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2

[*.hbs]
insert_final_newline = false

[*.{diff,md}]
trim_trailing_whitespace = false
9 changes: 9 additions & 0 deletions test-packages/basic-app/.ember-cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
/**
Ember CLI sends analytics information by default. The data is completely
anonymous, but there are times when you might want to disable this behavior.

Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": false
}
20 changes: 20 additions & 0 deletions test-packages/basic-app/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
53 changes: 53 additions & 0 deletions test-packages/basic-app/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
'use strict';

module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true
}
},
plugins: [
'ember'
],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
],
env: {
browser: true
},
rules: {},
overrides: [
// node files
{
files: [
'.eslintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'lib/*/index.js',
'server/**/*.js'
],
parserOptions: {
sourceType: 'script'
},
env: {
browser: false,
node: true
},
plugins: ['node'],
extends: ['plugin:node/recommended'],
rules: {
// this can be removed once the following is fixed
// https://github.com/mysticatea/eslint-plugin-node/issues/77
'node/no-unpublished-require': 'off'
}
}
]
};
25 changes: 25 additions & 0 deletions test-packages/basic-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/.env*
/.pnp*
/.sass-cache
/connect.lock
/coverage/
/libpeerconnection.log
/npm-debug.log*
/testem.log
/yarn-error.log

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
5 changes: 5 additions & 0 deletions test-packages/basic-app/.template-lintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
extends: 'octane'
};
3 changes: 3 additions & 0 deletions test-packages/basic-app/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ignore_dirs": ["tmp", "dist"]
}
58 changes: 58 additions & 0 deletions test-packages/basic-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# basic-app

This README outlines the details of collaborating on this Ember application.
A short introduction of this app could easily go here.

## Prerequisites

You will need the following things properly installed on your computer.

* [Git](https://git-scm.com/)
* [Node.js](https://nodejs.org/)
* [Yarn](https://yarnpkg.com/)
* [Ember CLI](https://ember-cli.com/)
* [Google Chrome](https://google.com/chrome/)

## Installation

* `git clone <repository-url>` this repository
* `cd basic-app`
* `yarn install`

## Running / Development

* `ember serve`
* Visit your app at [http://localhost:4200](http://localhost:4200).
* Visit your tests at [http://localhost:4200/tests](http://localhost:4200/tests).

### Code Generators

Make use of the many generators for code, try `ember help generate` for more details

### Running Tests

* `ember test`
* `ember test --server`

### Linting

* `yarn lint:hbs`
* `yarn lint:js`
* `yarn lint:js --fix`

### Building

* `ember build` (development)
* `ember build --environment production` (production)

### Deploying

Specify what it takes to deploy your app.

## Further Reading / Useful Links

* [ember.js](https://emberjs.com/)
* [ember-cli](https://ember-cli.com/)
* Development Browser Extensions
* [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)
* [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/)
12 changes: 12 additions & 0 deletions test-packages/basic-app/app/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Application from '@ember/application';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';

export default class App extends Application {
modulePrefix = config.modulePrefix;
podModulePrefix = config.podModulePrefix;
Resolver = Resolver;
}

loadInitializers(App, config.modulePrefix);
Empty file.
Empty file.
Empty file.
Loading