From f82307ad60514d1e912a9aa2b64204721fe955eb Mon Sep 17 00:00:00 2001 From: Josh Spicer Date: Tue, 23 Aug 2022 17:23:21 -0400 Subject: test updates to adopt https://github.com/devcontainers/cli/pull/124 (#114) * test updates to adopt https://github.com/devcontainers/cli/pull/124 * remove accidental tgz check in * typo in option * typo in python install script on dotnet6/jammy branch * no scenarios * code review and test name * Delete install_os_provided_python.sh --- .github/workflows/test-all.yaml | 68 ++++++++++++- .github/workflows/test-manual.yaml | 6 +- .github/workflows/test-pr.yaml | 28 ++++-- .github/workflows/test-scenarios.yaml | 19 ---- test-scenarios/install_additional_dotnet.sh | 13 --- test-scenarios/install_additional_java.sh | 13 --- test-scenarios/install_additional_node.sh | 17 ---- test-scenarios/install_additional_php.sh | 13 --- test-scenarios/install_additional_python.sh | 14 --- test-scenarios/install_additional_ruby.sh | 13 --- test-scenarios/install_cudnn_nvxt.sh | 15 --- test-scenarios/install_cudnn_nvxt_version.sh | 16 --- test-scenarios/install_dotnet_3.sh | 13 --- test-scenarios/install_dotnet_5.sh | 14 --- test-scenarios/install_gradle_and_maven.sh | 13 --- test-scenarios/install_jupyterlab.sh | 16 --- test-scenarios/install_os_provided_python.sh | 16 --- test-scenarios/install_python_twice.sh | 14 --- test-scenarios/rust_at_pinned_version.sh | 15 --- test-scenarios/scenarios.json | 130 ------------------------- test/_global/all_the_clis.sh | 14 +++ test/_global/node_java_rust.sh | 14 +++ test/_global/scenarios.json | 18 ++++ test/dotnet/install_additional_dotnet.sh | 13 +++ test/dotnet/install_dotnet_3.sh | 13 +++ test/dotnet/install_dotnet_5.sh | 14 +++ test/dotnet/scenarios.json | 27 +++++ test/java/install_additional_java.sh | 13 +++ test/java/install_gradle_and_maven.sh | 13 +++ test/java/scenarios.json | 21 ++++ test/node/install_additional_node.sh | 17 ++++ test/node/scenarios.json | 11 +++ test/nvidia-cuda/install_cudnn_nvxt.sh | 15 +++ test/nvidia-cuda/install_cudnn_nvxt_version.sh | 16 +++ test/nvidia-cuda/scenarios.json | 22 +++++ test/php/install_additional_php.sh | 13 +++ test/php/scenarios.json | 11 +++ test/python/install_additional_python.sh | 14 +++ test/python/install_jupyterlab.sh | 16 +++ test/python/install_os_provided_python.sh | 16 +++ test/python/scenarios.json | 31 ++++++ test/ruby/install_additional_ruby.sh | 13 +++ test/ruby/scenarios.json | 11 +++ test/rust/rust_at_pinned_version.sh | 15 +++ test/rust/scenarios.json | 10 ++ 45 files changed, 480 insertions(+), 377 deletions(-) delete mode 100644 .github/workflows/test-scenarios.yaml delete mode 100644 test-scenarios/install_additional_dotnet.sh delete mode 100644 test-scenarios/install_additional_java.sh delete mode 100644 test-scenarios/install_additional_node.sh delete mode 100644 test-scenarios/install_additional_php.sh delete mode 100644 test-scenarios/install_additional_python.sh delete mode 100644 test-scenarios/install_additional_ruby.sh delete mode 100644 test-scenarios/install_cudnn_nvxt.sh delete mode 100644 test-scenarios/install_cudnn_nvxt_version.sh delete mode 100644 test-scenarios/install_dotnet_3.sh delete mode 100644 test-scenarios/install_dotnet_5.sh delete mode 100644 test-scenarios/install_gradle_and_maven.sh delete mode 100644 test-scenarios/install_jupyterlab.sh delete mode 100644 test-scenarios/install_os_provided_python.sh delete mode 100644 test-scenarios/install_python_twice.sh delete mode 100644 test-scenarios/rust_at_pinned_version.sh delete mode 100644 test-scenarios/scenarios.json create mode 100644 test/_global/all_the_clis.sh create mode 100644 test/_global/node_java_rust.sh create mode 100644 test/_global/scenarios.json create mode 100644 test/dotnet/install_additional_dotnet.sh create mode 100644 test/dotnet/install_dotnet_3.sh create mode 100644 test/dotnet/install_dotnet_5.sh create mode 100644 test/dotnet/scenarios.json create mode 100644 test/java/install_additional_java.sh create mode 100644 test/java/install_gradle_and_maven.sh create mode 100644 test/java/scenarios.json create mode 100644 test/node/install_additional_node.sh create mode 100644 test/node/scenarios.json create mode 100644 test/nvidia-cuda/install_cudnn_nvxt.sh create mode 100644 test/nvidia-cuda/install_cudnn_nvxt_version.sh create mode 100644 test/nvidia-cuda/scenarios.json create mode 100644 test/php/install_additional_php.sh create mode 100644 test/php/scenarios.json create mode 100644 test/python/install_additional_python.sh create mode 100644 test/python/install_jupyterlab.sh create mode 100644 test/python/install_os_provided_python.sh create mode 100644 test/python/scenarios.json create mode 100644 test/ruby/install_additional_ruby.sh create mode 100644 test/ruby/scenarios.json create mode 100644 test/rust/rust_at_pinned_version.sh create mode 100644 test/rust/scenarios.json diff --git a/.github/workflows/test-all.yaml b/.github/workflows/test-all.yaml index 6b453f8..621ee83 100644 --- a/.github/workflows/test-all.yaml +++ b/.github/workflows/test-all.yaml @@ -37,13 +37,73 @@ jobs: "rust", "sshd", "terraform", + ] + baseImage: + [ + "ubuntu:focal", + "ubuntu:jammy", + "debian:11", + "mcr.microsoft.com/devcontainers/base:ubuntu", + "mcr.microsoft.com/devcontainers/base:debian", ] - baseImage: [ "ubuntu:focal", "ubuntu:jammy", "debian:11", "mcr.microsoft.com/vscode/devcontainers/base:ubuntu", "mcr.microsoft.com/vscode/devcontainers/base:debian" ] steps: - uses: actions/checkout@v2 - name: "Install latest devcontainer CLI" - run: npm install -g @devcontainers/cli@0.12.1 + run: npm install -g @devcontainers/cli - - name: " Testing '${{ matrix.features }}' against '${{ matrix.baseImage }}'" - run: devcontainer features test -f ${{ matrix.features }} -i ${{ matrix.baseImage }} -c `pwd` + - name: "Generating tests for '${{ matrix.features }}' against '${{ matrix.baseImage }}'" + run: devcontainer features test --skip-scenarios -f ${{ matrix.features }} -i ${{ matrix.baseImage }} . + + test-scenarios: + runs-on: ubuntu-latest + continue-on-error: true + strategy: + matrix: + features: [ + "anaconda", + "aws-cli", + "azure-cli", + "common-utils", + "desktop-lite", + "docker-from-docker", + "docker-in-docker", + "dotnet", + "git", + "git-lfs", + "github-cli", + "go", + "hugo", + "java", + "kubectl-helm-minikube", + "node", + "nvidia-cuda", + "oryx", + "php", + "powershell", + "python", + "ruby", + "rust", + "sshd", + "terraform", + ] + steps: + - uses: actions/checkout@v2 + + - name: "Install latest devcontainer CLI" + run: npm install -g @devcontainers/cli + + - name: "Testing '${{ matrix.features }}' scenarios" + run: devcontainer features test -f ${{ matrix.features }} --skip-autogenerated . + + test-global: + runs-on: ubuntu-latest + continue-on-error: true + steps: + - uses: actions/checkout@v2 + + - name: "Install latest devcontainer CLI" + run: npm install -g @devcontainers/cli + + - name: "Testing global scenarios" + run: devcontainer features test --global-scenarios-only . \ No newline at end of file diff --git a/.github/workflows/test-manual.yaml b/.github/workflows/test-manual.yaml index 3e285a7..333dbb8 100644 --- a/.github/workflows/test-manual.yaml +++ b/.github/workflows/test-manual.yaml @@ -3,7 +3,7 @@ on: workflow_dispatch: inputs: features: - description: "list of features to execute tests against" + description: "List of features to execute tests against" required: true default: "go dotnet" baseImage: @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v2 - name: "Install latest devcontainer CLI" - run: npm install -g @devcontainers/cli@0.12.1 + run: npm install -g @devcontainers/cli - name: "Testing '${{ github.event.inputs.features }}' against '${{ github.event.inputs.baseImage }}'" - run: devcontainer features test --features ${{ github.event.inputs.features }} --base-image ${{ github.event.inputs.baseImage }} --collection-folder `pwd` --log-level ${{ github.event.inputs.logLevel }} + run: devcontainer features test --features ${{ github.event.inputs.features }} --base-image ${{ github.event.inputs.baseImage }} --log-level ${{ github.event.inputs.logLevel }} . diff --git a/.github/workflows/test-pr.yaml b/.github/workflows/test-pr.yaml index 7624701..c8dec8f 100644 --- a/.github/workflows/test-pr.yaml +++ b/.github/workflows/test-pr.yaml @@ -1,4 +1,4 @@ -name: "PR -Test Updated Features" +name: "PR - Test Updated Features" on: pull_request: @@ -50,14 +50,30 @@ jobs: "ubuntu:focal", "ubuntu:jammy", "debian:11", - "mcr.microsoft.com/vscode/devcontainers/base:ubuntu", - "mcr.microsoft.com/vscode/devcontainers/base:debian", + "mcr.microsoft.com/devcontainers/base:ubuntu", + "mcr.microsoft.com/devcontainers/base:debian", ] steps: - uses: actions/checkout@v2 - name: "Install latest devcontainer CLI" - run: npm install -g @devcontainers/cli@0.12.1 + run: npm install -g @devcontainers/cli - - name: "Testing '${{ matrix.features }}' against '${{ matrix.baseImage }}'" - run: devcontainer features test -f ${{ matrix.features }} -i ${{ matrix.baseImage }} -c `pwd` + - name: "Generating tests for '${{ matrix.features }}' against '${{ matrix.baseImage }}'" + run: devcontainer features test --skip-scenarios -f ${{ matrix.features }} -i ${{ matrix.baseImage }} . + + test-scenarios: + needs: [detect-changes] + runs-on: ubuntu-latest + continue-on-error: true + strategy: + matrix: + features: ${{ fromJSON(needs.detect-changes.outputs.features) }} + steps: + - uses: actions/checkout@v2 + + - name: "Install latest devcontainer CLI" + run: npm install -g @devcontainers/cli + + - name: "Testing '${{ matrix.features }}' scenarios" + run: devcontainer features test -f ${{ matrix.features }} --skip-autogenerated . \ No newline at end of file diff --git a/.github/workflows/test-scenarios.yaml b/.github/workflows/test-scenarios.yaml deleted file mode 100644 index cc71737..0000000 --- a/.github/workflows/test-scenarios.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: "Test Scenarios" -on: - pull_request: - push: - branches: - - main - workflow_dispatch: - -jobs: - scenarios: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: "Install latest devcontainer CLI" - run: npm install -g @devcontainers/cli@0.12.1 - - - name: "Running predefined test scenarios" - run: devcontainer features test --scenarios `pwd`/test-scenarios -c `pwd` diff --git a/test-scenarios/install_additional_dotnet.sh b/test-scenarios/install_additional_dotnet.sh deleted file mode 100644 index fdb2da7..0000000 --- a/test-scenarios/install_additional_dotnet.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -set -e - -# Optional: Import test library -source dev-container-features-test-lib - -check "dotnet version 6.0.301 installed as default" dotnet --version | grep 6.0.301 -check "dotnet version 5.0 installed" ls -l /usr/local/dotnet | grep 5.0 -check "dotnet version 3.1.420 installed" ls -l /usr/local/dotnet | grep 3.1.420 - -# Report result -reportResults diff --git a/test-scenarios/install_additional_java.sh b/test-scenarios/install_additional_java.sh deleted file mode 100644 index a796fee..0000000 --- a/test-scenarios/install_additional_java.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -set -e - -# Optional: Import test library -source dev-container-features-test-lib - -check "java version 17 installed as default" java --version | grep 17 -check "java version 11 installed" ls /usr/local/sdkman/candidates/java | grep 11 -check "java version 8 installed" ls /usr/local/sdkman/candidates/java | grep 8 - -# Report result -reportResults diff --git a/test-scenarios/install_additional_node.sh b/test-scenarios/install_additional_node.sh deleted file mode 100644 index 83dae86..0000000 --- a/test-scenarios/install_additional_node.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -set -e - -# Optional: Import test library -source dev-container-features-test-lib - -# 'latest' is some version of node 18 for a while. -check "version_on_path" node -v | grep 18 - -check "v18_installed" ls -1 /usr/local/share/nvm/versions/node | grep 18 -check "v14_installed" ls -1 /usr/local/share/nvm/versions/node | grep 14.19.3 -check "v17_installed" ls -1 /usr/local/share/nvm/versions/node | grep 17.9.1 - - -# Report result -reportResults diff --git a/test-scenarios/install_additional_php.sh b/test-scenarios/install_additional_php.sh deleted file mode 100644 index 590187a..0000000 --- a/test-scenarios/install_additional_php.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -set -e - -# Optional: Import test library -source dev-container-features-test-lib - -check "php version 8.1.4 installed as default" php --version | grep 8.1.4 -check "php version 8.0.17 installed" ls -l /usr/local/php | grep 8.0.17 -check "php version 8.0.3 installed" ls -l /usr/local/php | grep 8.0.3 - -# Report result -reportResults diff --git a/test-scenarios/install_additional_python.sh b/test-scenarios/install_additional_python.sh deleted file mode 100644 index b0393d3..0000000 --- a/test-scenarios/install_additional_python.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -set -e - -# Optional: Import test library -source dev-container-features-test-lib - -check "python version 3.10.5 installed as default" python --version | grep 3.10.5 -check "python3 version 3.10.5 installed as default" python3 --version | grep 3.10.5 -check "python version 3.8.13 installed" ls -l /usr/local/python | grep 3.8.13 -check "python version 3.9.13 installed" ls -l /usr/local/python | grep 3.9.13 - -# Report result -reportResults diff --git a/test-scenarios/install_additional_ruby.sh b/test-scenarios/install_additional_ruby.sh deleted file mode 100644 index 3e76159..0000000 --- a/test-scenarios/install_additional_ruby.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -set -e - -# Optional: Import test library -source dev-container-features-test-lib - -check "ruby version 3.1.2 installed as default" ruby -v | grep 3.1.2 -check "ruby version 2.5.9 installed" rvm list | grep 2.5.9 -check "ruby version 3.0.4 installed" rvm list | grep 3.0.4 - -# Report result -reportResults diff --git a/test-scenarios/install_cudnn_nvxt.sh b/test-scenarios/install_cudnn_nvxt.sh deleted file mode 100644 index 7b20f43..0000000 --- a/test-scenarios/install_cudnn_nvxt.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -set -e - -# Optional: Import test library -source dev-container-features-test-lib - -# Check installation of libcudnn8 -check "libcudnn.so.8" test 1 -eq "$(find /usr -name 'libcudnn.so.8' | wc -l)" - -# Check installation of cuda-nvtx-11- -check "cuda-11+nvtx" test -e '/usr/local/cuda-11/targets/x86_64-linux/include/nvtx3' - -# Report result -reportResults diff --git a/test-scenarios/install_cudnn_nvxt_version.sh b/test-scenarios/install_cudnn_nvxt_version.sh deleted file mode 100644 index a7f46bd..0000000 --- a/test-scenarios/install_cudnn_nvxt_version.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -set -e - -# Optional: Import test library -source dev-container-features-test-lib - -# Check installation of libcudnn8 (8.3.2) -check "libcudnn.so.8.3.2" test 1 -eq "$(find /usr -name 'libcudnn.so.8.3.2' | wc -l)" - -# Check installation of cuda-nvtx-11-5 (11.5) -check "cuda-11-5+nvtx" test -e '/usr/local/cuda-11.5/targets/x86_64-linux/include/nvtx3' - -# Report result -reportResults - \ No newline at end of file diff --git a/test-scenarios/install_dotnet_3.sh b/test-scenarios/install_dotnet_3.sh deleted file mode 100644 index 0d05215..0000000 --- a/test-scenarios/install_dotnet_3.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -set -e - -# Optional: Import test library -source dev-container-features-test-lib - -check "dotnet sdks" dotnet --list-sdks -check "some major version of dotnet 3 is installed" dotnet --list-sdks | grep '3\.[0-9]*\.[0-9]*' -check "dotnet version 3 installed" ls -l /usr/share/dotnet/sdk | grep '3\.[0-9]*\.[0-9]*' - -# Report result -reportResults diff --git a/test-scenarios/install_dotnet_5.sh b/test-scenarios/install_dotnet_5.sh deleted file mode 100644 index 5f48eb1..0000000 --- a/test-scenarios/install_dotnet_5.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -set -e - -# Optional: Import test library -source dev-container-features-test-lib - -check "dotnet sdks" dotnet --list-sdks -check "some major version of dotnet 5 is installed" dotnet --list-sdks | grep '5\.[0-9]*\.[0-9]*' -check "dotnet version 5 installed" ls -l /usr/share/dotnet/sdk | grep '5\.[0-9]*\.[0-9]*' - - -# Report result -reportResults diff --git a/test-scenarios/install_gradle_and_maven.sh b/test-scenarios/install_gradle_and_maven.sh deleted file mode 100644 index a81dd9e..0000000 --- a/test-scenarios/install_gradle_and_maven.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -set -e - -# Optional: Import test library -source dev-container-features-test-lib - -check "java" java --version -check "gradle" gradle --version -check "maven" mvn --version - -# Report result -reportResults diff --git a/test-scenarios/install_jupyterlab.sh b/test-scenarios/install_jupyterlab.sh deleted file mode 100644 index 9c5e453..0000000 --- a/test-scenarios/install_jupyterlab.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -set -e - -# Optional: Import test library -source dev-container-features-test-lib - -check "version" jupyter lab --version -check "config" grep ".*.allow_origin = '*'" /home/vscode/.jupyter/jupyter_notebook_config.py - -check "user" whoami | grep vscode -check "zsh" zsh --version -check "wget" wget -V - -# Report result -reportResults diff --git a/test-scenarios/install_os_provided_python.sh b/test-scenarios/install_os_provided_python.sh deleted file mode 100644 index 4dba59d..0000000 --- a/test-scenarios/install_os_provided_python.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -set -e - -# Optional: Import test library -source dev-container-features-test-lib - -check "python3 is installed" python3 --version -check "python is installed" python --version -check "pip is installed" pip --version -check "pip is installed" pip3 --version - -check "node is installed" node --version - -# Report result -reportResults diff --git a/test-scenarios/install_python_twice.sh b/test-scenarios/install_python_twice.sh deleted file mode 100644 index 911ee54..0000000 --- a/test-scenarios/install_python_twice.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -set -e - -# Optional: Import test library -source dev-container-features-test-lib - -check "version 3.9 installed" ls -1 /usr/local/python/ | grep 3.9 -check "version 3.8 installed" ls -1 /usr/local/python/ | grep 3.8 - -check "3.9 alias to python on path" python --version | grep 3.9 - -# Report result -reportResults diff --git a/test-scenarios/rust_at_pinned_version.sh b/test-scenarios/rust_at_pinned_version.sh deleted file mode 100644 index 2954a7a..0000000 --- a/test-scenarios/rust_at_pinned_version.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -set -e - -# Optional: Import test library -source dev-container-features-test-lib - -# Definition specific tests -check "cargo version" cargo --version -check "rustc version" rustc --version -check "correct rust version" rustc --version | grep 1.62.0 - - -# Report result -reportResults \ No newline at end of file diff --git a/test-scenarios/scenarios.json b/test-scenarios/scenarios.json deleted file mode 100644 index ddf15d0..0000000 --- a/test-scenarios/scenarios.json +++ /dev/null @@ -1,130 +0,0 @@ -{ - "install_os_provided_python": { - "image": "mcr.microsoft.com/devcontainers/base:0-bullseye", - "features": { - "node": "latest", - "python": "os-provided" - } - }, - "install_gradle_and_maven": { - "image": "ubuntu:focal", - "features": { - "java": { - "version": "latest", - "installGradle": true, - "installMaven": true - } - } - }, - "install_additional_php": { - "image": "ubuntu:focal", - "features": { - "php": { - "version": "8.1.4", - "additionalVersions": "8.0.17,8.0.3" - } - } - }, - "install_additional_java": { - "image": "ubuntu:focal", - "features": { - "java": { - "version": "17", - "additionalVersions": "11,8" - } - } - }, - "install_jupyterlab": { - "image": "mcr.microsoft.com/devcontainers/base:focal", - "remoteUser": "vscode", - "features": { - "common-utils": { - "username": "vscode" - }, - "python": { - "installJupyterlab": true, - "configureJupyterlabAllowOrigin": "*" - } - } - }, - "install_additional_node": { - "image": "debian:11", - "features": { - "node": { - "version": "latest", - "additionalVersions": "v17.9.1,v14.19.3" - } - } - }, - "install_additional_python": { - "image": "ubuntu:focal", - "features": { - "python": { - "version": "3.10.5", - "additionalVersions": "3.8,3.9.13" - } - } - }, - "install_additional_ruby": { - "image": "ubuntu:focal", - "features": { - "ruby": { - "version": "3.1.2", - "additionalVersions": "2.5,3.0.4" - } - } - }, - "install_additional_dotnet": { - "image": "ubuntu:focal", - "features": { - "dotnet": { - "version": "6.0.301", - "additionalVersions": "5.0,3.1.420" - } - } - }, - "install_dotnet_5": { - "image": "ubuntu:focal", - "features": { - "dotnet": { - "version": "5" - } - } - }, - "install_dotnet_3": { - "image": "ubuntu:focal", - "features": { - "dotnet": { - "version": "3" - } - } - }, - "rust_at_pinned_version": { - "image": "ubuntu:focal", - "features": { - "rust": { - "version": "1.62.0" - } - } - }, - "install_cudnn_nvxt": { - "image": "debian", - "features": { - "nvidia-cuda": { - "installCudnn": true, - "installNvtx": true - } - } - }, - "install_cudnn_nvxt_version": { - "image": "debian", - "features": { - "nvidia-cuda": { - "installCudnn": true, - "installNvtx": true, - "cudaVersion": "11.5", - "cudnnVersion": "8.3.2.44" - } - } - } -} \ No newline at end of file diff --git a/test/_global/all_the_clis.sh b/test/_global/all_the_clis.sh new file mode 100644 index 0000000..71171c1 --- /dev/null +++ b/test/_global/all_the_clis.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +check "check for aws" aws --version +check "check for gh" gh --version +check "check for azure" az --version + +# Report result +reportResults \ No newline at end of file diff --git a/test/_global/node_java_rust.sh b/test/_global/node_java_rust.sh new file mode 100644 index 0000000..5d05729 --- /dev/null +++ b/test/_global/node_java_rust.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +check "check for node" node --version +check "check for java" java --version +check "check for rust" rustc --version + +# Report result +reportResults \ No newline at end of file diff --git a/test/_global/scenarios.json b/test/_global/scenarios.json new file mode 100644 index 0000000..2228c7d --- /dev/null +++ b/test/_global/scenarios.json @@ -0,0 +1,18 @@ +{ + "all_the_clis": { + "image": "ubuntu:focal", + "features": { + "aws-cli": {}, + "azure-cli": {}, + "github-cli": {} + } + }, + "node_java_rust": { + "image": "ubuntu:focal", + "features": { + "node": {}, + "java": {}, + "rust": {} + } + } +} \ No newline at end of file diff --git a/test/dotnet/install_additional_dotnet.sh b/test/dotnet/install_additional_dotnet.sh new file mode 100644 index 0000000..fdb2da7 --- /dev/null +++ b/test/dotnet/install_additional_dotnet.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +check "dotnet version 6.0.301 installed as default" dotnet --version | grep 6.0.301 +check "dotnet version 5.0 installed" ls -l /usr/local/dotnet | grep 5.0 +check "dotnet version 3.1.420 installed" ls -l /usr/local/dotnet | grep 3.1.420 + +# Report result +reportResults diff --git a/test/dotnet/install_dotnet_3.sh b/test/dotnet/install_dotnet_3.sh new file mode 100644 index 0000000..0d05215 --- /dev/null +++ b/test/dotnet/install_dotnet_3.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +check "dotnet sdks" dotnet --list-sdks +check "some major version of dotnet 3 is installed" dotnet --list-sdks | grep '3\.[0-9]*\.[0-9]*' +check "dotnet version 3 installed" ls -l /usr/share/dotnet/sdk | grep '3\.[0-9]*\.[0-9]*' + +# Report result +reportResults diff --git a/test/dotnet/install_dotnet_5.sh b/test/dotnet/install_dotnet_5.sh new file mode 100644 index 0000000..5f48eb1 --- /dev/null +++ b/test/dotnet/install_dotnet_5.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +check "dotnet sdks" dotnet --list-sdks +check "some major version of dotnet 5 is installed" dotnet --list-sdks | grep '5\.[0-9]*\.[0-9]*' +check "dotnet version 5 installed" ls -l /usr/share/dotnet/sdk | grep '5\.[0-9]*\.[0-9]*' + + +# Report result +reportResults diff --git a/test/dotnet/scenarios.json b/test/dotnet/scenarios.json new file mode 100644 index 0000000..edf4a75 --- /dev/null +++ b/test/dotnet/scenarios.json @@ -0,0 +1,27 @@ +{ + "install_additional_dotnet": { + "image": "ubuntu:focal", + "features": { + "dotnet": { + "version": "6.0.301", + "additionalVersions": "5.0,3.1.420" + } + } + }, + "install_dotnet_3": { + "image": "ubuntu:focal", + "features": { + "dotnet": { + "version": "3" + } + } + }, + "install_dotnet_5": { + "image": "ubuntu:focal", + "features": { + "dotnet": { + "version": "5" + } + } + } +} \ No newline at end of file diff --git a/test/java/install_additional_java.sh b/test/java/install_additional_java.sh new file mode 100644 index 0000000..a796fee --- /dev/null +++ b/test/java/install_additional_java.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +check "java version 17 installed as default" java --version | grep 17 +check "java version 11 installed" ls /usr/local/sdkman/candidates/java | grep 11 +check "java version 8 installed" ls /usr/local/sdkman/candidates/java | grep 8 + +# Report result +reportResults diff --git a/test/java/install_gradle_and_maven.sh b/test/java/install_gradle_and_maven.sh new file mode 100644 index 0000000..a81dd9e --- /dev/null +++ b/test/java/install_gradle_and_maven.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +check "java" java --version +check "gradle" gradle --version +check "maven" mvn --version + +# Report result +reportResults diff --git a/test/java/scenarios.json b/test/java/scenarios.json new file mode 100644 index 0000000..659a857 --- /dev/null +++ b/test/java/scenarios.json @@ -0,0 +1,21 @@ +{ + "install_additional_java": { + "image": "ubuntu:focal", + "features": { + "java": { + "version": "17", + "additionalVersions": "11,8" + } + } + }, + "install_gradle_and_maven": { + "image": "ubuntu:focal", + "features": { + "java": { + "version": "latest", + "installGradle": true, + "installMaven": true + } + } + } +} \ No newline at end of file diff --git a/test/node/install_additional_node.sh b/test/node/install_additional_node.sh new file mode 100644 index 0000000..83dae86 --- /dev/null +++ b/test/node/install_additional_node.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# 'latest' is some version of node 18 for a while. +check "version_on_path" node -v | grep 18 + +check "v18_installed" ls -1 /usr/local/share/nvm/versions/node | grep 18 +check "v14_installed" ls -1 /usr/local/share/nvm/versions/node | grep 14.19.3 +check "v17_installed" ls -1 /usr/local/share/nvm/versions/node | grep 17.9.1 + + +# Report result +reportResults diff --git a/test/node/scenarios.json b/test/node/scenarios.json new file mode 100644 index 0000000..845c892 --- /dev/null +++ b/test/node/scenarios.json @@ -0,0 +1,11 @@ +{ + "install_additional_node": { + "image": "debian:11", + "features": { + "node": { + "version": "latest", + "additionalVersions": "v17.9.1,v14.19.3" + } + } + } +} \ No newline at end of file diff --git a/test/nvidia-cuda/install_cudnn_nvxt.sh b/test/nvidia-cuda/install_cudnn_nvxt.sh new file mode 100644 index 0000000..7b20f43 --- /dev/null +++ b/test/nvidia-cuda/install_cudnn_nvxt.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Check installation of libcudnn8 +check "libcudnn.so.8" test 1 -eq "$(find /usr -name 'libcudnn.so.8' | wc -l)" + +# Check installation of cuda-nvtx-11- +check "cuda-11+nvtx" test -e '/usr/local/cuda-11/targets/x86_64-linux/include/nvtx3' + +# Report result +reportResults diff --git a/test/nvidia-cuda/install_cudnn_nvxt_version.sh b/test/nvidia-cuda/install_cudnn_nvxt_version.sh new file mode 100644 index 0000000..a7f46bd --- /dev/null +++ b/test/nvidia-cuda/install_cudnn_nvxt_version.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Check installation of libcudnn8 (8.3.2) +check "libcudnn.so.8.3.2" test 1 -eq "$(find /usr -name 'libcudnn.so.8.3.2' | wc -l)" + +# Check installation of cuda-nvtx-11-5 (11.5) +check "cuda-11-5+nvtx" test -e '/usr/local/cuda-11.5/targets/x86_64-linux/include/nvtx3' + +# Report result +reportResults + \ No newline at end of file diff --git a/test/nvidia-cuda/scenarios.json b/test/nvidia-cuda/scenarios.json new file mode 100644 index 0000000..1993dcd --- /dev/null +++ b/test/nvidia-cuda/scenarios.json @@ -0,0 +1,22 @@ +{ + "install_cudnn_nvxt": { + "image": "debian", + "features": { + "nvidia-cuda": { + "installCudnn": true, + "installNvtx": true + } + } + }, + "install_cudnn_nvxt_version": { + "image": "debian", + "features": { + "nvidia-cuda": { + "installCudnn": true, + "installNvtx": true, + "cudaVersion": "11.5", + "cudnnVersion": "8.3.2.44" + } + } + } +} \ No newline at end of file diff --git a/test/php/install_additional_php.sh b/test/php/install_additional_php.sh new file mode 100644 index 0000000..590187a --- /dev/null +++ b/test/php/install_additional_php.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +check "php version 8.1.4 installed as default" php --version | grep 8.1.4 +check "php version 8.0.17 installed" ls -l /usr/local/php | grep 8.0.17 +check "php version 8.0.3 installed" ls -l /usr/local/php | grep 8.0.3 + +# Report result +reportResults diff --git a/test/php/scenarios.json b/test/php/scenarios.json new file mode 100644 index 0000000..f24753b --- /dev/null +++ b/test/php/scenarios.json @@ -0,0 +1,11 @@ +{ + "install_additional_php": { + "image": "ubuntu:focal", + "features": { + "php": { + "version": "8.1.4", + "additionalVersions": "8.0.17,8.0.3" + } + } + } +} \ No newline at end of file diff --git a/test/python/install_additional_python.sh b/test/python/install_additional_python.sh new file mode 100644 index 0000000..b0393d3 --- /dev/null +++ b/test/python/install_additional_python.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +check "python version 3.10.5 installed as default" python --version | grep 3.10.5 +check "python3 version 3.10.5 installed as default" python3 --version | grep 3.10.5 +check "python version 3.8.13 installed" ls -l /usr/local/python | grep 3.8.13 +check "python version 3.9.13 installed" ls -l /usr/local/python | grep 3.9.13 + +# Report result +reportResults diff --git a/test/python/install_jupyterlab.sh b/test/python/install_jupyterlab.sh new file mode 100644 index 0000000..9c5e453 --- /dev/null +++ b/test/python/install_jupyterlab.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +check "version" jupyter lab --version +check "config" grep ".*.allow_origin = '*'" /home/vscode/.jupyter/jupyter_notebook_config.py + +check "user" whoami | grep vscode +check "zsh" zsh --version +check "wget" wget -V + +# Report result +reportResults diff --git a/test/python/install_os_provided_python.sh b/test/python/install_os_provided_python.sh new file mode 100644 index 0000000..50a617e --- /dev/null +++ b/test/python/install_os_provided_python.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +check "python3 is installed" python3 --version +check "python is installed" python --version +check "pip is installed" pip --version +check "pip is installed" pip3 --version + +check "node is installed" node --version + +# Report result +reportResults \ No newline at end of file diff --git a/test/python/scenarios.json b/test/python/scenarios.json new file mode 100644 index 0000000..2aa246f --- /dev/null +++ b/test/python/scenarios.json @@ -0,0 +1,31 @@ +{ + "install_additional_python": { + "image": "ubuntu:focal", + "features": { + "python": { + "version": "3.10.5", + "additionalVersions": "3.8,3.9.13" + } + } + }, + "install_jupyterlab": { + "image": "mcr.microsoft.com/vscode/devcontainers/base:focal", + "remoteUser": "vscode", + "features": { + "common-utils": { + "username": "vscode" + }, + "python": { + "installJupyterlab": true, + "configureJupyterlabAllowOrigin": "*" + } + } + }, + "install_os_provided_python": { + "image": "mcr.microsoft.com/devcontainers/base:0-bullseye", + "features": { + "node": "latest", + "python": "os-provided" + } + } +} \ No newline at end of file diff --git a/test/ruby/install_additional_ruby.sh b/test/ruby/install_additional_ruby.sh new file mode 100644 index 0000000..3e76159 --- /dev/null +++ b/test/ruby/install_additional_ruby.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +check "ruby version 3.1.2 installed as default" ruby -v | grep 3.1.2 +check "ruby version 2.5.9 installed" rvm list | grep 2.5.9 +check "ruby version 3.0.4 installed" rvm list | grep 3.0.4 + +# Report result +reportResults diff --git a/test/ruby/scenarios.json b/test/ruby/scenarios.json new file mode 100644 index 0000000..9f88d9e --- /dev/null +++ b/test/ruby/scenarios.json @@ -0,0 +1,11 @@ +{ + "install_additional_ruby": { + "image": "ubuntu:focal", + "features": { + "ruby": { + "version": "3.1.2", + "additionalVersions": "2.5,3.0.4" + } + } + } +} \ No newline at end of file diff --git a/test/rust/rust_at_pinned_version.sh b/test/rust/rust_at_pinned_version.sh new file mode 100644 index 0000000..2954a7a --- /dev/null +++ b/test/rust/rust_at_pinned_version.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +check "cargo version" cargo --version +check "rustc version" rustc --version +check "correct rust version" rustc --version | grep 1.62.0 + + +# Report result +reportResults \ No newline at end of file diff --git a/test/rust/scenarios.json b/test/rust/scenarios.json new file mode 100644 index 0000000..4a2d540 --- /dev/null +++ b/test/rust/scenarios.json @@ -0,0 +1,10 @@ +{ + "rust_at_pinned_version": { + "image": "ubuntu:focal", + "features": { + "rust": { + "version": "1.62.0" + } + } + } +} \ No newline at end of file -- cgit v1.2.3