diff --git a/src/common-utils/devcontainer-feature.json b/src/common-utils/devcontainer-feature.json index 329f8dec8..44f9b32b4 100644 --- a/src/common-utils/devcontainer-feature.json +++ b/src/common-utils/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "common-utils", - "version": "2.3.1", + "version": "2.4.1", "name": "Common Utilities", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/common-utils", "description": "Installs a set of common command line utilities, Oh My Zsh!, and sets up a non-root user.", @@ -66,4 +66,4 @@ "description": "Add packages from non-free Debian repository? (Debian only)" } } -} +} \ No newline at end of file diff --git a/src/common-utils/main.sh b/src/common-utils/main.sh index 2e0231de1..376dde623 100644 --- a/src/common-utils/main.sh +++ b/src/common-utils/main.sh @@ -48,6 +48,7 @@ install_debian_packages() { ca-certificates \ unzip \ bzip2 \ + xz-utils \ zip \ nano \ vim-tiny \ @@ -154,9 +155,12 @@ install_debian_packages() { install_redhat_packages() { local package_list="" local remove_epel="false" - local install_cmd=dnf - if ! type dnf > /dev/null 2>&1; then - install_cmd=yum + local install_cmd=microdnf + if ! type microdnf > /dev/null 2>&1; then + install_cmd=dnf + if ! type dnf > /dev/null 2>&1; then + install_cmd=yum + fi fi if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then @@ -173,6 +177,7 @@ install_redhat_packages() { ca-certificates \ rsync \ unzip \ + xz \ zip \ nano \ vim-minimal \ @@ -256,6 +261,7 @@ install_alpine_packages() { rsync \ ca-certificates \ unzip \ + xz \ zip \ nano \ vim \ @@ -265,7 +271,6 @@ install_alpine_packages() { libstdc++ \ krb5-libs \ libintl \ - libssl1.1 \ lttng-ust \ tzdata \ userspace-rcu \ @@ -279,6 +284,12 @@ install_alpine_packages() { shadow \ strace + # # Include libssl1.1 if available (not available for 3.19 and newer) + LIBSSL1_PKG=libssl1.1 + if [[ $(apk search --no-cache -a $LIBSSL1_PKG | grep $LIBSSL1_PKG) ]]; then + apk add --no-cache $LIBSSL1_PKG + fi + # Install man pages - package name varies between 3.12 and earlier versions if apk info man > /dev/null 2>&1; then apk add --no-cache man man-pages diff --git a/src/docker-outside-of-docker/devcontainer-feature.json b/src/docker-outside-of-docker/devcontainer-feature.json index b82fc6d8b..4e5eae721 100644 --- a/src/docker-outside-of-docker/devcontainer-feature.json +++ b/src/docker-outside-of-docker/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "docker-outside-of-docker", - "version": "1.3.1", + "version": "1.3.2", "name": "Docker (docker-outside-of-docker)", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/docker-outside-of-docker", "description": "Re-use the host docker socket, adding the Docker CLI to a container. Feature invokes a script to enable using a forwarded Docker socket within a container to run Docker commands.", diff --git a/src/docker-outside-of-docker/install.sh b/src/docker-outside-of-docker/install.sh index 3c0520698..901dd7870 100755 --- a/src/docker-outside-of-docker/install.sh +++ b/src/docker-outside-of-docker/install.sh @@ -329,7 +329,7 @@ if [ "${ENABLE_NONROOT_DOCKER}" = "true" ] && [ "${SOURCE_SOCKET}" != "${TARGET_ log "Enabling socket proxy." log "Proxying ${SOURCE_SOCKET} to ${TARGET_SOCKET} for vscode" sudoIf rm -rf ${TARGET_SOCKET} - (sudoIf socat UNIX-LISTEN:${TARGET_SOCKET},fork,mode=660,user=${USERNAME} UNIX-CONNECT:${SOURCE_SOCKET} 2>&1 | sudoIf tee -a \${SOCAT_LOG} > /dev/null & echo "\$!" | sudoIf tee \${SOCAT_PID} > /dev/null) + (sudoIf socat UNIX-LISTEN:${TARGET_SOCKET},fork,mode=660,user=${USERNAME},backlog=128 UNIX-CONNECT:${SOURCE_SOCKET} 2>&1 | sudoIf tee -a \${SOCAT_LOG} > /dev/null & echo "\$!" | sudoIf tee \${SOCAT_PID} > /dev/null) else log "Socket proxy already running." fi diff --git a/src/dotnet/devcontainer-feature.json b/src/dotnet/devcontainer-feature.json index b9c7260ea..7abfc2d30 100644 --- a/src/dotnet/devcontainer-feature.json +++ b/src/dotnet/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "dotnet", - "version": "2.0.2", + "version": "2.0.3", "name": "Dotnet CLI", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/dotnet", "description": "This Feature installs the latest .NET SDK, which includes the .NET CLI and the shared runtime. Options are provided to choose a different version or additional versions.", diff --git a/src/dotnet/scripts/vendor/dotnet-install.sh b/src/dotnet/scripts/vendor/dotnet-install.sh index b350ad4e1..86a2d0bad 100755 --- a/src/dotnet/scripts/vendor/dotnet-install.sh +++ b/src/dotnet/scripts/vendor/dotnet-install.sh @@ -1708,7 +1708,11 @@ do -?|--?|-h|--help|-[Hh]elp) script_name="$(basename "$0")" echo ".NET Tools Installer" - echo "Usage: $script_name [-c|--channel ] [-v|--version ] [-p|--prefix ]" + echo "Usage:" + echo " # Install a .NET SDK of a given Quality from a given Channel" + echo " $script_name [-c|--channel ] [-q|--quality ]" + echo " # Install a .NET SDK of a specific public version" + echo " $script_name [-v|--version ]" echo " $script_name -h|-?|--help" echo "" echo "$script_name is a simple command line interface for obtaining dotnet cli." diff --git a/src/java/README.md b/src/java/README.md index 1ffd6188b..4699eb517 100644 --- a/src/java/README.md +++ b/src/java/README.md @@ -23,6 +23,8 @@ Installs Java, SDKMAN! (if not installed), and needed dependencies. | mavenVersion | Select or enter a Maven version | string | latest | | installAnt | Install Ant, a software tool for automating software build processes | boolean | false | | antVersion | Select or enter an Ant version | string | latest | +| installGroovy | Install Groovy, powerful, optionally typed and dynamic language with static-typing and static compilation capabilities | boolean | false | +| groovyVersion | Select or enter a Groovy version | string | latest | ## Customizations diff --git a/src/java/devcontainer-feature.json b/src/java/devcontainer-feature.json index d4aede873..64a4ca932 100644 --- a/src/java/devcontainer-feature.json +++ b/src/java/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "java", - "version": "1.2.2", + "version": "1.3.0", "name": "Java (via SDKMAN!)", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/java", "description": "Installs Java, SDKMAN! (if not installed), and needed dependencies.", @@ -23,7 +23,8 @@ "ms", "open", "oracle", - "tem" + "tem", + "amzn" ], "default": "ms", "description": "Select or enter a JDK distribution" @@ -74,6 +75,22 @@ ], "default": "latest", "description": "Select or enter an Ant version" + }, + "installGroovy": { + "type": "boolean", + "default": false, + "description": "Install Groovy, powerful, optionally typed and dynamic language with static-typing and static compilation capabilities" + }, + "groovyVersion": { + "type": "string", + "proposals": [ + "latest", + "2.5.22", + "3.0.19", + "4.0.16" + ], + "default": "latest", + "description": "Select or enter a Groovy version" } }, "customizations": { @@ -92,6 +109,6 @@ "PATH": "/usr/local/sdkman/bin:/usr/local/sdkman/candidates/java/current/bin:/usr/local/sdkman/candidates/gradle/current/bin:/usr/local/sdkman/candidates/maven/current/bin:/usr/local/sdkman/candidates/ant/current/bin:${PATH}" }, "installsAfter": [ - "ghcr.io/devcontainers/features/common-utils" + "ghcr.io/devcontainers/features/common-utils" ] } diff --git a/src/java/install.sh b/src/java/install.sh index 2decc31b5..16bbb1c66 100644 --- a/src/java/install.sh +++ b/src/java/install.sh @@ -16,6 +16,8 @@ INSTALL_MAVEN="${INSTALLMAVEN:-"false"}" MAVEN_VERSION="${MAVENVERSION:-"latest"}" INSTALL_ANT="${INSTALLANT:-"false"}" ANT_VERSION="${ANTVERSION:-"latest"}" +INSTALL_GROOVY="${INSTALLGROOVY:-"false"}" +GROOVY_VERSION="${GROOVYVERSION:-"latest"}" JDK_DISTRO="${JDKDISTRO}" export SDKMAN_DIR="${SDKMAN_DIR:-"/usr/local/sdkman"}" @@ -190,6 +192,11 @@ if [[ "${INSTALL_MAVEN}" = "true" ]] && ! mvn --version > /dev/null; then sdk_install maven ${MAVEN_VERSION} fi +# Install Groovy +if [[ "${INSTALL_GROOVY}" = "true" ]] && ! groovy --version > /dev/null; then + sdk_install groovy "${GROOVY_VERSION}" +fi + # Clean up rm -rf /var/lib/apt/lists/* diff --git a/src/kubectl-helm-minikube/devcontainer-feature.json b/src/kubectl-helm-minikube/devcontainer-feature.json index 4206772b2..fa8ea6138 100644 --- a/src/kubectl-helm-minikube/devcontainer-feature.json +++ b/src/kubectl-helm-minikube/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "kubectl-helm-minikube", - "version": "1.1.5", + "version": "1.1.6", "name": "Kubectl, Helm, and Minikube", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/kubectl-helm-minikube", "description": "Installs latest version of kubectl, Helm, and optionally minikube. Auto-detects latest versions and installs needed dependencies.", diff --git a/src/kubectl-helm-minikube/install.sh b/src/kubectl-helm-minikube/install.sh index 35444c5dc..5deb377c3 100755 --- a/src/kubectl-helm-minikube/install.sh +++ b/src/kubectl-helm-minikube/install.sh @@ -148,7 +148,7 @@ if [ ${KUBECTL_VERSION} != "none" ]; then kubectl completion bash > /etc/bash_completion.d/kubectl # kubectl zsh completion - if [ -e "${USERHOME}}/.oh-my-zsh" ]; then + if [ -e "${USERHOME}/.oh-my-zsh" ]; then mkdir -p "${USERHOME}/.oh-my-zsh/completions" kubectl completion zsh > "${USERHOME}/.oh-my-zsh/completions/_kubectl" chown -R "${USERNAME}" "${USERHOME}/.oh-my-zsh" diff --git a/src/nix/README.md b/src/nix/README.md index 3ab9b0017..4fd9700f3 100644 --- a/src/nix/README.md +++ b/src/nix/README.md @@ -18,6 +18,7 @@ Installs the Nix package manager and optionally a set of packages. | version | Version of Nix to install. | string | latest | | multiUser | Perform a multi-user install (instead of single user) | boolean | true | | packages | Optional comma separated list of Nix packages to install in profile. | string | - | +| useAttributePath | Enable this option to use exact attribute path of the package in the Nixpkgs repository, aligning with the nix-env -iA command. | boolean | false | | flakeUri | Optional URI to a Nix Flake to install in profile. | string | - | | extraNixConfig | Optional comma separated list of extra lines to add to /etc/nix/nix.conf. | string | - | diff --git a/src/nix/devcontainer-feature.json b/src/nix/devcontainer-feature.json index 96a75016b..0e37efed2 100644 --- a/src/nix/devcontainer-feature.json +++ b/src/nix/devcontainer-feature.json @@ -1,9 +1,9 @@ { "id": "nix", - "version": "1.1.3", + "version": "1.2.0", "name": "Nix Package Manager", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/nix", - "description": "Installs the Nix package manager and optionally a set of packages.", + "description": "Installs the Nix package manager and optionally a set of packages.", "options": { "version": { "type": "string", @@ -21,6 +21,11 @@ "default": "", "description": "Optional comma separated list of Nix packages to install in profile." }, + "useAttributePath": { + "type": "boolean", + "default": false, + "description": "Enable this option to use exact attribute path of the package in the Nixpkgs repository, aligning with the nix-env -iA command." + }, "flakeUri": { "type": "string", "default": "", @@ -39,4 +44,4 @@ "PATH": "/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:${PATH}" }, "entrypoint": "/usr/local/share/nix-entrypoint.sh" -} \ No newline at end of file +} diff --git a/src/nix/install.sh b/src/nix/install.sh index ed048fe8d..5b8fe8f28 100755 --- a/src/nix/install.sh +++ b/src/nix/install.sh @@ -8,6 +8,7 @@ cd "${FEATURE_DIR}" VERSION="${VERSION:-"latest"}" MULTIUSER="${MULTIUSER:-"true"}" PACKAGES="${PACKAGES//,/ }" +USEATTRIBUTEPATH="${USEATTRIBUTEPATH:-"false"}" FLAKEURI="${FLAKEURI:-""}" EXTRANIXCONFIG="${EXTRANIXCONFIG:-""}" USERNAME="${USERNAME:-"${_REMOTE_USER:-"automatic"}"}" @@ -68,7 +69,7 @@ else exit 1 fi echo "(*) Performing single-user install..." - echo -e "\n**NOTE: Nix will only work for user ${USERNAME} on Linux if the host machine user's UID is $(id -u ${USERNAME}). You will need to chown /nix otherwise.**\n" + echo -e "\n**NOTE: Nix will only work for user ${USERNAME} on Linux if the host machine user's UID is $(id -u ${USERNAME}). You will need to chown /nix otherwise.**\n" # Install per https://nixos.org/manual/nix/stable/installation/installing-binary.html#single-user-installation mkdir -p /nix chown ${USERNAME} /nix ${tmpdir} @@ -79,14 +80,14 @@ else ' update_rc_file "$home_dir/.bashrc" "${snippet}" update_rc_file "$home_dir/.zshenv" "${snippet}" - update_rc_file "$home_dir/.profile" "${snippet}" + update_rc_file "$home_dir/.profile" "${snippet}" fi rm -rf "${tmpdir}" "/tmp/tmp-gnupg" fi # Set nix config mkdir -p /etc/nix -create_or_update_file /etc/nix/nix.conf 'sandbox = false' +create_or_update_file /etc/nix/nix.conf 'sandbox = false' if [ ! -z "${FLAKEURI}" ] && [ "${FLAKEURI}" != "none" ]; then create_or_update_file /etc/nix/nix.conf 'experimental-features = nix-command flakes' fi @@ -127,4 +128,4 @@ else " fi -echo "Done!" \ No newline at end of file +echo "Done!" diff --git a/src/nix/post-install-steps.sh b/src/nix/post-install-steps.sh index aa466798b..68f93a391 100755 --- a/src/nix/post-install-steps.sh +++ b/src/nix/post-install-steps.sh @@ -2,10 +2,29 @@ set -e echo "(*) Executing post-installation steps..." +# if not starts with "nixpkgs." add it as prefix to package name +add_nixpkgs_prefix() { + local packages=$1 + local -a addr + IFS=' ' read -ra addr <<<"$packages" + for i in "${!addr[@]}"; do + if [[ ${addr[i]} != nixpkgs.* ]]; then + addr[i]="nixpkgs.${addr[i]}" + fi + done + IFS=' ' echo "${addr[*]}" +} + # Install list of packages in profile if specified. if [ ! -z "${PACKAGES}" ] && [ "${PACKAGES}" != "none" ]; then + if [ "${USEATTRIBUTEPATH}" = "true" ]; then + PACKAGES=$(add_nixpkgs_prefix "$PACKAGES") + echo "Installing packages \"${PACKAGES}\" in profile..." + nix-env -iA ${PACKAGES} + else echo "Installing packages \"${PACKAGES}\" in profile..." nix-env --install ${PACKAGES} + fi fi # Install Nix flake in profile if specified diff --git a/test/common-utils/alma-8-minimal.sh b/test/common-utils/alma-8-minimal.sh new file mode 100755 index 000000000..d08731824 --- /dev/null +++ b/test/common-utils/alma-8-minimal.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +. /etc/os-release +check "non-root user" test "$(whoami)" = "devcontainer" +check "distro" test "${PLATFORM_ID}" = "platform:el8" +check "curl" curl --version +check "jq" jq --version + +# Report result +reportResults \ No newline at end of file diff --git a/test/common-utils/alma-8.sh b/test/common-utils/alma-8.sh new file mode 100755 index 000000000..d08731824 --- /dev/null +++ b/test/common-utils/alma-8.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +. /etc/os-release +check "non-root user" test "$(whoami)" = "devcontainer" +check "distro" test "${PLATFORM_ID}" = "platform:el8" +check "curl" curl --version +check "jq" jq --version + +# Report result +reportResults \ No newline at end of file diff --git a/test/common-utils/alma-9-minimal.sh b/test/common-utils/alma-9-minimal.sh new file mode 100755 index 000000000..cb2b339e1 --- /dev/null +++ b/test/common-utils/alma-9-minimal.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +. /etc/os-release +check "non-root user" test "$(whoami)" = "devcontainer" +check "distro" test "${PLATFORM_ID}" = "platform:el9" +check "curl" curl --version +check "jq" jq --version + +# Report result +reportResults \ No newline at end of file diff --git a/test/common-utils/alma-9.sh b/test/common-utils/alma-9.sh new file mode 100755 index 000000000..cb2b339e1 --- /dev/null +++ b/test/common-utils/alma-9.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +. /etc/os-release +check "non-root user" test "$(whoami)" = "devcontainer" +check "distro" test "${PLATFORM_ID}" = "platform:el9" +check "curl" curl --version +check "jq" jq --version + +# Report result +reportResults \ No newline at end of file diff --git a/test/common-utils/alpine-3-18.sh b/test/common-utils/alpine-3-18.sh new file mode 100755 index 000000000..eaf384b9e --- /dev/null +++ b/test/common-utils/alpine-3-18.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +. /etc/os-release +check "non-root user" test "$(whoami)" = "devcontainer" +check "distro" test "${ID}" = "alpine" +check "bashrc" ls /etc/bash/bashrc +check "libssl1.1 is installed" grep "libssl1.1" <(apk list --no-cache libssl1.1) + +# Report result +reportResults \ No newline at end of file diff --git a/test/common-utils/rocky-8-minimal.sh b/test/common-utils/rocky-8-minimal.sh new file mode 100755 index 000000000..d08731824 --- /dev/null +++ b/test/common-utils/rocky-8-minimal.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +. /etc/os-release +check "non-root user" test "$(whoami)" = "devcontainer" +check "distro" test "${PLATFORM_ID}" = "platform:el8" +check "curl" curl --version +check "jq" jq --version + +# Report result +reportResults \ No newline at end of file diff --git a/test/common-utils/rocky-9-minimal.sh b/test/common-utils/rocky-9-minimal.sh new file mode 100755 index 000000000..cb2b339e1 --- /dev/null +++ b/test/common-utils/rocky-9-minimal.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +. /etc/os-release +check "non-root user" test "$(whoami)" = "devcontainer" +check "distro" test "${PLATFORM_ID}" = "platform:el9" +check "curl" curl --version +check "jq" jq --version + +# Report result +reportResults \ No newline at end of file diff --git a/test/common-utils/scenarios.json b/test/common-utils/scenarios.json index c1ee18dde..2e357bc2b 100644 --- a/test/common-utils/scenarios.json +++ b/test/common-utils/scenarios.json @@ -41,6 +41,34 @@ "common-utils": {} } }, + "alma-8": { + "image": "almalinux:8", + "remoteUser": "devcontainer", + "features": { + "common-utils": {} + } + }, + "alma-9": { + "image": "almalinux:9", + "remoteUser": "devcontainer", + "features": { + "common-utils": {} + } + }, + "alma-8-minimal": { + "image": "almalinux:8-minimal", + "remoteUser": "devcontainer", + "features": { + "common-utils": {} + } + }, + "alma-9-minimal": { + "image": "almalinux:9-minimal", + "remoteUser": "devcontainer", + "features": { + "common-utils": {} + } + }, "rocky-8": { "image": "rockylinux:8", "remoteUser": "devcontainer", @@ -55,6 +83,20 @@ "common-utils": {} } }, + "rocky-8-minimal": { + "image": "rockylinux:8-minimal", + "remoteUser": "devcontainer", + "features": { + "common-utils": {} + } + }, + "rocky-9-minimal": { + "image": "rockylinux:9-minimal", + "remoteUser": "devcontainer", + "features": { + "common-utils": {} + } + }, "fedora": { "image": "fedora", "remoteUser": "devcontainer", @@ -162,6 +204,13 @@ "common-utils": {} } }, + "alpine-3-18": { + "image": "alpine:3.18", + "remoteUser": "devcontainer", + "features": { + "common-utils": {} + } + }, "devcontainer-info": { "build": { "dockerfile": "Dockerfile" @@ -202,4 +251,4 @@ "common-utils": {} } } -} +} \ No newline at end of file diff --git a/test/dotnet/install_aspnetcore_runtime_only.sh b/test/dotnet/install_aspnetcore_runtime_only.sh index 35bd540b7..78e4f099c 100644 --- a/test/dotnet/install_aspnetcore_runtime_only.sh +++ b/test/dotnet/install_aspnetcore_runtime_only.sh @@ -18,10 +18,6 @@ expected=$(fetch_latest_version "aspnetcore") check "Latest ASP.NET Core Runtime version installed" \ is_aspnetcore_runtime_version_installed "$expected" -# Expect this check to fail in November 2023 when .NET 8.0 becomes GA -check "It is a flavor of .NET 7.0" \ -is_aspnetcore_runtime_version_installed "7.0" - # Report results # If any of the checks above exited with a non-zero exit code, the test will fail. reportResults \ No newline at end of file diff --git a/test/dotnet/install_dotnet_latest_when_version_is_empty.sh b/test/dotnet/install_dotnet_latest_when_version_is_empty.sh index 7418892e1..cd23edcf1 100644 --- a/test/dotnet/install_dotnet_latest_when_version_is_empty.sh +++ b/test/dotnet/install_dotnet_latest_when_version_is_empty.sh @@ -18,12 +18,8 @@ expected=$(fetch_latest_version) check "Latest .NET SDK version installed" \ is_dotnet_sdk_version_installed "$expected" -# Expect this check to fail in November 2023 when .NET 8.0 becomes GA -check "It is a flavor of .NET 7.0" \ -is_dotnet_sdk_version_installed "7.0" - check "Build and run example project" \ -dotnet run --project projects/net7.0 +dotnet run --project projects/net8.0 # Report results # If any of the checks above exited with a non-zero exit code, the test will fail. diff --git a/test/dotnet/install_dotnet_lts.sh b/test/dotnet/install_dotnet_lts.sh index fe37b89f7..bc2d40782 100644 --- a/test/dotnet/install_dotnet_lts.sh +++ b/test/dotnet/install_dotnet_lts.sh @@ -19,7 +19,7 @@ check "Latest LTS version installed" \ is_dotnet_sdk_version_installed "$expected" check "Build and run example project" \ -dotnet run --project projects/net6.0 +dotnet run --project projects/net8.0 # Report results # If any of the checks above exited with a non-zero exit code, the test will fail. diff --git a/test/dotnet/install_dotnet_runtime_only.sh b/test/dotnet/install_dotnet_runtime_only.sh index 65188c5ec..3c58340d1 100644 --- a/test/dotnet/install_dotnet_runtime_only.sh +++ b/test/dotnet/install_dotnet_runtime_only.sh @@ -18,10 +18,6 @@ expected=$(fetch_latest_version "dotnet") check "Latest .NET Runtime version installed" \ is_dotnet_runtime_version_installed "$expected" -# Expect this check to fail in November 2023 when .NET 8.0 becomes GA -check "It is a flavor of .NET 7.0" \ -is_dotnet_runtime_version_installed "7.0" - # Report results # If any of the checks above exited with a non-zero exit code, the test will fail. reportResults \ No newline at end of file diff --git a/test/dotnet/test.sh b/test/dotnet/test.sh index 7418892e1..cd23edcf1 100644 --- a/test/dotnet/test.sh +++ b/test/dotnet/test.sh @@ -18,12 +18,8 @@ expected=$(fetch_latest_version) check "Latest .NET SDK version installed" \ is_dotnet_sdk_version_installed "$expected" -# Expect this check to fail in November 2023 when .NET 8.0 becomes GA -check "It is a flavor of .NET 7.0" \ -is_dotnet_sdk_version_installed "7.0" - check "Build and run example project" \ -dotnet run --project projects/net7.0 +dotnet run --project projects/net8.0 # Report results # If any of the checks above exited with a non-zero exit code, the test will fail. diff --git a/test/java/install_ant_and_gradle_and_maven.sh b/test/java/install_ant_and_gradle_and_maven_and_groovy.sh similarity index 84% rename from test/java/install_ant_and_gradle_and_maven.sh rename to test/java/install_ant_and_gradle_and_maven_and_groovy.sh index 599f8d9d5..e171f5be5 100644 --- a/test/java/install_ant_and_gradle_and_maven.sh +++ b/test/java/install_ant_and_gradle_and_maven_and_groovy.sh @@ -24,5 +24,11 @@ check "maven" mvn --version cd /tmp && mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false check "m2 exists" grep ".m2" <(ls -la /root) +check "groovy" groovy --version +cat << EOF > /tmp/test.groovy +println("verify") +EOF +check "groovy works" test "$(groovy /tmp/test.groovy)" = "verify" + # Report result reportResults diff --git a/test/java/install_ant_and_gradle_and_maven_for_user.sh b/test/java/install_ant_and_gradle_and_maven_and_groovy_for_user.sh similarity index 84% rename from test/java/install_ant_and_gradle_and_maven_for_user.sh rename to test/java/install_ant_and_gradle_and_maven_and_groovy_for_user.sh index 4e8b43134..8d9f293e9 100644 --- a/test/java/install_ant_and_gradle_and_maven_for_user.sh +++ b/test/java/install_ant_and_gradle_and_maven_and_groovy_for_user.sh @@ -24,5 +24,11 @@ check "maven" mvn --version cd /tmp && mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false check "m2 exists" grep ".m2" <(ls -la /home/vscode) +check "groovy" groovy --version +cat << EOF > /tmp/test.groovy +println("verify") +EOF +check "groovy works" test "$(groovy /tmp/test.groovy)" = "verify" + # Report result reportResults diff --git a/test/java/install_ant_and_gradle_and_maven_with_specific_version.sh b/test/java/install_ant_and_gradle_and_maven_and_groovy_with_specific_version.sh similarity index 92% rename from test/java/install_ant_and_gradle_and_maven_with_specific_version.sh rename to test/java/install_ant_and_gradle_and_maven_and_groovy_with_specific_version.sh index 7727f51b6..54e13e0cf 100644 --- a/test/java/install_ant_and_gradle_and_maven_with_specific_version.sh +++ b/test/java/install_ant_and_gradle_and_maven_and_groovy_with_specific_version.sh @@ -24,5 +24,7 @@ check "maven version" grep "Apache Maven 3.6.3" <(mvn --version) cd /tmp && mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false check "m2 exists" grep ".m2" <(ls -la /root) +check "groovy version" grep "Groovy Version: 2.5.22" <(groovy --version) + # Report result reportResults diff --git a/test/java/install_from_non_default_distro.sh b/test/java/install_from_non_default_distro.sh index 021a72a21..3ab648cab 100644 --- a/test/java/install_from_non_default_distro.sh +++ b/test/java/install_from_non_default_distro.sh @@ -5,7 +5,7 @@ set -e # Optional: Import test library source dev-container-features-test-lib -check "java version openjdk 19 installed" grep "openjdk 19." <(java --version) +check "java version openjdk 21 installed" grep "openjdk 21." <(java --version) # Report result reportResults diff --git a/test/java/scenarios.json b/test/java/scenarios.json index 5d7e684ba..dac9850f2 100644 --- a/test/java/scenarios.json +++ b/test/java/scenarios.json @@ -3,7 +3,7 @@ "image": "ubuntu:focal", "features": { "java": { - "version": "19", + "version": "21", "jdkDistro": "open" } } @@ -17,7 +17,7 @@ } } }, - "install_ant_and_gradle_and_maven_for_user": { + "install_ant_and_gradle_and_maven_and_groovy_for_user": { "image": "ubuntu:focal", "remoteUser": "vscode", "features": { @@ -28,22 +28,24 @@ "version": "latest", "installAnt": true, "installGradle": true, - "installMaven": true + "installMaven": true, + "installGroovy": true } } }, - "install_ant_and_gradle_and_maven": { + "install_ant_and_gradle_and_maven_and_groovy": { "image": "ubuntu:focal", "features": { "java": { "version": "latest", "installAnt": true, "installGradle": true, - "installMaven": true + "installMaven": true, + "installGroovy": true } } }, - "install_ant_and_gradle_and_maven_with_specific_version": { + "install_ant_and_gradle_and_maven_and_groovy_with_specific_version": { "image": "ubuntu:focal", "features": { "java": { @@ -53,13 +55,15 @@ "installGradle": "true", "gradleVersion": "6.8.3", "installMaven": "true", - "mavenVersion": "3.6.3" + "mavenVersion": "3.6.3", + "installGroovy": "true", + "groovyVersion": "2.5.22" } } }, "install_non_conventional_version": { "image": "ubuntu:focal", - "features":{ + "features": { "java": { "version": "21", "jdkDistro": "graalce" diff --git a/test/nix/packages-use-attr-path.sh b/test/nix/packages-use-attr-path.sh new file mode 100755 index 000000000..7f34a96ea --- /dev/null +++ b/test/nix/packages-use-attr-path.sh @@ -0,0 +1,35 @@ +#!/bin/bash +set -e + +# Optional: Import test library bundled with the devcontainer CLI +source dev-container-features-test-lib + +uid="$(id -u)" +echo "Current user UID is ${uid}." +if [ "${uid}" != "1000" ]; then + echo "Current user UID was adjusted." +fi +set +e +vscode_uid="$(id -u vscode)" +set -e +if [ "${vscode_uid}" != "" ]; then + echo "User vscode UID is ${vscode_uid}." + if [ "${vscode_uid}" != "1000" ]; then + echo "User vscode UID was adjusted." + fi +fi +nix_uid="$(stat /nix -c "%u")" +echo "/nix UID is ${nix_uid}." + +cat /etc/os-release + +# Feature-specific tests +# The 'check' command comes from the dev-container-features-test-lib. +check "nix-env" type nix-env +check "vim_installed" type vim +check "node_installed" type node +check "yarn_installed" type yarn + +# Report result +# If any of the checks above exited with a non-zero exit code, the test will fail. +reportResults &2>1 diff --git a/test/nix/scenarios.json b/test/nix/scenarios.json index c287f58c7..80ead7ff6 100644 --- a/test/nix/scenarios.json +++ b/test/nix/scenarios.json @@ -81,6 +81,17 @@ } } }, + "packages-use-attr-path": { + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "remoteUser": "vscode", + "features": { + "nix": { + "packages": "nodePackages.nodejs,nixpkgs.vim,nixpkgs.yarn", + "useAttributePath": true + } + } + }, + "flake": { "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "remoteUser": "vscode", @@ -99,4 +110,4 @@ } } } -} \ No newline at end of file +}