Bladeren bron

chore: colocate tests

jamesread 7 maanden geleden
bovenliggende
commit
458f50a6ae
43 gewijzigde bestanden met toevoegingen van 27 en 20 verwijderingen
  1. 5 0
      config.yaml
  2. 1 0
      integration-tests/.mocharc.yml
  3. 1 1
      integration-tests/Makefile
  4. 2 1
      integration-tests/Vagrantfile
  5. 1 1
      integration-tests/runner.mjs
  6. 1 1
      integration-tests/tests/authRequireGuestsToLogin/authRequireGuestsToLogin.mjs
  7. 0 0
      integration-tests/tests/authRequireGuestsToLogin/config.yaml
  8. 0 0
      integration-tests/tests/dashboardsWithBasicFieldsets/config.yaml
  9. 1 1
      integration-tests/tests/dashboardsWithBasicFieldsets/dashboardsWithBasicFieldsets.js
  10. 0 0
      integration-tests/tests/datetime/config.yaml
  11. 1 1
      integration-tests/tests/datetime/datetime.mjs
  12. 0 0
      integration-tests/tests/emptyDashboardsAreHidden/config.yaml
  13. 1 1
      integration-tests/tests/emptyDashboardsAreHidden/emptyDashboardsAreHidden.js
  14. 0 0
      integration-tests/tests/entities/config.yaml
  15. 1 1
      integration-tests/tests/entities/entities.js
  16. 0 0
      integration-tests/tests/entities/entities/servers.yaml
  17. 0 0
      integration-tests/tests/entityFilesWithLongIntsUseStandardForm/config.yaml
  18. 0 0
      integration-tests/tests/entityFilesWithLongIntsUseStandardForm/entities/data.json
  19. 1 1
      integration-tests/tests/entityFilesWithLongIntsUseStandardForm/entityFilesWithLongIntsUseStandardForm.js
  20. 0 0
      integration-tests/tests/general/config.yaml
  21. 1 1
      integration-tests/tests/general/general.mjs
  22. 0 0
      integration-tests/tests/hiddenFooter/config.yaml
  23. 1 1
      integration-tests/tests/hiddenFooter/hiddenFooter.mjs
  24. 0 0
      integration-tests/tests/hiddenNav/config.yaml
  25. 1 1
      integration-tests/tests/hiddenNav/hiddenNav.mjs
  26. 0 0
      integration-tests/tests/include/config.d/00-first.yml
  27. 0 0
      integration-tests/tests/include/config.d/01-second.yml
  28. 0 0
      integration-tests/tests/include/config.yaml
  29. 1 1
      integration-tests/tests/include/include.mjs
  30. 0 0
      integration-tests/tests/localAuth/config.yaml
  31. 1 1
      integration-tests/tests/localAuth/localAuth.mjs
  32. 0 0
      integration-tests/tests/multipleDropdowns/config.yaml
  33. 1 1
      integration-tests/tests/multipleDropdowns/multipleDropdowns.js
  34. 0 0
      integration-tests/tests/onlyDashboards/config.yaml
  35. 1 1
      integration-tests/tests/onlyDashboards/onlyDashboards.mjs
  36. 0 0
      integration-tests/tests/policy-all-false/config.yaml
  37. 1 1
      integration-tests/tests/policy-all-false/policy-all-false.mjs
  38. 0 0
      integration-tests/tests/prometheus/config.yaml
  39. 1 1
      integration-tests/tests/prometheus/prometheus.mjs
  40. 0 0
      integration-tests/tests/sleep/config.yaml
  41. 1 1
      integration-tests/tests/sleep/sleep.js
  42. 0 0
      integration-tests/tests/trustedHeader/config.yaml
  43. 1 1
      integration-tests/tests/trustedHeader/trustedHeader.js

+ 5 - 0
config.yaml

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

+ 1 - 0
integration-tests/.mocharc.yml

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

+ 1 - 1
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"

+ 2 - 1
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'

+ 1 - 1
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
 

+ 1 - 1
integration-tests/test/authRequireGuestsToLogin.mjs → 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)

+ 0 - 0
integration-tests/configs/authRequireGuestsToLogin/config.yaml → integration-tests/tests/authRequireGuestsToLogin/config.yaml


