-
-
Notifications
You must be signed in to change notification settings - Fork 29
Fixed workflow tests. #2073
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
Fixed workflow tests. #2073
Changes from all commits
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 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -141,6 +141,15 @@ jobs: | |||||||||||||
| - name: Adjust git config to allow running git-related tests | ||||||||||||||
| run: git config --global safe.directory '*' | ||||||||||||||
|
|
||||||||||||||
| - name: Generate test SSH key pair used for deployment tests | ||||||||||||||
| run: | | ||||||||||||||
| mkdir -p "$HOME/.ssh" | ||||||||||||||
| ssh-keygen -t rsa -b 4096 -m PEM -N '' -f "$HOME/.ssh/id_rsa" | ||||||||||||||
| chmod 600 "$HOME/.ssh/id_rsa" | ||||||||||||||
| ssh-agent -a "${HOME}/ssh-agent.sock" > ssh-agent-output | ||||||||||||||
| export SSH_AUTH_SOCK=$(grep SSH_AUTH_SOCK ssh-agent-output | cut -d';' -f1 | cut -d= -f2) | ||||||||||||||
| echo "SSH_AUTH_SOCK=${SSH_AUTH_SOCK}" >> "$GITHUB_ENV" | ||||||||||||||
|
|
||||||||||||||
| - name: Setup Node.js | ||||||||||||||
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6 | ||||||||||||||
| with: | ||||||||||||||
|
|
@@ -161,7 +170,15 @@ jobs: | |||||||||||||
| run: | | ||||||||||||||
| # Create an empty coverage directory to avoid errors. @see https://github.com/actions/upload-artifact/issues/255 | ||||||||||||||
| mkdir -p /tmp/.vortex-coverage-html && touch "/tmp/.vortex-coverage-html/.empty-$(date +%Y%m%d%H%M%S)" | ||||||||||||||
| php -d memory_limit=-1 vendor/bin/phpunit phpunit --group="${TEST_NODE_INDEX:-*}" | ||||||||||||||
|
|
||||||||||||||
| # Configure git username and email if it is not set. | ||||||||||||||
| [ "$(git config --global user.name)" = "" ] && echo "==> Configuring global test git user name" && git config --global user.name "Test user" | ||||||||||||||
| [ "$(git config --global user.email)" = "" ] && echo "==> Configuring global test git user email" && git config --global user.email "someone@example.com" | ||||||||||||||
|
Comment on lines
+174
to
+176
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Use The git config guard logic is correct but can be made more idiomatic by using the - [ "$(git config --global user.name)" = "" ] && echo "==> Configuring global test git user name" && git config --global user.name "Test user"
- [ "$(git config --global user.email)" = "" ] && echo "==> Configuring global test git user email" && git config --global user.email "someone@example.com"
+ [ -z "$(git config --global user.name)" ] && echo "==> Configuring global test git user name" && git config --global user.name "Test user"
+ [ -z "$(git config --global user.email)" ] && echo "==> Configuring global test git user email" && git config --global user.email "someone@example.com"📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
|
|
||||||||||||||
| # Create stub of local network. | ||||||||||||||
| docker network create amazeeio-network 2>/dev/null || true | ||||||||||||||
|
|
||||||||||||||
| php -d memory_limit=-1 vendor/bin/phpunit --group="p${TEST_NODE_INDEX:-*}" | ||||||||||||||
|
Comment on lines
+179
to
+181
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainDocker network creation and phpunit grouping look sound. The docker network stub creation with proper error suppression follows best practices, and the phpunit test grouping pattern Verify that tests tagged with groups 🏁 Script executed: #!/bin/bash
# Description: Verify phpunit test groups are properly defined and distributed
# Search for test group annotations in the test files
rg -n '@group\s+p[0-4]' .vortex/tests --type=php | head -20
# Count tests per group
echo "=== Test count per group ==="
rg '@group\s+p[0-4]' .vortex/tests --type=php -c | sort | uniq -cLength of output: 28 I need to search more broadly to understand the actual test grouping strategy used in this repository. 🏁 Script executed: #!/bin/bash
# Description: Search for all @group annotations to understand actual test grouping
echo "=== All @group annotations in .vortex/tests ==="
rg -n '@group' .vortex/tests --type=php -A1 | head -30
echo ""
echo "=== Unique group names ==="
rg '@group\s+(\S+)' .vortex/tests --type=php -o --replace '$1' | sort | uniq -c | sort -rn
echo ""
echo "=== Check for phpunit.xml or test configuration ==="
fd '(phpunit|test)" -type f .vortex/tests | head -20Length of output: 198 Let me fix the script and gather more comprehensive information: 🏁 Script executed: #!/bin/bash
# Description: Understand test structure and grouping
echo "=== Test files in .vortex/tests ==="
fd --type f '.php$' .vortex/tests | head -20
echo ""
echo "=== Search for @group in test files ==="
rg -n '@group' .vortex/tests --type=php | head -20
echo ""
echo "=== Check for phpunit.xml ==="
fd -name 'phpunit.xml*' .vortex
echo ""
echo "=== Check workflow context - lines around 179 ==="
sed -n '170,190p' .github/workflows/vortex-test-common.ymlLength of output: 2422 🏁 Script executed: #!/bin/bash
# Description: Check phpunit config and TEST_NODE_INDEX usage
echo "=== Find phpunit configuration files ==="
find .vortex -name 'phpunit.xml*' -o -name 'phpunit.dist.xml' 2>/dev/null
echo ""
echo "=== Search for TEST_NODE_INDEX in workflow ==="
grep -n 'TEST_NODE_INDEX' .github/workflows/vortex-test-common.yml
echo ""
echo "=== Check matrix batch configuration ==="
sed -n '1,200p' .github/workflows/vortex-test-common.yml | grep -A 20 'strategy:'
echo ""
echo "=== Verify no @group tags exist at all in tests ==="
rg -c '^[[:space:]]*\*[[:space:]]*@group' .vortex/tests --type=phpLength of output: 1661 🏁 Script executed: #!/bin/bash
# Description: Check phpunit.xml configuration
echo "=== phpunit.xml content ==="
cat .vortex/tests/phpunit.xml
echo ""
echo "=== Check if there are any group-related configurations ==="
grep -i 'group' .vortex/tests/phpunit.xml || echo "(no group configuration found)"Length of output: 1327 Matrix test distribution is non-functional—tests lack required group annotations. The workflow references Tests must be annotated with 🤖 Prompt for AI Agents |
||||||||||||||
| working-directory: .vortex/tests | ||||||||||||||
| env: | ||||||||||||||
| TEST_VORTEX_DEBUG: ${{ vars.TEST_VORTEX_DEBUG }} | ||||||||||||||
|
|
||||||||||||||
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.
🧹 Nitpick | 🔵 Trivial
Consider extracting SSH key generation to a composite action.
The SSH key generation logic at lines 144-151 is identical to lines 53-60 in the
vortex-test-commonjob. While this duplication works, extracting it to a reusable composite action would improve maintainability and reduce the risk of the two implementations diverging.🤖 Prompt for AI Agents