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(ui): fixed flakey tests #16268

Merged
merged 3 commits into from
Dec 18, 2019
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
1. [16237](https://github.com/influxdata/influxdb/pull/16237): Updated Sortby functionality for table frontend sorts to sort numbers correctly
1. [16249](https://github.com/influxdata/influxdb/pull/16249): Prevent potential infinite loop when finding tasks by organization.
1. [16255](https://github.com/influxdata/influxdb/pull/16255): Retain user input when parsing invalid JSON during import
1. [16268](https://github.com/influxdata/influxdb/pull/16268): Fixed test flakiness that stemmed from multiple flush/signins being called in the same test suite

### UI Improvements

Expand Down
75 changes: 15 additions & 60 deletions ui/cypress/e2e/explorer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe('DataExplorer', () => {
cy.signin().then(({body}) => {
cy.wrap(body.org).as('org')
cy.createMapVariable(body.org.id)
cy.wrap(body.bucket).as('bucket')
})

cy.fixture('routes').then(({orgs, explorer}) => {
Expand Down Expand Up @@ -551,26 +552,9 @@ describe('DataExplorer', () => {

describe('visualize with 360 lines', () => {
const numLines = 360

beforeEach(() => {
cy.flush()

cy.signin().then(({body}) => {
const {
org: {id},
bucket,
} = body
cy.wrap(body.org).as('org')
cy.wrap(bucket).as('bucket')

// POST 360 lines to the server
cy.writeData(lines(numLines))

// start at the data explorer
cy.fixture('routes').then(({orgs, explorer}) => {
cy.visit(`${orgs}/${id}${explorer}`)
})
})
// POST 360 lines to the server
cy.writeData(lines(numLines))
})

it('can view time-series data', () => {
Expand All @@ -597,33 +581,6 @@ describe('DataExplorer', () => {
cy.getByTestID('raw-data-table').should('exist')
cy.getByTestID('raw-data--toggle').click()
})
})

// skipping until the sigin flake gets resolve in:
// https://github.com/influxdata/influxdb/issues/16253
describe.skip('visualize tables', () => {
const numLines = 360

beforeEach(() => {
cy.flush()

cy.signin().then(({body}) => {
const {
org: {id},
bucket,
} = body
cy.wrap(body.org).as('org')
cy.wrap(bucket).as('bucket')

// POST 360 lines to the server
cy.writeData(lines(numLines))

// start at the data explorer
cy.fixture('routes').then(({orgs, explorer}) => {
cy.visit(`${orgs}/${id}${explorer}`)
})
})
})

it('can view table data & sort values numerically', () => {
// build the query to return data from beforeEach
Expand Down Expand Up @@ -658,21 +615,19 @@ describe('DataExplorer', () => {
cy.get('.table-graph-cell__sort-asc').should('exist')
cy.getByTestID('_value-table-header').click()
cy.get('.table-graph-cell__sort-desc').should('exist')
cy.getByTestID('_value-table-header')
.should('exist')
.then(el => {
// get the column index
const columnIndex = el[0].getAttribute('data-column-index')
let prev = Infinity
// get all the column values for that one and see if they are in order
cy.get(`[data-column-index="${columnIndex}"]`).each(val => {
const num = Number(val.text())
if (isNaN(num) === false) {
expect(num < prev).to.equal(true)
prev = num
}
})
cy.getByTestID('_value-table-header').then(el => {
// get the column index
const columnIndex = el[0].getAttribute('data-column-index')
let prev = Infinity
// get all the column values for that one and see if they are in order
cy.get(`[data-column-index="${columnIndex}"]`).each(val => {
const num = Number(val.text())
if (isNaN(num) === false) {
expect(num < prev).to.equal(true)
prev = num
}
})
})
})
})
})
Expand Down