+ 0 - 0
integration-tests/configs/dashboardsWithBasicFieldsets/config.yaml → integration-tests/tests/dashboardsWithBasicFieldsets/config.yaml


+ 1 - 1
integration-tests/test/dashboardsWithBasicFieldsets.js → 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 () {

+ 0 - 0
integration-tests/configs/datetime/config.yaml → integration-tests/tests/datetime/config.yaml


+ 1 - 1
integration-tests/test/datetime.mjs → 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 () {

+ 0 - 0
integration-tests/configs/emptyDashboardsAreHidden/config.yaml → integration-tests/tests/emptyDashboardsAreHidden/config.yaml


+ 1 - 1
integration-tests/test/emptyDashboardsAreHidden.js → 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 () {

+ 0 - 0
integration-tests/configs/entities/config.yaml → integration-tests/tests/entities/config.yaml


+ 1 - 1
integration-tests/test/entities.js → 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 () {

+ 0 - 0
integration-tests/configs/entities/entities/servers.yaml → integration-tests/tests/entities/entities/servers.yaml


+ 0 - 0
integration-tests/configs/entityFilesWithLongIntsUseStandardForm/config.yaml → integration-tests/tests/entityFilesWithLongIntsUseStandardForm/config.yaml


+ 0 - 0
integration-tests/configs/entityFilesWithLongIntsUseStandardForm/entities/data.json → integration-tests/tests/entityFilesWithLongIntsUseStandardForm/entities/data.json


+ 1 - 1
integration-tests/test/entityFilesWithLongIntsUseStandardForm.js → 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 () {

+ 0 - 0
integration-tests/configs/general/config.yaml → integration-tests/tests/general/config.yaml


+ 1 - 1
integration-tests/test/general.mjs → 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 () {

+ 0 - 0
integration-tests/configs/hiddenFooter/config.yaml → integration-tests/tests/hiddenFooter/config.yaml


+ 1 - 1
integration-tests/test/hiddenFooter.mjs → 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 () {

+ 0 - 0
integration-tests/configs/hiddenNav/config.yaml → integration-tests/tests/hiddenNav/config.yaml


+ 1 - 1
integration-tests/test/hiddenNav.mjs → 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 () {

+ 0 - 0
integration-tests/configs/include/config.d/00-first.yml → integration-tests/tests/include/config.d/00-first.yml


+ 0 - 0
integration-tests/configs/include/config.d/01-second.yml → integration-tests/tests/include/config.d/01-second.yml


+ 0 - 0
integration-tests/configs/include/config.yaml → integration-tests/tests/include/config.yaml


+ 1 - 1
integration-tests/test/include.mjs → 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)

+ 0 - 0
integration-tests/configs/localAuth/config.yaml → integration-tests/tests/localAuth/config.yaml


+ 1 - 1
integration-tests/test/localAuth.mjs → 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

+ 0 - 0
integration-tests/configs/multipleDropdowns/config.yaml → integration-tests/tests/multipleDropdowns/config.yaml


+ 1 - 1
integration-tests/test/multipleDropdowns.js → 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 () {

+ 0 - 0
integration-tests/configs/onlyDashboards/config.yaml → integration-tests/tests/onlyDashboards/config.yaml


+ 1 - 1
integration-tests/test/onlyDashboards.mjs → 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 () {

+ 0 - 0
integration-tests/configs/policy-all-false/config.yaml → integration-tests/tests/policy-all-false/config.yaml


+ 1 - 1
integration-tests/test/policy-all-false.mjs → 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'

+ 0 - 0
integration-tests/configs/prometheus/config.yaml → integration-tests/tests/prometheus/config.yaml


+ 1 - 1
integration-tests/test/prometheus.mjs → 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'},

+ 0 - 0
integration-tests/configs/sleep/config.yaml → integration-tests/tests/sleep/config.yaml


+ 1 - 1
integration-tests/test/sleep.js → 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 () {

+ 0 - 0
integration-tests/configs/trustedHeader/config.yaml → integration-tests/tests/trustedHeader/config.yaml


+ 1 - 1
integration-tests/test/trustedHeader.js → 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 () {