Report a bug in the pause menu (a new Gitea issue filled in with the version, computer, mode, land and where you are; copy the details; the log file), the playtest guide (docs/PLAYTEST.md), and the Cove's 0.6.0 parts in the player guide
This commit is contained in:
@@ -9,7 +9,7 @@ if [ ! -f .godot/global_script_class_cache.cfg ]; then
|
||||
echo "Importing the project first (fresh copy)..."
|
||||
godot --headless --path . --import >/dev/null 2>&1
|
||||
fi
|
||||
for t in test_survival_core test_survival_stats test_save_load test_weather_building test_creatures_combat test_wolves test_alpha test_bear test_thieves test_barrow test_boss test_den_sites test_fishing_diet test_food test_hazards test_iron test_stone test_net_lobby test_net_world test_net_shared test_net_life test_net_boss test_net_rules test_net_lands test_host test_tutorial test_tutorial_full test_hints test_updates test_audio test_items_more test_worldlets test_worldlet_pick test_water_bodies test_cove test_wreck test_shore test_boat test_tunnel test_map test_terrain_edges test_boundary; do
|
||||
for t in test_survival_core test_survival_stats test_save_load test_weather_building test_creatures_combat test_wolves test_alpha test_bear test_thieves test_barrow test_boss test_den_sites test_fishing_diet test_food test_hazards test_iron test_stone test_net_lobby test_net_world test_net_shared test_net_life test_net_boss test_net_rules test_net_lands test_host test_tutorial test_tutorial_full test_hints test_updates test_audio test_items_more test_worldlets test_worldlet_pick test_water_bodies test_cove test_wreck test_shore test_boat test_bug_report test_tunnel test_map test_terrain_edges test_boundary; do
|
||||
extra=""
|
||||
[ "$t" = "test_boundary" ] && extra="--fixed-fps 30"
|
||||
# A suite that waits on a world that failed to load would hang forever,
|
||||
|
||||
76
tests/test_bug_report.gd
Normal file
76
tests/test_bug_report.gd
Normal file
@@ -0,0 +1,76 @@
|
||||
extends SceneTree
|
||||
## 0.6.0, the playtest: Report a bug. The pause menu has a "Report a bug"
|
||||
## page; its link is a new issue on the Emberwild repo, filled in with
|
||||
## questions to answer and the details (version, computer, mode, land, time,
|
||||
## where you are), short enough for a browser; the log's path is shown.
|
||||
## Run: godot --headless --path . --script res://tests/test_bug_report.gd
|
||||
|
||||
const BugReport = preload("res://scripts/core/bug_report.gd")
|
||||
|
||||
var _fails := 0
|
||||
var _finished := false
|
||||
var S: Node
|
||||
|
||||
func check(cond: bool, what: String) -> void:
|
||||
print((" ok " if cond else " FAIL ") + what)
|
||||
if not cond:
|
||||
_fails += 1
|
||||
|
||||
func _initialize() -> void:
|
||||
_run.call_deferred()
|
||||
|
||||
func _run() -> void:
|
||||
S = root.get_node("Saves")
|
||||
S.root_dir = "user://test_bug_worlds"
|
||||
for x in S.list_worlds():
|
||||
S.delete_world(x.id)
|
||||
await _body()
|
||||
check(_finished, "test ran to the end (no script errors)")
|
||||
for x in S.list_worlds():
|
||||
S.delete_world(x.id)
|
||||
DirAccess.remove_absolute(S.root_dir)
|
||||
print("RESULT: %s (%d failures)" % ["PASS" if _fails == 0 else "FAIL", _fails])
|
||||
quit(1 if _fails > 0 else 0)
|
||||
|
||||
func _body() -> void:
|
||||
S.current_id = S.create_world("Cove", 1337, {"worldlet": "cove"})
|
||||
var w: Node3D = load("res://scenes/world.tscn").instantiate()
|
||||
root.add_child(w)
|
||||
for _i in range(8):
|
||||
await physics_frame
|
||||
w.creatures.enabled = false
|
||||
w.player.set_physics_process(false)
|
||||
|
||||
print("the link")
|
||||
var url: String = BugReport.issue_url(w)
|
||||
check(url.begins_with("https://git.psbailey.uk/Admin/Emberwild/issues/new?title=Bug%3A%20&body="), "a new issue on the Emberwild repo")
|
||||
check(url.length() < 4000, "short enough for any browser (%d characters)" % url.length())
|
||||
var body := url.get_slice("&body=", 1).uri_decode()
|
||||
var ver: String = String(ProjectSettings.get_setting("application/config/version"))
|
||||
for want in ["**What happened?**", "**How can we make it happen again?**", "- Version: Emberwild %s" % ver,
|
||||
"- Computer: ", "- Mode: single-player", "- Land: Cove", "- Time: day ", "- Where: ", "- Seed: 1337", "godot.log"]:
|
||||
check(body.contains(want), "it says %s" % want)
|
||||
check(BugReport.log_path().ends_with("logs/godot.log") and BugReport.log_path().begins_with("/"), "the log's full path (%s)" % BugReport.log_path())
|
||||
check(not BugReport.details_text(w).contains("**"), "Copy gives just the details")
|
||||
check(not body.contains(OS.get_environment("HOME")) and body.contains("~/"), "and not your user name (the home folder is ~)")
|
||||
|
||||
print("the pause menu")
|
||||
var menu: Control = load("res://scripts/ui/pause_menu.gd").new() # (headless there's no HUD: build the menu as it does)
|
||||
w.add_child(menu)
|
||||
menu.bind(w.player)
|
||||
var btn: Button = null
|
||||
for c in menu._main.get_children():
|
||||
if c is Button and c.text == "Report a bug":
|
||||
btn = c
|
||||
check(btn != null, "a Report a bug button")
|
||||
if btn != null:
|
||||
menu.open()
|
||||
btn.pressed.emit()
|
||||
check(menu._report.visible and not menu._main.visible, "it opens the Report a bug page")
|
||||
var labels: Array = menu._report.get_children().filter(func(c): return c is Button).map(func(c): return c.text)
|
||||
check("Open the bug report page" in labels and "Copy the details" in labels and "Show the log file" in labels, "with %s" % [labels])
|
||||
menu.back()
|
||||
check(menu._main.visible and not menu._report.visible, "Esc goes back")
|
||||
menu.close()
|
||||
menu.queue_free()
|
||||
_finished = true
|
||||
1
tests/test_bug_report.gd.uid
Normal file
1
tests/test_bug_report.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bqvh4okrloluq
|
||||
Reference in New Issue
Block a user