diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0dcf6cef3..9297e8cc7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 diff --git a/__tests__/e2e_test.bat b/__tests__/e2e_test.bat index 3ea7c38e7..59bf4e669 100644 --- a/__tests__/e2e_test.bat +++ b/__tests__/e2e_test.bat @@ -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 -) \ No newline at end of file +@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 ) \ No newline at end of file