Skip to content
Draft
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
32 changes: 1 addition & 31 deletions .github/workflows/test-ui.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

name: test-ui
on:
pull_request:
Expand Down Expand Up @@ -50,22 +51,8 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/setup-js
- uses: browser-actions/setup-chrome@4f8e94349a351df0f048634f25fec36c3c91eded # v2.1.1
- name: Retrieve Vault-hosted Secrets
if: endsWith(github.repository, '-enterprise')
id: vault
uses: hashicorp/vault-action@4c06c5ccf5c0761b6029f56cfb1dcf5565918a3b # v3.4.0
with:
url: ${{ vars.CI_VAULT_URL }}
method: ${{ vars.CI_VAULT_METHOD }}
path: ${{ vars.CI_VAULT_PATH }}
jwtGithubAudience: ${{ vars.CI_VAULT_AUD }}
secrets: |-
kv/data/teams/nomad/ui PERCY_TOKEN ;
- name: ember exam
id: ember_exam
env:
PERCY_TOKEN: ${{ env.PERCY_TOKEN || secrets.PERCY_TOKEN }}
PERCY_PARALLEL_NONCE: ${{ needs.pre-test.outputs.nonce }}
run: |
pnpm exam:parallel --split=${{ matrix.split }} --partition=${{ matrix.partition }} --json-report=test-results/test-results.json
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently failing here because

The option '--json-report' is not registered with the 'exam' command. Run ember exam --help for a list of supported options.
EmberExam: You must specify a split value in order to use partition.

I assume because we're not wrapping ember exam with Percy anymore.

continue-on-error: true
Expand Down Expand Up @@ -101,17 +88,6 @@ jobs:
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/setup-js
- name: Retrieve Vault-hosted Secrets
if: endsWith(github.repository, '-enterprise')
id: vault
uses: hashicorp/vault-action@4c06c5ccf5c0761b6029f56cfb1dcf5565918a3b # v3.4.0
with:
url: ${{ vars.CI_VAULT_URL }}
method: ${{ vars.CI_VAULT_METHOD }}
path: ${{ vars.CI_VAULT_PATH }}
jwtGithubAudience: ${{ vars.CI_VAULT_AUD }}
secrets: |-
kv/data/teams/nomad/ui PERCY_TOKEN ;
- name: Download all test results
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
Expand All @@ -130,12 +106,6 @@ jobs:
path: ui/combined-test-results.json
retention-days: 90

- name: finalize
env:
PERCY_TOKEN: ${{ env.PERCY_TOKEN || secrets.PERCY_TOKEN }}
PERCY_PARALLEL_NONCE: ${{ needs.pre-test.outputs.nonce }}
run: pnpm percy build:finalize

handle-failure:
needs:
- pre-test
Expand Down
530 changes: 0 additions & 530 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

15 changes: 0 additions & 15 deletions ui/.percy.yml

This file was deleted.

