From fe1a96f850fb0b0d5eeaea179bdbae03f7c99dda Mon Sep 17 00:00:00 2001 From: Lucien Greathouse Date: Tue, 1 Oct 2019 17:44:24 -0700 Subject: [PATCH] Improve plugin test running, reducing project duplication --- bin/put-plugin-in-test-place.lua | 8 +++++++ bin/run-plugin-tests.sh | 14 +++++++++--- plugin/place.project.json | 37 -------------------------------- 3 files changed, 19 insertions(+), 40 deletions(-) create mode 100644 bin/put-plugin-in-test-place.lua diff --git a/bin/put-plugin-in-test-place.lua b/bin/put-plugin-in-test-place.lua new file mode 100644 index 00000000..f651c1bf --- /dev/null +++ b/bin/put-plugin-in-test-place.lua @@ -0,0 +1,8 @@ +local pluginPath, placePath = ... + +local plugin = remodel.readModelFile(pluginPath)[1] +local place = remodel.readPlaceFile(placePath) + +plugin.Parent = place:GetService("ReplicatedStorage") + +remodel.writePlaceFile(place, placePath) \ No newline at end of file diff --git a/bin/run-plugin-tests.sh b/bin/run-plugin-tests.sh index 28d630a9..9d8672d7 100755 --- a/bin/run-plugin-tests.sh +++ b/bin/run-plugin-tests.sh @@ -1,6 +1,14 @@ #!/bin/sh -set -ev +set -e -rojo build plugin/place.project.json -o PluginPlace.rbxlx -run-in-roblox -s plugin/testBootstrap.server.lua PluginPlace.rbxlx \ No newline at end of file +DIR="$( mktemp -d )" +PLUGIN_FILE="$DIR/Rojo.rbxmx" +PLACE_FILE="$DIR/RojoTestPlace.rbxlx" + +rojo build plugin -o "$PLUGIN_FILE" +rojo build plugin/place.project.json -o "$PLACE_FILE" + +remodel bin/put-plugin-in-test-place.lua "$PLUGIN_FILE" "$PLACE_FILE" + +run-in-roblox -s plugin/testBootstrap.server.lua "$PLACE_FILE" \ No newline at end of file diff --git a/plugin/place.project.json b/plugin/place.project.json index 2010494e..1fa420be 100644 --- a/plugin/place.project.json +++ b/plugin/place.project.json @@ -6,46 +6,9 @@ "ReplicatedStorage": { "$className": "ReplicatedStorage", - "Rojo": { - "$className": "Folder", - - "Plugin": { - "$path": "src" - }, - "Roact": { - "$path": "modules/roact/src" - }, - "Promise": { - "$path": "modules/promise/lib" - }, - "t": { - "$path": "modules/t/lib" - }, - "RbxDom": { - "$path": "modules/rbx-dom/rbx_dom_lua/src" - } - }, "TestEZ": { "$path": "modules/testez/lib" } - }, - - "HttpService": { - "$className": "HttpService", - "$properties": { - "HttpEnabled": { - "Type": "Bool", - "Value": true - } - } - }, - - "ServerScriptService": { - "$className": "ServerScriptService", - - "TestBootstrap": { - "$path": "testBootstrap.server.lua" - } } } } \ No newline at end of file