Skip to content

Commit 58392c9

Browse files
committed
Fixed workflow tests.
1 parent 8b6e3d5 commit 58392c9

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

.github/workflows/vortex-test-common.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,15 @@ jobs:
141141
- name: Adjust git config to allow running git-related tests
142142
run: git config --global safe.directory '*'
143143

144+
- name: Generate test SSH key pair used for deployment tests
145+
run: |
146+
mkdir -p "$HOME/.ssh"
147+
ssh-keygen -t rsa -b 4096 -m PEM -N '' -f "$HOME/.ssh/id_rsa"
148+
chmod 600 "$HOME/.ssh/id_rsa"
149+
ssh-agent -a "${HOME}/ssh-agent.sock" > ssh-agent-output
150+
export SSH_AUTH_SOCK=$(grep SSH_AUTH_SOCK ssh-agent-output | cut -d';' -f1 | cut -d= -f2)
151+
echo "SSH_AUTH_SOCK=${SSH_AUTH_SOCK}" >> "$GITHUB_ENV"
152+
144153
- name: Setup Node.js
145154
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
146155
with:
@@ -161,7 +170,15 @@ jobs:
161170
run: |
162171
# Create an empty coverage directory to avoid errors. @see https://github.com/actions/upload-artifact/issues/255
163172
mkdir -p /tmp/.vortex-coverage-html && touch "/tmp/.vortex-coverage-html/.empty-$(date +%Y%m%d%H%M%S)"
164-
php -d memory_limit=-1 vendor/bin/phpunit phpunit --group="${TEST_NODE_INDEX:-*}"
173+
174+
# Configure git username and email if it is not set.
175+
[ "$(git config --global user.name)" = "" ] && echo "==> Configuring global test git user name" && git config --global user.name "Test user"
176+
[ "$(git config --global user.email)" = "" ] && echo "==> Configuring global test git user email" && git config --global user.email "someone@example.com"
177+
178+
# Create stub of local network.
179+
docker network create amazeeio-network 2>/dev/null || true
180+
181+
php -d memory_limit=-1 vendor/bin/phpunit --group="p${TEST_NODE_INDEX:-*}"
165182
working-directory: .vortex/tests
166183
env:
167184
TEST_VORTEX_DEBUG: ${{ vars.TEST_VORTEX_DEBUG }}

.vortex/tests/phpunit/Functional/InstallerTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ protected function setUp(): void {
2929
$this->gitAssertClean(static::$repo, 'Git working tree of the Vortex template repository should be clean');
3030
}
3131

32+
#[Group('p0')]
3233
public function testInstallFromLatest(): void {
3334
$this->logSubstep('Add custom files to SUT');
3435
File::dump('test1.txt', 'test content');

0 commit comments

Comments
 (0)