From 821591cb8498b93ccfc52bdc8837dc3ac2739fd6 Mon Sep 17 00:00:00 2001 From: Chris Tacke Date: Sun, 10 Oct 2021 11:31:34 -0500 Subject: [PATCH] Updated Test Suite docs --- Meadow.TestSuite.sln | 12 +- doc/TestSuite.postman_collection.json | 278 +++++++++++++++++++ authoring-tests.md => doc/authoring-tests.md | 0 doc/config.md | 18 ++ implementation.md => doc/implementation.md | 0 raspi.md => doc/raspi.md | 0 doc/rest-api.md | 19 ++ setup.md => doc/setup.md | 0 usage.md => doc/usage.md | 0 readme.md | 10 +- 10 files changed, 328 insertions(+), 9 deletions(-) create mode 100644 doc/TestSuite.postman_collection.json rename authoring-tests.md => doc/authoring-tests.md (100%) create mode 100644 doc/config.md rename implementation.md => doc/implementation.md (100%) rename raspi.md => doc/raspi.md (100%) create mode 100644 doc/rest-api.md rename setup.md => doc/setup.md (100%) rename usage.md => doc/usage.md (100%) diff --git a/Meadow.TestSuite.sln b/Meadow.TestSuite.sln index bfcbc4e..3ff8ef2 100644 --- a/Meadow.TestSuite.sln +++ b/Meadow.TestSuite.sln @@ -10,11 +10,15 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.Meadow.Core.F7", "Tes EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{085FCF8D-543A-465C-B239-BCEFC3B75537}" ProjectSection(SolutionItems) = preProject - authoring-tests.md = authoring-tests.md - implementation.md = implementation.md readme.md = readme.md - setup.md = setup.md - usage.md = usage.md + doc\authoring-tests.md = doc\authoring-tests.md + doc\usage.md = doc\usage.md + doc\TestSuite.postman_collection.json = doc\TestSuite.postman_collection.json + doc\setup.md = doc\setup.md + doc\raspi.md = doc\raspi.md + doc\implementation.md = doc\implementation.md + rest-api.md = rest-api.md + config.md = config.md EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Meadow.TestSuite.Director", "Meadow.TestSuite.Director\Meadow.TestSuite.Director.csproj", "{88D83E30-8507-4007-9F60-69A57D0A6636}" diff --git a/doc/TestSuite.postman_collection.json b/doc/TestSuite.postman_collection.json new file mode 100644 index 0000000..c65ae77 --- /dev/null +++ b/doc/TestSuite.postman_collection.json @@ -0,0 +1,278 @@ +{ + "info": { + "_postman_id": "b3befbd8-b926-4cac-aad5-508ce0392c0c", + "name": "TestSuite", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "Time", + "item": [ + { + "name": "Get Time", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{meadow-address}}:{{meadow-port}}/time", + "protocol": "http", + "host": [ + "{{meadow-address}}" + ], + "port": "{{meadow-port}}", + "path": [ + "time" + ] + } + }, + "response": [] + }, + { + "name": "Set Time", + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"SystemTime\": \"{{$isoTimestamp}}\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://{{meadow-address}}:{{meadow-port}}/time", + "protocol": "http", + "host": [ + "{{meadow-address}}" + ], + "port": "{{meadow-port}}", + "path": [ + "time" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Assemblies", + "item": [ + { + "name": "Add or Update Assembly", + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "file", + "file": { + "src": "/Users/christophertacke/repos/wilderness/Meadow.TestSuite/Tests.Meadow.Core/bin/Debug/netstandard2.1/Tests.Meadow.Core.dll" + } + }, + "url": { + "raw": "http://{{meadow-address}}:{{meadow-port}}/assemblies/Tests.Meadow.Core", + "protocol": "http", + "host": [ + "{{meadow-address}}" + ], + "port": "{{meadow-port}}", + "path": [ + "assemblies", + "Tests.Meadow.Core" + ] + } + }, + "response": [] + }, + { + "name": "Get Assemblies", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{meadow-address}}:{{meadow-port}}/assemblies", + "protocol": "http", + "host": [ + "{{meadow-address}}" + ], + "port": "{{meadow-port}}", + "path": [ + "assemblies" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Tests", + "item": [ + { + "name": "Get Tests", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{meadow-address}}:{{meadow-port}}/tests", + "protocol": "http", + "host": [ + "{{meadow-address}}" + ], + "port": "{{meadow-port}}", + "path": [ + "tests" + ] + } + }, + "response": [] + }, + { + "name": "Get Test Info", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{meadow-address}}:{{meadow-port}}/tests/Tests.Meadow.Core.LEDTests.LedTestFunction", + "protocol": "http", + "host": [ + "{{meadow-address}}" + ], + "port": "{{meadow-port}}", + "path": [ + "tests", + "Tests.Meadow.Core.LEDTests.LedTestFunction" + ] + } + }, + "response": [] + }, + { + "name": "Start GPIO Test", + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "http://{{meadow-address}}:{{meadow-port}}/tests/Tests.Meadow.Core.GpioTests.Loopback3_4", + "protocol": "http", + "host": [ + "{{meadow-address}}" + ], + "port": "{{meadow-port}}", + "path": [ + "tests", + "Tests.Meadow.Core.GpioTests.Loopback3_4" + ] + } + }, + "response": [] + }, + { + "name": "Start LED Test", + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "http://{{meadow-address}}:{{meadow-port}}/tests/Tests.Meadow.Core.LEDTests.LedTestFunction", + "protocol": "http", + "host": [ + "{{meadow-address}}" + ], + "port": "{{meadow-port}}", + "path": [ + "tests", + "Tests.Meadow.Core.LEDTests.LedTestFunction" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Results", + "item": [ + { + "name": "Get Specific Test Result By Name", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{meadow-address}}:{{meadow-port}}/results/Tests.Meadow.Core.LEDTests.LedTestFunction", + "protocol": "http", + "host": [ + "{{meadow-address}}" + ], + "port": "{{meadow-port}}", + "path": [ + "results", + "Tests.Meadow.Core.LEDTests.LedTestFunction" + ] + } + }, + "response": [] + }, + { + "name": "Get All Test Results", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{meadow-address}}:{{meadow-port}}/results", + "protocol": "http", + "host": [ + "{{meadow-address}}" + ], + "port": "{{meadow-port}}", + "path": [ + "results" + ] + } + }, + "response": [] + }, + { + "name": "Get Specific Test Result By ID", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{meadow-address}}:{{meadow-port}}/results/b15e9829-b081-4e69-8343-66107c9076e3", + "protocol": "http", + "host": [ + "{{meadow-address}}" + ], + "port": "{{meadow-port}}", + "path": [ + "results", + "b15e9829-b081-4e69-8343-66107c9076e3" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Get TestSuite Info", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{meadow-address}}:{{meadow-port}}/", + "protocol": "http", + "host": [ + "{{meadow-address}}" + ], + "port": "{{meadow-port}}", + "path": [ + "" + ] + } + }, + "response": [] + } + ] +} \ No newline at end of file diff --git a/authoring-tests.md b/doc/authoring-tests.md similarity index 100% rename from authoring-tests.md rename to doc/authoring-tests.md diff --git a/doc/config.md b/doc/config.md new file mode 100644 index 0000000..047ef8a --- /dev/null +++ b/doc/config.md @@ -0,0 +1,18 @@ +# Test Suite Worker Configuration + +The Test Suite Worker can be configured by modifying and deploying a file named `config.json` to the root (application) folder. + +## Example Config File + +``` +{ + "Display": "ST7789", + "Network": { + "SSID": "YOUR_WIFI_SSID", + "Pass": "YOUR_PASSCODE" + }, + "Serial": { + "Enabled": false + } +} +``` \ No newline at end of file diff --git a/implementation.md b/doc/implementation.md similarity index 100% rename from implementation.md rename to doc/implementation.md diff --git a/raspi.md b/doc/raspi.md similarity index 100% rename from raspi.md rename to doc/raspi.md diff --git a/doc/rest-api.md b/doc/rest-api.md new file mode 100644 index 0000000..49f4f26 --- /dev/null +++ b/doc/rest-api.md @@ -0,0 +1,19 @@ +# Test Suite Worker REST API + +The Test Suite Worker exposes a REST API using the [Wilderness Labs Maple Web Server](https://github.com/WildernessLabs/Meadow.Foundation/tree/main/Source/Meadow.Foundation.Libraries_and_Frameworks/Web.Maple). + +A [Postman Collection is available](TestSuite.postman_collection.json) that provides examples of all REST endpoints. + +| Path | Verb | Description | +| --- | --- | --- | +| `/` | GET | Gets version information about Test Suite. Intended to be a simple test point to see if the Worker is running. | +| `/time` | GET | Gets the current UTC time of the Meadow running the Worker | +| `/time` | PUT | Sets the current UTC time of the Meadow running the Worker | +| `/assemblies` | GET | Gets a list of all loaded test assemblies | +| `/assemblies/{name}` | PUT | Uploads a test assembly with file name `name` to the configured test assembly folder | +| `/tests` | GET | Gets a list of all loaded tests IDs | +| `/tests/{testID}` | GET | Gets information about the specified Test ID | +| `/tests/{testID}` | POST | Starts a new run of the specified Test ID | +| `/results` | GET | Gets a list of all known Test Results | +| `/results/{guid}` | GET | Gets the results for the specified Result ID | +| `/results/{testID}` | GET | Gets all known results for the specified Test ID | diff --git a/setup.md b/doc/setup.md similarity index 100% rename from setup.md rename to doc/setup.md diff --git a/usage.md b/doc/usage.md similarity index 100% rename from usage.md rename to doc/usage.md diff --git a/readme.md b/readme.md index 68cadf4..febb735 100644 --- a/readme.md +++ b/readme.md @@ -4,17 +4,17 @@ Meadow.TestSuite is intended to provide a remote-controllable test infrastructur A goal is to provide a API that at least feels like xUnit, or a subset of xUnit, to facilitate easier test creation. Direct use of xUnit, at least right now, is not a goal since the tests must be run on-device and control has to be handled by a meadow-specific transport layer. -[Using a Raspberry Pi as the Test Director](raspi.md) +[Using a Raspberry Pi as the Test Director](doc/raspi.md) [Running the TestDirector from a Container](deploy/readme.md) -[Hardware Setup](setup.md) +[Hardware Setup](doc/setup.md) -[Using TestSuite](usage.md) +[Using TestSuite](doc/usage.md) -[Authoring TestSuite Tests](authoring-tests.md) +[Authoring TestSuite Tests](doc/authoring-tests.md) -[TestSuite Implementation Details](implementation.md) +[TestSuite Implementation Details](doc/implementation.md) ## Beta Notes