Skip to content

Commit

Permalink
Fix order vscode tests
Browse files Browse the repository at this point in the history
  • Loading branch information
julieg18 committed Sep 21, 2023
1 parent 2380be6 commit 08bc33d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 2 additions & 0 deletions extension/src/test/fixtures/expShow/base/columns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const nestedParamsFile = join('nested', 'params.yaml')

export const dataColumnOrder: string[] = [
'id',
'branch',
'commit',
'Created',
'metrics:summary.json:accuracy',
'metrics:summary.json:loss',
Expand Down
5 changes: 3 additions & 2 deletions extension/src/test/suite/experiments/columns/tree.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,9 @@ suite('Experiments Columns Tree Test Suite', () => {

const firstColumns = []
const otherColumns = []
const defaultColumns = ['id', 'branch', 'commit']
for (const column of columnsOrder) {
if (column === 'id') {
if (defaultColumns.includes(column)) {
continue
}
if (
Expand Down Expand Up @@ -410,7 +411,7 @@ suite('Experiments Columns Tree Test Suite', () => {
])

expect(columnsModel.getColumnOrder()).to.deep.equal([
'id',
...defaultColumns,
...firstColumns,
...otherColumns
])
Expand Down
10 changes: 8 additions & 2 deletions extension/src/test/suite/experiments/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1096,9 +1096,12 @@ suite('Experiments Test Suite', () => {
})
await messageSent

const [id, firstColumn] = messageSpy.lastCall.args[0].columnOrder
const [id, branch, commit, firstColumn] =
messageSpy.lastCall.args[0].columnOrder

expect(id).to.equal('id')
expect(commit).to.equal('commit')
expect(branch).to.equal('branch')
expect(firstColumn).to.equal(movedColumn)
}).timeout(WEBVIEW_TEST_TIMEOUT)

Expand Down Expand Up @@ -1126,8 +1129,11 @@ suite('Experiments Test Suite', () => {

expect(paramsYamlColumns).to.be.greaterThan(6)

const [id, ...columns] = messageSpy.lastCall.args[0].columnOrder
const [id, branch, commit, ...columns] =
messageSpy.lastCall.args[0].columnOrder
expect(id).to.equal('id')
expect(branch).to.equal('branch')
expect(commit).to.equal('commit')

let params = 0
let other = 0
Expand Down
2 changes: 1 addition & 1 deletion extension/src/test/util/mocha/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const runMocha = async (
try {
// eslint-disable-next-line sonarjs/cognitive-complexity
await new Promise<void>((resolve, reject) => {
glob(`**/**.test.${ext}`, { cwd }, (err, files) => {
glob(`**/experiments/**.test.${ext}`, { cwd }, (err, files) => {
if (err) {
return reject(err)
}
Expand Down

0 comments on commit 08bc33d

Please sign in to comment.