Skip to content

Commit

Permalink
Archive screenshots from the test pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettmflynn committed May 27, 2024
1 parent e21df99 commit 0d23d60
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/testing_pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,11 @@ jobs:
- if: matrix.os == 'ubuntu-latest'
name: Run tests with xvfb
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:pipelines

- name: Archive Pipeline Test Screenshots
if: always()
uses: actions/upload-artifact@v4
with:
name: test-pipelines-screenshots-${{ matrix.os }}
path: docs/assets/tutorials/test-pipelines
retention-days: 1
Binary file added docs/assets/tutorials/pipelines/created.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/tutorials/pipelines/list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 11 additions & 12 deletions tests/e2e/pipelines.test.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
import { describe, expect, test, skip, beforeAll } from 'vitest'
import { connect } from '../puppeteer'
import { describe, expect, test, beforeAll } from 'vitest'

import { join } from 'node:path'
import { mkdirSync, existsSync } from 'node:fs'
import { join, dirname } from 'node:path'
import { fileURLToPath } from 'node:url'

import { homedir } from 'node:os'

const __dirname = dirname(fileURLToPath(import.meta.url));
const screenshotPath = join( __dirname, 'screenshots')
mkdirSync(screenshotPath, { recursive: true })

import examplePipelines from "../../src/example_pipelines.yml";

import paths from "../../src/paths.config.json" assert { type: "json" };
import { evaluate, initTests } from './utils'
import { evaluate, initTests, takeScreenshot } from './utils'
import { header } from '../../src/electron/renderer/src/stories/forms/utils'

// NOTE: We assume the user has put the GIN data in ~/NWB_GUIDE/test-data
const guideRootPath = join(homedir(), paths.root)
const testGINPath = join(guideRootPath, 'test-data', 'GIN')
// NOTE: We assume the user has put the GIN data in ~/NWB_GUIDE/test-data/GIN
const testGINPath = join(homedir(), paths.root, 'test-data', 'GIN')
// const hasGINPath = existsSync(testGINPath)
const pipelineDescribeFn = describe // hasGINPath ? describe : describe.skip

Expand Down Expand Up @@ -55,6 +48,9 @@ describe('Run example pipelines', () => {
page.save()
}, testGINPath)

await takeScreenshot('test-pipelines/created')


// Transition back to the conversions page and count pipelines
const pipelineNames = await evaluate(async () => {
const dashboard = document.querySelector('nwb-dashboard')
Expand All @@ -64,6 +60,9 @@ describe('Run example pipelines', () => {
return Array.from(pipelineCards).map(card => card.info.project.name)
})

await takeScreenshot('test-pipelines/list', 500)


// Assert all the pipelines are present
expect(pipelineNames.sort()).toEqual(Object.keys(examplePipelines).map(header).sort())

Check failure on line 67 in tests/e2e/pipelines.test.ts

View workflow job for this annotation

GitHub Actions / Pipelines / ubuntu-latest data

tests/e2e/pipelines.test.ts > Run example pipelines > Generate and run pipeline from YAML file > All example pipelines are created

AssertionError: expected [] to deeply equal [ …(13) ] - Expected + Received - Array [ - "BrukerTiffMultiChannelSinglePlane", - "Caiman SinglePlane SingleChannel", - "CellExplorer", - "CellExplorerSortingOnly", - "CellExplorerUnits", - "DeepLabCut", - "IntanSingleFileRecording", - "ScanImage SinglePlane SingleChannel", - "SpikeGLX V1 SingleProbe AP", - "SpikeGLX-Phy", - "SpikeGLXConverter-Phy", - "Suite2P SinglePlane SingleChannel", - "TDT", - ] + Array [] ❯ tests/e2e/pipelines.test.ts:67:38

Expand Down

0 comments on commit 0d23d60

Please sign in to comment.