2 changes: 1 addition & 1 deletion ui/app/controllers/jobs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ export default class JobsIndexController extends Controller {
'NodePool is not empty',
'(dc1 in Datacenters) or (dc2 in Datacenters)',
];
// In test/Percy environments, pick deterministically so snapshots are stable.
// In test environments, pick deterministically so snapshots are stable.
// In production, keep it random so users discover different filter syntax.
if (Ember.testing) {
const filter = this.filter || '';
Expand Down
10 changes: 0 additions & 10 deletions ui/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ if (process.env.USE_MIRAGE) {
USE_MIRAGE = process.env.USE_MIRAGE == 'true';
}

let USE_PERCY = true;

if (process.env.USE_PERCY) {
USE_PERCY = process.env.USE_PERCY == 'true';
}

module.exports = function (environment) {
let ENV = {
modulePrefix: 'nomad-ui',
Expand All @@ -43,10 +37,6 @@ module.exports = function (environment) {
mirageWithTokens: true,
mirageWithRegions: true,
},

percy: {
enabled: USE_PERCY,
},
};

if (environment === 'development') {
Expand Down
6 changes: 1 addition & 5 deletions ui/mirage/faker.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ import config from 'nomad-ui/config/environment';

const searchIncludesSeed = window.location.search.includes('faker-seed');

if (
config.environment !== 'test' ||
config.percy.enabled ||
searchIncludesSeed
) {
if (config.environment !== 'test' || searchIncludesSeed) {
if (searchIncludesSeed) {
const params = new URLSearchParams(window.location.search);
const seed = parseInt(params.get('faker-seed'));
Expand Down
10 changes: 3 additions & 7 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
},
"scripts": {
"build": "ember build --environment=production",
"exam": "percy exec -- ember exam --split=4 --parallel",
"exam:parallel": "percy exec --parallel -- ember exam",
"exam": "ember exam --split=4 --parallel",
"exam:parallel": "ember exam --parallel",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
"lint:hbs": "ember-template-lint .",
Expand All @@ -20,12 +20,10 @@
"lint:js:fix": "eslint . --fix",
"local:exam": "ember exam --server --load-balance --parallel=4",
"local:test": "ember test --server",
"percy": "percy",
"precommit": "lint-staged",
"seedless-test": "USE_PERCY=false ember test",
"start": "ember server",
"test": "npm-run-all lint test:*",
"test:ember": "percy exec -- ember test"
"test:ember": "ember test"
},
"husky": {
"hooks": {
Expand Down Expand Up @@ -54,8 +52,6 @@
"@glint/template": "^1.5.2",
"@hashicorp/design-system-components": "4.13.0",
"@hashicorp/design-system-tokens": "^2.3.0",
"@percy/cli": "^1.30.0",
"@percy/ember": "^4.2.0",
"anser": "^2.1.1",
"babel-eslint": "^10.1.0",
"base64-js": "^1.3.1",
Expand Down
4 changes: 2 additions & 2 deletions ui/tests/acceptance/access-control-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Administration from 'nomad-ui/tests/pages/administration';
import Tokens from 'nomad-ui/tests/pages/settings/tokens';
import { allScenarios } from '../../mirage/scenarios/default';
import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit';
import percySnapshot from '@percy/ember';

import faker from 'nomad-ui/mirage/faker';

// Several related tests within Access Control are contained in the Tokens, Roles,
Expand Down Expand Up @@ -98,7 +98,7 @@ module('Acceptance | access control', function (hooks) {
await Administration.visit();

assert.dom('[data-test-sentinel-policies-card]').exists();
await percySnapshot(assert);

await click('[data-test-sentinel-policies-card] a');
assert.equal(currentURL(), '/administration/sentinel-policies');
});
Expand Down
28 changes: 0 additions & 28 deletions ui/tests/acceptance/actions-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { setupApplicationTest } from 'ember-qunit';
import { setupMirage } from 'ember-cli-mirage/test-support';
import Tokens from 'nomad-ui/tests/pages/settings/tokens';
import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit';
import percySnapshot from '@percy/ember';
import Actions from 'nomad-ui/tests/pages/jobs/job/actions';
import { triggerEvent, visit, click } from '@ember/test-helpers';
import faker from 'nomad-ui/mirage/faker';
Expand Down Expand Up @@ -203,12 +202,6 @@ module('Acceptance | actions', function (hooks) {
"The first action's dropdown subcontent exists"
);

await percySnapshot(assert, {
percyCSS: `
.allocation-row td { display: none; }
`,
});

// run on a random alloc
await Actions.titleActions.multiAllocActions[0].subActions[0].click();

Expand Down Expand Up @@ -275,8 +268,6 @@ module('Acceptance | actions', function (hooks) {
3,
'Running on an orphan alloc results in 1 further action instance'
);

await percySnapshot('Actions flyout with multiple instances');
});

test('Running actions from a task row', async function (assert) {
Expand Down Expand Up @@ -376,29 +367,10 @@ module('Acceptance | actions', function (hooks) {
Actions.flyout.actions.isPresent,
'Flyout has actions dropdown on task page'
);
await percySnapshot(assert, {
percyCSS: `
g.tick { visibility: hidden; }
.recent-events-table td {
display: none;
}
.inline-definitions { visibility: hidden; }
`,
});

// Clear finished actions and take a snapshot
await click('button[data-test-clear-finished-actions]');

await percySnapshot('Cleared actions/flyout open state', {
percyCSS: `
g.tick { visibility: hidden; }
.recent-events-table td {
display: none;
}
.inline-definitions { visibility: hidden; }
`,
});

// Close flyout; global button is no longer present
await Actions.flyout.close();
assert.notOk(
Expand Down
4 changes: 0 additions & 4 deletions ui/tests/acceptance/application-errors-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit';
import ClientsList from 'nomad-ui/tests/pages/clients/list';
import JobsList from 'nomad-ui/tests/pages/jobs/list';
import Job from 'nomad-ui/tests/pages/jobs/detail';
import percySnapshot from '@percy/ember';
import faker from 'nomad-ui/mirage/faker';

module('Acceptance | application errors ', function (hooks) {
Expand All @@ -32,7 +31,6 @@ module('Acceptance | application errors ', function (hooks) {
server.pretender.get('/v1/nodes', () => [500, {}, null]);
await ClientsList.visit();
await a11yAudit(assert);
await percySnapshot(assert);
});

test('transitioning away from an error page resets the global error', async function (assert) {
Expand All @@ -58,7 +56,6 @@ module('Acceptance | application errors ', function (hooks) {

assert.ok(Job.error.isPresent, 'Error message is shown');
assert.equal(Job.error.title, 'Not Authorized', 'Error message is for 403');
await percySnapshot(assert);

await Job.error.seekHelp();
assert.equal(
Expand All @@ -84,7 +81,6 @@ module('Acceptance | application errors ', function (hooks) {
'No Cluster Leader',
'The error is specifically for the lack of a cluster leader'
);
await percySnapshot(assert);
});

test('error pages include links to the jobs, clients and auth pages', async function (assert) {
Expand Down
5 changes: 0 additions & 5 deletions ui/tests/acceptance/clients-list-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { setupMirage } from 'ember-cli-mirage/test-support';
import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit';
import pageSizeSelect from './behaviors/page-size-select';
import ClientsList from 'nomad-ui/tests/pages/clients/list';
import percySnapshot from '@percy/ember';
import faker from 'nomad-ui/mirage/faker';

module('Acceptance | clients list', function (hooks) {
Expand Down Expand Up @@ -42,8 +41,6 @@ module('Acceptance | clients list', function (hooks) {

await ClientsList.visit();

await percySnapshot(assert);

assert.equal(ClientsList.nodes.length, ClientsList.pageSize);
assert.ok(ClientsList.hasPagination, 'Pagination found on the page');

Expand Down Expand Up @@ -237,8 +234,6 @@ module('Acceptance | clients list', function (hooks) {

await ClientsList.visit();

await percySnapshot(assert);

assert.ok(ClientsList.isEmpty);
assert.equal(ClientsList.empty.headline, 'No Clients');
});
Expand Down
6 changes: 2 additions & 4 deletions ui/tests/acceptance/dynamic-host-volume-detail-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import moment from 'moment';
import { formatBytes, formatHertz } from 'nomad-ui/utils/units';
import VolumeDetail from 'nomad-ui/tests/pages/storage/dynamic-host-volumes/detail';
import Layout from 'nomad-ui/tests/pages/layout';
import percySnapshot from '@percy/ember';
import faker from 'nomad-ui/mirage/faker';

const assignAlloc = (volume, alloc) => {
Expand Down Expand Up @@ -74,7 +73,7 @@ module('Acceptance | dynamic host volume detail', function (hooks) {

test('/storage/volumes/:id should list all allocations the volume is attached to', async function (assert) {
// Use fixed timestamps so both absolute dates and relative times are
// deterministic across Percy snapshot runs.
// deterministic across test runs.
const pinned = new Date('2025-06-15T12:00:00Z');
const pinnedNs = pinned.getTime() * 1e6; // nanoseconds

Expand All @@ -95,7 +94,7 @@ module('Acceptance | dynamic host volume detail', function (hooks) {
allocations.forEach((alloc) => assignAlloc(volume, alloc));

// Freeze moment's time reference so relative times ("9 hours ago") are
// deterministic across Percy snapshot runs.
// deterministic across test runs.
const originalMomentNow = moment.now;
moment.now = () => pinned.getTime();

Expand All @@ -112,7 +111,6 @@ module('Acceptance | dynamic host volume detail', function (hooks) {
VolumeDetail.allocations.objectAt(idx).id
);
});
await percySnapshot(assert);
} finally {
moment.now = originalMomentNow;
}
Expand Down
7 changes: 0 additions & 7 deletions ui/tests/acceptance/evaluations-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit';
import { selectChoose } from 'ember-power-select/test-support';
import { clickTrigger } from 'ember-power-select/test-support/helpers';
import { generateAcceptanceTestEvalMock } from '../../mirage/utils';
import percySnapshot from '@percy/ember';
import faker from 'nomad-ui/mirage/faker';

const getStandardRes = () => [
Expand Down Expand Up @@ -133,8 +132,6 @@ module('Acceptance | evaluations list', function (hooks) {
await visit('/evaluations');
assert.expect(2);

await percySnapshot(assert);

assert
.dom('[data-test-empty-evaluations-list]')
.exists('We display empty table message.');
Expand Down Expand Up @@ -163,8 +160,6 @@ module('Acceptance | evaluations list', function (hooks) {

await visit('/evaluations');

await percySnapshot(assert);

assert
.dom('[data-test-eval-table]')
.exists('Evaluations table should render');
Expand Down Expand Up @@ -702,8 +697,6 @@ module('Acceptance | evaluations list', function (hooks) {
const evalId = '5fb1b8cd';
await click(`[data-test-evaluation='${evalId}']`);

await percySnapshot(assert);

assert
.dom('[data-test-eval-detail-is-open]')
.exists(
Expand Down
4 changes: 0 additions & 4 deletions ui/tests/acceptance/exec-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit';
import Service from '@ember/service';
import Exec from 'nomad-ui/tests/pages/exec';
import KEYS from 'nomad-ui/utils/keys';
import percySnapshot from '@percy/ember';
import faker from 'nomad-ui/mirage/faker';

module('Acceptance | exec', function (hooks) {
Expand Down Expand Up @@ -105,8 +104,6 @@ module('Acceptance | exec', function (hooks) {
assert.notOk(Exec.taskGroups[0].tasks[0].isActive);
assert.ok(Exec.taskGroups[0].chevron.isDown);

await percySnapshot(assert);

await Exec.taskGroups[0].click();
assert.equal(Exec.taskGroups[0].tasks.length, 0);
});
Expand Down Expand Up @@ -305,7 +302,6 @@ module('Acceptance | exec', function (hooks) {

const terminalTextRendered = assert.async();
setTimeout(async () => {
await percySnapshot(assert);
terminalTextRendered();
}, 1000);
});
Expand Down
Loading
Loading