@@ -37,17 +37,17 @@ jobs:
37
37
38
38
- name : Activate plugins
39
39
run : |
40
- npm run wp-env run cli wp plugin activate phpdoc-parser posts-to-posts
40
+ npm run wp-env run cli -- -- wp plugin activate phpdoc-parser posts-to-posts
41
41
42
42
- name : Run sample import (subset of files)
43
43
run : |
44
44
# Import a small subset of WordPress core files for testing
45
- npm run wp-env run cli wp parser create /var/www/html/wp-includes/functions.php --user=admin --quick
45
+ npm run wp-env run cli -- -- wp parser create /var/www/html/wp-includes/functions.php --user=admin --quick
46
46
47
47
- name : Verify import worked
48
48
run : |
49
49
# Check that functions were imported
50
- FUNCTION_COUNT=$(npm run wp-env run cli wp post list --post_type=wp-parser-function --format=count --quiet )
50
+ FUNCTION_COUNT=$(npm run wp-env run cli -- -- wp post list --post_type=wp-parser-function --format=count | tail -1 )
51
51
echo "Functions imported: $FUNCTION_COUNT"
52
52
53
53
if [ "$FUNCTION_COUNT" -lt 50 ]; then
@@ -56,21 +56,21 @@ jobs:
56
56
fi
57
57
58
58
# Check that classes were imported
59
- CLASS_COUNT=$(npm run wp-env run cli wp post list --post_type=wp-parser-class --format=count --quiet )
59
+ CLASS_COUNT=$(npm run wp-env run cli -- -- wp post list --post_type=wp-parser-class --format=count | tail -1 )
60
60
echo "Classes imported: $CLASS_COUNT"
61
61
62
62
# Check that hooks were imported
63
- HOOK_COUNT=$(npm run wp-env run cli wp post list --post_type=wp-parser-hook --format=count --quiet )
63
+ HOOK_COUNT=$(npm run wp-env run cli -- -- wp post list --post_type=wp-parser-hook --format=count | tail -1 )
64
64
echo "Hooks imported: $HOOK_COUNT"
65
65
66
66
# Check that methods were imported
67
- METHOD_COUNT=$(npm run wp-env run cli wp post list --post_type=wp-parser-method --format=count --quiet )
67
+ METHOD_COUNT=$(npm run wp-env run cli -- -- wp post list --post_type=wp-parser-method --format=count | tail -1 )
68
68
echo "Methods imported: $METHOD_COUNT"
69
69
70
70
- name : Test parser command with error detection
71
71
run : |
72
72
# Run parser and capture both stdout and stderr
73
- if ! npm run wp-env run cli wp parser create /var/www/html/wp-includes/class-wp.php --user=admin 2>&1 | tee import_output.log; then
73
+ if ! npm run wp-env run cli -- -- wp parser create /var/www/html/wp-includes/class-wp.php --user=admin 2>&1 | tee import_output.log; then
74
74
echo "ERROR: Parser command failed"
75
75
exit 1
76
76
fi
@@ -86,18 +86,18 @@ jobs:
86
86
87
87
- name : Verify specific function exists
88
88
run : |
89
- # Test that a well-known WordPress function was parsed correctly
90
- FUNCTION_EXISTS=$(npm run wp-env run cli wp post list --post_type=wp-parser-function --name=add-action --format=count --quiet )
89
+ # Test that a well-known WordPress function was parsed correctly from functions.php
90
+ FUNCTION_EXISTS=$(npm run wp-env run cli -- -- wp post list --post_type=wp-parser-function --s=wp_date --format=count | tail -1 )
91
91
if [ "$FUNCTION_EXISTS" -eq 0 ]; then
92
- echo "ERROR: add_action function not found in parsed data"
92
+ echo "ERROR: wp_date function not found in parsed data"
93
93
exit 1
94
94
fi
95
- echo "✓ add_action function successfully parsed"
95
+ echo "✓ wp_date function successfully parsed"
96
96
97
97
- name : Test database integrity
98
98
run : |
99
99
# Check that taxonomies are properly assigned
100
- FILE_TERMS=$(npm run wp-env run cli wp term list wp-parser-source-file --format=count --quiet )
100
+ FILE_TERMS=$(npm run wp-env run cli -- -- wp term list wp-parser-source-file --format=count | tail -1 )
101
101
echo "File taxonomy terms: $FILE_TERMS"
102
102
103
103
if [ "$FILE_TERMS" -eq 0 ]; then
@@ -107,15 +107,11 @@ jobs:
107
107
108
108
echo "✓ Database integrity checks passed"
109
109
110
- - name : Test API functionality
110
+ - name : Test WP-CLI functionality
111
111
run : |
112
- # Basic test that WordPress is serving the parsed data
113
- if ! curl -s http://localhost:8888/wp-admin/edit.php?post_type=wp-parser-function | grep -q "wp-parser-function"; then
114
- echo "ERROR: WordPress admin not displaying parsed functions"
115
- exit 1
116
- fi
117
-
118
- echo "✓ WordPress admin displaying parsed data correctly"
112
+ # Test that WP-CLI is working with the parser
113
+ npm run wp-env run cli -- -- wp parser --help | grep -q "create"
114
+ echo "✓ WP-CLI parser command available"
119
115
120
116
- name : Cleanup on failure
121
117
if : failure()
0 commit comments