-
Notifications
You must be signed in to change notification settings - Fork 0
[feat][#16] Re-implement mega-planner as standalone Python script #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
3d1d2b5
c18d9c3
b2c6f00
a728851
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| #!/usr/bin/env bash | ||
| # Test: Makefile env target prints correct environment exports | ||
|
|
||
| source "$(dirname "$0")/../common.sh" | ||
|
|
||
| test_info "Makefile env target prints correct environment exports" | ||
|
|
||
| cd "$PROJECT_ROOT" | ||
|
|
||
| # Clear MAKEFLAGS to avoid jobserver inheritance issues when invoked via make | ||
| unset MAKEFLAGS MAKELEVEL | ||
|
|
||
| # Capture make env output | ||
| ENV_OUTPUT=$(make env 2>&1) | ||
|
|
||
| # Verify AGENTIZE_HOME export is present with $(CURDIR) resolved | ||
| if ! echo "$ENV_OUTPUT" | grep -q 'export AGENTIZE_HOME='; then | ||
| test_fail "make env missing AGENTIZE_HOME export" | ||
| fi | ||
|
|
||
| # Verify PYTHONPATH export is present | ||
| if ! echo "$ENV_OUTPUT" | grep -q 'export PYTHONPATH='; then | ||
| test_fail "make env missing PYTHONPATH export" | ||
| fi | ||
|
|
||
| # Verify the output is valid shell (can be eval'd without error) | ||
| eval "$ENV_OUTPUT" 2>/dev/null | ||
| if [ $? -ne 0 ]; then | ||
| test_fail "make env output is not valid shell syntax" | ||
| fi | ||
|
|
||
| # Verify AGENTIZE_HOME was actually set after eval | ||
| if [ -z "$AGENTIZE_HOME" ]; then | ||
| test_fail "AGENTIZE_HOME not set after eval \$(make env)" | ||
| fi | ||
|
Comment on lines
+26
to
+35
|
||
|
|
||
| test_pass "make env prints valid environment exports" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| #!/usr/bin/env bash | ||
| # Test: Makefile help target documents env targets | ||
|
|
||
| source "$(dirname "$0")/../common.sh" | ||
|
|
||
| test_info "Makefile help target documents env targets" | ||
|
|
||
| cd "$PROJECT_ROOT" | ||
|
|
||
| # Clear MAKEFLAGS to avoid jobserver inheritance issues when invoked via make | ||
| unset MAKEFLAGS MAKELEVEL | ||
|
|
||
| # Capture make help output | ||
| HELP_OUTPUT=$(make help 2>&1) | ||
|
|
||
| # Verify env target is documented in help | ||
| if ! echo "$HELP_OUTPUT" | grep -q "make env"; then | ||
| test_fail "make help missing 'make env' documentation" | ||
| fi | ||
|
|
||
| # Verify eval usage hint is present | ||
| if ! echo "$HELP_OUTPUT" | grep -q "eval"; then | ||
| test_fail "make help missing eval usage hint for env target" | ||
| fi | ||
|
|
||
| test_pass "make help documents env targets" |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,80 @@ | ||||||||||
| #!/usr/bin/env bash | ||||||||||
| # Test: Template Makefiles have env, env-script, and help targets | ||||||||||
|
|
||||||||||
| source "$(dirname "$0")/../common.sh" | ||||||||||
|
|
||||||||||
| test_info "Template Makefiles have env, env-script, and help targets" | ||||||||||
|
|
||||||||||
| TEMPLATES_DIR="$PROJECT_ROOT/templates" | ||||||||||
| FAILED=0 | ||||||||||
|
|
||||||||||
| for lang in python c cxx; do | ||||||||||
| MAKEFILE="$TEMPLATES_DIR/$lang/Makefile" | ||||||||||
|
|
||||||||||
| if [ ! -f "$MAKEFILE" ]; then | ||||||||||
| echo "FAIL: $MAKEFILE not found" | ||||||||||
| FAILED=1 | ||||||||||
| continue | ||||||||||
| fi | ||||||||||
|
|
||||||||||
| # Check env target exists | ||||||||||
| if ! grep -q '^env:' "$MAKEFILE"; then | ||||||||||
| echo "FAIL: $lang/Makefile missing env target" | ||||||||||
| FAILED=1 | ||||||||||
| fi | ||||||||||
|
|
||||||||||
| # Check env-script target exists | ||||||||||
| if ! grep -q '^env-script:' "$MAKEFILE"; then | ||||||||||
| echo "FAIL: $lang/Makefile missing env-script target" | ||||||||||
| FAILED=1 | ||||||||||
| fi | ||||||||||
|
|
||||||||||
| # Check help target exists | ||||||||||
| if ! grep -q '^help:' "$MAKEFILE"; then | ||||||||||
| echo "FAIL: $lang/Makefile missing help target" | ||||||||||
| FAILED=1 | ||||||||||
| fi | ||||||||||
|
|
||||||||||
| # Check env target exports PROJECT_ROOT | ||||||||||
| if ! grep -q 'PROJECT_ROOT' "$MAKEFILE"; then | ||||||||||
| echo "FAIL: $lang/Makefile env target missing PROJECT_ROOT" | ||||||||||
| FAILED=1 | ||||||||||
| fi | ||||||||||
|
|
||||||||||
| # Check env-script generates setup.sh | ||||||||||
| if ! grep -q 'setup.sh' "$MAKEFILE"; then | ||||||||||
| echo "FAIL: $lang/Makefile env-script doesn't generate setup.sh" | ||||||||||
| FAILED=1 | ||||||||||
| fi | ||||||||||
|
|
||||||||||
| # Check .PHONY includes new targets | ||||||||||
| if ! grep -q 'env' "$MAKEFILE" | head -1; then | ||||||||||
| echo "FAIL: $lang/Makefile .PHONY missing env" | ||||||||||
|
||||||||||
| if ! grep -q 'env' "$MAKEFILE" | head -1; then | |
| echo "FAIL: $lang/Makefile .PHONY missing env" | |
| if ! grep -q '^\.PHONY:.*\benv\b.*\benv-script\b.*\bhelp\b' "$MAKEFILE"; then | |
| echo "FAIL: $lang/Makefile .PHONY missing env, env-script, or help" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PYTHONPATHis being set to$(CURDIR)/src, but this template doesn't have asrc/directory (it has the package directory at the repo root, e.g.project_name/). As a result,eval $(make env)/make env-scriptwon't actually put the SDK onPYTHONPATH. Update the export to match the template layout (likely$(CURDIR)or a configurable source path).