Skip to content

Commit f095c9b

Browse files
committed
Hot reload: move test/* entries one level up
1 parent 980c148 commit f095c9b

File tree

12 files changed

+21
-39
lines changed

12 files changed

+21
-39
lines changed

.github/workflows/full-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ jobs:
410410

411411
- name: "Build and test hot-reload"
412412
if: ${{ matrix.with-hot-reload }}
413-
working-directory: itest/hot-reload/godot/test
413+
working-directory: itest/hot-reload/godot
414414
# Repeat a few times, our hot reload integration test can sometimes be a bit flaky.
415415
run: $RETRY ./run-test.sh
416416
shell: bash

.github/workflows/minimal-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ jobs:
226226

227227
- name: "Build and test hot-reload"
228228
if: ${{ matrix.with-hot-reload }}
229-
working-directory: itest/hot-reload/godot/test
229+
working-directory: itest/hot-reload/godot
230230
run: ./run-test.sh
231231
shell: bash
232232

itest/hot-reload/godot/MainScene.tscn

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
[gd_scene format=3 uid="uid://da7eiv1notj7j"]
1+
[gd_scene load_steps=2 format=3 uid="uid://da7eiv1notj7j"]
22

3-
[node name="Reloadable" type="Reloadable"]
3+
[ext_resource type="Script" path="res://ReloadTest.gd" id="1_6hpr0"]
4+
5+
[node name="MainScene" type="Node"]
6+
script = ExtResource("1_6hpr0")

itest/hot-reload/godot/test/ReloadOrchestrator.gd renamed to itest/hot-reload/godot/ReloadOrchestrator.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func _initialize():
2929

3030
["replace"]:
3131
print("[GD Orch] Replace source code...")
32-
ok = replace_line("../../rust/src/lib.rs")
32+
ok = replace_line("../rust/src/lib.rs")
3333

3434
["notify"]:
3535
print("[GD Orch] Notify Godot about change...")

itest/hot-reload/godot/project.godot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ config_version=5
1111
[application]
1212

1313
config/name="hot-reload"
14-
config/features=PackedStringArray("4.3", "Forward Plus")
14+
config/features=PackedStringArray("4.2", "Forward Plus")

itest/hot-reload/godot/test/run-test.sh renamed to itest/hot-reload/godot/run-test.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
# License, v. 2.0. If a copy of the MPL was not distributed with this
55
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
66

7+
rel="."
8+
79
# Restore un-reloaded files on exit (for local testing).
810
cleanedUp=0 # avoid recursion if cleanup fails
911
cleanup() {
1012
if [[ $cleanedUp -eq 0 ]]; then
1113
cleanedUp=1
1214
echo "[Bash] Cleanup..."
13-
git checkout --quiet ../../rust/src/lib.rs ../rust.gdextension ../MainScene.tscn || true # ignore errors here
15+
git checkout --quiet $rel/../rust/src/lib.rs $rel/rust.gdextension $rel/MainScene.tscn || true # ignore errors here
1416
fi
1517
}
1618

@@ -20,12 +22,12 @@ trap cleanup EXIT
2022
echo "[Bash] Start hot-reload integration test..."
2123

2224
# Restore un-reloaded file (for local testing).
23-
git checkout --quiet ../../rust/src/lib.rs ../rust.gdextension
25+
git checkout --quiet $rel/../rust/src/lib.rs $rel/rust.gdextension
2426

2527
# Set up editor file which has scene open, so @tool script loads at startup. Also copy scene file that holds a script.
26-
mkdir -p ../.godot/editor
27-
cp editor_layout.cfg ../.godot/editor/editor_layout.cfg
28-
cp MainScene.tscn ../MainScene.tscn
28+
mkdir -p $rel/.godot/editor
29+
cp editor_layout.cfg $rel/.godot/editor/editor_layout.cfg
30+
cp MainScene.tscn $rel/MainScene.tscn
2931

3032
# Compile original Rust source.
3133
cargoArgs=""
@@ -35,7 +37,7 @@ cargo build -p hot-reload $cargoArgs
3537
# Wait briefly so artifacts are present on file system.
3638
sleep 0.5
3739

38-
$GODOT4_BIN -e --headless --path .. &
40+
$GODOT4_BIN -e --headless --path $rel &
3941
pid=$!
4042
echo "[Bash] Wait for Godot ready (PID $pid)..."
4143

0 commit comments

Comments
 (0)