diff --git a/config.yaml b/config.yaml index ee4c6ba..6b932c3 100644 --- a/config.yaml +++ b/config.yaml @@ -272,6 +272,11 @@ dashboards: # matching title IF the `contents: ` property is empty. - title: Ping All Servers + - title: + Foo + type: display + + # If you create an item with some "contents:", OliveTin will show that as # directory. - title: Hypervisors diff --git a/integration-tests/.mocharc.yml b/integration-tests/.mocharc.yml index 53e1f3b..9d389e5 100644 --- a/integration-tests/.mocharc.yml +++ b/integration-tests/.mocharc.yml @@ -1,3 +1,4 @@ --- +recursive: true require: - mochaSetup.mjs diff --git a/integration-tests/Makefile b/integration-tests/Makefile index 9f3f028..f79e0e4 100644 --- a/integration-tests/Makefile +++ b/integration-tests/Makefile @@ -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" diff --git a/integration-tests/Vagrantfile b/integration-tests/Vagrantfile index 1e44fac..5cd7f87 100644 --- a/integration-tests/Vagrantfile +++ b/integration-tests/Vagrantfile @@ -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' diff --git a/integration-tests/runner.mjs b/integration-tests/runner.mjs index 6993a29..853d47c 100644 --- a/integration-tests/runner.mjs +++ b/integration-tests/runner.mjs @@ -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 diff --git a/integration-tests/test/authRequireGuestsToLogin.mjs b/integration-tests/tests/authRequireGuestsToLogin/authRequireGuestsToLogin.mjs similarity index 97% rename from integration-tests/test/authRequireGuestsToLogin.mjs rename to integration-tests/tests/authRequireGuestsToLogin/authRequireGuestsToLogin.mjs index 4ea99d9..f789288 100644 --- a/integration-tests/test/authRequireGuestsToLogin.mjs +++ b/integration-tests/tests/authRequireGuestsToLogin/authRequireGuestsToLogin.mjs @@ -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) diff --git a/integration-tests/configs/authRequireGuestsToLogin/config.yaml b/integration-tests/tests/authRequireGuestsToLogin/config.yaml similarity index 100% rename from integration-tests/configs/authRequireGuestsToLogin/config.yaml rename to integration-tests/tests/authRequireGuestsToLogin/config.yaml diff --git a/integration-tests/configs/dashboardsWithBasicFieldsets/config.yaml b/integration-tests/tests/dashboardsWithBasicFieldsets/config.yaml similarity index 100% rename from integration-tests/configs/dashboardsWithBasicFieldsets/config.yaml rename to integration-tests/tests/dashboardsWithBasicFieldsets/config.yaml diff --git a/integration-tests/test/dashboardsWithBasicFieldsets.js b/integration-tests/tests/dashboardsWithBasicFieldsets/dashboardsWithBasicFieldsets.js similarity index 98% rename from integration-tests/test/dashboardsWithBasicFieldsets.js rename to integration-tests/tests/dashboardsWithBasicFieldsets/dashboardsWithBasicFieldsets.js index c36817a..9bcac40 100644 --- a/integration-tests/test/dashboardsWithBasicFieldsets.js +++ b/integration-tests/tests/dashboardsWithBasicFieldsets/dashboardsWithBasicFieldsets.js @@ -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 () { diff --git a/integration-tests/configs/datetime/config.yaml b/integration-tests/tests/datetime/config.yaml similarity index 100% rename from integration-tests/configs/datetime/config.yaml rename to integration-tests/tests/datetime/config.yaml diff --git a/integration-tests/test/datetime.mjs b/integration-tests/tests/datetime/datetime.mjs similarity index 99% rename from integration-tests/test/datetime.mjs rename to integration-tests/tests/datetime/datetime.mjs index 3f799fc..d748d7f 100644 --- a/integration-tests/test/datetime.mjs +++ b/integration-tests/tests/datetime/datetime.mjs @@ -5,7 +5,7 @@ import { getRootAndWait, getActionButton, takeScreenshotOnFailure, -} from '../lib/elements.js' +} from '../../lib/elements.js' describe('config: datetime', function () { before(async function () { diff --git a/integration-tests/configs/emptyDashboardsAreHidden/config.yaml b/integration-tests/tests/emptyDashboardsAreHidden/config.yaml similarity index 100% rename from integration-tests/configs/emptyDashboardsAreHidden/config.yaml rename to integration-tests/tests/emptyDashboardsAreHidden/config.yaml diff --git a/integration-tests/test/emptyDashboardsAreHidden.js b/integration-tests/tests/emptyDashboardsAreHidden/emptyDashboardsAreHidden.js similarity index 96% rename from integration-tests/test/emptyDashboardsAreHidden.js rename to integration-tests/tests/emptyDashboardsAreHidden/emptyDashboardsAreHidden.js index 602c784..e5d498b 100644 --- a/integration-tests/test/emptyDashboardsAreHidden.js +++ b/integration-tests/tests/emptyDashboardsAreHidden/emptyDashboardsAreHidden.js @@ -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 () { diff --git a/integration-tests/configs/entities/config.yaml b/integration-tests/tests/entities/config.yaml similarity index 100% rename from integration-tests/configs/entities/config.yaml rename to integration-tests/tests/entities/config.yaml diff --git a/integration-tests/test/entities.js b/integration-tests/tests/entities/entities.js similarity index 97% rename from integration-tests/test/entities.js rename to integration-tests/tests/entities/entities.js index cd582a4..43ebc81 100644 --- a/integration-tests/test/entities.js +++ b/integration-tests/tests/entities/entities.js @@ -5,7 +5,7 @@ import { getRootAndWait, takeScreenshot, takeScreenshotOnFailure, -} from '../lib/elements.js' +} from '../../lib/elements.js' describe('config: entities', function () { before(async function () { diff --git a/integration-tests/configs/entities/entities/servers.yaml b/integration-tests/tests/entities/entities/servers.yaml similarity index 100% rename from integration-tests/configs/entities/entities/servers.yaml rename to integration-tests/tests/entities/entities/servers.yaml diff --git a/integration-tests/configs/entityFilesWithLongIntsUseStandardForm/config.yaml b/integration-tests/tests/entityFilesWithLongIntsUseStandardForm/config.yaml similarity index 100% rename from integration-tests/configs/entityFilesWithLongIntsUseStandardForm/config.yaml rename to integration-tests/tests/entityFilesWithLongIntsUseStandardForm/config.yaml diff --git a/integration-tests/configs/entityFilesWithLongIntsUseStandardForm/entities/data.json b/integration-tests/tests/entityFilesWithLongIntsUseStandardForm/entities/data.json similarity index 100% rename from integration-tests/configs/entityFilesWithLongIntsUseStandardForm/entities/data.json rename to integration-tests/tests/entityFilesWithLongIntsUseStandardForm/entities/data.json diff --git a/integration-tests/test/entityFilesWithLongIntsUseStandardForm.js b/integration-tests/tests/entityFilesWithLongIntsUseStandardForm/entityFilesWithLongIntsUseStandardForm.js similarity index 98% rename from integration-tests/test/entityFilesWithLongIntsUseStandardForm.js rename to integration-tests/tests/entityFilesWithLongIntsUseStandardForm/entityFilesWithLongIntsUseStandardForm.js index b907992..eb92a07 100644 --- a/integration-tests/test/entityFilesWithLongIntsUseStandardForm.js +++ b/integration-tests/tests/entityFilesWithLongIntsUseStandardForm/entityFilesWithLongIntsUseStandardForm.js @@ -6,7 +6,7 @@ import { getRootAndWait, getActionButtons, takeScreenshotOnFailure, -} from '../lib/elements.js' +} from '../../lib/elements.js' describe('config: entities', function () { before(async function () { diff --git a/integration-tests/configs/general/config.yaml b/integration-tests/tests/general/config.yaml similarity index 100% rename from integration-tests/configs/general/config.yaml rename to integration-tests/tests/general/config.yaml diff --git a/integration-tests/test/general.mjs b/integration-tests/tests/general/general.mjs similarity index 99% rename from integration-tests/test/general.mjs rename to integration-tests/tests/general/general.mjs index 3cd8fbb..ce892ab 100644 --- a/integration-tests/test/general.mjs +++ b/integration-tests/tests/general/general.mjs @@ -7,7 +7,7 @@ import { getActionButtons, takeScreenshotOnFailure, openSidebar, -} from '../lib/elements.js' +} from '../../lib/elements.js' describe('config: general', function () { before(async function () { diff --git a/integration-tests/configs/hiddenFooter/config.yaml b/integration-tests/tests/hiddenFooter/config.yaml similarity index 100% rename from integration-tests/configs/hiddenFooter/config.yaml rename to integration-tests/tests/hiddenFooter/config.yaml diff --git a/integration-tests/test/hiddenFooter.mjs b/integration-tests/tests/hiddenFooter/hiddenFooter.mjs similarity index 95% rename from integration-tests/test/hiddenFooter.mjs rename to integration-tests/tests/hiddenFooter/hiddenFooter.mjs index e4040c6..8ff192e 100644 --- a/integration-tests/test/hiddenFooter.mjs +++ b/integration-tests/tests/hiddenFooter/hiddenFooter.mjs @@ -6,7 +6,7 @@ import { getRootAndWait, getActionButtons, takeScreenshotOnFailure, -} from '../lib/elements.js' +} from '../../lib/elements.js' describe('config: hiddenFooter', function () { before(async function () { diff --git a/integration-tests/configs/hiddenNav/config.yaml b/integration-tests/tests/hiddenNav/config.yaml similarity index 100% rename from integration-tests/configs/hiddenNav/config.yaml rename to integration-tests/tests/hiddenNav/config.yaml diff --git a/integration-tests/test/hiddenNav.mjs b/integration-tests/tests/hiddenNav/hiddenNav.mjs similarity index 95% rename from integration-tests/test/hiddenNav.mjs rename to integration-tests/tests/hiddenNav/hiddenNav.mjs index f8657b0..147df85 100644 --- a/integration-tests/test/hiddenNav.mjs +++ b/integration-tests/tests/hiddenNav/hiddenNav.mjs @@ -4,7 +4,7 @@ import { getRootAndWait, getActionButtons, takeScreenshotOnFailure, -} from '../lib/elements.js' +} from '../../lib/elements.js' describe('config: hiddenNav', function () { diff --git a/integration-tests/configs/include/config.d/00-first.yml b/integration-tests/tests/include/config.d/00-first.yml similarity index 100% rename from integration-tests/configs/include/config.d/00-first.yml rename to integration-tests/tests/include/config.d/00-first.yml diff --git a/integration-tests/configs/include/config.d/01-second.yml b/integration-tests/tests/include/config.d/01-second.yml similarity index 100% rename from integration-tests/configs/include/config.d/01-second.yml rename to integration-tests/tests/include/config.d/01-second.yml diff --git a/integration-tests/configs/include/config.yaml b/integration-tests/tests/include/config.yaml similarity index 100% rename from integration-tests/configs/include/config.yaml rename to integration-tests/tests/include/config.yaml diff --git a/integration-tests/test/include.mjs b/integration-tests/tests/include/include.mjs similarity index 98% rename from integration-tests/test/include.mjs rename to integration-tests/tests/include/include.mjs index 86cfe1b..f376ee0 100644 --- a/integration-tests/test/include.mjs +++ b/integration-tests/tests/include/include.mjs @@ -5,7 +5,7 @@ import { getRootAndWait, getActionButtons, takeScreenshotOnFailure, -} from '../lib/elements.js' +} from '../../lib/elements.js' describe('config: include', function () { this.timeout(30000) diff --git a/integration-tests/configs/localAuth/config.yaml b/integration-tests/tests/localAuth/config.yaml similarity index 100% rename from integration-tests/configs/localAuth/config.yaml rename to integration-tests/tests/localAuth/config.yaml diff --git a/integration-tests/test/localAuth.mjs b/integration-tests/tests/localAuth/localAuth.mjs similarity index 99% rename from integration-tests/test/localAuth.mjs rename to integration-tests/tests/localAuth/localAuth.mjs index 276078d..163a385 100644 --- a/integration-tests/test/localAuth.mjs +++ b/integration-tests/tests/localAuth/localAuth.mjs @@ -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 diff --git a/integration-tests/configs/multipleDropdowns/config.yaml b/integration-tests/tests/multipleDropdowns/config.yaml similarity index 100% rename from integration-tests/configs/multipleDropdowns/config.yaml rename to integration-tests/tests/multipleDropdowns/config.yaml diff --git a/integration-tests/test/multipleDropdowns.js b/integration-tests/tests/multipleDropdowns/multipleDropdowns.js similarity index 98% rename from integration-tests/test/multipleDropdowns.js rename to integration-tests/tests/multipleDropdowns/multipleDropdowns.js index 9f5cb1f..25b9901 100644 --- a/integration-tests/test/multipleDropdowns.js +++ b/integration-tests/tests/multipleDropdowns/multipleDropdowns.js @@ -5,7 +5,7 @@ import { getRootAndWait, getActionButtons, takeScreenshotOnFailure, -} from '../lib/elements.js' +} from '../../lib/elements.js' describe('config: multipleDropdowns', function () { diff --git a/integration-tests/configs/onlyDashboards/config.yaml b/integration-tests/tests/onlyDashboards/config.yaml similarity index 100% rename from integration-tests/configs/onlyDashboards/config.yaml rename to integration-tests/tests/onlyDashboards/config.yaml diff --git a/integration-tests/test/onlyDashboards.mjs b/integration-tests/tests/onlyDashboards/onlyDashboards.mjs similarity index 98% rename from integration-tests/test/onlyDashboards.mjs rename to integration-tests/tests/onlyDashboards/onlyDashboards.mjs index 557b3c0..fd4b6b7 100644 --- a/integration-tests/test/onlyDashboards.mjs +++ b/integration-tests/tests/onlyDashboards/onlyDashboards.mjs @@ -8,7 +8,7 @@ import { openSidebar, closeSidebar, takeScreenshotOnFailure, -} from '../lib/elements.js' +} from '../../lib/elements.js' describe('config: onlyDashboards', function () { before(async function () { diff --git a/integration-tests/configs/policy-all-false/config.yaml b/integration-tests/tests/policy-all-false/config.yaml similarity index 100% rename from integration-tests/configs/policy-all-false/config.yaml rename to integration-tests/tests/policy-all-false/config.yaml diff --git a/integration-tests/test/policy-all-false.mjs b/integration-tests/tests/policy-all-false/policy-all-false.mjs similarity index 96% rename from integration-tests/test/policy-all-false.mjs rename to integration-tests/tests/policy-all-false/policy-all-false.mjs index 10d42b5..aa1097b 100644 --- a/integration-tests/test/policy-all-false.mjs +++ b/integration-tests/tests/policy-all-false/policy-all-false.mjs @@ -1,7 +1,7 @@ import { getRootAndWait, takeScreenshotOnFailure, -} from '../lib/elements.js' +} from '../../lib/elements.js' import { By } from 'selenium-webdriver' import { expect } from 'chai' diff --git a/integration-tests/configs/prometheus/config.yaml b/integration-tests/tests/prometheus/config.yaml similarity index 100% rename from integration-tests/configs/prometheus/config.yaml rename to integration-tests/tests/prometheus/config.yaml diff --git a/integration-tests/test/prometheus.mjs b/integration-tests/tests/prometheus/prometheus.mjs similarity index 97% rename from integration-tests/test/prometheus.mjs rename to integration-tests/tests/prometheus/prometheus.mjs index 3dad964..7d1f2ea 100644 --- a/integration-tests/test/prometheus.mjs +++ b/integration-tests/tests/prometheus/prometheus.mjs @@ -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'}, diff --git a/integration-tests/configs/sleep/config.yaml b/integration-tests/tests/sleep/config.yaml similarity index 100% rename from integration-tests/configs/sleep/config.yaml rename to integration-tests/tests/sleep/config.yaml diff --git a/integration-tests/test/sleep.js b/integration-tests/tests/sleep/sleep.js similarity index 97% rename from integration-tests/test/sleep.js rename to integration-tests/tests/sleep/sleep.js index a00d11f..e7d2a41 100644 --- a/integration-tests/test/sleep.js +++ b/integration-tests/tests/sleep/sleep.js @@ -9,7 +9,7 @@ import { requireExecutionDialogStatus, getRootAndWait, getActionButton -} from '../lib/elements.js' +} from '../../lib/elements.js' describe('config: sleep', function () { before(async function () { diff --git a/integration-tests/configs/trustedHeader/config.yaml b/integration-tests/tests/trustedHeader/config.yaml similarity index 100% rename from integration-tests/configs/trustedHeader/config.yaml rename to integration-tests/tests/trustedHeader/config.yaml diff --git a/integration-tests/test/trustedHeader.js b/integration-tests/tests/trustedHeader/trustedHeader.js similarity index 97% rename from integration-tests/test/trustedHeader.js rename to integration-tests/tests/trustedHeader/trustedHeader.js index c7367f9..93980b7 100644 --- a/integration-tests/test/trustedHeader.js +++ b/integration-tests/tests/trustedHeader/trustedHeader.js @@ -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 () {