Skip to content

Automate tutorial following#48

Closed
iurimatias wants to merge 3 commits into
masterfrom
automate_tutorial_following
Closed

Automate tutorial following#48
iurimatias wants to merge 3 commits into
masterfrom
automate_tutorial_following

Conversation

@iurimatias
Copy link
Copy Markdown
Member

No description provided.

- Pin all logos-co repo refs in the 4 guides to /tutorial-v2
- Fix broken cross-doc anchors (#61-running-with-logoscore,
  #42-building-lgx-packages)
- Sync logos-calc-ui-cpp example with Part 3: add status PROP to
  calc_ui_cpp.rep and status binding/display to Main.qml

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 27, 2026 14:33
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR pins tutorial documentation examples to the tutorial-v2 branch and adds automated tutorial replay specs plus a Bash runner for scaffolding, building, inspecting, and UI-testing the tutorials. It also updates the C++ UI example to expose and display a backend status property.

Changes:

  • Updated tutorial/developer guide flake URLs and some guide cross-reference anchors.
  • Added YAML tutorial test specs and a tests/run-tutorial-test.sh harness.
  • Added status to the C++ UI .rep interface and QML display.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
tutorial-wrapping-c-library.md Pins tutorial commands and flake examples to tutorial-v2; updates guide links.
tutorial-qml-ui-app.md Pins QML tutorial commands and dependency examples to tutorial-v2; updates guide links.
tutorial-cpp-ui-app.md Pins C++ UI tutorial scaffold and flake examples to tutorial-v2.
logos-developer-guide.md Pins guide command examples to tutorial-v2 and updates LGX guide references.
tests/run-tutorial-test.sh Adds the automated tutorial replay/test runner.
tests/tutorial-wrapping-c-library.test.yaml Adds replay spec for the C library wrapping tutorial.
tests/tutorial-qml-ui-app.test.yaml Adds replay spec for the QML UI tutorial.
tests/tutorial-cpp-ui-app.test.yaml Adds replay spec for the C++ UI backend tutorial.
logos-calc-ui-cpp/src/calc_ui_cpp.rep Adds a status Remote Objects property.
logos-calc-ui-cpp/src/qml/Main.qml Reads and displays the backend status property.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# Available: scaffold,files,build,inspect,logoscore,basecamp
# --keep-workdir Don't delete the temp working directory on exit
# --workdir <path> Use existing directory instead of creating a fresh one
# (skips scaffold+files phases unless explicitly requested)
tutorial: tutorial-wrapping-c-library.md

scaffold:
template: "github:logos-co/logos-module-builder#with-external-lib"
description = "Calculator module - wraps libcalc C library for Logos";

inputs = {
logos-module-builder.url = "github:logos-co/logos-module-builder";
tutorial: tutorial-qml-ui-app.md

scaffold:
template: "github:logos-co/logos-module-builder#ui-qml"
Comment on lines +230 to +231
logos-module-builder.url = "github:logos-co/logos-module-builder";
calc_module.url = "github:logos-co/logos-tutorial?dir=logos-calc-module";
tutorial: tutorial-cpp-ui-app.md

scaffold:
template: "github:logos-co/logos-module-builder#ui-qml-backend"
Comment on lines +305 to +306
logos-module-builder.url = "github:logos-co/logos-module-builder";
calc_module.url = "github:logos-co/logos-tutorial?dir=logos-calc-module";
Comment on lines +426 to +478

# Generate .mjs test file from YAML basecamp declarations
MJS_FILE="$(mktemp "${WORKDIR}/basecamp-test-XXXXXX.mjs")"

{
echo 'import { resolve } from "node:path";'
echo "const qtMcpRoot = \"$QT_MCP\";"
echo 'const { test, run } = await import(resolve(qtMcpRoot, "test-framework/framework.mjs"));'
echo ''
echo "test(\"$TUTORIAL_NAME: basecamp UI verification\", async (app) => {"

BC_TEST_COUNT=$(yq_read '.basecamp.tests | length')
for i in $(seq 0 $((BC_TEST_COUNT - 1))); do
ACTION=$(yq_read ".basecamp.tests[$i].action")
TARGET=$(yq_read ".basecamp.tests[$i].target")
TEXTS=$(yq_read ".basecamp.tests[$i].texts")
TIMEOUT=$(yq_read ".basecamp.tests[$i].timeout")
NAME=$(yq_read ".basecamp.tests[$i].name")

case "$ACTION" in
click)
echo " await app.click(\"$TARGET\");"
;;
expect_texts)
TEXTS_JS=$(yq_read ".basecamp.tests[$i].texts | @json")
echo " await app.expectTexts($TEXTS_JS);"
;;
wait_for)
TEXTS_JS=$(yq_read ".basecamp.tests[$i].texts | @json")
TO="${TIMEOUT:-10000}"
echo " await app.waitFor("
echo " async () => { await app.expectTexts($TEXTS_JS); },"
echo " { timeout: $TO, interval: 500, description: \"$NAME\" }"
echo " );"
;;
esac
done

echo '});'
echo ''
echo 'run();'
} > "$MJS_FILE"

[[ "$VERBOSE" == "true" ]] && echo " Generated test file: $MJS_FILE"

# Run the generated test
if node "$MJS_FILE" --ci "$BASECAMP_BIN" --verbose 2>&1; then
pass "basecamp UI tests"
else
fail "basecamp UI tests" "test runner exited with non-zero"
fi

rm -f "$MJS_FILE"
QUIT_FLAG="--quit-on-finish"
fi

cmd="timeout $CALL_TIMEOUT logoscore $QUIT_FLAG -m ./modules -l $MODULE_NAME -c \"$TEST_CALL\""
automate tutorial following

improve test specs; ensure basecamp tests are being run

replicate issue; run tests in the CI

merge actions
fix for tutorial

fix linux test
@iurimatias iurimatias force-pushed the automate_tutorial_following branch from b1e631e to c051f59 Compare May 27, 2026 18:48
@iurimatias
Copy link
Copy Markdown
Member Author

closed in favour of #50

@iurimatias iurimatias closed this May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants