chore: colocate tests

This commit is contained in:
jamesread 2025-11-22 19:24:51 +00:00
parent 1b89b3e217
commit 458f50a6ae
43 changed files with 27 additions and 20 deletions

View File

@ -272,6 +272,11 @@ dashboards:
# matching title IF the `contents: ` property is empty. # matching title IF the `contents: ` property is empty.
- title: Ping All Servers - title: Ping All Servers
- title:
<a href = "#">Foo</a>
type: display
# If you create an item with some "contents:", OliveTin will show that as # If you create an item with some "contents:", OliveTin will show that as
# directory. # directory.
- title: Hypervisors - title: Hypervisors

View File

@ -1,3 +1,4 @@
--- ---
recursive: true
require: require:
- mochaSetup.mjs - mochaSetup.mjs

View File

@ -5,7 +5,7 @@ test-install:
test-run: test-run:
# GitHub Actions fails badly on the default timeout of 2000ms # GitHub Actions fails badly on the default timeout of 2000ms
npx mocha -t 10000 npx mocha tests --recursive -t 10000
find-flakey-tests: find-flakey-tests:
echo "Running test-run infinately" echo "Running test-run infinately"

View File

@ -4,7 +4,8 @@
Vagrant.configure("2") do |config| Vagrant.configure("2") do |config|
config.vm.provision "shell", inline: "mkdir /etc/OliveTin && chmod o+w /etc/OliveTin/ && mkdir -p /opt/OliveTin-configs/ && chmod 0777 /opt/OliveTin-configs", privileged: true config.vm.provision "shell", inline: "mkdir /etc/OliveTin && chmod o+w /etc/OliveTin/ && mkdir -p /opt/OliveTin-configs/ && chmod 0777 /opt/OliveTin-configs", privileged: true
config.vm.provision "file", source: "configs/.", destination: "/opt/OliveTin-configs/" config.vm.provision "file", source: "tests/.", destination: "/tmp/test-configs/"
config.vm.provision "shell", inline: "for dir in /tmp/test-configs/*/; do if [ -f \"$dir/config.yaml\" ]; then cp -r \"$dir\" /opt/OliveTin-configs/$(basename \"$dir\")/; fi; done", privileged: true
config.vm.provider :libvirt do |libvirt| config.vm.provider :libvirt do |libvirt|
libvirt.management_network_device = 'virbr0' libvirt.management_network_device = 'virbr0'

View File

