aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornaturedamends <120284608+naturedamends@users.noreply.github.com>2023-08-12 02:01:57 +0300
committerGitHub <noreply@github.com>2023-08-12 02:01:57 +0300
commitbe082b0ef5f0f3795708cd1a6c37a427d8c0bb73 (patch)
tree431f504174ec7e2ab094c6868d4fbe0b096eaaf3 /test
parent9e75db9a1dbcc245f94707c0917470143c17595b (diff)
Common utils: Add config to remove zsh rc files from (#614)feature_common-utils_2.1.0
* Add config to remove zsh rc files from common-utils. * Bump version and add config to install script. * Checks preventing excess writing to .zshrc. * Change devcontainer feature option name. * Coding standards. * Favour adding feature via config and default to overriding .zshrc with dev-container default template. * Update devcontainer-feature.json * Update devcontainer-feature.json * Update src/common-utils/devcontainer-feature.json Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com> * Update src/common-utils/devcontainer-feature.json Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com> * Testing for using devcontainer .zshrc template file. * Coding standards. * Coding standards. * Update configure_zsh_as_default_shell_no_template.sh * Grammar in configure_zsh_as_default_shell.sh * Testing accounts for marked file cache (#4) * Account for mark file in testing. * Remove some debugging and tests back * Add back tests? * Update configure_zsh_no_template.sh --------- Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com>
Diffstat (limited to 'test')
-rw-r--r--test/common-utils/configure_zsh_as_default_shell.sh2
-rw-r--r--test/common-utils/configure_zsh_no_template.sh15
-rw-r--r--test/common-utils/scenarios.json11
3 files changed, 28 insertions, 0 deletions
diff --git a/test/common-utils/configure_zsh_as_default_shell.sh b/test/common-utils/configure_zsh_as_default_shell.sh
index e5cc89e..6a569a9 100644
--- a/test/common-utils/configure_zsh_as_default_shell.sh
+++ b/test/common-utils/configure_zsh_as_default_shell.sh
@@ -7,6 +7,8 @@ source dev-container-features-test-lib
# Definition specific tests
check "default-shell-is-zsh" bash -c "getent passwd $(whoami) | awk -F: '{ print $7 }' | grep '/bin/zsh'"
+# check it overrides the ~/.zshrc with default dev containers template
+check "default-zshrc-is-dev-container-template" bash -c "cat ~/.zshrc | grep ZSH_THEME | grep devcontainers"
# Report result
reportResults
diff --git a/test/common-utils/configure_zsh_no_template.sh b/test/common-utils/configure_zsh_no_template.sh
new file mode 100644
index 0000000..c62cae9
--- /dev/null
+++ b/test/common-utils/configure_zsh_no_template.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+set -e
+
+# Optional: Import test library
+source dev-container-features-test-lib
+
+# Definition specific tests
+function file_not_overridden() {
+ cat ~/.zshrc | grep 'alias fnomockalias=' | grep testingmock
+}
+check "default-zsh-with-no-zshrc" file_not_overridden
+
+# Report result
+reportResults
diff --git a/test/common-utils/scenarios.json b/test/common-utils/scenarios.json
index 9800242..904a47b 100644
--- a/test/common-utils/scenarios.json
+++ b/test/common-utils/scenarios.json
@@ -115,6 +115,17 @@
}
}
},
+ "configure_zsh_no_template": {
+ "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
+ "postCreateCommand": "echo alias fnomockalias=testingmock >> /root/.zshrc",
+ "remoteUser": "root",
+ "features": {
+ "common-utils": {
+ "installZsh": true,
+ "installOhMyZshConfig": false
+ }
+ }
+ },
"config-subdirectory": {
"image": "alpine",
"remoteUser": "devcontainer",