Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
pschoffer committed Aug 12, 2022
1 parent 8367285 commit 273f1ce
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 58 deletions.
84 changes: 46 additions & 38 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,52 @@
name: Run VIP-cli tests
name: Run linux based image
on:
pull_request

env:
NODE_OPTIONS: --unhandled-rejections=warn

jobs:
Run_windows_tests:
name: Run Windows Tests
Try_pull_image:
name: Try pull Image
runs-on: windows-latest
steps:
# To prevent issues with fixtures on Windows tests
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Check out repository code
uses: actions/checkout@v2
with:
submodules: true
path: vip

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 'lts/*'

- name: Install dependencies
run: npm ci
working-directory: vip

# - name: Unit Tests
# working-directory: vip
# run: npm run jest

# - name: Build it
# working-directory: vip
# run: npm run pack

- name: Test Command line
working-directory: vip
run: ./__tests__/e2e_test.bat
- name: Image pull step
run: docker pull ubuntu

# name: Run VIP-cli tests
# on:
# pull_request

# env:
# NODE_OPTIONS: --unhandled-rejections=warn

# jobs:
# Run_windows_tests:
# name: Run Windows Tests
# runs-on: windows-latest
# steps:
# # To prevent issues with fixtures on Windows tests
# - name: Set git to use LF
# run: |
# git config --global core.autocrlf false
# git config --global core.eol lf

# - name: Check out repository code
# uses: actions/checkout@v2
# with:
# submodules: true
# path: vip

# - name: Setup Node
# uses: actions/setup-node@v2
# with:
# node-version: 'lts/*'

# # - name: Install dependencies
# # run: npm ci
# # working-directory: vip

# # - name: Unit Tests
# # working-directory: vip
# # run: npm run jest

# - name: Test Command line
# working-directory: vip
# run: ./__tests__/e2e_test.bat
65 changes: 45 additions & 20 deletions __tests__/e2e_test.bat
Original file line number Diff line number Diff line change
@@ -1,32 +1,57 @@

call npm pack
@REM call DockerCli -SwitchLinuxEngine
call docker version
call where docker
@REM call dir "C:\Program Files\Docker"
call where docker-compose

echo "== Installing vip"
@REM call dir \s DockerCli.exe
C:
call dir \s DockerCli.exe
@REM call dir "C:\ProgramData\Chocolatey"

FOR /R "." %%f IN ( *.tgz) DO (
call npm i -g %%f
)
@REM call cat "C:\ProgramData\Docker\config\daemon.json"

echo "== Running e2e tests"
@REM call Install-WindowsFeature -Name Hyper-V -IncludeManagementTools -Restart
call Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
call Get-PackageProvider -ListAvailableget-packagesource -ProviderName DockerMsftProvider

call vip --help
call wsl -l -o

rem dev-env tests
call wsl --status

echo "== Creating dev-env"
call systeminfo

call vip dev-env create --client-code image --title Test --multisite false --php 8.0 --wordpress 6.0 --mu-plugins image -e false -p false -x false
call docker pull ubuntu

if NOT %errorlevel% == 0 (
echo "== Failed to create dev-env"
exit 1
)
@REM call npm pack

echo "== Starting dev-env"
@REM echo "== Installing vip"

call vip dev-env start --skip-wp-versions-check
@REM FOR /R "." %%f IN ( *.tgz) DO (
@REM call npm i -g %%f
@REM )

if NOT %errorlevel% == 0 (
echo "== Dev-env failed to start"
exit 1
)
@REM echo "== Running e2e tests"

@REM call vip --help

@REM rem dev-env tests

@REM echo "== Creating dev-env"

@REM call vip dev-env create --client-code image --title Test --multisite false --php 8.0 --wordpress 6.0 --mu-plugins image -e false -p false -x false

@REM if NOT %errorlevel% == 0 (
@REM echo "== Failed to create dev-env"
@REM exit 1
@REM )

@REM echo "== Starting dev-env"

@REM call vip dev-env start --skip-wp-versions-check

@REM if NOT %errorlevel% == 0 (
@REM echo "== Dev-env failed to start"
@REM exit 1
@REM )

0 comments on commit 273f1ce

Please sign in to comment.