@ -38,7 +38,7 @@ class OliveTinTestRunnerStartLocalProcess extends OliveTinTestRunner {
console.log(" OliveTin starting local process...") console.log(" OliveTin starting local process...")
this.ot = spawn('./../service/OliveTin', ['-configdir', 'configs/' + cfg + '/']) this.ot = spawn('./../service/OliveTin', ['-configdir', 'tests/' + cfg + '/'])
let logStdout = false let logStdout = false

View File

@ -4,7 +4,7 @@ import { By, until } from 'selenium-webdriver'
import { import {
getRootAndWait, getRootAndWait,
takeScreenshotOnFailure, takeScreenshotOnFailure,
} from '../lib/elements.js' } from '../../lib/elements.js'
describe('config: authRequireGuestsToLogin', function () { describe('config: authRequireGuestsToLogin', function () {
this.timeout(30000) this.timeout(30000)

View File

@ -8,7 +8,7 @@ import {
openSidebar, openSidebar,
getNavigationLinks, getNavigationLinks,
takeScreenshotOnFailure, takeScreenshotOnFailure,
} from '../lib/elements.js' } from '../../lib/elements.js'
describe('config: dashboards with basic fieldsets', function () { describe('config: dashboards with basic fieldsets', function () {
before(async function () { before(async function () {

View File

@ -5,7 +5,7 @@ import {
getRootAndWait, getRootAndWait,
getActionButton, getActionButton,
takeScreenshotOnFailure, takeScreenshotOnFailure,
} from '../lib/elements.js' } from '../../lib/elements.js'
describe('config: datetime', function () { describe('config: datetime', function () {
before(async function () { before(async function () {

View File

@ -7,7 +7,7 @@ import {
openSidebar, openSidebar,
getNavigationLinks, getNavigationLinks,
takeScreenshotOnFailure, takeScreenshotOnFailure,
} from '../lib/elements.js' } from '../../lib/elements.js'
describe('config: empty dashboards are hidden', function () { describe('config: empty dashboards are hidden', function () {
before(async function () { before(async function () {

View File

@ -5,7 +5,7 @@ import {
getRootAndWait, getRootAndWait,
takeScreenshot, takeScreenshot,
takeScreenshotOnFailure, takeScreenshotOnFailure,
} from '../lib/elements.js' } from '../../lib/elements.js'
describe('config: entities', function () { describe('config: entities', function () {
before(async function () { before(async function () {

View File

@ -6,7 +6,7 @@ import {
getRootAndWait, getRootAndWait,
getActionButtons, getActionButtons,
takeScreenshotOnFailure, takeScreenshotOnFailure,
} from '../lib/elements.js' } from '../../lib/elements.js'
describe('config: entities', function () { describe('config: entities', function () {
before(async function () { before(async function () {

View File

@ -7,7 +7,7 @@ import {
getActionButtons, getActionButtons,
takeScreenshotOnFailure, takeScreenshotOnFailure,
openSidebar, openSidebar,
} from '../lib/elements.js' } from '../../lib/elements.js'
describe('config: general', function () { describe('config: general', function () {
before(async function () { before(async function () {

View File

@ -6,7 +6,7 @@ import {
getRootAndWait, getRootAndWait,
getActionButtons, getActionButtons,
takeScreenshotOnFailure, takeScreenshotOnFailure,
} from '../lib/elements.js' } from '../../lib/elements.js'
describe('config: hiddenFooter', function () { describe('config: hiddenFooter', function () {
before(async function () { before(async function () {

View File

@ -4,7 +4,7 @@ import {
getRootAndWait, getRootAndWait,
getActionButtons, getActionButtons,
takeScreenshotOnFailure, takeScreenshotOnFailure,
} from '../lib/elements.js' } from '../../lib/elements.js'
describe('config: hiddenNav', function () { describe('config: hiddenNav', function () {

View File

@ -5,7 +5,7 @@ import {
getRootAndWait, getRootAndWait,
getActionButtons, getActionButtons,
takeScreenshotOnFailure, takeScreenshotOnFailure,
} from '../lib/elements.js' } from '../../lib/elements.js'
describe('config: include', function () { describe('config: include', function () {
this.timeout(30000) this.timeout(30000)

View File

@ -4,7 +4,7 @@ import { By, until, Condition } from 'selenium-webdriver'
import { import {
getRootAndWait, getRootAndWait,
takeScreenshotOnFailure, takeScreenshotOnFailure,
} from '../lib/elements.js' } from '../../lib/elements.js'
describe('config: localAuth', function () { describe('config: localAuth', function () {
this.timeout(30000) // Increase timeout to 30 seconds this.timeout(30000) // Increase timeout to 30 seconds

View File

@ -5,7 +5,7 @@ import {
getRootAndWait, getRootAndWait,
getActionButtons, getActionButtons,
takeScreenshotOnFailure, takeScreenshotOnFailure,
} from '../lib/elements.js' } from '../../lib/elements.js'
describe('config: multipleDropdowns', function () { describe('config: multipleDropdowns', function () {

View File

@ -8,7 +8,7 @@ import {
openSidebar, openSidebar,
closeSidebar, closeSidebar,
takeScreenshotOnFailure, takeScreenshotOnFailure,
} from '../lib/elements.js' } from '../../lib/elements.js'
describe('config: onlyDashboards', function () { describe('config: onlyDashboards', function () {
before(async function () { before(async function () {

View File

@ -1,7 +1,7 @@
import { import {
getRootAndWait, getRootAndWait,
takeScreenshotOnFailure, takeScreenshotOnFailure,
} from '../lib/elements.js' } from '../../lib/elements.js'
import { By } from 'selenium-webdriver' import { By } from 'selenium-webdriver'
import { expect } from 'chai' import { expect } from 'chai'

View File

@ -4,7 +4,7 @@ import { expect } from 'chai'
import { By } from 'selenium-webdriver' import { By } from 'selenium-webdriver'
import { import {
takeScreenshotOnFailure, takeScreenshotOnFailure,
} from '../lib/elements.js' } from '../../lib/elements.js'
let metrics = [ let metrics = [
{'name': 'olivetin_actions_requested_count', 'type': 'counter', 'desc': 'The actions requested count'}, {'name': 'olivetin_actions_requested_count', 'type': 'counter', 'desc': 'The actions requested count'},

View File

@ -9,7 +9,7 @@ import {
requireExecutionDialogStatus, requireExecutionDialogStatus,
getRootAndWait, getRootAndWait,
getActionButton getActionButton
} from '../lib/elements.js' } from '../../lib/elements.js'
describe('config: sleep', function () { describe('config: sleep', function () {
before(async function () { before(async function () {

View File

@ -2,7 +2,7 @@ import { expect } from 'chai'
import { import {
getRootAndWait, getRootAndWait,
takeScreenshotOnFailure, takeScreenshotOnFailure,
} from '../lib/elements.js' } from '../../lib/elements.js'
describe('config: trustedHeader', function () { describe('config: trustedHeader', function () {
before(async function () { before(async function () {