Bumped a bunch of dependencies. Mirage needed some work. Added ember and yarn scripts that runs same version of node as prod

This commit is contained in:
Ignacio Bona 2018-08-30 15:54:14 -07:00
parent 380c698410
commit 41cf965400
31 changed files with 695 additions and 722 deletions

View File

@ -42,6 +42,19 @@ task emberCoverage(type: NodeTask, dependsOn: emberTest) {
args = ['-f', 'coverage/coverage-final.json']
}
task execEmber(type: NodeTask) {
script = file('node_modules/.bin/ember')
if ( project.hasProperty('emberArgs') ) {
args = emberArgs.tokenize();
}
}
task execYarn(type: YarnTask) {
if ( project.hasProperty('yarnArgs') ) {
args = yarnArgs.tokenize();
}
}
clean {
delete 'node_modules'
delete 'bower_components'

View File

@ -23,7 +23,6 @@ export interface IMirageServer {
loadFactories: (factoryMap: object) => void;
create: (type: string, options?: object) => object;
createList: <T>(type: string, amount: number, traitsAndOverrides?: object | string) => Array<T>;
shutdown: (this: IMirageServer) => void;
}
/**

View File

@ -74,6 +74,10 @@ module.exports = function(environment) {
ENV.APP.rootElement = '#ember-testing';
ENV.APP.autoboot = false;
ENV['ember-cli-mirage'] = {
enabled: true,
autostart: true
};
}
if (environment === 'production') {

View File

@ -27,7 +27,9 @@ export default Factory.extend({
tbl_type: 'VIRTUAL_VIEW',
view_expanded_text: faker.lorem.sentence()
}),
schema: 'abcd',
// TODO https://github.com/samselikoff/ember-cli-mirage/issues/1379
whSchema: 'abcd',
source: 'Hive',
urn: faker.internet.url(),
watchId: 0,
@ -37,8 +39,15 @@ export default Factory.extend({
id(id: number) {
return id;
},
schema(id: number) {
// TODO https://github.com/samselikoff/ember-cli-mirage/issues/1379
whSchema(id: number) {
return id === 0 ? testSchemaA : 'abcd';
}
})
}),
// TODO https://github.com/samselikoff/ember-cli-mirage/issues/1379
afterCreate(dataset: any) {
dataset.attrs.schema = dataset.attrs.whSchema;
}
});

View File

@ -1,6 +1,6 @@
import { IFunctionRouteHandler } from 'wherehows-web/typings/ember-cli-mirage';
export const getDatasetHealth = function(this: IFunctionRouteHandler, { db: healths }: any) {
export const getDatasetHealth = function(this: IFunctionRouteHandler, { db: { healths } }: any) {
return {
health: this.serialize(healths[0])
};

View File

@ -28,17 +28,17 @@
"@types/lodash": "^4.14.83",
"@types/qunit": "^2.5.2",
"@types/rsvp": "^4.0.2",
"@zestia/ember-simple-infinite-scroller": "^2.0.2",
"@zestia/ember-simple-infinite-scroller": "^3.0.2",
"babel-plugin-transform-async-to-generator": "^6.24.1",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-es2015-destructuring": "^6.23.0",
"babel-plugin-transform-es2015-parameters": "^6.24.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"broccoli-asset-rev": "^2.7.0",
"broccoli-asset-rev": "^3.0.0",
"broccoli-funnel": "^2.0.1",
"broccoli-merge-trees": "^3.0.0",
"codecov": "^3.0.0",
"ember-ace": "^1.3.1",
"ember-ace": "^2.0.0",
"ember-ajax": "^3.0.0",
"ember-basic-dropdown": "^1.0.0",
"ember-cli": "^3.3.0",
@ -46,11 +46,11 @@
"ember-cli-babel": "^6.12.0",
"ember-cli-bootstrap-sassy": "^0.5.8",
"ember-cli-code-coverage": "^1.0.0-beta.4",
"ember-cli-dependency-checker": "^2.0.0",
"ember-cli-dependency-checker": "^3.0.0",
"ember-cli-dependency-lint": "^1.0.3",
"ember-cli-eslint": "^4.2.1",
"ember-cli-eyeglass": "^5.0.0",
"ember-cli-htmlbars": "^2.0.1",
"ember-cli-htmlbars": "^3.0.0",
"ember-cli-htmlbars-inline-precompile": "^1.0.0",
"ember-cli-inject-live-reload": "^1.4.1",
"ember-cli-moment-shim": "^3.5.0",
@ -64,23 +64,24 @@
"ember-concurrency": "^0.8.15",
"ember-decorators": "^2.0.0",
"ember-export-application-global": "^2.0.0",
"ember-fetch": "^5.1.1",
"ember-fetch": "5.1.1",
"ember-font-awesome": "^4.0.0-rc.2",
"ember-highcharts": "^1.0.0",
"ember-inflector": "^2.2.0",
"ember-inflector": "2.3.0",
"ember-load-initializers": "^1.0.0",
"ember-math-helpers": "^2.4.0",
"ember-medium-editor": "^0.1.4",
"ember-metrics": "^0.12.1",
"ember-power-calendar": "^0.7.1",
"ember-power-calendar": "^0.9.0",
"ember-power-calendar-moment": "^0.1.3",
"ember-power-select-typeahead": "^0.7.0",
"ember-resolver": "^4.0.0",
"ember-resolver": "^5.0.1",
"ember-sinon": "^1.0.1",
"ember-sinon-qunit": "^2.1.0",
"ember-source": "^3.3.1",
"ember-symbol-observable": "^1.0.1",
"eslint": "^4.15.0",
"eslint-config-prettier": "^2.9.0",
"eslint": "^5.4.0",
"eslint-config-prettier": "^3.0.1",
"eslint-plugin-ember": "^5.0.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-prettier": "^2.6.2",
@ -99,7 +100,7 @@
"bootstrap": "3.3.7",
"dynamic-link": "^0.2.3",
"ember-aupac-typeahead": "3.1.0",
"ember-cli-mirage": "0.4.1",
"ember-cli-mirage": "^0.4.9",
"ember-cli-string-helpers": "^1.4.0",
"ember-lodash": "^4.18.0",
"ember-modal-dialog": "^2.4.1",
@ -107,8 +108,8 @@
"ember-power-select": "^2.0.4",
"ember-radio-button": "^1.2.1",
"ember-simple-auth": "^1.4.0",
"ember-tether": "0.4.1",
"ember-tooltips": "https://github.com/mattgraham1995/ember-tooltips#06112adb703f1701eef2257bf7690434af2c7444",
"ember-tether": "^1.0.0",
"ember-tooltips": "^2.10.0",
"ember-truth-helpers": "^2.0.0",
"eslint-plugin-typescript": "^0.12.0",
"font-awesome": "^4.7.0",
@ -116,10 +117,10 @@
"jquery-jsonview": "^1.2.3",
"jquery-treegrid": "^0.3.0",
"json-human": "https://github.com/marianoguerra/json.human.js#0.1.1",
"marked": "^0.3.6",
"medium-editor": "5.14.4",
"marked": "^0.5.0",
"medium-editor": "^5.23.3",
"scrollmonitor": "^1.2.4",
"typescript-eslint-parser": "^17.0.1"
"typescript-eslint-parser": "^18.0.0"
},
"engines": {
"node": ">= 8.*"

View File

@ -14,7 +14,7 @@ module('Acceptance | datasets/dataset/comments', function(hooks) {
// feature not yet supported in v2
skip('visiting /datasets/dataset/comments', async function(assert) {
assert.expect(2);
defaultScenario(server);
defaultScenario(this.server);
const url = '/datasets/12345/comments';
await visit(url);

View File

@ -13,7 +13,7 @@ module('Acceptance | datasets/dataset/ownership', function(hooks) {
skip('visiting /datasets/dataset/ownership', async function(assert) {
assert.expect(2);
defaultScenario(server);
defaultScenario(this.server);
const url = '/datasets/12345/ownership';
await visit(url);

View File

@ -13,7 +13,7 @@ module('Acceptance | datasets/dataset/properties', function(hooks) {
skip('visiting /datasets/dataset/properties', async function(assert) {
assert.expect(2);
defaultScenario(server);
defaultScenario(this.server);
const url = '/datasets/12345/properties';
await visit(url);

View File

@ -13,7 +13,7 @@ module('Acceptance | datasets/dataset/relationships', function(hooks) {
skip('visiting /datasets/dataset/relationships', async function(assert) {
assert.expect(2);
defaultScenario(server);
defaultScenario(this.server);
const url = '/datasets/12345/relationships';
await visit(url);

View File

@ -13,7 +13,7 @@ module('Acceptance | datasets/dataset/sample', function(hooks) {
skip('visiting /datasets/dataset/sample', async function(assert) {
assert.expect(2);
defaultScenario(server);
defaultScenario(this.server);
const url = '/datasets/12345/sample';
await visit(url);

View File

@ -13,7 +13,7 @@ module('Acceptance | datasets/dataset/schema', function(hooks) {
skip('visiting /datasets/dataset/schema', async function(assert) {
assert.expect(2);
defaultScenario(server);
defaultScenario(this.server);
const url = '/datasets/12345/schema';
await visit(url);

View File

@ -2,21 +2,11 @@ import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { startMirage } from 'wherehows-web/initializers/ember-cli-mirage';
import { nonHdfsUrn } from 'wherehows-web/mirage/fixtures/urn';
module('Integration | Component | datasets/containers/data-systems-count', function(hooks) {
setupRenderingTest(hooks);
hooks.beforeEach(function(this: any) {
this.server = startMirage();
});
hooks.afterEach(function(this: any) {
this.server.shutdown();
});
test('component rendering', async function(assert) {
assert.expect(2);

View File

@ -16,16 +16,16 @@ module('Integration | Component | datasets/containers/dataset acl access', funct
this['current-user'] = this.owner.lookup('service:current-user');
this.notifications = this.owner.lookup('service:notifications');
this.server = sinon.createFakeServer();
this.server.respondImmediately = true;
this.sinonServer = sinon.createFakeServer();
this.sinonServer.respondImmediately = true;
});
hooks.afterEach(function() {
this.server.restore();
this.sinonServer.restore();
});
test('it renders', async function(assert) {
this.server.respondWith('GET', /\/api\/v2\/datasets.*/, [
this.sinonServer.respondWith('GET', /\/api\/v2\/datasets.*/, [
200,
{ 'Content-Type': 'application/json' },
JSON.stringify({})

View File

@ -3,19 +3,10 @@ import { setupRenderingTest } from 'ember-qunit';
import { render, waitUntil, find } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { initialComplianceObjectFactory } from 'wherehows-web/constants';
import { startMirage } from 'wherehows-web/initializers/ember-cli-mirage';
module('Integration | Component | datasets/containers/dataset compliance', function(hooks) {
setupRenderingTest(hooks);
hooks.beforeEach(function() {
this.server = startMirage();
});
hooks.afterEach(function() {
this.server.shutdown();
});
test('it renders', async function(assert) {
assert.expect(1);
const { server } = this;

View File

@ -2,7 +2,6 @@ import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, find, waitFor } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { startMirage } from 'wherehows-web/initializers/ember-cli-mirage';
import fabrics from 'wherehows-web/mirage/fixtures/fabrics';
const containerTestClass = 'container-testing-class';
@ -10,14 +9,6 @@ const containerTestClass = 'container-testing-class';
module('Integration | Component | datasets/containers/dataset-fabrics', function(hooks) {
setupRenderingTest(hooks);
hooks.beforeEach(function() {
this.server = startMirage();
});
hooks.afterEach(function() {
this.server.shutdown();
});
test('dataset fabric container rendering', async function(assert) {
assert.expect(2);

View File

@ -3,11 +3,14 @@ import { setupRenderingTest } from 'ember-qunit';
import { urn } from 'wherehows-web/mirage/fixtures/urn';
import { render, find } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import defaultScenario from 'wherehows-web/mirage/scenarios/default';
module('Integration | Component | datasets/containers/dataset-health', function(hooks) {
setupRenderingTest(hooks);
test('it renders', async function(assert) {
defaultScenario(this.server);
this.set('urn', urn);
await render(hbs`{{datasets/containers/dataset-health urn=urn}}`);

View File

@ -3,19 +3,10 @@ import { setupRenderingTest } from 'ember-qunit';
import { render, findAll } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { nonHdfsUrn } from 'wherehows-web/mirage/fixtures/urn';
import { startMirage } from 'wherehows-web/initializers/ember-cli-mirage';
module('Integration | Component | datasets/containers/dataset-lineage-downstreams', function(hooks) {
setupRenderingTest(hooks);
hooks.beforeEach(function(this: any) {
this.server = startMirage();
});
hooks.afterEach(function(this: any) {
this.server.shutdown();
});
test('component rendering', async function(assert) {
assert.expect(2);

View File

@ -2,20 +2,11 @@ import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, findAll } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { startMirage } from 'wherehows-web/initializers/ember-cli-mirage';
import { nonHdfsUrn } from 'wherehows-web/mirage/fixtures/urn';
module('Integration | Component | datasets/containers/dataset-lineage-upstreams', function(hooks) {
setupRenderingTest(hooks);
hooks.beforeEach(function(this: any) {
this.server = startMirage();
});
hooks.afterEach(function(this: any) {
this.server.shutdown();
});
test('component rendering', async function(assert) {
assert.expect(2);

View File

@ -9,23 +9,23 @@ module('Integration | Component | datasets/containers/dataset ownership', functi
setupRenderingTest(hooks);
hooks.beforeEach(function() {
this.server = sinon.createFakeServer();
this.server.respondImmediately = true;
this.sinonServer = sinon.createFakeServer();
this.sinonServer.respondImmediately = true;
});
hooks.afterEach(function() {
this.server.restore();
this.sinonServer.restore();
});
test('it renders', async function(assert) {
const lookupClass = '.dataset-owner-table__add-owner';
this.set('urn', urn);
this.server.respondWith('GET', /\/api\/v2\/datasets.*/, [
this.sinonServer.respondWith('GET', /\/api\/v2\/datasets.*/, [
200,
{ 'Content-Type': 'application/json' },
JSON.stringify({})
]);
this.server.respondWith('GET', '/api/v1/owner/types', [
this.sinonServer.respondWith('GET', '/api/v1/owner/types', [
200,
{ 'Content-Type': 'application/json' },
JSON.stringify([])

View File

@ -2,19 +2,10 @@ import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, waitUntil, find } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { startMirage } from 'wherehows-web/initializers/ember-cli-mirage';
module('Integration | Component | datasets/containers/dataset properties', function(hooks) {
setupRenderingTest(hooks);
hooks.beforeEach(function() {
this.server = startMirage();
});
hooks.afterEach(function() {
this.server.shutdown();
});
test('it renders', async function(assert) {
const { server } = this;
const { uri } = server.create('datasetView');

View File

@ -3,19 +3,10 @@ import { setupRenderingTest } from 'ember-qunit';
import { render, find } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { urn } from 'wherehows-web/mirage/fixtures/urn';
import { startMirage } from 'wherehows-web/initializers/ember-cli-mirage';
module('Integration | Component | datasets/containers/dataset schema', function(hooks) {
setupRenderingTest(hooks);
hooks.beforeEach(function() {
this.server = startMirage();
});
hooks.afterEach(function() {
this.server.shutdown();
});
test('it renders', async function(assert) {
this.set('urn', urn);
await render(hbs`{{datasets/containers/dataset-schema urn=urn}}`);

View File

@ -2,11 +2,14 @@ import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import defaultScenario from 'wherehows-web/mirage/scenarios/default';
module('Integration | Component | datasets/containers/health-score-gauge', function(hooks) {
setupRenderingTest(hooks);
test('it renders', async function(assert) {
defaultScenario(this.server);
await render(hbs`{{datasets/containers/health-score-gauge}}`);
assert.ok(this.element, 'Renders without errors');

View File

@ -2,7 +2,6 @@ import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, waitUntil, find, findAll, click } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { startMirage } from 'wherehows-web/initializers/ember-cli-mirage';
import { DatasetPlatform, PurgePolicy } from 'wherehows-web/constants';
import { hdfsUrn } from 'wherehows-web/mirage/fixtures/urn';
@ -13,14 +12,6 @@ const purgePolicyClass = '.purge-policy-list__item';
module('Integration | Component | datasets/containers/upstream dataset', function(hooks) {
setupRenderingTest(hooks);
hooks.beforeEach(function() {
this.server = startMirage();
});
hooks.afterEach(function() {
this.server.shutdown();
});
test('it renders', async function(assert) {
assert.expect(1);
const { server } = this;

View File

@ -9,12 +9,12 @@ module('Integration | Component | datasets/containers/upstream owners', function
setupRenderingTest(hooks);
hooks.beforeEach(function() {
this.server = sinon.createFakeServer();
this.server.respondImmediately = true;
this.sinonServer = sinon.createFakeServer();
this.sinonServer.respondImmediately = true;
});
hooks.afterEach(function() {
this.server.restore();
this.sinonServer.restore();
});
test('it renders', async function(assert) {
@ -22,7 +22,7 @@ module('Integration | Component | datasets/containers/upstream owners', function
const nativeName = 'A nativeName';
this.set('upstreamUrn', hdfsUrn);
this.server.respondWith(/\/api\/v2\/datasets.*/, async function(xhr) {
this.sinonServer.respondWith(/\/api\/v2\/datasets.*/, async function(xhr) {
xhr.respond(
200,
{ 'Content-Type': 'application/json' },

View File

@ -3,19 +3,10 @@ import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { nonHdfsUrn } from 'wherehows-web/mirage/fixtures/urn';
import { startMirage } from 'wherehows-web/initializers/ember-cli-mirage';
module('Integration | Component | datasets/dataset-relationships', function(hooks) {
setupRenderingTest(hooks);
hooks.beforeEach(function(this: any) {
this.server = startMirage();
});
hooks.afterEach(function(this: any) {
this.server.shutdown();
});
test('component rendering', async function(assert) {
this.set('urn', nonHdfsUrn);

View File

@ -13,11 +13,11 @@ module('Integration | Component | purge policy', function(hooks) {
setupRenderingTest(hooks);
hooks.beforeEach(function() {
this.server = sinon.createFakeServer();
this.sinonServer = sinon.createFakeServer();
});
hooks.afterEach(function() {
this.server.restore();
this.sinonServer.restore();
});
const policyList = '.purge-policy-list';
@ -89,7 +89,7 @@ module('Integration | Component | purge policy', function(hooks) {
this.set('purgePolicy', selectedPolicy);
this.set('supportedPurgePolicies', getSupportedPurgePolicies(platform, platforms));
this.server.respondWith('GET', '/api/v1/list/platforms', [
this.sinonServer.respondWith('GET', '/api/v1/list/platforms', [
200,
{ 'Content-Type': 'application/json' },
JSON.stringify({ status: ApiStatus.OK, platforms })
@ -98,7 +98,7 @@ module('Integration | Component | purge policy', function(hooks) {
await render(
hbs`{{purge-policy isEditable=isEditable purgePolicy=purgePolicy platform=platform supportedPurgePolicies=supportedPurgePolicies}}`
);
this.server.respond();
this.sinonServer.respond();
assert.ok(
document.querySelector(`${policyList} [type=radio][value=${selectedPolicy}]`).checked,

View File

@ -19,16 +19,16 @@ module('Integration | Component | search/containers/search sources', function(ho
setupRenderingTest(hooks);
hooks.beforeEach(function() {
this.server = sinon.createFakeServer();
this.server.respondImmediately = true;
this.sinonServer = sinon.createFakeServer();
this.sinonServer.respondImmediately = true;
});
hooks.afterEach(function() {
this.server.restore();
this.sinonServer.restore();
});
test('it renders', async function(assert) {
this.server.respondWith('GET', /\/api\/v2\/list\/platforms/, [
this.sinonServer.respondWith('GET', /\/api\/v2\/list\/platforms/, [
200,
{ 'Content-Type': 'application/json' },
JSON.stringify(platformsResponse)
@ -46,7 +46,7 @@ module('Integration | Component | search/containers/search sources', function(ho
});
test('Platform sources yielded', async function(assert) {
this.server.respondWith('GET', /\/api\/v2\/list\/platforms/, [
this.sinonServer.respondWith('GET', /\/api\/v2\/list\/platforms/, [
200,
{ 'Content-Type': 'application/json' },
JSON.stringify(platformsResponse)
@ -57,7 +57,7 @@ module('Integration | Component | search/containers/search sources', function(ho
<span class="inner-content">
{{#each container.radioSources as |source|}}
{{source.value}}
{{/each}}
{{/each}}
</span>
{{/search/containers/search-sources}}
`);

View File

@ -5,11 +5,11 @@ import { ApiStatus } from 'wherehows-web/utils/api';
module('Unit | Utility | authenticators/custom ldap', function(hooks) {
hooks.beforeEach(function() {
this.server = sinon.createFakeServer();
this.sinonServer = sinon.createFakeServer();
});
hooks.afterEach(function() {
this.server.restore();
this.sinonServer.restore();
});
test('Authenticate methods work as expected', async function(assert) {
@ -23,14 +23,14 @@ module('Unit | Utility | authenticators/custom ldap', function(hooks) {
let response;
this.server.respondWith('POST', '/authenticate', [
this.sinonServer.respondWith('POST', '/authenticate', [
200,
{ 'Content-Type': 'application/json' },
JSON.stringify({ status: ApiStatus.OK, data })
]);
response = authenticator.authenticate('username', 'password');
this.server.respond();
this.sinonServer.respond();
assert.ok(typeof response.then === 'function', 'returns a Promise object or thennable');
assert.equal((await response).username, data.username, 'authenticate correctly resolves with api response');

View File

@ -2,6 +2,7 @@ import { module, test } from 'qunit';
import { startMirage } from 'wherehows-web/initializers/ember-cli-mirage';
import datasetsCreateSearchEntries from 'wherehows-web/utils/datasets/create-search-entries';
import { testSchemaA } from 'wherehows-web/mirage/fixtures/schema';
import mirageScenario from 'wherehows-web/mirage/scenarios/default';
module('Unit | Utility | datasets/create search entries', function(hooks) {
hooks.beforeEach(function() {
@ -14,7 +15,7 @@ module('Unit | Utility | datasets/create search entries', function(hooks) {
test('it works base case', function(assert) {
const { server } = this;
const dataset = server.create('dataset', 'forUnitTests');
const dataset = server.create('dataset', 'forUnitTests').attrs;
const result = datasetsCreateSearchEntries([]);
assert.ok(!result, 'Returns without error for nothing case');
@ -26,7 +27,7 @@ module('Unit | Utility | datasets/create search entries', function(hooks) {
test('it works for keyword cases', function(assert) {
const { server } = this;
const dataset = server.create('dataset', 'forUnitTests');
const dataset = server.create('dataset', 'forUnitTests').attrs;
datasetsCreateSearchEntries([dataset], 'Rebel');
assert.equal(dataset.id, 0, 'Sanity check: Created model successfully again');

File diff suppressed because it is too large Load Diff