Skip to content

Commit

Permalink
test are running but failing badly
Browse files Browse the repository at this point in the history
  • Loading branch information
makemp committed Nov 11, 2023
1 parent 594f93c commit b4ec05d
Show file tree
Hide file tree
Showing 69 changed files with 1,598 additions and 3,290 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ module.exports = {
triggerCopyError: true,
signInUser: true,
withFeature: true,
percySnapshot: true,
waitForElement: true
},
plugins: ['node'],
Expand Down
4 changes: 2 additions & 2 deletions app/adapters/build.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import V3Adapter from 'travis/adapters/v3';
import Ember from 'ember';
import { testing } from 'ember';

let includes = 'build.commit,build.branch,build.request,build.created_by';

// TODO this is a workaround for an infinite loop in Mirage serialising 😞
if (!Ember.testing) {
if (testing) {
includes += ',build.repository';
}

Expand Down
2 changes: 1 addition & 1 deletion app/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* global Travis */
import Evented from '@ember/object/evented';

import Ember from 'ember';
import Application from '@ember/application';
import Resolver from './resolver';
import loadInitializers from 'ember-load-initializers';
Expand Down
4 changes: 2 additions & 2 deletions app/components/broadcast-tower.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { later } from '@ember/runloop';
import { Promise as EmberPromise } from 'rsvp';
import Component from '@ember/component';
import Ember from 'ember';
import {testing} from 'ember';
import { task } from 'ember-concurrency';

export default Component.extend({
Expand All @@ -16,7 +16,7 @@ export default Component.extend({
this.toggleBroadcasts();

// Acceptance tests will wait for the promise to resolve, so skip in tests
if (this.isOpen && !Ember.testing) {
if (this.isOpen && !testing) {
yield new EmberPromise(resolve => later(resolve, 10000));

this.toggleProperty('isOpen');
Expand Down
4 changes: 2 additions & 2 deletions app/components/build-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { and, notEmpty } from '@ember/object/computed';
import { htmlSafe } from '@ember/string';
import { typeOf } from '@ember/utils';
import { codeblockName } from 'travis/utils/format-config';
import Ember from 'ember';
import { Handlebars } from 'ember';

const { escapeExpression: escape } = Ember.Handlebars.Utils;
const { Utils: { escapeExpression: escape } } = Handlebars;

export default Component.extend({
tagName: '',
Expand Down
4 changes: 2 additions & 2 deletions app/components/queued-jobs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Component from '@ember/component';
import Ember from 'ember';
import {testing} from 'ember';
import { reads } from '@ember/object/computed';
import config from 'travis/config/environment';
import Visibility from 'visibilityjs';
Expand All @@ -13,7 +13,7 @@ export default Component.extend({

init() {
this._super(...arguments);
if (!Ember.testing) {
if (!testing) {
return Visibility.every(config.intervals.updateTimes, this.updateTimes.bind(this));
}
},
Expand Down
4 changes: 2 additions & 2 deletions app/components/repository-sidebar.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isEmpty } from '@ember/utils';
import { schedule } from '@ember/runloop';
import Component from '@ember/component';
import Ember from 'ember';
import {testing} from 'ember';
import Visibility from 'visibilityjs';
import { task } from 'ember-concurrency';
import { computed } from '@ember/object';
Expand Down Expand Up @@ -42,7 +42,7 @@ export default Component.extend({
this.set('_data', this.get('repositories.accessible'));
}

if (!Ember.testing) {
if (!testing) {
Visibility.every(config.intervals.updateTimes, () => {
const callback = (record) => record.get('currentBuild');
const withCurrentBuild = this._data.filter(callback).map(callback);
Expand Down
4 changes: 2 additions & 2 deletions app/components/running-jobs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Component from '@ember/component';
import Ember from 'ember';
import {testing} from 'ember';
import { reads } from '@ember/object/computed';
import config from 'travis/config/environment';
import Visibility from 'visibilityjs';
Expand All @@ -13,7 +13,7 @@ export default Component.extend({

init() {
this._super(...arguments);
if (!Ember.testing) {
if (!testing) {
return Visibility.every(config.intervals.updateTimes, this.updateTimes.bind(this));
}
},
Expand Down
4 changes: 2 additions & 2 deletions app/components/top-bar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { scheduleOnce } from '@ember/runloop';
import Component from '@ember/component';
import Ember from 'ember';
import {testing} from 'ember';
import {
computed,
setProperties,
Expand Down Expand Up @@ -84,7 +84,7 @@ export default class TopBar extends Component {
}

didInsertElement() {
if (Ember.testing) {
if (testing) {
super.didInsertElement(...arguments);
return;
}
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Controller, { inject as controller } from '@ember/controller';
import Ember from 'ember';
import {testing} from 'ember';
import Polling from 'travis/mixins/polling';
import Visibility from 'visibilityjs';
import config from 'travis/config/environment';
Expand Down Expand Up @@ -28,7 +28,7 @@ export default Controller.extend(Polling, {

init() {
this._super(...arguments);
if (!Ember.testing) {
if (!testing) {
return Visibility.every(config.intervals.updateTimes, this.updateTimes.bind(this));
}
},
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/dashboard/builds.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Controller from '@ember/controller';
import Ember from 'ember';
import {testing} from 'ember';
import Visibility from 'visibilityjs';
import { inject as service } from '@ember/service';
import config from 'travis/config/environment';
Expand All @@ -9,7 +9,7 @@ export default Controller.extend({

init() {
this._super(...arguments);
if (!Ember.testing) {
if (!testing) {
Visibility.every(config.intervals.updateTimes, this.updateTimes.bind(this));
}
},
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Controller from '@ember/controller';
import Ember from 'ember';
import {testing} from 'ember';
import { computed } from '@ember/object';
import { alias } from '@ember/object/computed';
import Visibility from 'visibilityjs';
Expand All @@ -18,7 +18,7 @@ export default Controller.extend({

init() {
this._super(...arguments);
if (!Ember.testing) {
if (!testing) {
return Visibility.every(config.intervals.updateTimes, this.updateTimes.bind(this));
}
},
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/repo.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { scheduleOnce } from '@ember/runloop';
import { isEmpty } from '@ember/utils';
import Controller, { inject as controller } from '@ember/controller';
import Ember from 'ember';
import {testing} from 'ember';
import eventually from 'travis/utils/eventually';
import Visibility from 'visibilityjs';
import { inject as service } from '@ember/service';
Expand Down Expand Up @@ -63,7 +63,7 @@ export default Controller.extend({

init() {
this._super(...arguments);
if (!Ember.testing) {
if (!testing) {
Visibility.every(config.intervals.updateTimes, this.updateTimes.bind(this));
}
},
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/commit-link.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Ember from 'ember';
import { Handlebars } from 'ember';
import { htmlSafe } from '@ember/string';
import Helper from '@ember/component/helper';
import { inject as service } from '@ember/service';
import formatCommit from 'travis/utils/format-commit';

const { escapeExpression: escape } = Ember.Handlebars.Utils;
const { Utils: { escapeExpression: escape } } = Handlebars;

export default Helper.extend({
externalLinks: service(),
Expand Down
4 changes: 2 additions & 2 deletions app/services/animation.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Service from '@ember/service';
import { computed } from '@ember/object';
import Ember from 'ember';
import {testing} from 'ember';
import fade from 'ember-animated/transitions/fade';

const isTest = Ember.testing;
const isTest = testing;

export const DURATION_NAMES = {
QUICK: 'quick',
Expand Down
3 changes: 1 addition & 2 deletions app/templates/account-error.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@
If you believe you've received this message in error, please
<LinkTo @route="help" @query={{hash anchor="form"}}>
contact support.
</LinkTo>
</p>
</LinkTo> </p>
</div>
3 changes: 1 addition & 2 deletions app/templates/account/settings.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@
@query={{hash tab="insights"}}
>
View {{this.account.fullName}}'s Insights
</LinkTo>
</p>
</LinkTo> </p>
<VisibilitySettingList
@options={{this.insightsVisibilityOptions}}
@initialKey={{this.privateInsightsVisibility}}
Expand Down
1 change: 1 addition & 0 deletions app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{head-layout}}
{{#let this.features as |f|}}
<HeadLayout />
<div class="feature-wrapper {{if f.dashboard 'dashboard'}} {{if f.pride 'travis-pride'}} {{if f.comicSans 'travis-comicsans'}}">
Expand Down
3 changes: 1 addition & 2 deletions app/templates/components/email-unsubscribe.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
class="repo-link repo-slug"
>
{{this.repo.formattedSlug}}
</LinkTo>
</h1>
</LinkTo> </h1>
<p class="description" data-test-email-unsubscribe-description>
{{#if this.isSubscribed}}
Please confirm that you would like to unsubscribe from build emails for the
Expand Down
6 changes: 2 additions & 4 deletions app/templates/components/job-tabs.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
data-test-job-log-tab="true"
>
Job log
</LinkTo>
</li>
</LinkTo> </li>
<li>
<LinkTo
@route="job.config"
Expand All @@ -32,8 +31,7 @@
<EmberTooltip @text={{this.messagesBadgeTooltipText}} />
</span>
{{/if}}
</LinkTo>
</li>
</LinkTo> </li>
</ul>
</nav>
<div class="travistab-body job-tabs">
Expand Down
3 changes: 1 addition & 2 deletions app/templates/components/link-to-account.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{{#if this.routeModel}}
<LinkTo @route={{this.routeName}} @model={{this.routeModel}} class={{@class}}>
{{yield}}
</LinkTo>
{{else}}
</LinkTo>{{else}}
<LinkTo @route={{this.routeName}} class={{@class}}>
{{yield}}
</LinkTo>
Expand Down
3 changes: 1 addition & 2 deletions app/templates/components/plan_usage.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@
@query={{hash serverType=this.repo.serverType}}
>
{{repository.formattedSlug}}
</LinkTo>
</td>
</LinkTo> </td>
<td>
{{format-number repository.buildMinutes}}
</td>
Expand Down
9 changes: 3 additions & 6 deletions app/templates/components/repo-show-tools.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,17 @@
<li>
<LinkTo @route="settings" @model={{this.repo}}>
Settings
</LinkTo>
</li>
</LinkTo> </li>
{{/if}}
<li>
<LinkTo @route="requests" @model={{this.repo}}>
Requests
</LinkTo>
</li>
</LinkTo> </li>
{{#if this.displayCachesLink}}
<li>
<LinkTo @route="caches" @model={{this.repo}}>
Caches
</LinkTo>
</li>
</LinkTo> </li>
{{/if}}
{{#if (and this.displayTriggerBuildLink this.canOwnerBuild)}}
<li>
Expand Down
6 changes: 2 additions & 4 deletions app/templates/components/repository-layout.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
<h1 data-test-repo-header-title class="inline-block vertical-align">
<LinkTo @route="owner" @models={{array this.repo.provider this.repo.ownerName}} >
{{this.repo.owner.login}}
</LinkTo>
/
</LinkTo> /
<LinkTo
@route="repo" @models={{array this.repo.provider this.repo.urlOwnerName this.repo.urlName}}
@query={{hash serverType=this.repo.serverType}}
>
{{this.repo.name}}
</LinkTo>
</h1>
</LinkTo> </h1>
</div>
<div>
<ExternalLinkTo
Expand Down
6 changes: 2 additions & 4 deletions app/templates/dashboard.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@
<h2 class="small-title">
<LinkTo @route="dashboard.repositories" data-test-active-repos-tab="true">
Active repositories
</LinkTo>
</h2>
</LinkTo> </h2>
<h2 class="small-title">
<LinkTo @route="dashboard.builds" data-test-my-builds-tab="true">
My builds
</LinkTo>
</h2>
</LinkTo> </h2>
</header>
{{outlet}}
</TravisLayout>
6 changes: 2 additions & 4 deletions app/templates/owner/repositories.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
<li>
<LinkTo @query={{hash tab="repositories" timeInterval=this.defaultTimeInterval}} >
Repositories
</LinkTo>
</li>
</LinkTo> </li>
<li>
<LinkTo @query={{hash tab="insights" timeInterval=this.timeInterval page=1}}>
Insights
</LinkTo>
</li>
</LinkTo> </li>
</ul>
</nav>
<div class="owner-repo">
Expand Down
6 changes: 2 additions & 4 deletions app/templates/settings.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -317,17 +317,15 @@
class="migrated-repo-settings-modal__button button--blue"
>
View Build History
</LinkTo>
<ExternalLinkTo
</LinkTo> <ExternalLinkTo
@href={{this.migratedRepositorySettingsLink}}
class="migrated-repo-settings-modal__button button--dark-grey"
>
Edit settings on .com
</ExternalLinkTo>
<LinkTo @route="repo.index" @models={{array repo.provider repo.ownerName repo.vcsName}} class="modal-close pointer">
<SvgImage @name="icon-failed" @class="icon" />
</LinkTo>
</div>
</LinkTo> </div>
</div>
</Modal>
<Dialogs::UserManagementModal
Expand Down
8 changes: 0 additions & 8 deletions config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,14 +396,6 @@ module.exports = function (environment) {

ENV.logLimit = 100;

ENV.percy = {
breakpointsConfig: {
mobile: 375,
desktop: 1280
},
defaultBreakpoints: ['mobile', 'desktop']
};

ENV.featureFlags['debug-logging'] = false;
ENV.featureFlags['dashboard'] = false;
ENV.featureFlags['pro-version'] = false;
Expand Down
Loading

0 comments on commit b4ec05d

Please sign in to comment.