chore: colocate tests (#758)

This commit is contained in:
James Read 2025-11-22 19:57:26 +00:00 committed by GitHub
commit 7f12b6d72c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
42 changed files with 22 additions and 20 deletions

View File

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

View File

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

View File

@ -4,7 +4,8 @@
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 "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|
libvirt.management_network_device = 'virbr0'

View File

@ -38,7 +38,7 @@ class OliveTinTestRunnerStartLocalProcess extends OliveTinTestRunner {
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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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