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

Fix Github actions not running #843

Merged
merged 6 commits into from
Aug 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 6 additions & 7 deletions .github/ci.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CI

on:
pull_request:
pull_request: {}
push:
# Filtering branches here prevents duplicate builds from pull_request and push
branches:
Expand All @@ -25,7 +25,7 @@ jobs:

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

steps:
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:

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

steps:
Expand All @@ -74,7 +74,7 @@ jobs:

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

steps:
Expand All @@ -100,7 +100,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: ['14', '12', '10']
node-version: [14.x, 12.x]

steps:
- name: Checkout Code
Expand All @@ -119,7 +119,6 @@ jobs:
run: |
yarn install --ignore-engines --frozen-lockfile
- name: Run Mocha Tests
working-directory: ./packages/ember-cli-fastboot
run: |
npm --version
yarn test:mocha
yarn workspace ember-cli-fastboot test:mocha
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"npm": false
},
"volta": {
"node": "12.19.0",
"node": "14.17.3",
"yarn": "1.22.10"
}
}
42 changes: 27 additions & 15 deletions packages/ember-cli-fastboot/test/fastboot-config-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,49 @@ const request = RSVP.denodeify(require('request'));

const AddonTestApp = require('ember-cli-addon-tests').AddonTestApp;

describe('FastBoot config', function() {
describe('FastBoot config', function () {
this.timeout(400000);

let app;

before(function() {
before(function () {
app = new AddonTestApp();

return app.create('fastboot-config', { emberVersion: 'latest'})
.then(function() {
return app
.create('fastboot-config', {
skipNpm: true,
emberVersion: 'latest',
emberDataVersion: '~3.19.0',
})
.then(function () {
app.editPackageJSON((pkg) => {
delete pkg.devDependencies['ember-fetch'];
});
return app.run('npm', 'install');
})
.then(function () {
return app.startServer({
command: 'serve'
command: 'serve',
});
});
});

after(function() {
after(function () {
return app.stopServer();
});

it('provides sandbox globals', function() {
it('provides sandbox globals', function () {
return request({
url: 'http://localhost:49741/',
headers: {
'Accept': 'text/html'
}
})
.then(function(response) {
expect(response.statusCode).to.equal(200);
expect(response.headers['content-type']).to.equalIgnoreCase('text/html; charset=utf-8');
expect(response.body).to.contain('<h1>My Global</h1>');
});
Accept: 'text/html',
},
}).then(function (response) {
expect(response.statusCode).to.equal(200);
expect(response.headers['content-type']).to.equalIgnoreCase(
'text/html; charset=utf-8'
);
expect(response.body).to.contain('<h1>My Global</h1>');
});
});
});
45 changes: 29 additions & 16 deletions packages/ember-cli-fastboot/test/fastboot-location-config-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,62 @@ const request = RSVP.denodeify(require('request'));

const AddonTestApp = require('ember-cli-addon-tests').AddonTestApp;

describe('FastBootLocation Configuration', function() {
describe('FastBootLocation Configuration', function () {
this.timeout(300000);

let app;

before(function() {
before(function () {
app = new AddonTestApp();

return app.create('fastboot-location-config', { emberVersion: 'latest'})
.then(function() {
return app
.create('fastboot-location-config', {
skipNpm: true,
emberVersion: 'latest',
emberDataVersion: '~3.19.0',
})
.then(function () {
app.editPackageJSON((pkg) => {
delete pkg.devDependencies['ember-fetch'];
});
return app.run('npm', 'install');
})
.then(function () {
return app.startServer({
command: 'serve'
command: 'serve',
});
});
});

after(function() {
after(function () {
return app.stopServer();
});

it('should use the redirect code provided by the EmberApp', function() {
it('should use the redirect code provided by the EmberApp', function () {
return request({
url: 'http://localhost:49741/redirect-on-transition-to',
followRedirect: false,
headers: {
Accept: 'text/html'
}
}).then(function(response) {
Accept: 'text/html',
},
}).then(function (response) {
if (response.statusCode === 500) throw new Error(response.body);
expect(response.statusCode).to.equal(302);
expect(response.headers.location).to.equal('//localhost:49741/test-passed');
expect(response.headers.location).to.equal(
'//localhost:49741/test-passed'
);
});
});

describe('when fastboot.fastbootHeaders is false', function() {
it('should not send the "x-fastboot-path" header on a redirect', function() {
describe('when fastboot.fastbootHeaders is false', function () {
it('should not send the "x-fastboot-path" header on a redirect', function () {
return request({
url: 'http://localhost:49741/redirect-on-transition-to',
followRedirect: false,
headers: {
Accept: 'text/html'
}
}).then(function(response) {
Accept: 'text/html',
},
}).then(function (response) {
if (response.statusCode === 500) throw new Error(response.body);
expect(response.headers).to.not.include.keys(['x-fastboot-path']);
});
Expand Down
74 changes: 42 additions & 32 deletions packages/ember-cli-fastboot/test/fastboot-location-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,44 @@ const request = RSVP.denodeify(require('request'));

const AddonTestApp = require('ember-cli-addon-tests').AddonTestApp;

describe('FastBootLocation', function() {
describe('FastBootLocation', function () {
this.timeout(300000);

let app;
before(function() {
before(function () {
app = new AddonTestApp();

return app.create('fastboot-location', { emberVersion: 'latest'})
.then(function() {
return app
.create('fastboot-location', {
skipNpm: true,
emberVersion: 'latest',
emberDataVersion: '~3.19.0',
})
.then(function () {
app.editPackageJSON((pkg) => {
delete pkg.devDependencies['ember-fetch'];
});
return app.run('npm', 'install');
})
.then(function () {
return app.startServer({
command: 'serve'
command: 'serve',
});
});
});

after(function() {
after(function () {
return app.stopServer();
});

it('should NOT redirect when no transition is called', function() {
it('should NOT redirect when no transition is called', function () {
return request({
url: 'http://localhost:49741/my-root/test-passed',
followRedirect: false,
headers: {
Accept: 'text/html'
}
}).then(function(response) {
Accept: 'text/html',
},
}).then(function (response) {
if (response.statusCode === 500) throw new Error(response.body);
expect(response.statusCode).to.equal(200);

Expand All @@ -46,15 +57,14 @@ describe('FastBootLocation', function() {
});
});

it('should NOT redirect when intermediateTransitionTo is called', function() {
it('should NOT redirect when intermediateTransitionTo is called', function () {
return request({
url:
'http://localhost:49741/my-root/redirect-on-intermediate-transition-to',
url: 'http://localhost:49741/my-root/redirect-on-intermediate-transition-to',
followRedirect: false,
headers: {
Accept: 'text/html'
}
}).then(function(response) {
Accept: 'text/html',
},
}).then(function (response) {
if (response.statusCode === 500) throw new Error(response.body);
expect(response.statusCode).to.equal(200);

Expand All @@ -69,14 +79,14 @@ describe('FastBootLocation', function() {
});
});

it('should redirect when transitionTo is called', function() {
it('should redirect when transitionTo is called', function () {
return request({
url: 'http://localhost:49741/my-root/redirect-on-transition-to',
followRedirect: false,
headers: {
Accept: 'text/html'
}
}).then(function(response) {
Accept: 'text/html',
},
}).then(function (response) {
if (response.statusCode === 500) throw new Error(response.body);
expect(response.statusCode).to.equal(307);

Expand All @@ -92,14 +102,14 @@ describe('FastBootLocation', function() {
});
});

it('should redirect when replaceWith is called', function() {
it('should redirect when replaceWith is called', function () {
return request({
url: 'http://localhost:49741/my-root/redirect-on-replace-with',
followRedirect: false,
headers: {
Accept: 'text/html'
}
}).then(function(response) {
Accept: 'text/html',
},
}).then(function (response) {
if (response.statusCode === 500) throw new Error(response.body);
expect(response.statusCode).to.equal(307);

Expand All @@ -115,14 +125,14 @@ describe('FastBootLocation', function() {
});
});

it('should NOT redirect when transitionTo is called with identical route name', function() {
it('should NOT redirect when transitionTo is called with identical route name', function () {
return request({
url: 'http://localhost:49741/my-root/noop-transition-to',
followRedirect: false,
headers: {
Accept: 'text/html'
}
}).then(function(response) {
Accept: 'text/html',
},
}).then(function (response) {
if (response.statusCode === 500) throw new Error(response.body);
expect(response.statusCode).to.equal(200);

Expand All @@ -136,14 +146,14 @@ describe('FastBootLocation', function() {
});
});

it('should NOT redirect when replaceWith is called with identical route name', function() {
it('should NOT redirect when replaceWith is called with identical route name', function () {
return request({
url: 'http://localhost:49741/my-root/noop-replace-with',
followRedirect: false,
headers: {
Accept: 'text/html'
}
}).then(function(response) {
Accept: 'text/html',
},
}).then(function (response) {
if (response.statusCode === 500) throw new Error(response.body);
expect(response.statusCode).to.equal(200);

Expand Down
1 change: 0 additions & 1 deletion packages/ember-cli-fastboot/test/new-package-json-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const expect = require('chai').expect;
const helpers = require('broccoli-test-helper');
const createBuilder = helpers.createBuilder;
const createTempDir = helpers.createTempDir;
const co = require('co');
const FastbootConfig = require('../lib/broccoli/fastboot-config');

describe('FastbootConfig', function() {
Expand Down
Loading