From f54bc5b0c2d244780d522c61cfb5cbaa72d5377c Mon Sep 17 00:00:00 2001 From: Martin Gaughran Date: Sun, 14 Jun 2026 10:19:46 +0000 Subject: [PATCH 01/19] Trim down golden master tests --- .../demo_configuration/argocd/v2.14.10.yaml | 13 - .../dls-pmac-control/0.1.yaml | 29 --- .../dls-pmac-control/0.2.yaml | 29 --- .../demo_configuration/ec/i13-1.yaml | 19 -- .../demo_configuration/ec/p47.yaml | 20 -- .../edge-containers-cli/0.1.yaml | 54 ---- .../example-module-apps/0.1.yaml | 13 +- .../example-module-deps/0.2.yaml | 2 - .../demo_configuration/phoebus/0.1.yaml | 20 -- .../demo_configuration/settings.yaml | 3 +- tests/generate_samples.sh | 2 - .../deploy-tools-output/deployment.yaml | 245 +----------------- .../modulefiles/argocd/v2.14.10 | 1 - .../modulefiles/dls-pmac-control/.version | 2 - .../modulefiles/dls-pmac-control/0.1 | 1 - .../modulefiles/dls-pmac-control/0.2 | 1 - .../modulefiles/ec/.version | 2 - .../deploy-tools-output/modulefiles/ec/i13-1 | 1 - .../deploy-tools-output/modulefiles/ec/p47 | 1 - .../modulefiles/edge-containers-cli/.version | 2 - .../modulefiles/edge-containers-cli/0.1 | 1 - .../modulefiles/phoebus/.version | 2 - .../modulefiles/phoebus/0.1 | 1 - .../modules/argocd/v2.14.10/module.yaml | 15 -- .../modules/argocd/v2.14.10/modulefile | 13 - .../0.1/entrypoints/dls-pmac-control | 44 ---- .../0.1/entrypoints/test-echo-module-file | 7 - .../modules/dls-pmac-control/0.1/module.yaml | 33 --- .../modules/dls-pmac-control/0.1/modulefile | 15 -- .../0.2/entrypoints/dls-pmac-control | 44 ---- .../0.2/entrypoints/test-echo-module-file | 7 - .../modules/dls-pmac-control/0.2/module.yaml | 33 --- .../modules/dls-pmac-control/0.2/modulefile | 15 -- .../modules/ec/i13-1/module.yaml | 18 -- .../modules/ec/i13-1/modulefile | 19 -- .../modules/ec/p47/module.yaml | 18 -- .../modules/ec/p47/modulefile | 19 -- .../edge-containers-cli/0.1/entrypoints/ec | 44 ---- .../0.1/entrypoints/ec-bash | 44 ---- .../0.1/entrypoints/ec-login | 8 - .../edge-containers-cli/0.1/module.yaml | 56 ---- .../edge-containers-cli/0.1/modulefile | 18 -- .../0.1/entrypoints/cowsay-hello | 2 +- .../0.1/entrypoints/show-directory | 44 ---- ...cho-module-folder => test-echo-module-var} | 0 .../example-module-apps/0.1/module.yaml | 14 +- .../example-module-apps/0.1/modulefile | 2 +- .../example-module-deps/0.2/module.yaml | 2 - .../example-module-deps/0.2/modulefile | 1 - .../modules/phoebus/0.1/entrypoints/phoebus | 44 ---- .../modules/phoebus/0.1/module.yaml | 27 -- .../modules/phoebus/0.1/modulefile | 13 - 52 files changed, 12 insertions(+), 1071 deletions(-) delete mode 100644 src/deploy_tools/demo_configuration/argocd/v2.14.10.yaml delete mode 100644 src/deploy_tools/demo_configuration/dls-pmac-control/0.1.yaml delete mode 100644 src/deploy_tools/demo_configuration/dls-pmac-control/0.2.yaml delete mode 100644 src/deploy_tools/demo_configuration/ec/i13-1.yaml delete mode 100644 src/deploy_tools/demo_configuration/ec/p47.yaml delete mode 100644 src/deploy_tools/demo_configuration/edge-containers-cli/0.1.yaml delete mode 100644 src/deploy_tools/demo_configuration/phoebus/0.1.yaml delete mode 120000 tests/samples/deploy-tools-output/modulefiles/argocd/v2.14.10 delete mode 100644 tests/samples/deploy-tools-output/modulefiles/dls-pmac-control/.version delete mode 120000 tests/samples/deploy-tools-output/modulefiles/dls-pmac-control/0.1 delete mode 120000 tests/samples/deploy-tools-output/modulefiles/dls-pmac-control/0.2 delete mode 100644 tests/samples/deploy-tools-output/modulefiles/ec/.version delete mode 120000 tests/samples/deploy-tools-output/modulefiles/ec/i13-1 delete mode 120000 tests/samples/deploy-tools-output/modulefiles/ec/p47 delete mode 100644 tests/samples/deploy-tools-output/modulefiles/edge-containers-cli/.version delete mode 120000 tests/samples/deploy-tools-output/modulefiles/edge-containers-cli/0.1 delete mode 100644 tests/samples/deploy-tools-output/modulefiles/phoebus/.version delete mode 120000 tests/samples/deploy-tools-output/modulefiles/phoebus/0.1 delete mode 100644 tests/samples/deploy-tools-output/modules/argocd/v2.14.10/module.yaml delete mode 100644 tests/samples/deploy-tools-output/modules/argocd/v2.14.10/modulefile delete mode 100755 tests/samples/deploy-tools-output/modules/dls-pmac-control/0.1/entrypoints/dls-pmac-control delete mode 100755 tests/samples/deploy-tools-output/modules/dls-pmac-control/0.1/entrypoints/test-echo-module-file delete mode 100644 tests/samples/deploy-tools-output/modules/dls-pmac-control/0.1/module.yaml delete mode 100644 tests/samples/deploy-tools-output/modules/dls-pmac-control/0.1/modulefile delete mode 100755 tests/samples/deploy-tools-output/modules/dls-pmac-control/0.2/entrypoints/dls-pmac-control delete mode 100755 tests/samples/deploy-tools-output/modules/dls-pmac-control/0.2/entrypoints/test-echo-module-file delete mode 100644 tests/samples/deploy-tools-output/modules/dls-pmac-control/0.2/module.yaml delete mode 100644 tests/samples/deploy-tools-output/modules/dls-pmac-control/0.2/modulefile delete mode 100644 tests/samples/deploy-tools-output/modules/ec/i13-1/module.yaml delete mode 100644 tests/samples/deploy-tools-output/modules/ec/i13-1/modulefile delete mode 100644 tests/samples/deploy-tools-output/modules/ec/p47/module.yaml delete mode 100644 tests/samples/deploy-tools-output/modules/ec/p47/modulefile delete mode 100755 tests/samples/deploy-tools-output/modules/edge-containers-cli/0.1/entrypoints/ec delete mode 100755 tests/samples/deploy-tools-output/modules/edge-containers-cli/0.1/entrypoints/ec-bash delete mode 100755 tests/samples/deploy-tools-output/modules/edge-containers-cli/0.1/entrypoints/ec-login delete mode 100644 tests/samples/deploy-tools-output/modules/edge-containers-cli/0.1/module.yaml delete mode 100644 tests/samples/deploy-tools-output/modules/edge-containers-cli/0.1/modulefile delete mode 100755 tests/samples/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/show-directory rename tests/samples/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/{test-echo-module-folder => test-echo-module-var} (100%) delete mode 100755 tests/samples/deploy-tools-output/modules/phoebus/0.1/entrypoints/phoebus delete mode 100644 tests/samples/deploy-tools-output/modules/phoebus/0.1/module.yaml delete mode 100644 tests/samples/deploy-tools-output/modules/phoebus/0.1/modulefile diff --git a/src/deploy_tools/demo_configuration/argocd/v2.14.10.yaml b/src/deploy_tools/demo_configuration/argocd/v2.14.10.yaml deleted file mode 100644 index a0b09c3e..00000000 --- a/src/deploy_tools/demo_configuration/argocd/v2.14.10.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json - -module: - name: argocd - version: v2.14.10 - description: Demonstration of binary download - - applications: - - app_type: binary - name: argocd - url: https://github.com/argoproj/argo-cd/releases/download/v2.14.10/argocd-linux-amd64 - hash_type: sha256 - hash: d1750274a336f0a090abf196a832cee14cb9f1c2fc3d20d80b0dbfeff83550fa diff --git a/src/deploy_tools/demo_configuration/dls-pmac-control/0.1.yaml b/src/deploy_tools/demo_configuration/dls-pmac-control/0.1.yaml deleted file mode 100644 index 12865f7d..00000000 --- a/src/deploy_tools/demo_configuration/dls-pmac-control/0.1.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json - -module: - name: dls-pmac-control - version: "0.1" - description: Demonstration of the deploy-tools process - - env_vars: - - name: EXAMPLE_VALUE - value: Test message EXAMPLE_VALUE from example-module-file version 0.1 - - applications: - - app_type: apptainer - - container: - path: docker://ghcr.io/diamondlightsource/dls-pmac-control - version: "3.2.0b1" - - entrypoints: - - name: dls-pmac-control - command: dls-pmac-control - options: - apptainer_args: -e - - - app_type: shell - - name: test-echo-module-file - script: - - echo $EXAMPLE_VALUE diff --git a/src/deploy_tools/demo_configuration/dls-pmac-control/0.2.yaml b/src/deploy_tools/demo_configuration/dls-pmac-control/0.2.yaml deleted file mode 100644 index 4302f7dd..00000000 --- a/src/deploy_tools/demo_configuration/dls-pmac-control/0.2.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json - -module: - name: dls-pmac-control - version: "0.2" - description: Demonstration of the deploy-tools process - - env_vars: - - name: EXAMPLE_VALUE - value: Test message EXAMPLE_VALUE from example-module-file version 0.2 - - applications: - - app_type: apptainer - - container: - path: docker://ghcr.io/diamondlightsource/dls-pmac-control - version: "3.2.0b1" - - entrypoints: - - name: dls-pmac-control - command: dls-pmac-control - options: - apptainer_args: -e - - - app_type: shell - - name: test-echo-module-file - script: - - echo $EXAMPLE_VALUE diff --git a/src/deploy_tools/demo_configuration/ec/i13-1.yaml b/src/deploy_tools/demo_configuration/ec/i13-1.yaml deleted file mode 100644 index 8ee73cb4..00000000 --- a/src/deploy_tools/demo_configuration/ec/i13-1.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json - -module: - name: ec - version: i13-1 - description: ec command line tool configured for i13-1 - - dependencies: - - name: edge-containers-cli - - name: k8s-i13-1 - version: local - - env_vars: - - name: EC_TARGET - value: i13-1-beamline/i13-1 - - name: EC_SERVICES_REPO - value: https://gitlab.diamond.ac.uk/controls/containers/beamline/i13-1-services.git - - applications: [] diff --git a/src/deploy_tools/demo_configuration/ec/p47.yaml b/src/deploy_tools/demo_configuration/ec/p47.yaml deleted file mode 100644 index 47291088..00000000 --- a/src/deploy_tools/demo_configuration/ec/p47.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json - -module: - name: ec - version: p47 - description: ec command line tool configured for p47 - - dependencies: - - name: edge-containers-cli - version: "0.1" - - name: pollux - version: local - - env_vars: - - name: EC_TARGET - value: p47-beamline/p47 - - name: EC_SERVICES_REPO - value: https://github.com/epics-containers/p47-services - - applications: [] diff --git a/src/deploy_tools/demo_configuration/edge-containers-cli/0.1.yaml b/src/deploy_tools/demo_configuration/edge-containers-cli/0.1.yaml deleted file mode 100644 index 30536008..00000000 --- a/src/deploy_tools/demo_configuration/edge-containers-cli/0.1.yaml +++ /dev/null @@ -1,54 +0,0 @@ -# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json - -module: - name: edge-containers-cli - version: "0.1" - description: ec command line tool for kubernetes IOCs - - dependencies: - - name: argocd - version: v2.14.10 - - env_vars: - - name: EC_CLI_BACKEND - value: ARGOCD - - name: EC_LOG_URL - value: "https://graylog.diamond.ac.uk/search?rangetype=relative&fields=message%2Csource&width=1489&highlightMessage=&relative=172800&q=pod_name%3A{service_name}*" - - applications: - - app_type: apptainer - - container: - path: docker://ghcr.io/epics-containers/edge-containers-cli - version: "4.4.1" - - entrypoints: - - name: ec - command: ec - # for debugging enter the container with bash shell - - name: ec-bash - command: bash - - global_options: - mounts: - # places to get argocd and kubectl config from - - /dls/science/users/:/dls/science/users/ - - /scratch:/scratch - - /dls_sw/apps:/dls_sw/apps - host_binaries: - # argocd deploy-tools - - argocd - # other kubernetes tools from the beamline cluster module - - kubectl - - helm - - kubelogin - - klogout - - kustomize - - kubeseal - - kubectl-oidc_login - - - app_type: shell - name: ec-login - script: - - argocd login argocd.diamond.ac.uk --grpc-web --sso - - kubectl version diff --git a/src/deploy_tools/demo_configuration/example-module-apps/0.1.yaml b/src/deploy_tools/demo_configuration/example-module-apps/0.1.yaml index 1145a3ac..0a934518 100644 --- a/src/deploy_tools/demo_configuration/example-module-apps/0.1.yaml +++ b/src/deploy_tools/demo_configuration/example-module-apps/0.1.yaml @@ -7,7 +7,7 @@ module: env_vars: - name: OTHER_VALUE - value: Test message OTHER_VALUE from example-module-folder + value: Version 0.1 applications: - app_type: apptainer @@ -22,18 +22,9 @@ module: options: command_args: Hello - - name: show-directory - command: ls - options: - command_args: -al /dls_sw_test - - global_options: - mounts: - - /dls_sw:/dls_sw_test:ro - - app_type: shell - name: test-echo-module-folder + name: test-echo-module-var script: - echo $OTHER_VALUE diff --git a/src/deploy_tools/demo_configuration/example-module-deps/0.2.yaml b/src/deploy_tools/demo_configuration/example-module-deps/0.2.yaml index 7b9da8d1..4e5c3fc4 100644 --- a/src/deploy_tools/demo_configuration/example-module-deps/0.2.yaml +++ b/src/deploy_tools/demo_configuration/example-module-deps/0.2.yaml @@ -6,8 +6,6 @@ module: description: Demonstration of deploy-tools dependencies dependencies: - - name: dls-pmac-control - version: "0.1" - name: example-module-apps version: "0.1" diff --git a/src/deploy_tools/demo_configuration/phoebus/0.1.yaml b/src/deploy_tools/demo_configuration/phoebus/0.1.yaml deleted file mode 100644 index 33ef8af0..00000000 --- a/src/deploy_tools/demo_configuration/phoebus/0.1.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json - -module: - name: phoebus - version: "0.1" - description: Containerised release of CSS Phoebus - - applications: - - app_type: apptainer - - container: - path: docker://ghcr.io/epics-containers/ec-phoebus - version: "4.7.3ec2" - - entrypoints: - - name: phoebus - command: java -jar /phoebus/phoebus.jar -server 7010 - options: - apptainer_args: --env DISPLAY=${DISPLAY} -e - command_args: -server 7010 diff --git a/src/deploy_tools/demo_configuration/settings.yaml b/src/deploy_tools/demo_configuration/settings.yaml index 8009f5a5..70f60017 100644 --- a/src/deploy_tools/demo_configuration/settings.yaml +++ b/src/deploy_tools/demo_configuration/settings.yaml @@ -1,4 +1,3 @@ # yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/deployment-settings.json -default_versions: - dls-pmac-control: "0.1" +default_versions: {} diff --git a/tests/generate_samples.sh b/tests/generate_samples.sh index 84fbb75e..bdcd275a 100755 --- a/tests/generate_samples.sh +++ b/tests/generate_samples.sh @@ -15,8 +15,6 @@ deploy-tools sync --from-scratch ${TMP_DIR} ${THIS_DIR}/../src/deploy_tools/demo # don't keep the sif or git files rm -rf $(find ${TMP_DIR} -name "*.sif") rm -rf ${TMP_DIR}/.git* -# also remove binaries -rm ${TMP_DIR}/modules/argocd/*/entrypoints/argocd rm -rf ${SAMPLES_DIR} mkdir -p ${SAMPLES_DIR} diff --git a/tests/samples/deploy-tools-output/deployment.yaml b/tests/samples/deploy-tools-output/deployment.yaml index 4a0ee826..f33dff7d 100644 --- a/tests/samples/deploy-tools-output/deployment.yaml +++ b/tests/samples/deploy-tools-output/deployment.yaml @@ -1,199 +1,4 @@ releases: - argocd: - v2.14.10: - deprecated: false - module: - allow_updates: false - applications: - - app_type: binary - hash: d1750274a336f0a090abf196a832cee14cb9f1c2fc3d20d80b0dbfeff83550fa - hash_type: sha256 - name: argocd - url: https://github.com/argoproj/argo-cd/releases/download/v2.14.10/argocd-linux-amd64 - dependencies: [] - description: Demonstration of binary download - env_vars: [] - exclude_from_defaults: false - load_script: [] - name: argocd - unload_script: [] - version: v2.14.10 - dls-pmac-control: - '0.1': - deprecated: false - module: - allow_updates: false - applications: - - app_type: apptainer - container: - path: docker://ghcr.io/diamondlightsource/dls-pmac-control - version: 3.2.0b1 - entrypoints: - - command: dls-pmac-control - name: dls-pmac-control - options: - apptainer_args: -e - command_args: '' - host_binaries: [] - mounts: [] - global_options: - apptainer_args: '' - command_args: '' - host_binaries: [] - mounts: [] - - app_type: shell - name: test-echo-module-file - script: - - echo $EXAMPLE_VALUE - dependencies: [] - description: Demonstration of the deploy-tools process - env_vars: - - name: EXAMPLE_VALUE - value: Test message EXAMPLE_VALUE from example-module-file version 0.1 - exclude_from_defaults: false - load_script: [] - name: dls-pmac-control - unload_script: [] - version: '0.1' - '0.2': - deprecated: false - module: - allow_updates: false - applications: - - app_type: apptainer - container: - path: docker://ghcr.io/diamondlightsource/dls-pmac-control - version: 3.2.0b1 - entrypoints: - - command: dls-pmac-control - name: dls-pmac-control - options: - apptainer_args: -e - command_args: '' - host_binaries: [] - mounts: [] - global_options: - apptainer_args: '' - command_args: '' - host_binaries: [] - mounts: [] - - app_type: shell - name: test-echo-module-file - script: - - echo $EXAMPLE_VALUE - dependencies: [] - description: Demonstration of the deploy-tools process - env_vars: - - name: EXAMPLE_VALUE - value: Test message EXAMPLE_VALUE from example-module-file version 0.2 - exclude_from_defaults: false - load_script: [] - name: dls-pmac-control - unload_script: [] - version: '0.2' - ec: - i13-1: - deprecated: false - module: - allow_updates: false - applications: [] - dependencies: - - name: edge-containers-cli - version: null - - name: k8s-i13-1 - version: local - description: ec command line tool configured for i13-1 - env_vars: - - name: EC_TARGET - value: i13-1-beamline/i13-1 - - name: EC_SERVICES_REPO - value: https://gitlab.diamond.ac.uk/controls/containers/beamline/i13-1-services.git - exclude_from_defaults: false - load_script: [] - name: ec - unload_script: [] - version: i13-1 - p47: - deprecated: false - module: - allow_updates: false - applications: [] - dependencies: - - name: edge-containers-cli - version: '0.1' - - name: pollux - version: local - description: ec command line tool configured for p47 - env_vars: - - name: EC_TARGET - value: p47-beamline/p47 - - name: EC_SERVICES_REPO - value: https://github.com/epics-containers/p47-services - exclude_from_defaults: false - load_script: [] - name: ec - unload_script: [] - version: p47 - edge-containers-cli: - '0.1': - deprecated: false - module: - allow_updates: false - applications: - - app_type: apptainer - container: - path: docker://ghcr.io/epics-containers/edge-containers-cli - version: 4.4.1 - entrypoints: - - command: ec - name: ec - options: - apptainer_args: '' - command_args: '' - host_binaries: [] - mounts: [] - - command: bash - name: ec-bash - options: - apptainer_args: '' - command_args: '' - host_binaries: [] - mounts: [] - global_options: - apptainer_args: '' - command_args: '' - host_binaries: - - argocd - - kubectl - - helm - - kubelogin - - klogout - - kustomize - - kubeseal - - kubectl-oidc_login - mounts: - - /dls/science/users/:/dls/science/users/ - - /scratch:/scratch - - /dls_sw/apps:/dls_sw/apps - - app_type: shell - name: ec-login - script: - - argocd login argocd.diamond.ac.uk --grpc-web --sso - - kubectl version - dependencies: - - name: argocd - version: v2.14.10 - description: ec command line tool for kubernetes IOCs - env_vars: - - name: EC_CLI_BACKEND - value: ARGOCD - - name: EC_LOG_URL - value: https://graylog.diamond.ac.uk/search?rangetype=relative&fields=message%2Csource&width=1489&highlightMessage=&relative=172800&q=pod_name%3A{service_name}* - exclude_from_defaults: false - load_script: [] - name: edge-containers-cli - unload_script: [] - version: '0.1' example-module-apps: '0.1': deprecated: false @@ -212,21 +17,13 @@ releases: command_args: Hello host_binaries: [] mounts: [] - - command: ls - name: show-directory - options: - apptainer_args: '' - command_args: -al /dls_sw_test - host_binaries: [] - mounts: [] global_options: apptainer_args: '' command_args: '' host_binaries: [] - mounts: - - /dls_sw:/dls_sw_test:ro + mounts: [] - app_type: shell - name: test-echo-module-folder + name: test-echo-module-var script: - echo $OTHER_VALUE - app_type: shell @@ -239,7 +36,7 @@ releases: description: Demonstration of a module configuration folder env_vars: - name: OTHER_VALUE - value: Test message OTHER_VALUE from example-module-folder + value: Version 0.1 exclude_from_defaults: false load_script: [] name: example-module-apps @@ -252,8 +49,6 @@ releases: allow_updates: false applications: [] dependencies: - - name: dls-pmac-control - version: '0.1' - name: example-module-apps version: '0.1' description: Demonstration of deploy-tools dependencies @@ -263,37 +58,5 @@ releases: name: example-module-deps unload_script: [] version: '0.2' - phoebus: - '0.1': - deprecated: false - module: - allow_updates: false - applications: - - app_type: apptainer - container: - path: docker://ghcr.io/epics-containers/ec-phoebus - version: 4.7.3ec2 - entrypoints: - - command: java -jar /phoebus/phoebus.jar -server 7010 - name: phoebus - options: - apptainer_args: --env DISPLAY=${DISPLAY} -e - command_args: -server 7010 - host_binaries: [] - mounts: [] - global_options: - apptainer_args: '' - command_args: '' - host_binaries: [] - mounts: [] - dependencies: [] - description: Containerised release of CSS Phoebus - env_vars: [] - exclude_from_defaults: false - load_script: [] - name: phoebus - unload_script: [] - version: '0.1' settings: - default_versions: - dls-pmac-control: '0.1' + default_versions: {} diff --git a/tests/samples/deploy-tools-output/modulefiles/argocd/v2.14.10 b/tests/samples/deploy-tools-output/modulefiles/argocd/v2.14.10 deleted file mode 120000 index 40d562c2..00000000 --- a/tests/samples/deploy-tools-output/modulefiles/argocd/v2.14.10 +++ /dev/null @@ -1 +0,0 @@ -/tmp/deploy-tools-output/modules/argocd/v2.14.10/modulefile \ No newline at end of file diff --git a/tests/samples/deploy-tools-output/modulefiles/dls-pmac-control/.version b/tests/samples/deploy-tools-output/modulefiles/dls-pmac-control/.version deleted file mode 100644 index d9b8f921..00000000 --- a/tests/samples/deploy-tools-output/modulefiles/dls-pmac-control/.version +++ /dev/null @@ -1,2 +0,0 @@ -#%Module1.0 -set ModulesVersion 0.1 diff --git a/tests/samples/deploy-tools-output/modulefiles/dls-pmac-control/0.1 b/tests/samples/deploy-tools-output/modulefiles/dls-pmac-control/0.1 deleted file mode 120000 index 75b70243..00000000 --- a/tests/samples/deploy-tools-output/modulefiles/dls-pmac-control/0.1 +++ /dev/null @@ -1 +0,0 @@ -/tmp/deploy-tools-output/modules/dls-pmac-control/0.1/modulefile \ No newline at end of file diff --git a/tests/samples/deploy-tools-output/modulefiles/dls-pmac-control/0.2 b/tests/samples/deploy-tools-output/modulefiles/dls-pmac-control/0.2 deleted file mode 120000 index 0c56729d..00000000 --- a/tests/samples/deploy-tools-output/modulefiles/dls-pmac-control/0.2 +++ /dev/null @@ -1 +0,0 @@ -/tmp/deploy-tools-output/modules/dls-pmac-control/0.2/modulefile \ No newline at end of file diff --git a/tests/samples/deploy-tools-output/modulefiles/ec/.version b/tests/samples/deploy-tools-output/modulefiles/ec/.version deleted file mode 100644 index 8c1a7aa7..00000000 --- a/tests/samples/deploy-tools-output/modulefiles/ec/.version +++ /dev/null @@ -1,2 +0,0 @@ -#%Module1.0 -set ModulesVersion p47 diff --git a/tests/samples/deploy-tools-output/modulefiles/ec/i13-1 b/tests/samples/deploy-tools-output/modulefiles/ec/i13-1 deleted file mode 120000 index b5348c58..00000000 --- a/tests/samples/deploy-tools-output/modulefiles/ec/i13-1 +++ /dev/null @@ -1 +0,0 @@ -/tmp/deploy-tools-output/modules/ec/i13-1/modulefile \ No newline at end of file diff --git a/tests/samples/deploy-tools-output/modulefiles/ec/p47 b/tests/samples/deploy-tools-output/modulefiles/ec/p47 deleted file mode 120000 index 0c2cf517..00000000 --- a/tests/samples/deploy-tools-output/modulefiles/ec/p47 +++ /dev/null @@ -1 +0,0 @@ -/tmp/deploy-tools-output/modules/ec/p47/modulefile \ No newline at end of file diff --git a/tests/samples/deploy-tools-output/modulefiles/edge-containers-cli/.version b/tests/samples/deploy-tools-output/modulefiles/edge-containers-cli/.version deleted file mode 100644 index d9b8f921..00000000 --- a/tests/samples/deploy-tools-output/modulefiles/edge-containers-cli/.version +++ /dev/null @@ -1,2 +0,0 @@ -#%Module1.0 -set ModulesVersion 0.1 diff --git a/tests/samples/deploy-tools-output/modulefiles/edge-containers-cli/0.1 b/tests/samples/deploy-tools-output/modulefiles/edge-containers-cli/0.1 deleted file mode 120000 index 00b90c0c..00000000 --- a/tests/samples/deploy-tools-output/modulefiles/edge-containers-cli/0.1 +++ /dev/null @@ -1 +0,0 @@ -/tmp/deploy-tools-output/modules/edge-containers-cli/0.1/modulefile \ No newline at end of file diff --git a/tests/samples/deploy-tools-output/modulefiles/phoebus/.version b/tests/samples/deploy-tools-output/modulefiles/phoebus/.version deleted file mode 100644 index d9b8f921..00000000 --- a/tests/samples/deploy-tools-output/modulefiles/phoebus/.version +++ /dev/null @@ -1,2 +0,0 @@ -#%Module1.0 -set ModulesVersion 0.1 diff --git a/tests/samples/deploy-tools-output/modulefiles/phoebus/0.1 b/tests/samples/deploy-tools-output/modulefiles/phoebus/0.1 deleted file mode 120000 index 5468b291..00000000 --- a/tests/samples/deploy-tools-output/modulefiles/phoebus/0.1 +++ /dev/null @@ -1 +0,0 @@ -/tmp/deploy-tools-output/modules/phoebus/0.1/modulefile \ No newline at end of file diff --git a/tests/samples/deploy-tools-output/modules/argocd/v2.14.10/module.yaml b/tests/samples/deploy-tools-output/modules/argocd/v2.14.10/module.yaml deleted file mode 100644 index 9cb7ad78..00000000 --- a/tests/samples/deploy-tools-output/modules/argocd/v2.14.10/module.yaml +++ /dev/null @@ -1,15 +0,0 @@ -allow_updates: false -applications: -- app_type: binary - hash: d1750274a336f0a090abf196a832cee14cb9f1c2fc3d20d80b0dbfeff83550fa - hash_type: sha256 - name: argocd - url: https://github.com/argoproj/argo-cd/releases/download/v2.14.10/argocd-linux-amd64 -dependencies: [] -description: Demonstration of binary download -env_vars: [] -exclude_from_defaults: false -load_script: [] -name: argocd -unload_script: [] -version: v2.14.10 diff --git a/tests/samples/deploy-tools-output/modules/argocd/v2.14.10/modulefile b/tests/samples/deploy-tools-output/modules/argocd/v2.14.10/modulefile deleted file mode 100644 index a4ef6d62..00000000 --- a/tests/samples/deploy-tools-output/modules/argocd/v2.14.10/modulefile +++ /dev/null @@ -1,13 +0,0 @@ -#%Module1.0 -## -## argocd - Demonstration of binary download -## -module-whatis "Demonstration of binary download" - -if { [module-info mode load] } { - if { [is-loaded argocd] } { - module unload argocd - } -} - -prepend-path PATH "/tmp/deploy-tools-output/modules/argocd/v2.14.10/entrypoints" diff --git a/tests/samples/deploy-tools-output/modules/dls-pmac-control/0.1/entrypoints/dls-pmac-control b/tests/samples/deploy-tools-output/modules/dls-pmac-control/0.1/entrypoints/dls-pmac-control deleted file mode 100755 index e09f6b48..00000000 --- a/tests/samples/deploy-tools-output/modules/dls-pmac-control/0.1/entrypoints/dls-pmac-control +++ /dev/null @@ -1,44 +0,0 @@ -#! /bin/bash - -# Arguments: -# ${@} = Remaining args to pass to the command - -# Halt on error -set -e - -# Mounts for container -mounts="" -# Additional arguments for apptainer -apptainer_args="-e" -# Sif file path -sif_file="$(dirname $0)/../sif_files/a2c305dc6e8732efbb76b32c89f884f4.sif" -# Command to run in container -command="dls-pmac-control" -# Options and arguments to pass to command -command_args="" - -# Raise an error if sif file does not exist -if [[ ! -f ${sif_file} ]]; then - echo "ERROR: sif file ${sif_file} does not exist" 1>&2 - exit 1 -fi - -# add mounts of host binaries into /usr/bin -for i in ; do - binary=$(which $i) - mounts="${mounts},${binary}:/usr/bin/${i}" -done - -# Set up mounts if any have been configured -if [[ ! -z ${mounts} ]]; then - opts="-B ${mounts}" -fi - -opts=${opts}" --env DISPLAY=${DISPLAY}" -opts=${opts}" ${apptainer_args}" - - -if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then - set -x -fi -apptainer exec ${opts} ${sif_file} ${command} ${command_args} "${@}" diff --git a/tests/samples/deploy-tools-output/modules/dls-pmac-control/0.1/entrypoints/test-echo-module-file b/tests/samples/deploy-tools-output/modules/dls-pmac-control/0.1/entrypoints/test-echo-module-file deleted file mode 100755 index 6da99f6f..00000000 --- a/tests/samples/deploy-tools-output/modules/dls-pmac-control/0.1/entrypoints/test-echo-module-file +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/bash - -if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then - set -x -fi - -echo $EXAMPLE_VALUE diff --git a/tests/samples/deploy-tools-output/modules/dls-pmac-control/0.1/module.yaml b/tests/samples/deploy-tools-output/modules/dls-pmac-control/0.1/module.yaml deleted file mode 100644 index 0f59a153..00000000 --- a/tests/samples/deploy-tools-output/modules/dls-pmac-control/0.1/module.yaml +++ /dev/null @@ -1,33 +0,0 @@ -allow_updates: false -applications: -- app_type: apptainer - container: - path: docker://ghcr.io/diamondlightsource/dls-pmac-control - version: 3.2.0b1 - entrypoints: - - command: dls-pmac-control - name: dls-pmac-control - options: - apptainer_args: -e - command_args: '' - host_binaries: [] - mounts: [] - global_options: - apptainer_args: '' - command_args: '' - host_binaries: [] - mounts: [] -- app_type: shell - name: test-echo-module-file - script: - - echo $EXAMPLE_VALUE -dependencies: [] -description: Demonstration of the deploy-tools process -env_vars: -- name: EXAMPLE_VALUE - value: Test message EXAMPLE_VALUE from example-module-file version 0.1 -exclude_from_defaults: false -load_script: [] -name: dls-pmac-control -unload_script: [] -version: '0.1' diff --git a/tests/samples/deploy-tools-output/modules/dls-pmac-control/0.1/modulefile b/tests/samples/deploy-tools-output/modules/dls-pmac-control/0.1/modulefile deleted file mode 100644 index fb4880c4..00000000 --- a/tests/samples/deploy-tools-output/modules/dls-pmac-control/0.1/modulefile +++ /dev/null @@ -1,15 +0,0 @@ -#%Module1.0 -## -## dls-pmac-control - Demonstration of the deploy-tools process -## -module-whatis "Demonstration of the deploy-tools process" - -if { [module-info mode load] } { - if { [is-loaded dls-pmac-control] } { - module unload dls-pmac-control - } -} - -setenv EXAMPLE_VALUE "Test message EXAMPLE_VALUE from example-module-file version 0.1" - -prepend-path PATH "/tmp/deploy-tools-output/modules/dls-pmac-control/0.1/entrypoints" diff --git a/tests/samples/deploy-tools-output/modules/dls-pmac-control/0.2/entrypoints/dls-pmac-control b/tests/samples/deploy-tools-output/modules/dls-pmac-control/0.2/entrypoints/dls-pmac-control deleted file mode 100755 index e09f6b48..00000000 --- a/tests/samples/deploy-tools-output/modules/dls-pmac-control/0.2/entrypoints/dls-pmac-control +++ /dev/null @@ -1,44 +0,0 @@ -#! /bin/bash - -# Arguments: -# ${@} = Remaining args to pass to the command - -# Halt on error -set -e - -# Mounts for container -mounts="" -# Additional arguments for apptainer -apptainer_args="-e" -# Sif file path -sif_file="$(dirname $0)/../sif_files/a2c305dc6e8732efbb76b32c89f884f4.sif" -# Command to run in container -command="dls-pmac-control" -# Options and arguments to pass to command -command_args="" - -# Raise an error if sif file does not exist -if [[ ! -f ${sif_file} ]]; then - echo "ERROR: sif file ${sif_file} does not exist" 1>&2 - exit 1 -fi - -# add mounts of host binaries into /usr/bin -for i in ; do - binary=$(which $i) - mounts="${mounts},${binary}:/usr/bin/${i}" -done - -# Set up mounts if any have been configured -if [[ ! -z ${mounts} ]]; then - opts="-B ${mounts}" -fi - -opts=${opts}" --env DISPLAY=${DISPLAY}" -opts=${opts}" ${apptainer_args}" - - -if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then - set -x -fi -apptainer exec ${opts} ${sif_file} ${command} ${command_args} "${@}" diff --git a/tests/samples/deploy-tools-output/modules/dls-pmac-control/0.2/entrypoints/test-echo-module-file b/tests/samples/deploy-tools-output/modules/dls-pmac-control/0.2/entrypoints/test-echo-module-file deleted file mode 100755 index 6da99f6f..00000000 --- a/tests/samples/deploy-tools-output/modules/dls-pmac-control/0.2/entrypoints/test-echo-module-file +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/bash - -if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then - set -x -fi - -echo $EXAMPLE_VALUE diff --git a/tests/samples/deploy-tools-output/modules/dls-pmac-control/0.2/module.yaml b/tests/samples/deploy-tools-output/modules/dls-pmac-control/0.2/module.yaml deleted file mode 100644 index d00eb836..00000000 --- a/tests/samples/deploy-tools-output/modules/dls-pmac-control/0.2/module.yaml +++ /dev/null @@ -1,33 +0,0 @@ -allow_updates: false -applications: -- app_type: apptainer - container: - path: docker://ghcr.io/diamondlightsource/dls-pmac-control - version: 3.2.0b1 - entrypoints: - - command: dls-pmac-control - name: dls-pmac-control - options: - apptainer_args: -e - command_args: '' - host_binaries: [] - mounts: [] - global_options: - apptainer_args: '' - command_args: '' - host_binaries: [] - mounts: [] -- app_type: shell - name: test-echo-module-file - script: - - echo $EXAMPLE_VALUE -dependencies: [] -description: Demonstration of the deploy-tools process -env_vars: -- name: EXAMPLE_VALUE - value: Test message EXAMPLE_VALUE from example-module-file version 0.2 -exclude_from_defaults: false -load_script: [] -name: dls-pmac-control -unload_script: [] -version: '0.2' diff --git a/tests/samples/deploy-tools-output/modules/dls-pmac-control/0.2/modulefile b/tests/samples/deploy-tools-output/modules/dls-pmac-control/0.2/modulefile deleted file mode 100644 index 72f3dd9e..00000000 --- a/tests/samples/deploy-tools-output/modules/dls-pmac-control/0.2/modulefile +++ /dev/null @@ -1,15 +0,0 @@ -#%Module1.0 -## -## dls-pmac-control - Demonstration of the deploy-tools process -## -module-whatis "Demonstration of the deploy-tools process" - -if { [module-info mode load] } { - if { [is-loaded dls-pmac-control] } { - module unload dls-pmac-control - } -} - -setenv EXAMPLE_VALUE "Test message EXAMPLE_VALUE from example-module-file version 0.2" - -prepend-path PATH "/tmp/deploy-tools-output/modules/dls-pmac-control/0.2/entrypoints" diff --git a/tests/samples/deploy-tools-output/modules/ec/i13-1/module.yaml b/tests/samples/deploy-tools-output/modules/ec/i13-1/module.yaml deleted file mode 100644 index 89d7b25b..00000000 --- a/tests/samples/deploy-tools-output/modules/ec/i13-1/module.yaml +++ /dev/null @@ -1,18 +0,0 @@ -allow_updates: false -applications: [] -dependencies: -- name: edge-containers-cli - version: null -- name: k8s-i13-1 - version: local -description: ec command line tool configured for i13-1 -env_vars: -- name: EC_TARGET - value: i13-1-beamline/i13-1 -- name: EC_SERVICES_REPO - value: https://gitlab.diamond.ac.uk/controls/containers/beamline/i13-1-services.git -exclude_from_defaults: false -load_script: [] -name: ec -unload_script: [] -version: i13-1 diff --git a/tests/samples/deploy-tools-output/modules/ec/i13-1/modulefile b/tests/samples/deploy-tools-output/modules/ec/i13-1/modulefile deleted file mode 100644 index 16411822..00000000 --- a/tests/samples/deploy-tools-output/modules/ec/i13-1/modulefile +++ /dev/null @@ -1,19 +0,0 @@ -#%Module1.0 -## -## ec - ec command line tool configured for i13-1 -## -module-whatis "ec command line tool configured for i13-1" - -if { [module-info mode load] } { - if { [is-loaded ec] } { - module unload ec - } -} - -module load edge-containers-cli -module load k8s-i13-1/local - -setenv EC_TARGET "i13-1-beamline/i13-1" -setenv EC_SERVICES_REPO "https://gitlab.diamond.ac.uk/controls/containers/beamline/i13-1-services.git" - -prepend-path PATH "/tmp/deploy-tools-output/modules/ec/i13-1/entrypoints" diff --git a/tests/samples/deploy-tools-output/modules/ec/p47/module.yaml b/tests/samples/deploy-tools-output/modules/ec/p47/module.yaml deleted file mode 100644 index 73d6a8b2..00000000 --- a/tests/samples/deploy-tools-output/modules/ec/p47/module.yaml +++ /dev/null @@ -1,18 +0,0 @@ -allow_updates: false -applications: [] -dependencies: -- name: edge-containers-cli - version: '0.1' -- name: pollux - version: local -description: ec command line tool configured for p47 -env_vars: -- name: EC_TARGET - value: p47-beamline/p47 -- name: EC_SERVICES_REPO - value: https://github.com/epics-containers/p47-services -exclude_from_defaults: false -load_script: [] -name: ec -unload_script: [] -version: p47 diff --git a/tests/samples/deploy-tools-output/modules/ec/p47/modulefile b/tests/samples/deploy-tools-output/modules/ec/p47/modulefile deleted file mode 100644 index 0f17b6bf..00000000 --- a/tests/samples/deploy-tools-output/modules/ec/p47/modulefile +++ /dev/null @@ -1,19 +0,0 @@ -#%Module1.0 -## -## ec - ec command line tool configured for p47 -## -module-whatis "ec command line tool configured for p47" - -if { [module-info mode load] } { - if { [is-loaded ec] } { - module unload ec - } -} - -module load edge-containers-cli/0.1 -module load pollux/local - -setenv EC_TARGET "p47-beamline/p47" -setenv EC_SERVICES_REPO "https://github.com/epics-containers/p47-services" - -prepend-path PATH "/tmp/deploy-tools-output/modules/ec/p47/entrypoints" diff --git a/tests/samples/deploy-tools-output/modules/edge-containers-cli/0.1/entrypoints/ec b/tests/samples/deploy-tools-output/modules/edge-containers-cli/0.1/entrypoints/ec deleted file mode 100755 index 03240d6d..00000000 --- a/tests/samples/deploy-tools-output/modules/edge-containers-cli/0.1/entrypoints/ec +++ /dev/null @@ -1,44 +0,0 @@ -#! /bin/bash - -# Arguments: -# ${@} = Remaining args to pass to the command - -# Halt on error -set -e - -# Mounts for container -mounts="/dls/science/users/:/dls/science/users/,/scratch:/scratch,/dls_sw/apps:/dls_sw/apps" -# Additional arguments for apptainer -apptainer_args="" -# Sif file path -sif_file="$(dirname $0)/../sif_files/4b34247055f8388a8877c90302ff30d2.sif" -# Command to run in container -command="ec" -# Options and arguments to pass to command -command_args="" - -# Raise an error if sif file does not exist -if [[ ! -f ${sif_file} ]]; then - echo "ERROR: sif file ${sif_file} does not exist" 1>&2 - exit 1 -fi - -# add mounts of host binaries into /usr/bin -for i in argocd kubectl helm kubelogin klogout kustomize kubeseal kubectl-oidc_login; do - binary=$(which $i) - mounts="${mounts},${binary}:/usr/bin/${i}" -done - -# Set up mounts if any have been configured -if [[ ! -z ${mounts} ]]; then - opts="-B ${mounts}" -fi - -opts=${opts}" --env DISPLAY=${DISPLAY}" -opts=${opts}" ${apptainer_args}" - - -if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then - set -x -fi -apptainer exec ${opts} ${sif_file} ${command} ${command_args} "${@}" diff --git a/tests/samples/deploy-tools-output/modules/edge-containers-cli/0.1/entrypoints/ec-bash b/tests/samples/deploy-tools-output/modules/edge-containers-cli/0.1/entrypoints/ec-bash deleted file mode 100755 index 4cb4464f..00000000 --- a/tests/samples/deploy-tools-output/modules/edge-containers-cli/0.1/entrypoints/ec-bash +++ /dev/null @@ -1,44 +0,0 @@ -#! /bin/bash - -# Arguments: -# ${@} = Remaining args to pass to the command - -# Halt on error -set -e - -# Mounts for container -mounts="/dls/science/users/:/dls/science/users/,/scratch:/scratch,/dls_sw/apps:/dls_sw/apps" -# Additional arguments for apptainer -apptainer_args="" -# Sif file path -sif_file="$(dirname $0)/../sif_files/4b34247055f8388a8877c90302ff30d2.sif" -# Command to run in container -command="bash" -# Options and arguments to pass to command -command_args="" - -# Raise an error if sif file does not exist -if [[ ! -f ${sif_file} ]]; then - echo "ERROR: sif file ${sif_file} does not exist" 1>&2 - exit 1 -fi - -# add mounts of host binaries into /usr/bin -for i in argocd kubectl helm kubelogin klogout kustomize kubeseal kubectl-oidc_login; do - binary=$(which $i) - mounts="${mounts},${binary}:/usr/bin/${i}" -done - -# Set up mounts if any have been configured -if [[ ! -z ${mounts} ]]; then - opts="-B ${mounts}" -fi - -opts=${opts}" --env DISPLAY=${DISPLAY}" -opts=${opts}" ${apptainer_args}" - - -if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then - set -x -fi -apptainer exec ${opts} ${sif_file} ${command} ${command_args} "${@}" diff --git a/tests/samples/deploy-tools-output/modules/edge-containers-cli/0.1/entrypoints/ec-login b/tests/samples/deploy-tools-output/modules/edge-containers-cli/0.1/entrypoints/ec-login deleted file mode 100755 index 71ebeae9..00000000 --- a/tests/samples/deploy-tools-output/modules/edge-containers-cli/0.1/entrypoints/ec-login +++ /dev/null @@ -1,8 +0,0 @@ -#! /bin/bash - -if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then - set -x -fi - -argocd login argocd.diamond.ac.uk --grpc-web --sso -kubectl version diff --git a/tests/samples/deploy-tools-output/modules/edge-containers-cli/0.1/module.yaml b/tests/samples/deploy-tools-output/modules/edge-containers-cli/0.1/module.yaml deleted file mode 100644 index d61fb20b..00000000 --- a/tests/samples/deploy-tools-output/modules/edge-containers-cli/0.1/module.yaml +++ /dev/null @@ -1,56 +0,0 @@ -allow_updates: false -applications: -- app_type: apptainer - container: - path: docker://ghcr.io/epics-containers/edge-containers-cli - version: 4.4.1 - entrypoints: - - command: ec - name: ec - options: - apptainer_args: '' - command_args: '' - host_binaries: [] - mounts: [] - - command: bash - name: ec-bash - options: - apptainer_args: '' - command_args: '' - host_binaries: [] - mounts: [] - global_options: - apptainer_args: '' - command_args: '' - host_binaries: - - argocd - - kubectl - - helm - - kubelogin - - klogout - - kustomize - - kubeseal - - kubectl-oidc_login - mounts: - - /dls/science/users/:/dls/science/users/ - - /scratch:/scratch - - /dls_sw/apps:/dls_sw/apps -- app_type: shell - name: ec-login - script: - - argocd login argocd.diamond.ac.uk --grpc-web --sso - - kubectl version -dependencies: -- name: argocd - version: v2.14.10 -description: ec command line tool for kubernetes IOCs -env_vars: -- name: EC_CLI_BACKEND - value: ARGOCD -- name: EC_LOG_URL - value: https://graylog.diamond.ac.uk/search?rangetype=relative&fields=message%2Csource&width=1489&highlightMessage=&relative=172800&q=pod_name%3A{service_name}* -exclude_from_defaults: false -load_script: [] -name: edge-containers-cli -unload_script: [] -version: '0.1' diff --git a/tests/samples/deploy-tools-output/modules/edge-containers-cli/0.1/modulefile b/tests/samples/deploy-tools-output/modules/edge-containers-cli/0.1/modulefile deleted file mode 100644 index 20a9e158..00000000 --- a/tests/samples/deploy-tools-output/modules/edge-containers-cli/0.1/modulefile +++ /dev/null @@ -1,18 +0,0 @@ -#%Module1.0 -## -## edge-containers-cli - ec command line tool for kubernetes IOCs -## -module-whatis "ec command line tool for kubernetes IOCs" - -if { [module-info mode load] } { - if { [is-loaded edge-containers-cli] } { - module unload edge-containers-cli - } -} - -module load argocd/v2.14.10 - -setenv EC_CLI_BACKEND "ARGOCD" -setenv EC_LOG_URL "https://graylog.diamond.ac.uk/search?rangetype=relative&fields=message%2Csource&width=1489&highlightMessage=&relative=172800&q=pod_name%3A{service_name}*" - -prepend-path PATH "/tmp/deploy-tools-output/modules/edge-containers-cli/0.1/entrypoints" diff --git a/tests/samples/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello b/tests/samples/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello index 8e6480e1..d43f0d44 100755 --- a/tests/samples/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello +++ b/tests/samples/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello @@ -7,7 +7,7 @@ set -e # Mounts for container -mounts="/dls_sw:/dls_sw_test:ro" +mounts="" # Additional arguments for apptainer apptainer_args="" # Sif file path diff --git a/tests/samples/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/show-directory b/tests/samples/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/show-directory deleted file mode 100755 index 111f5a57..00000000 --- a/tests/samples/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/show-directory +++ /dev/null @@ -1,44 +0,0 @@ -#! /bin/bash - -# Arguments: -# ${@} = Remaining args to pass to the command - -# Halt on error -set -e - -# Mounts for container -mounts="/dls_sw:/dls_sw_test:ro" -# Additional arguments for apptainer -apptainer_args="" -# Sif file path -sif_file="$(dirname $0)/../sif_files/a553018b87553334a94c33cb04eb025c.sif" -# Command to run in container -command="ls" -# Options and arguments to pass to command -command_args="-al /dls_sw_test" - -# Raise an error if sif file does not exist -if [[ ! -f ${sif_file} ]]; then - echo "ERROR: sif file ${sif_file} does not exist" 1>&2 - exit 1 -fi - -# add mounts of host binaries into /usr/bin -for i in ; do - binary=$(which $i) - mounts="${mounts},${binary}:/usr/bin/${i}" -done - -# Set up mounts if any have been configured -if [[ ! -z ${mounts} ]]; then - opts="-B ${mounts}" -fi - -opts=${opts}" --env DISPLAY=${DISPLAY}" -opts=${opts}" ${apptainer_args}" - - -if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then - set -x -fi -apptainer exec ${opts} ${sif_file} ${command} ${command_args} "${@}" diff --git a/tests/samples/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-folder b/tests/samples/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var similarity index 100% rename from tests/samples/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-folder rename to tests/samples/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var diff --git a/tests/samples/deploy-tools-output/modules/example-module-apps/0.1/module.yaml b/tests/samples/deploy-tools-output/modules/example-module-apps/0.1/module.yaml index 5f3ac87a..51a06102 100644 --- a/tests/samples/deploy-tools-output/modules/example-module-apps/0.1/module.yaml +++ b/tests/samples/deploy-tools-output/modules/example-module-apps/0.1/module.yaml @@ -12,21 +12,13 @@ applications: command_args: Hello host_binaries: [] mounts: [] - - command: ls - name: show-directory - options: - apptainer_args: '' - command_args: -al /dls_sw_test - host_binaries: [] - mounts: [] global_options: apptainer_args: '' command_args: '' host_binaries: [] - mounts: - - /dls_sw:/dls_sw_test:ro + mounts: [] - app_type: shell - name: test-echo-module-folder + name: test-echo-module-var script: - echo $OTHER_VALUE - app_type: shell @@ -39,7 +31,7 @@ dependencies: [] description: Demonstration of a module configuration folder env_vars: - name: OTHER_VALUE - value: Test message OTHER_VALUE from example-module-folder + value: Version 0.1 exclude_from_defaults: false load_script: [] name: example-module-apps diff --git a/tests/samples/deploy-tools-output/modules/example-module-apps/0.1/modulefile b/tests/samples/deploy-tools-output/modules/example-module-apps/0.1/modulefile index ae2ca594..b6458983 100644 --- a/tests/samples/deploy-tools-output/modules/example-module-apps/0.1/modulefile +++ b/tests/samples/deploy-tools-output/modules/example-module-apps/0.1/modulefile @@ -10,6 +10,6 @@ if { [module-info mode load] } { } } -setenv OTHER_VALUE "Test message OTHER_VALUE from example-module-folder" +setenv OTHER_VALUE "Version 0.1" prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-apps/0.1/entrypoints" diff --git a/tests/samples/deploy-tools-output/modules/example-module-deps/0.2/module.yaml b/tests/samples/deploy-tools-output/modules/example-module-deps/0.2/module.yaml index d65d333c..0765b12f 100644 --- a/tests/samples/deploy-tools-output/modules/example-module-deps/0.2/module.yaml +++ b/tests/samples/deploy-tools-output/modules/example-module-deps/0.2/module.yaml @@ -1,8 +1,6 @@ allow_updates: false applications: [] dependencies: -- name: dls-pmac-control - version: '0.1' - name: example-module-apps version: '0.1' description: Demonstration of deploy-tools dependencies diff --git a/tests/samples/deploy-tools-output/modules/example-module-deps/0.2/modulefile b/tests/samples/deploy-tools-output/modules/example-module-deps/0.2/modulefile index 33681986..a4fbe508 100644 --- a/tests/samples/deploy-tools-output/modules/example-module-deps/0.2/modulefile +++ b/tests/samples/deploy-tools-output/modules/example-module-deps/0.2/modulefile @@ -10,7 +10,6 @@ if { [module-info mode load] } { } } -module load dls-pmac-control/0.1 module load example-module-apps/0.1 prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-deps/0.2/entrypoints" diff --git a/tests/samples/deploy-tools-output/modules/phoebus/0.1/entrypoints/phoebus b/tests/samples/deploy-tools-output/modules/phoebus/0.1/entrypoints/phoebus deleted file mode 100755 index 0dc0feff..00000000 --- a/tests/samples/deploy-tools-output/modules/phoebus/0.1/entrypoints/phoebus +++ /dev/null @@ -1,44 +0,0 @@ -#! /bin/bash - -# Arguments: -# ${@} = Remaining args to pass to the command - -# Halt on error -set -e - -# Mounts for container -mounts="" -# Additional arguments for apptainer -apptainer_args="--env DISPLAY=${DISPLAY} -e" -# Sif file path -sif_file="$(dirname $0)/../sif_files/433dd7c0f3803fb792bf46b323938691.sif" -# Command to run in container -command="java -jar /phoebus/phoebus.jar -server 7010" -# Options and arguments to pass to command -command_args="-server 7010" - -# Raise an error if sif file does not exist -if [[ ! -f ${sif_file} ]]; then - echo "ERROR: sif file ${sif_file} does not exist" 1>&2 - exit 1 -fi - -# add mounts of host binaries into /usr/bin -for i in ; do - binary=$(which $i) - mounts="${mounts},${binary}:/usr/bin/${i}" -done - -# Set up mounts if any have been configured -if [[ ! -z ${mounts} ]]; then - opts="-B ${mounts}" -fi - -opts=${opts}" --env DISPLAY=${DISPLAY}" -opts=${opts}" ${apptainer_args}" - - -if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then - set -x -fi -apptainer exec ${opts} ${sif_file} ${command} ${command_args} "${@}" diff --git a/tests/samples/deploy-tools-output/modules/phoebus/0.1/module.yaml b/tests/samples/deploy-tools-output/modules/phoebus/0.1/module.yaml deleted file mode 100644 index 9f9b48a6..00000000 --- a/tests/samples/deploy-tools-output/modules/phoebus/0.1/module.yaml +++ /dev/null @@ -1,27 +0,0 @@ -allow_updates: false -applications: -- app_type: apptainer - container: - path: docker://ghcr.io/epics-containers/ec-phoebus - version: 4.7.3ec2 - entrypoints: - - command: java -jar /phoebus/phoebus.jar -server 7010 - name: phoebus - options: - apptainer_args: --env DISPLAY=${DISPLAY} -e - command_args: -server 7010 - host_binaries: [] - mounts: [] - global_options: - apptainer_args: '' - command_args: '' - host_binaries: [] - mounts: [] -dependencies: [] -description: Containerised release of CSS Phoebus -env_vars: [] -exclude_from_defaults: false -load_script: [] -name: phoebus -unload_script: [] -version: '0.1' diff --git a/tests/samples/deploy-tools-output/modules/phoebus/0.1/modulefile b/tests/samples/deploy-tools-output/modules/phoebus/0.1/modulefile deleted file mode 100644 index e3b3ee9f..00000000 --- a/tests/samples/deploy-tools-output/modules/phoebus/0.1/modulefile +++ /dev/null @@ -1,13 +0,0 @@ -#%Module1.0 -## -## phoebus - Containerised release of CSS Phoebus -## -module-whatis "Containerised release of CSS Phoebus" - -if { [module-info mode load] } { - if { [is-loaded phoebus] } { - module unload phoebus - } -} - -prepend-path PATH "/tmp/deploy-tools-output/modules/phoebus/0.1/entrypoints" From f061f9939fcf35082548a81c66431a1c2d8abeea Mon Sep 17 00:00:00 2001 From: Martin Gaughran Date: Sun, 14 Jun 2026 12:52:44 +0000 Subject: [PATCH 02/19] Split tests into separate files --- tests/test_cli.py | 51 ------------------------------------- tests/test_golden_master.py | 33 ++++++++++++++++++++++++ tests/test_schema_gen.py | 22 ++++++++++++++++ 3 files changed, 55 insertions(+), 51 deletions(-) create mode 100644 tests/test_golden_master.py create mode 100644 tests/test_schema_gen.py diff --git a/tests/test_cli.py b/tests/test_cli.py index df8efb7b..745afdd8 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1,60 +1,9 @@ import subprocess import sys -import tempfile -from pathlib import Path -from shutil import rmtree -from conftest import run_cli from deploy_tools import __version__ -PATH_TO_SCHEMAS = ( - Path(__file__).parent.parent / "src" / "deploy_tools" / "models" / "schemas" -) - def test_cli_version(): cmd = [sys.executable, "-m", "deploy_tools", "--version"] assert subprocess.check_output(cmd).decode().strip() == __version__ - - -def test_schema(schemas: Path): - with tempfile.TemporaryDirectory() as tmp: - tmp_path = Path(tmp) - - # Generate up to date schema files - run_cli("schema", tmp_path) - - # Compare with the expected schema files - for schema in tmp_path.glob("*.json"): - expected = schemas / schema.name - if schema.read_text() != expected.read_text(): - raise AssertionError(f"Schema file {expected} is out of date.") - - -def test_demo_configuration(samples: Path, demo_config: Path): - # use a fixed path for the demo configuration so that the outputs are consistent - out_folder = "deploy-tools-output" - temp_out = Path("/tmp") / out_folder - expected_out = samples / out_folder - - # make sure the output directory is empty and exists - rmtree(temp_out, ignore_errors=True) - temp_out.mkdir(exist_ok=True) - - # generate the demo configuration output - run_cli("sync", "--from-scratch", str(temp_out), str(demo_config)) - - # compare the output with the expected output - for expected in expected_out.glob("**/*"): - if expected.is_dir(): - continue - # check that the file exists in the output directory - out_file = temp_out / expected.relative_to(expected_out) - assert out_file.exists(), f"File {out_file} does not exist." - - # check that the file contents are the same - assert expected.read_text() == out_file.read_text(), ( - f"File {out_file} is different." - ) - - rmtree(temp_out, ignore_errors=True) diff --git a/tests/test_golden_master.py b/tests/test_golden_master.py new file mode 100644 index 00000000..4a53e6ea --- /dev/null +++ b/tests/test_golden_master.py @@ -0,0 +1,33 @@ +from pathlib import Path +from shutil import rmtree + +from conftest import run_cli + + +def test_demo_configuration(samples: Path, demo_config: Path): + # use a fixed path for the demo configuration so that the outputs are consistent + out_folder = "deploy-tools-output" + temp_out = Path("/tmp") / out_folder + expected_out = samples / out_folder + + # make sure the output directory is empty and exists + rmtree(temp_out, ignore_errors=True) + temp_out.mkdir(exist_ok=True) + + # generate the demo configuration output + run_cli("sync", "--from-scratch", str(temp_out), str(demo_config)) + + # compare the output with the expected output + for expected in expected_out.glob("**/*"): + if expected.is_dir(): + continue + # check that the file exists in the output directory + out_file = temp_out / expected.relative_to(expected_out) + assert out_file.exists(), f"File {out_file} does not exist." + + # check that the file contents are the same + assert expected.read_text() == out_file.read_text(), ( + f"File {out_file} is different." + ) + + rmtree(temp_out, ignore_errors=True) diff --git a/tests/test_schema_gen.py b/tests/test_schema_gen.py new file mode 100644 index 00000000..31ecf3a7 --- /dev/null +++ b/tests/test_schema_gen.py @@ -0,0 +1,22 @@ +import tempfile +from pathlib import Path + +from conftest import run_cli + +PATH_TO_SCHEMAS = ( + Path(__file__).parent.parent / "src" / "deploy_tools" / "models" / "schemas" +) + + +def test_schema_gen(schemas: Path): + with tempfile.TemporaryDirectory() as tmp: + tmp_path = Path(tmp) + + # Generate up to date schema files + run_cli("schema", tmp_path) + + # Compare with the expected schema files + for schema in tmp_path.glob("*.json"): + expected = schemas / schema.name + if schema.read_text() != expected.read_text(): + raise AssertionError(f"Schema file {expected} is out of date.") From 8f987c1e38fed13de5fc1981c21d6ba508cca331 Mon Sep 17 00:00:00 2001 From: Martin Gaughran Date: Mon, 15 Jun 2026 13:12:07 +0000 Subject: [PATCH 03/19] Cover module deprecation and removal in golden master No longer uses the demo_configuration folder for test configuration. --- .../01-initial/example-module-apps/0.1.yaml | 37 ++++++++++ .../01-initial/example-module-deps/0.2.yaml | 12 ++++ tests/configs/01-initial/settings.yaml | 3 + .../example-module-apps/0.1.yaml | 37 ++++++++++ .../example-module-deps/0.2.yaml | 16 +++++ tests/configs/02-deprecated/settings.yaml | 3 + .../03-removed/example-module-apps/0.1.yaml | 37 ++++++++++ tests/configs/03-removed/settings.yaml | 3 + tests/conftest.py | 4 +- tests/generate_samples.sh | 39 ++++++++-- .../deploy-tools-output/deployment.yaml | 0 .../modulefiles/example-module-apps/.version | 0 .../modulefiles/example-module-apps/0.1 | 0 .../modulefiles/example-module-deps/.version | 0 .../modulefiles/example-module-deps/0.2 | 0 .../0.1/entrypoints/cowsay-hello | 0 .../0.1/entrypoints/test-echo-module-var | 0 .../0.1/entrypoints/test-shell-script | 0 .../example-module-apps/0.1/module.yaml | 0 .../example-module-apps/0.1/modulefile | 0 .../example-module-deps/0.2/module.yaml | 0 .../example-module-deps/0.2/modulefile | 0 .../deploy-tools-output/deployment.yaml | 62 ++++++++++++++++ .../modulefiles/example-module-deps/0.2 | 1 + .../modulefiles/example-module-apps/.version | 2 + .../modulefiles/example-module-apps/0.1 | 1 + .../0.1/entrypoints/cowsay-hello | 44 ++++++++++++ .../0.1/entrypoints/test-echo-module-var | 7 ++ .../0.1/entrypoints/test-shell-script | 9 +++ .../example-module-apps/0.1/module.yaml | 39 ++++++++++ .../example-module-apps/0.1/modulefile | 15 ++++ .../example-module-deps/0.2/module.yaml | 12 ++++ .../example-module-deps/0.2/modulefile | 15 ++++ .../deploy-tools-output/deployment.yaml | 46 ++++++++++++ .../modulefiles/example-module-apps/.version | 2 + .../modulefiles/example-module-apps/0.1 | 1 + .../0.1/entrypoints/cowsay-hello | 44 ++++++++++++ .../0.1/entrypoints/test-echo-module-var | 7 ++ .../0.1/entrypoints/test-shell-script | 9 +++ .../example-module-apps/0.1/module.yaml | 39 ++++++++++ .../example-module-apps/0.1/modulefile | 15 ++++ tests/test_golden_master.py | 72 ++++++++++++++----- 42 files changed, 606 insertions(+), 27 deletions(-) create mode 100644 tests/configs/01-initial/example-module-apps/0.1.yaml create mode 100644 tests/configs/01-initial/example-module-deps/0.2.yaml create mode 100644 tests/configs/01-initial/settings.yaml create mode 100644 tests/configs/02-deprecated/example-module-apps/0.1.yaml create mode 100644 tests/configs/02-deprecated/example-module-deps/0.2.yaml create mode 100644 tests/configs/02-deprecated/settings.yaml create mode 100644 tests/configs/03-removed/example-module-apps/0.1.yaml create mode 100644 tests/configs/03-removed/settings.yaml rename tests/samples/{ => 01-initial}/deploy-tools-output/deployment.yaml (100%) rename tests/samples/{ => 01-initial}/deploy-tools-output/modulefiles/example-module-apps/.version (100%) rename tests/samples/{ => 01-initial}/deploy-tools-output/modulefiles/example-module-apps/0.1 (100%) rename tests/samples/{ => 01-initial}/deploy-tools-output/modulefiles/example-module-deps/.version (100%) rename tests/samples/{ => 01-initial}/deploy-tools-output/modulefiles/example-module-deps/0.2 (100%) rename tests/samples/{ => 01-initial}/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello (100%) rename tests/samples/{ => 01-initial}/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var (100%) rename tests/samples/{ => 01-initial}/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script (100%) rename tests/samples/{ => 01-initial}/deploy-tools-output/modules/example-module-apps/0.1/module.yaml (100%) rename tests/samples/{ => 01-initial}/deploy-tools-output/modules/example-module-apps/0.1/modulefile (100%) rename tests/samples/{ => 01-initial}/deploy-tools-output/modules/example-module-deps/0.2/module.yaml (100%) rename tests/samples/{ => 01-initial}/deploy-tools-output/modules/example-module-deps/0.2/modulefile (100%) create mode 100644 tests/samples/02-deprecated/deploy-tools-output/deployment.yaml create mode 120000 tests/samples/02-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 create mode 100644 tests/samples/02-deprecated/deploy-tools-output/modulefiles/example-module-apps/.version create mode 120000 tests/samples/02-deprecated/deploy-tools-output/modulefiles/example-module-apps/0.1 create mode 100755 tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello create mode 100755 tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var create mode 100755 tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script create mode 100644 tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/module.yaml create mode 100644 tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/modulefile create mode 100644 tests/samples/02-deprecated/deploy-tools-output/modules/example-module-deps/0.2/module.yaml create mode 100644 tests/samples/02-deprecated/deploy-tools-output/modules/example-module-deps/0.2/modulefile create mode 100644 tests/samples/03-removed/deploy-tools-output/deployment.yaml create mode 100644 tests/samples/03-removed/deploy-tools-output/modulefiles/example-module-apps/.version create mode 120000 tests/samples/03-removed/deploy-tools-output/modulefiles/example-module-apps/0.1 create mode 100755 tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello create mode 100755 tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var create mode 100755 tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script create mode 100644 tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/module.yaml create mode 100644 tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/modulefile diff --git a/tests/configs/01-initial/example-module-apps/0.1.yaml b/tests/configs/01-initial/example-module-apps/0.1.yaml new file mode 100644 index 00000000..0a934518 --- /dev/null +++ b/tests/configs/01-initial/example-module-apps/0.1.yaml @@ -0,0 +1,37 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: example-module-apps + version: "0.1" + description: Demonstration of a module configuration folder + + env_vars: + - name: OTHER_VALUE + value: Version 0.1 + + applications: + - app_type: apptainer + + container: + path: docker://ghcr.io/apptainer/lolcow + version: latest + + entrypoints: + - name: cowsay-hello + command: cowsay + options: + command_args: Hello + + - app_type: shell + + name: test-echo-module-var + script: + - echo $OTHER_VALUE + + - app_type: shell + + name: test-shell-script + script: + - "echo This is the first line of a shell script" + - "echo and this is the second line." + - "echo Your input is ${1}" diff --git a/tests/configs/01-initial/example-module-deps/0.2.yaml b/tests/configs/01-initial/example-module-deps/0.2.yaml new file mode 100644 index 00000000..4e5c3fc4 --- /dev/null +++ b/tests/configs/01-initial/example-module-deps/0.2.yaml @@ -0,0 +1,12 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: example-module-deps + version: "0.2" + description: Demonstration of deploy-tools dependencies + + dependencies: + - name: example-module-apps + version: "0.1" + + applications: [] diff --git a/tests/configs/01-initial/settings.yaml b/tests/configs/01-initial/settings.yaml new file mode 100644 index 00000000..70f60017 --- /dev/null +++ b/tests/configs/01-initial/settings.yaml @@ -0,0 +1,3 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/deployment-settings.json + +default_versions: {} diff --git a/tests/configs/02-deprecated/example-module-apps/0.1.yaml b/tests/configs/02-deprecated/example-module-apps/0.1.yaml new file mode 100644 index 00000000..0a934518 --- /dev/null +++ b/tests/configs/02-deprecated/example-module-apps/0.1.yaml @@ -0,0 +1,37 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: example-module-apps + version: "0.1" + description: Demonstration of a module configuration folder + + env_vars: + - name: OTHER_VALUE + value: Version 0.1 + + applications: + - app_type: apptainer + + container: + path: docker://ghcr.io/apptainer/lolcow + version: latest + + entrypoints: + - name: cowsay-hello + command: cowsay + options: + command_args: Hello + + - app_type: shell + + name: test-echo-module-var + script: + - echo $OTHER_VALUE + + - app_type: shell + + name: test-shell-script + script: + - "echo This is the first line of a shell script" + - "echo and this is the second line." + - "echo Your input is ${1}" diff --git a/tests/configs/02-deprecated/example-module-deps/0.2.yaml b/tests/configs/02-deprecated/example-module-deps/0.2.yaml new file mode 100644 index 00000000..e327b454 --- /dev/null +++ b/tests/configs/02-deprecated/example-module-deps/0.2.yaml @@ -0,0 +1,16 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: example-module-deps + version: "0.2" + description: Demonstration of deploy-tools dependencies + + dependencies: + - name: example-module-apps + version: "0.1" + + applications: [] + +# Mark this release as deprecated: its modulefile link moves into the deprecated area +# while the built module remains available, as a precursor to full removal. +deprecated: true diff --git a/tests/configs/02-deprecated/settings.yaml b/tests/configs/02-deprecated/settings.yaml new file mode 100644 index 00000000..70f60017 --- /dev/null +++ b/tests/configs/02-deprecated/settings.yaml @@ -0,0 +1,3 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/deployment-settings.json + +default_versions: {} diff --git a/tests/configs/03-removed/example-module-apps/0.1.yaml b/tests/configs/03-removed/example-module-apps/0.1.yaml new file mode 100644 index 00000000..0a934518 --- /dev/null +++ b/tests/configs/03-removed/example-module-apps/0.1.yaml @@ -0,0 +1,37 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: example-module-apps + version: "0.1" + description: Demonstration of a module configuration folder + + env_vars: + - name: OTHER_VALUE + value: Version 0.1 + + applications: + - app_type: apptainer + + container: + path: docker://ghcr.io/apptainer/lolcow + version: latest + + entrypoints: + - name: cowsay-hello + command: cowsay + options: + command_args: Hello + + - app_type: shell + + name: test-echo-module-var + script: + - echo $OTHER_VALUE + + - app_type: shell + + name: test-shell-script + script: + - "echo This is the first line of a shell script" + - "echo and this is the second line." + - "echo Your input is ${1}" diff --git a/tests/configs/03-removed/settings.yaml b/tests/configs/03-removed/settings.yaml new file mode 100644 index 00000000..70f60017 --- /dev/null +++ b/tests/configs/03-removed/settings.yaml @@ -0,0 +1,3 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/deployment-settings.json + +default_versions: {} diff --git a/tests/conftest.py b/tests/conftest.py index 77e0c8eb..b100119b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -26,5 +26,5 @@ def samples(): @pytest.fixture -def demo_config(): - return Path(__file__).parent.parent / "src" / "deploy_tools" / "demo_configuration" +def configs(): + return Path(__file__).parent / "configs" diff --git a/tests/generate_samples.sh b/tests/generate_samples.sh index bdcd275a..0149558f 100755 --- a/tests/generate_samples.sh +++ b/tests/generate_samples.sh @@ -4,18 +4,43 @@ set -xe THIS_DIR=$(realpath $(dirname ${0})) SAMPLES_DIR=${THIS_DIR}/samples +CONFIGS_DIR=${THIS_DIR}/configs TMP_DIR=/tmp/deploy-tools-output rm -rf "${SAMPLES_DIR}" rm -rf "${TMP_DIR}" mkdir -p "${TMP_DIR}" -deploy-tools sync --from-scratch ${TMP_DIR} ${THIS_DIR}/../src/deploy_tools/demo_configuration +# Copy the current state of the deployment area into the samples directory as the golden +# master for the named lifecycle stage. Files that should not be committed are dropped +# from the copy only (not from the live area): .sif images are large and not +# reproducible, and .git/.gitignore belong to the deployment area's own history rather +# than its deployed content. The live area keeps its git repository so that the +# subsequent (non --from-scratch) syncs can run against it. +save_sample () { + local stage=${1} + local stage_dir=${SAMPLES_DIR}/${stage} -# don't keep the sif or git files -rm -rf $(find ${TMP_DIR} -name "*.sif") -rm -rf ${TMP_DIR}/.git* + mkdir -p "${stage_dir}" + cp -r "${TMP_DIR}" "${stage_dir}" -rm -rf ${SAMPLES_DIR} -mkdir -p ${SAMPLES_DIR} -cp -r ${TMP_DIR} ${SAMPLES_DIR} + local dest=${stage_dir}/$(basename ${TMP_DIR}) + find "${dest}" -name "*.sif" -delete + rm -rf "${dest}"/.git* +} + +# The lifecycle stages share a single deployment area and must run in order, as +# deprecation and removal build on the previous deployment state. Only the first sync +# uses --from-scratch. + +# Stage 1: deploy the initial configuration into an empty area. +deploy-tools sync --from-scratch "${TMP_DIR}" "${CONFIGS_DIR}/01-initial" +save_sample 01-initial + +# Stage 2: deprecate example-module-deps/0.2 (modulefile link moves to deprecated area). +deploy-tools sync "${TMP_DIR}" "${CONFIGS_DIR}/02-deprecated" +save_sample 02-deprecated + +# Stage 3: remove the now-deprecated example-module-deps/0.2 entirely. +deploy-tools sync "${TMP_DIR}" "${CONFIGS_DIR}/03-removed" +save_sample 03-removed diff --git a/tests/samples/deploy-tools-output/deployment.yaml b/tests/samples/01-initial/deploy-tools-output/deployment.yaml similarity index 100% rename from tests/samples/deploy-tools-output/deployment.yaml rename to tests/samples/01-initial/deploy-tools-output/deployment.yaml diff --git a/tests/samples/deploy-tools-output/modulefiles/example-module-apps/.version b/tests/samples/01-initial/deploy-tools-output/modulefiles/example-module-apps/.version similarity index 100% rename from tests/samples/deploy-tools-output/modulefiles/example-module-apps/.version rename to tests/samples/01-initial/deploy-tools-output/modulefiles/example-module-apps/.version diff --git a/tests/samples/deploy-tools-output/modulefiles/example-module-apps/0.1 b/tests/samples/01-initial/deploy-tools-output/modulefiles/example-module-apps/0.1 similarity index 100% rename from tests/samples/deploy-tools-output/modulefiles/example-module-apps/0.1 rename to tests/samples/01-initial/deploy-tools-output/modulefiles/example-module-apps/0.1 diff --git a/tests/samples/deploy-tools-output/modulefiles/example-module-deps/.version b/tests/samples/01-initial/deploy-tools-output/modulefiles/example-module-deps/.version similarity index 100% rename from tests/samples/deploy-tools-output/modulefiles/example-module-deps/.version rename to tests/samples/01-initial/deploy-tools-output/modulefiles/example-module-deps/.version diff --git a/tests/samples/deploy-tools-output/modulefiles/example-module-deps/0.2 b/tests/samples/01-initial/deploy-tools-output/modulefiles/example-module-deps/0.2 similarity index 100% rename from tests/samples/deploy-tools-output/modulefiles/example-module-deps/0.2 rename to tests/samples/01-initial/deploy-tools-output/modulefiles/example-module-deps/0.2 diff --git a/tests/samples/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello b/tests/samples/01-initial/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello similarity index 100% rename from tests/samples/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello rename to tests/samples/01-initial/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello diff --git a/tests/samples/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var b/tests/samples/01-initial/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var similarity index 100% rename from tests/samples/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var rename to tests/samples/01-initial/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var diff --git a/tests/samples/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script b/tests/samples/01-initial/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script similarity index 100% rename from tests/samples/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script rename to tests/samples/01-initial/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script diff --git a/tests/samples/deploy-tools-output/modules/example-module-apps/0.1/module.yaml b/tests/samples/01-initial/deploy-tools-output/modules/example-module-apps/0.1/module.yaml similarity index 100% rename from tests/samples/deploy-tools-output/modules/example-module-apps/0.1/module.yaml rename to tests/samples/01-initial/deploy-tools-output/modules/example-module-apps/0.1/module.yaml diff --git a/tests/samples/deploy-tools-output/modules/example-module-apps/0.1/modulefile b/tests/samples/01-initial/deploy-tools-output/modules/example-module-apps/0.1/modulefile similarity index 100% rename from tests/samples/deploy-tools-output/modules/example-module-apps/0.1/modulefile rename to tests/samples/01-initial/deploy-tools-output/modules/example-module-apps/0.1/modulefile diff --git a/tests/samples/deploy-tools-output/modules/example-module-deps/0.2/module.yaml b/tests/samples/01-initial/deploy-tools-output/modules/example-module-deps/0.2/module.yaml similarity index 100% rename from tests/samples/deploy-tools-output/modules/example-module-deps/0.2/module.yaml rename to tests/samples/01-initial/deploy-tools-output/modules/example-module-deps/0.2/module.yaml diff --git a/tests/samples/deploy-tools-output/modules/example-module-deps/0.2/modulefile b/tests/samples/01-initial/deploy-tools-output/modules/example-module-deps/0.2/modulefile similarity index 100% rename from tests/samples/deploy-tools-output/modules/example-module-deps/0.2/modulefile rename to tests/samples/01-initial/deploy-tools-output/modules/example-module-deps/0.2/modulefile diff --git a/tests/samples/02-deprecated/deploy-tools-output/deployment.yaml b/tests/samples/02-deprecated/deploy-tools-output/deployment.yaml new file mode 100644 index 00000000..9a59c4f8 --- /dev/null +++ b/tests/samples/02-deprecated/deploy-tools-output/deployment.yaml @@ -0,0 +1,62 @@ +releases: + example-module-apps: + '0.1': + deprecated: false + module: + allow_updates: false + applications: + - app_type: apptainer + container: + path: docker://ghcr.io/apptainer/lolcow + version: latest + entrypoints: + - command: cowsay + name: cowsay-hello + options: + apptainer_args: '' + command_args: Hello + host_binaries: [] + mounts: [] + global_options: + apptainer_args: '' + command_args: '' + host_binaries: [] + mounts: [] + - app_type: shell + name: test-echo-module-var + script: + - echo $OTHER_VALUE + - app_type: shell + name: test-shell-script + script: + - echo This is the first line of a shell script + - echo and this is the second line. + - echo Your input is ${1} + dependencies: [] + description: Demonstration of a module configuration folder + env_vars: + - name: OTHER_VALUE + value: Version 0.1 + exclude_from_defaults: false + load_script: [] + name: example-module-apps + unload_script: [] + version: '0.1' + example-module-deps: + '0.2': + deprecated: true + module: + allow_updates: false + applications: [] + dependencies: + - name: example-module-apps + version: '0.1' + description: Demonstration of deploy-tools dependencies + env_vars: [] + exclude_from_defaults: false + load_script: [] + name: example-module-deps + unload_script: [] + version: '0.2' +settings: + default_versions: {} diff --git a/tests/samples/02-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 b/tests/samples/02-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 new file mode 120000 index 00000000..cd04ecdf --- /dev/null +++ b/tests/samples/02-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/example-module-deps/0.2/modulefile \ No newline at end of file diff --git a/tests/samples/02-deprecated/deploy-tools-output/modulefiles/example-module-apps/.version b/tests/samples/02-deprecated/deploy-tools-output/modulefiles/example-module-apps/.version new file mode 100644 index 00000000..d9b8f921 --- /dev/null +++ b/tests/samples/02-deprecated/deploy-tools-output/modulefiles/example-module-apps/.version @@ -0,0 +1,2 @@ +#%Module1.0 +set ModulesVersion 0.1 diff --git a/tests/samples/02-deprecated/deploy-tools-output/modulefiles/example-module-apps/0.1 b/tests/samples/02-deprecated/deploy-tools-output/modulefiles/example-module-apps/0.1 new file mode 120000 index 00000000..53b90576 --- /dev/null +++ b/tests/samples/02-deprecated/deploy-tools-output/modulefiles/example-module-apps/0.1 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/example-module-apps/0.1/modulefile \ No newline at end of file diff --git a/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello b/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello new file mode 100755 index 00000000..d43f0d44 --- /dev/null +++ b/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello @@ -0,0 +1,44 @@ +#! /bin/bash + +# Arguments: +# ${@} = Remaining args to pass to the command + +# Halt on error +set -e + +# Mounts for container +mounts="" +# Additional arguments for apptainer +apptainer_args="" +# Sif file path +sif_file="$(dirname $0)/../sif_files/a553018b87553334a94c33cb04eb025c.sif" +# Command to run in container +command="cowsay" +# Options and arguments to pass to command +command_args="Hello" + +# Raise an error if sif file does not exist +if [[ ! -f ${sif_file} ]]; then + echo "ERROR: sif file ${sif_file} does not exist" 1>&2 + exit 1 +fi + +# add mounts of host binaries into /usr/bin +for i in ; do + binary=$(which $i) + mounts="${mounts},${binary}:/usr/bin/${i}" +done + +# Set up mounts if any have been configured +if [[ ! -z ${mounts} ]]; then + opts="-B ${mounts}" +fi + +opts=${opts}" --env DISPLAY=${DISPLAY}" +opts=${opts}" ${apptainer_args}" + + +if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then + set -x +fi +apptainer exec ${opts} ${sif_file} ${command} ${command_args} "${@}" diff --git a/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var b/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var new file mode 100755 index 00000000..0a367ddf --- /dev/null +++ b/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var @@ -0,0 +1,7 @@ +#! /bin/bash + +if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then + set -x +fi + +echo $OTHER_VALUE diff --git a/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script b/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script new file mode 100755 index 00000000..6ca6871d --- /dev/null +++ b/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script @@ -0,0 +1,9 @@ +#! /bin/bash + +if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then + set -x +fi + +echo This is the first line of a shell script +echo and this is the second line. +echo Your input is ${1} diff --git a/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/module.yaml b/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/module.yaml new file mode 100644 index 00000000..51a06102 --- /dev/null +++ b/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/module.yaml @@ -0,0 +1,39 @@ +allow_updates: false +applications: +- app_type: apptainer + container: + path: docker://ghcr.io/apptainer/lolcow + version: latest + entrypoints: + - command: cowsay + name: cowsay-hello + options: + apptainer_args: '' + command_args: Hello + host_binaries: [] + mounts: [] + global_options: + apptainer_args: '' + command_args: '' + host_binaries: [] + mounts: [] +- app_type: shell + name: test-echo-module-var + script: + - echo $OTHER_VALUE +- app_type: shell + name: test-shell-script + script: + - echo This is the first line of a shell script + - echo and this is the second line. + - echo Your input is ${1} +dependencies: [] +description: Demonstration of a module configuration folder +env_vars: +- name: OTHER_VALUE + value: Version 0.1 +exclude_from_defaults: false +load_script: [] +name: example-module-apps +unload_script: [] +version: '0.1' diff --git a/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/modulefile b/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/modulefile new file mode 100644 index 00000000..b6458983 --- /dev/null +++ b/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## example-module-apps - Demonstration of a module configuration folder +## +module-whatis "Demonstration of a module configuration folder" + +if { [module-info mode load] } { + if { [is-loaded example-module-apps] } { + module unload example-module-apps + } +} + +setenv OTHER_VALUE "Version 0.1" + +prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-apps/0.1/entrypoints" diff --git a/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-deps/0.2/module.yaml b/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-deps/0.2/module.yaml new file mode 100644 index 00000000..0765b12f --- /dev/null +++ b/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-deps/0.2/module.yaml @@ -0,0 +1,12 @@ +allow_updates: false +applications: [] +dependencies: +- name: example-module-apps + version: '0.1' +description: Demonstration of deploy-tools dependencies +env_vars: [] +exclude_from_defaults: false +load_script: [] +name: example-module-deps +unload_script: [] +version: '0.2' diff --git a/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-deps/0.2/modulefile b/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-deps/0.2/modulefile new file mode 100644 index 00000000..a4fbe508 --- /dev/null +++ b/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-deps/0.2/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## example-module-deps - Demonstration of deploy-tools dependencies +## +module-whatis "Demonstration of deploy-tools dependencies" + +if { [module-info mode load] } { + if { [is-loaded example-module-deps] } { + module unload example-module-deps + } +} + +module load example-module-apps/0.1 + +prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-deps/0.2/entrypoints" diff --git a/tests/samples/03-removed/deploy-tools-output/deployment.yaml b/tests/samples/03-removed/deploy-tools-output/deployment.yaml new file mode 100644 index 00000000..aef13070 --- /dev/null +++ b/tests/samples/03-removed/deploy-tools-output/deployment.yaml @@ -0,0 +1,46 @@ +releases: + example-module-apps: + '0.1': + deprecated: false + module: + allow_updates: false + applications: + - app_type: apptainer + container: + path: docker://ghcr.io/apptainer/lolcow + version: latest + entrypoints: + - command: cowsay + name: cowsay-hello + options: + apptainer_args: '' + command_args: Hello + host_binaries: [] + mounts: [] + global_options: + apptainer_args: '' + command_args: '' + host_binaries: [] + mounts: [] + - app_type: shell + name: test-echo-module-var + script: + - echo $OTHER_VALUE + - app_type: shell + name: test-shell-script + script: + - echo This is the first line of a shell script + - echo and this is the second line. + - echo Your input is ${1} + dependencies: [] + description: Demonstration of a module configuration folder + env_vars: + - name: OTHER_VALUE + value: Version 0.1 + exclude_from_defaults: false + load_script: [] + name: example-module-apps + unload_script: [] + version: '0.1' +settings: + default_versions: {} diff --git a/tests/samples/03-removed/deploy-tools-output/modulefiles/example-module-apps/.version b/tests/samples/03-removed/deploy-tools-output/modulefiles/example-module-apps/.version new file mode 100644 index 00000000..d9b8f921 --- /dev/null +++ b/tests/samples/03-removed/deploy-tools-output/modulefiles/example-module-apps/.version @@ -0,0 +1,2 @@ +#%Module1.0 +set ModulesVersion 0.1 diff --git a/tests/samples/03-removed/deploy-tools-output/modulefiles/example-module-apps/0.1 b/tests/samples/03-removed/deploy-tools-output/modulefiles/example-module-apps/0.1 new file mode 120000 index 00000000..53b90576 --- /dev/null +++ b/tests/samples/03-removed/deploy-tools-output/modulefiles/example-module-apps/0.1 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/example-module-apps/0.1/modulefile \ No newline at end of file diff --git a/tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello b/tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello new file mode 100755 index 00000000..d43f0d44 --- /dev/null +++ b/tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello @@ -0,0 +1,44 @@ +#! /bin/bash + +# Arguments: +# ${@} = Remaining args to pass to the command + +# Halt on error +set -e + +# Mounts for container +mounts="" +# Additional arguments for apptainer +apptainer_args="" +# Sif file path +sif_file="$(dirname $0)/../sif_files/a553018b87553334a94c33cb04eb025c.sif" +# Command to run in container +command="cowsay" +# Options and arguments to pass to command +command_args="Hello" + +# Raise an error if sif file does not exist +if [[ ! -f ${sif_file} ]]; then + echo "ERROR: sif file ${sif_file} does not exist" 1>&2 + exit 1 +fi + +# add mounts of host binaries into /usr/bin +for i in ; do + binary=$(which $i) + mounts="${mounts},${binary}:/usr/bin/${i}" +done + +# Set up mounts if any have been configured +if [[ ! -z ${mounts} ]]; then + opts="-B ${mounts}" +fi + +opts=${opts}" --env DISPLAY=${DISPLAY}" +opts=${opts}" ${apptainer_args}" + + +if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then + set -x +fi +apptainer exec ${opts} ${sif_file} ${command} ${command_args} "${@}" diff --git a/tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var b/tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var new file mode 100755 index 00000000..0a367ddf --- /dev/null +++ b/tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var @@ -0,0 +1,7 @@ +#! /bin/bash + +if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then + set -x +fi + +echo $OTHER_VALUE diff --git a/tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script b/tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script new file mode 100755 index 00000000..6ca6871d --- /dev/null +++ b/tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script @@ -0,0 +1,9 @@ +#! /bin/bash + +if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then + set -x +fi + +echo This is the first line of a shell script +echo and this is the second line. +echo Your input is ${1} diff --git a/tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/module.yaml b/tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/module.yaml new file mode 100644 index 00000000..51a06102 --- /dev/null +++ b/tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/module.yaml @@ -0,0 +1,39 @@ +allow_updates: false +applications: +- app_type: apptainer + container: + path: docker://ghcr.io/apptainer/lolcow + version: latest + entrypoints: + - command: cowsay + name: cowsay-hello + options: + apptainer_args: '' + command_args: Hello + host_binaries: [] + mounts: [] + global_options: + apptainer_args: '' + command_args: '' + host_binaries: [] + mounts: [] +- app_type: shell + name: test-echo-module-var + script: + - echo $OTHER_VALUE +- app_type: shell + name: test-shell-script + script: + - echo This is the first line of a shell script + - echo and this is the second line. + - echo Your input is ${1} +dependencies: [] +description: Demonstration of a module configuration folder +env_vars: +- name: OTHER_VALUE + value: Version 0.1 +exclude_from_defaults: false +load_script: [] +name: example-module-apps +unload_script: [] +version: '0.1' diff --git a/tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/modulefile b/tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/modulefile new file mode 100644 index 00000000..b6458983 --- /dev/null +++ b/tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## example-module-apps - Demonstration of a module configuration folder +## +module-whatis "Demonstration of a module configuration folder" + +if { [module-info mode load] } { + if { [is-loaded example-module-apps] } { + module unload example-module-apps + } +} + +setenv OTHER_VALUE "Version 0.1" + +prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-apps/0.1/entrypoints" diff --git a/tests/test_golden_master.py b/tests/test_golden_master.py index 4a53e6ea..b0dd73ff 100644 --- a/tests/test_golden_master.py +++ b/tests/test_golden_master.py @@ -3,31 +3,67 @@ from conftest import run_cli +# Fixed deployment path so that generated modulefiles (which embed absolute paths) match +# the committed golden master output. The lifecycle stages below all share this single +# deployment area, as deprecation and removal build on the previous deployment state. +DEPLOYMENT_DIRNAME = "deploy-tools-output" +TEMP_OUT = Path("/tmp") / DEPLOYMENT_DIRNAME -def test_demo_configuration(samples: Path, demo_config: Path): - # use a fixed path for the demo configuration so that the outputs are consistent - out_folder = "deploy-tools-output" - temp_out = Path("/tmp") / out_folder - expected_out = samples / out_folder - # make sure the output directory is empty and exists - rmtree(temp_out, ignore_errors=True) - temp_out.mkdir(exist_ok=True) - - # generate the demo configuration output - run_cli("sync", "--from-scratch", str(temp_out), str(demo_config)) +def _assert_expected_files_match(expected_root: Path, actual_root: Path) -> None: + """Assert every file under ``expected_root`` matches the one in ``actual_root``. - # compare the output with the expected output - for expected in expected_out.glob("**/*"): + This is a one-directional check: files present in the deployment area but absent + from the golden master (e.g. ``.sif`` images, the ``.git`` directory) are ignored. + Use ``_assert_absent`` to verify that files have actually been removed. + """ + for expected in expected_root.glob("**/*"): if expected.is_dir(): continue + # check that the file exists in the output directory - out_file = temp_out / expected.relative_to(expected_out) - assert out_file.exists(), f"File {out_file} does not exist." + actual = actual_root / expected.relative_to(expected_root) + assert actual.exists(), f"File {actual} does not exist." # check that the file contents are the same - assert expected.read_text() == out_file.read_text(), ( - f"File {out_file} is different." + assert expected.read_text() == actual.read_text(), ( + f"File {actual} is different." ) - rmtree(temp_out, ignore_errors=True) + +def _assert_absent(root: Path, *relative_paths: str) -> None: + """Assert that none of the given paths exist under ``root``.""" + for relative_path in relative_paths: + path = root / relative_path + assert not path.exists(), f"Path {path} should not exist." + + +def test_module_lifecycle(samples: Path, configs: Path): + # make sure the output directory is empty and exists + rmtree(TEMP_OUT, ignore_errors=True) + TEMP_OUT.mkdir(exist_ok=True) + + # Stage 1: deploy the initial configuration into an empty area. + run_cli("sync", "--from-scratch", TEMP_OUT, configs / "01-initial") + _assert_expected_files_match(samples / "01-initial" / DEPLOYMENT_DIRNAME, TEMP_OUT) + + # Stage 2: deprecate example-module-deps/0.2. Its modulefile link should move out of + # the live modulefiles area and into the deprecated area, while the built module is + # left in place. + run_cli("sync", TEMP_OUT, configs / "02-deprecated") + _assert_expected_files_match( + samples / "02-deprecated" / DEPLOYMENT_DIRNAME, TEMP_OUT + ) + _assert_absent(TEMP_OUT, "modulefiles/example-module-deps") + + # Stage 3: remove the now-deprecated example-module-deps/0.2 entirely. Both its + # modulefile link and built module should be gone. + run_cli("sync", TEMP_OUT, configs / "03-removed") + _assert_expected_files_match(samples / "03-removed" / DEPLOYMENT_DIRNAME, TEMP_OUT) + _assert_absent( + TEMP_OUT, + "modules/example-module-deps", + "deprecated/modulefiles/example-module-deps", + ) + + rmtree(TEMP_OUT, ignore_errors=True) From 1ea0ae0eabdca604274cb39e0d8efb5c4912450d Mon Sep 17 00:00:00 2001 From: Martin Gaughran Date: Mon, 15 Jun 2026 13:48:47 +0000 Subject: [PATCH 04/19] Cover incremental module creation in golden master tests --- .../example-module-apps/0.1.yaml | 0 .../02-added/example-module-deps/0.2.yaml | 12 +++ .../02-added/example-module-extra/1.0.yaml | 17 ++++ .../{02-deprecated => 02-added}/settings.yaml | 0 .../example-module-apps/0.1.yaml | 0 .../example-module-deps/0.2.yaml | 0 .../example-module-extra/1.0.yaml | 17 ++++ .../settings.yaml | 0 .../04-removed/example-module-apps/0.1.yaml | 37 +++++++++ .../04-removed/example-module-extra/1.0.yaml | 17 ++++ tests/configs/04-removed/settings.yaml | 3 + tests/generate_samples.sh | 18 ++-- .../deploy-tools-output/deployment.yaml | 82 +++++++++++++++++++ .../modulefiles/example-module-apps/.version | 0 .../modulefiles/example-module-apps/0.1 | 0 .../modulefiles/example-module-deps/.version | 2 + .../modulefiles/example-module-deps/0.2 | 0 .../modulefiles/example-module-extra/.version | 2 + .../modulefiles/example-module-extra/1.0 | 1 + .../0.1/entrypoints/cowsay-hello | 0 .../0.1/entrypoints/test-echo-module-var | 0 .../0.1/entrypoints/test-shell-script | 0 .../example-module-apps/0.1/module.yaml | 0 .../example-module-apps/0.1/modulefile | 0 .../example-module-deps/0.2/module.yaml | 0 .../example-module-deps/0.2/modulefile | 0 .../1.0/entrypoints/test-extra-echo | 7 ++ .../example-module-extra/1.0/module.yaml | 16 ++++ .../example-module-extra/1.0/modulefile | 15 ++++ .../deploy-tools-output/deployment.yaml | 36 ++++++++ .../modulefiles/example-module-deps/0.2 | 1 + .../modulefiles/example-module-apps/.version | 0 .../modulefiles/example-module-apps/0.1 | 0 .../modulefiles/example-module-extra/.version | 2 + .../modulefiles/example-module-extra/1.0 | 1 + .../0.1/entrypoints/cowsay-hello | 0 .../0.1/entrypoints/test-echo-module-var | 0 .../0.1/entrypoints/test-shell-script | 0 .../example-module-apps/0.1/module.yaml | 0 .../example-module-apps/0.1/modulefile | 0 .../example-module-deps/0.2/module.yaml | 12 +++ .../example-module-deps/0.2/modulefile | 15 ++++ .../1.0/entrypoints/test-extra-echo | 7 ++ .../example-module-extra/1.0/module.yaml | 16 ++++ .../example-module-extra/1.0/modulefile | 15 ++++ .../deploy-tools-output/deployment.yaml | 26 +++--- .../modulefiles/example-module-apps/.version | 2 + .../modulefiles/example-module-apps/0.1 | 1 + .../modulefiles/example-module-extra/.version | 2 + .../modulefiles/example-module-extra/1.0 | 1 + .../0.1/entrypoints/cowsay-hello | 44 ++++++++++ .../0.1/entrypoints/test-echo-module-var | 7 ++ .../0.1/entrypoints/test-shell-script | 9 ++ .../example-module-apps/0.1/module.yaml | 39 +++++++++ .../example-module-apps/0.1/modulefile | 15 ++++ .../1.0/entrypoints/test-extra-echo | 7 ++ .../example-module-extra/1.0/module.yaml | 16 ++++ .../example-module-extra/1.0/modulefile | 15 ++++ tests/test_golden_master.py | 20 +++-- 59 files changed, 530 insertions(+), 25 deletions(-) rename tests/configs/{02-deprecated => 02-added}/example-module-apps/0.1.yaml (100%) create mode 100644 tests/configs/02-added/example-module-deps/0.2.yaml create mode 100644 tests/configs/02-added/example-module-extra/1.0.yaml rename tests/configs/{02-deprecated => 02-added}/settings.yaml (100%) rename tests/configs/{03-removed => 03-deprecated}/example-module-apps/0.1.yaml (100%) rename tests/configs/{02-deprecated => 03-deprecated}/example-module-deps/0.2.yaml (100%) create mode 100644 tests/configs/03-deprecated/example-module-extra/1.0.yaml rename tests/configs/{03-removed => 03-deprecated}/settings.yaml (100%) create mode 100644 tests/configs/04-removed/example-module-apps/0.1.yaml create mode 100644 tests/configs/04-removed/example-module-extra/1.0.yaml create mode 100644 tests/configs/04-removed/settings.yaml create mode 100644 tests/samples/02-added/deploy-tools-output/deployment.yaml rename tests/samples/{02-deprecated => 02-added}/deploy-tools-output/modulefiles/example-module-apps/.version (100%) rename tests/samples/{02-deprecated => 02-added}/deploy-tools-output/modulefiles/example-module-apps/0.1 (100%) create mode 100644 tests/samples/02-added/deploy-tools-output/modulefiles/example-module-deps/.version rename tests/samples/{02-deprecated/deploy-tools-output/deprecated => 02-added/deploy-tools-output}/modulefiles/example-module-deps/0.2 (100%) create mode 100644 tests/samples/02-added/deploy-tools-output/modulefiles/example-module-extra/.version create mode 120000 tests/samples/02-added/deploy-tools-output/modulefiles/example-module-extra/1.0 rename tests/samples/{02-deprecated => 02-added}/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello (100%) rename tests/samples/{02-deprecated => 02-added}/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var (100%) rename tests/samples/{02-deprecated => 02-added}/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script (100%) rename tests/samples/{02-deprecated => 02-added}/deploy-tools-output/modules/example-module-apps/0.1/module.yaml (100%) rename tests/samples/{02-deprecated => 02-added}/deploy-tools-output/modules/example-module-apps/0.1/modulefile (100%) rename tests/samples/{02-deprecated => 02-added}/deploy-tools-output/modules/example-module-deps/0.2/module.yaml (100%) rename tests/samples/{02-deprecated => 02-added}/deploy-tools-output/modules/example-module-deps/0.2/modulefile (100%) create mode 100755 tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo create mode 100644 tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/module.yaml create mode 100644 tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/modulefile rename tests/samples/{03-removed => 03-deprecated}/deploy-tools-output/deployment.yaml (56%) create mode 120000 tests/samples/03-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 rename tests/samples/{03-removed => 03-deprecated}/deploy-tools-output/modulefiles/example-module-apps/.version (100%) rename tests/samples/{03-removed => 03-deprecated}/deploy-tools-output/modulefiles/example-module-apps/0.1 (100%) create mode 100644 tests/samples/03-deprecated/deploy-tools-output/modulefiles/example-module-extra/.version create mode 120000 tests/samples/03-deprecated/deploy-tools-output/modulefiles/example-module-extra/1.0 rename tests/samples/{03-removed => 03-deprecated}/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello (100%) rename tests/samples/{03-removed => 03-deprecated}/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var (100%) rename tests/samples/{03-removed => 03-deprecated}/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script (100%) rename tests/samples/{03-removed => 03-deprecated}/deploy-tools-output/modules/example-module-apps/0.1/module.yaml (100%) rename tests/samples/{03-removed => 03-deprecated}/deploy-tools-output/modules/example-module-apps/0.1/modulefile (100%) create mode 100644 tests/samples/03-deprecated/deploy-tools-output/modules/example-module-deps/0.2/module.yaml create mode 100644 tests/samples/03-deprecated/deploy-tools-output/modules/example-module-deps/0.2/modulefile create mode 100755 tests/samples/03-deprecated/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo create mode 100644 tests/samples/03-deprecated/deploy-tools-output/modules/example-module-extra/1.0/module.yaml create mode 100644 tests/samples/03-deprecated/deploy-tools-output/modules/example-module-extra/1.0/modulefile rename tests/samples/{02-deprecated => 04-removed}/deploy-tools-output/deployment.yaml (76%) create mode 100644 tests/samples/04-removed/deploy-tools-output/modulefiles/example-module-apps/.version create mode 120000 tests/samples/04-removed/deploy-tools-output/modulefiles/example-module-apps/0.1 create mode 100644 tests/samples/04-removed/deploy-tools-output/modulefiles/example-module-extra/.version create mode 120000 tests/samples/04-removed/deploy-tools-output/modulefiles/example-module-extra/1.0 create mode 100755 tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello create mode 100755 tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var create mode 100755 tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script create mode 100644 tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/module.yaml create mode 100644 tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/modulefile create mode 100755 tests/samples/04-removed/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo create mode 100644 tests/samples/04-removed/deploy-tools-output/modules/example-module-extra/1.0/module.yaml create mode 100644 tests/samples/04-removed/deploy-tools-output/modules/example-module-extra/1.0/modulefile diff --git a/tests/configs/02-deprecated/example-module-apps/0.1.yaml b/tests/configs/02-added/example-module-apps/0.1.yaml similarity index 100% rename from tests/configs/02-deprecated/example-module-apps/0.1.yaml rename to tests/configs/02-added/example-module-apps/0.1.yaml diff --git a/tests/configs/02-added/example-module-deps/0.2.yaml b/tests/configs/02-added/example-module-deps/0.2.yaml new file mode 100644 index 00000000..4e5c3fc4 --- /dev/null +++ b/tests/configs/02-added/example-module-deps/0.2.yaml @@ -0,0 +1,12 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: example-module-deps + version: "0.2" + description: Demonstration of deploy-tools dependencies + + dependencies: + - name: example-module-apps + version: "0.1" + + applications: [] diff --git a/tests/configs/02-added/example-module-extra/1.0.yaml b/tests/configs/02-added/example-module-extra/1.0.yaml new file mode 100644 index 00000000..8443e1bf --- /dev/null +++ b/tests/configs/02-added/example-module-extra/1.0.yaml @@ -0,0 +1,17 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: example-module-extra + version: "1.0" + description: Demonstration of adding a module in a later sync + + env_vars: + - name: EXTRA_VALUE + value: Added after initial deployment + + applications: + - app_type: shell + + name: test-extra-echo + script: + - echo $EXTRA_VALUE diff --git a/tests/configs/02-deprecated/settings.yaml b/tests/configs/02-added/settings.yaml similarity index 100% rename from tests/configs/02-deprecated/settings.yaml rename to tests/configs/02-added/settings.yaml diff --git a/tests/configs/03-removed/example-module-apps/0.1.yaml b/tests/configs/03-deprecated/example-module-apps/0.1.yaml similarity index 100% rename from tests/configs/03-removed/example-module-apps/0.1.yaml rename to tests/configs/03-deprecated/example-module-apps/0.1.yaml diff --git a/tests/configs/02-deprecated/example-module-deps/0.2.yaml b/tests/configs/03-deprecated/example-module-deps/0.2.yaml similarity index 100% rename from tests/configs/02-deprecated/example-module-deps/0.2.yaml rename to tests/configs/03-deprecated/example-module-deps/0.2.yaml diff --git a/tests/configs/03-deprecated/example-module-extra/1.0.yaml b/tests/configs/03-deprecated/example-module-extra/1.0.yaml new file mode 100644 index 00000000..8443e1bf --- /dev/null +++ b/tests/configs/03-deprecated/example-module-extra/1.0.yaml @@ -0,0 +1,17 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: example-module-extra + version: "1.0" + description: Demonstration of adding a module in a later sync + + env_vars: + - name: EXTRA_VALUE + value: Added after initial deployment + + applications: + - app_type: shell + + name: test-extra-echo + script: + - echo $EXTRA_VALUE diff --git a/tests/configs/03-removed/settings.yaml b/tests/configs/03-deprecated/settings.yaml similarity index 100% rename from tests/configs/03-removed/settings.yaml rename to tests/configs/03-deprecated/settings.yaml diff --git a/tests/configs/04-removed/example-module-apps/0.1.yaml b/tests/configs/04-removed/example-module-apps/0.1.yaml new file mode 100644 index 00000000..0a934518 --- /dev/null +++ b/tests/configs/04-removed/example-module-apps/0.1.yaml @@ -0,0 +1,37 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: example-module-apps + version: "0.1" + description: Demonstration of a module configuration folder + + env_vars: + - name: OTHER_VALUE + value: Version 0.1 + + applications: + - app_type: apptainer + + container: + path: docker://ghcr.io/apptainer/lolcow + version: latest + + entrypoints: + - name: cowsay-hello + command: cowsay + options: + command_args: Hello + + - app_type: shell + + name: test-echo-module-var + script: + - echo $OTHER_VALUE + + - app_type: shell + + name: test-shell-script + script: + - "echo This is the first line of a shell script" + - "echo and this is the second line." + - "echo Your input is ${1}" diff --git a/tests/configs/04-removed/example-module-extra/1.0.yaml b/tests/configs/04-removed/example-module-extra/1.0.yaml new file mode 100644 index 00000000..8443e1bf --- /dev/null +++ b/tests/configs/04-removed/example-module-extra/1.0.yaml @@ -0,0 +1,17 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: example-module-extra + version: "1.0" + description: Demonstration of adding a module in a later sync + + env_vars: + - name: EXTRA_VALUE + value: Added after initial deployment + + applications: + - app_type: shell + + name: test-extra-echo + script: + - echo $EXTRA_VALUE diff --git a/tests/configs/04-removed/settings.yaml b/tests/configs/04-removed/settings.yaml new file mode 100644 index 00000000..70f60017 --- /dev/null +++ b/tests/configs/04-removed/settings.yaml @@ -0,0 +1,3 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/deployment-settings.json + +default_versions: {} diff --git a/tests/generate_samples.sh b/tests/generate_samples.sh index 0149558f..b62879ce 100755 --- a/tests/generate_samples.sh +++ b/tests/generate_samples.sh @@ -30,17 +30,21 @@ save_sample () { } # The lifecycle stages share a single deployment area and must run in order, as -# deprecation and removal build on the previous deployment state. Only the first sync +# each stage builds on the previous deployment state. Only the first sync # uses --from-scratch. # Stage 1: deploy the initial configuration into an empty area. deploy-tools sync --from-scratch "${TMP_DIR}" "${CONFIGS_DIR}/01-initial" save_sample 01-initial -# Stage 2: deprecate example-module-deps/0.2 (modulefile link moves to deprecated area). -deploy-tools sync "${TMP_DIR}" "${CONFIGS_DIR}/02-deprecated" -save_sample 02-deprecated +# Stage 2: add a new module (example-module-extra/1.0) on an incremental sync. +deploy-tools sync "${TMP_DIR}" "${CONFIGS_DIR}/02-added" +save_sample 02-added -# Stage 3: remove the now-deprecated example-module-deps/0.2 entirely. -deploy-tools sync "${TMP_DIR}" "${CONFIGS_DIR}/03-removed" -save_sample 03-removed +# Stage 3: deprecate example-module-deps/0.2 (modulefile link moves to deprecated area). +deploy-tools sync "${TMP_DIR}" "${CONFIGS_DIR}/03-deprecated" +save_sample 03-deprecated + +# Stage 4: remove the now-deprecated example-module-deps/0.2 entirely. +deploy-tools sync "${TMP_DIR}" "${CONFIGS_DIR}/04-removed" +save_sample 04-removed diff --git a/tests/samples/02-added/deploy-tools-output/deployment.yaml b/tests/samples/02-added/deploy-tools-output/deployment.yaml new file mode 100644 index 00000000..40f48db8 --- /dev/null +++ b/tests/samples/02-added/deploy-tools-output/deployment.yaml @@ -0,0 +1,82 @@ +releases: + example-module-apps: + '0.1': + deprecated: false + module: + allow_updates: false + applications: + - app_type: apptainer + container: + path: docker://ghcr.io/apptainer/lolcow + version: latest + entrypoints: + - command: cowsay + name: cowsay-hello + options: + apptainer_args: '' + command_args: Hello + host_binaries: [] + mounts: [] + global_options: + apptainer_args: '' + command_args: '' + host_binaries: [] + mounts: [] + - app_type: shell + name: test-echo-module-var + script: + - echo $OTHER_VALUE + - app_type: shell + name: test-shell-script + script: + - echo This is the first line of a shell script + - echo and this is the second line. + - echo Your input is ${1} + dependencies: [] + description: Demonstration of a module configuration folder + env_vars: + - name: OTHER_VALUE + value: Version 0.1 + exclude_from_defaults: false + load_script: [] + name: example-module-apps + unload_script: [] + version: '0.1' + example-module-deps: + '0.2': + deprecated: false + module: + allow_updates: false + applications: [] + dependencies: + - name: example-module-apps + version: '0.1' + description: Demonstration of deploy-tools dependencies + env_vars: [] + exclude_from_defaults: false + load_script: [] + name: example-module-deps + unload_script: [] + version: '0.2' + example-module-extra: + '1.0': + deprecated: false + module: + allow_updates: false + applications: + - app_type: shell + name: test-extra-echo + script: + - echo $EXTRA_VALUE + dependencies: [] + description: Demonstration of adding a module in a later sync + env_vars: + - name: EXTRA_VALUE + value: Added after initial deployment + exclude_from_defaults: false + load_script: [] + name: example-module-extra + unload_script: [] + version: '1.0' +settings: + default_versions: {} diff --git a/tests/samples/02-deprecated/deploy-tools-output/modulefiles/example-module-apps/.version b/tests/samples/02-added/deploy-tools-output/modulefiles/example-module-apps/.version similarity index 100% rename from tests/samples/02-deprecated/deploy-tools-output/modulefiles/example-module-apps/.version rename to tests/samples/02-added/deploy-tools-output/modulefiles/example-module-apps/.version diff --git a/tests/samples/02-deprecated/deploy-tools-output/modulefiles/example-module-apps/0.1 b/tests/samples/02-added/deploy-tools-output/modulefiles/example-module-apps/0.1 similarity index 100% rename from tests/samples/02-deprecated/deploy-tools-output/modulefiles/example-module-apps/0.1 rename to tests/samples/02-added/deploy-tools-output/modulefiles/example-module-apps/0.1 diff --git a/tests/samples/02-added/deploy-tools-output/modulefiles/example-module-deps/.version b/tests/samples/02-added/deploy-tools-output/modulefiles/example-module-deps/.version new file mode 100644 index 00000000..26a66b44 --- /dev/null +++ b/tests/samples/02-added/deploy-tools-output/modulefiles/example-module-deps/.version @@ -0,0 +1,2 @@ +#%Module1.0 +set ModulesVersion 0.2 diff --git a/tests/samples/02-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 b/tests/samples/02-added/deploy-tools-output/modulefiles/example-module-deps/0.2 similarity index 100% rename from tests/samples/02-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 rename to tests/samples/02-added/deploy-tools-output/modulefiles/example-module-deps/0.2 diff --git a/tests/samples/02-added/deploy-tools-output/modulefiles/example-module-extra/.version b/tests/samples/02-added/deploy-tools-output/modulefiles/example-module-extra/.version new file mode 100644 index 00000000..f0d55435 --- /dev/null +++ b/tests/samples/02-added/deploy-tools-output/modulefiles/example-module-extra/.version @@ -0,0 +1,2 @@ +#%Module1.0 +set ModulesVersion 1.0 diff --git a/tests/samples/02-added/deploy-tools-output/modulefiles/example-module-extra/1.0 b/tests/samples/02-added/deploy-tools-output/modulefiles/example-module-extra/1.0 new file mode 120000 index 00000000..59949819 --- /dev/null +++ b/tests/samples/02-added/deploy-tools-output/modulefiles/example-module-extra/1.0 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/example-module-extra/1.0/modulefile \ No newline at end of file diff --git a/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello b/tests/samples/02-added/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello similarity index 100% rename from tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello rename to tests/samples/02-added/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello diff --git a/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var b/tests/samples/02-added/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var similarity index 100% rename from tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var rename to tests/samples/02-added/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var diff --git a/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script b/tests/samples/02-added/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script similarity index 100% rename from tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script rename to tests/samples/02-added/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script diff --git a/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/module.yaml b/tests/samples/02-added/deploy-tools-output/modules/example-module-apps/0.1/module.yaml similarity index 100% rename from tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/module.yaml rename to tests/samples/02-added/deploy-tools-output/modules/example-module-apps/0.1/module.yaml diff --git a/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/modulefile b/tests/samples/02-added/deploy-tools-output/modules/example-module-apps/0.1/modulefile similarity index 100% rename from tests/samples/02-deprecated/deploy-tools-output/modules/example-module-apps/0.1/modulefile rename to tests/samples/02-added/deploy-tools-output/modules/example-module-apps/0.1/modulefile diff --git a/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-deps/0.2/module.yaml b/tests/samples/02-added/deploy-tools-output/modules/example-module-deps/0.2/module.yaml similarity index 100% rename from tests/samples/02-deprecated/deploy-tools-output/modules/example-module-deps/0.2/module.yaml rename to tests/samples/02-added/deploy-tools-output/modules/example-module-deps/0.2/module.yaml diff --git a/tests/samples/02-deprecated/deploy-tools-output/modules/example-module-deps/0.2/modulefile b/tests/samples/02-added/deploy-tools-output/modules/example-module-deps/0.2/modulefile similarity index 100% rename from tests/samples/02-deprecated/deploy-tools-output/modules/example-module-deps/0.2/modulefile rename to tests/samples/02-added/deploy-tools-output/modules/example-module-deps/0.2/modulefile diff --git a/tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo b/tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo new file mode 100755 index 00000000..77e9301a --- /dev/null +++ b/tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo @@ -0,0 +1,7 @@ +#! /bin/bash + +if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then + set -x +fi + +echo $EXTRA_VALUE diff --git a/tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/module.yaml b/tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/module.yaml new file mode 100644 index 00000000..3283a97d --- /dev/null +++ b/tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/module.yaml @@ -0,0 +1,16 @@ +allow_updates: false +applications: +- app_type: shell + name: test-extra-echo + script: + - echo $EXTRA_VALUE +dependencies: [] +description: Demonstration of adding a module in a later sync +env_vars: +- name: EXTRA_VALUE + value: Added after initial deployment +exclude_from_defaults: false +load_script: [] +name: example-module-extra +unload_script: [] +version: '1.0' diff --git a/tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/modulefile b/tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/modulefile new file mode 100644 index 00000000..1f731a5b --- /dev/null +++ b/tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## example-module-extra - Demonstration of adding a module in a later sync +## +module-whatis "Demonstration of adding a module in a later sync" + +if { [module-info mode load] } { + if { [is-loaded example-module-extra] } { + module unload example-module-extra + } +} + +setenv EXTRA_VALUE "Added after initial deployment" + +prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-extra/1.0/entrypoints" diff --git a/tests/samples/03-removed/deploy-tools-output/deployment.yaml b/tests/samples/03-deprecated/deploy-tools-output/deployment.yaml similarity index 56% rename from tests/samples/03-removed/deploy-tools-output/deployment.yaml rename to tests/samples/03-deprecated/deploy-tools-output/deployment.yaml index aef13070..9698f394 100644 --- a/tests/samples/03-removed/deploy-tools-output/deployment.yaml +++ b/tests/samples/03-deprecated/deploy-tools-output/deployment.yaml @@ -42,5 +42,41 @@ releases: name: example-module-apps unload_script: [] version: '0.1' + example-module-deps: + '0.2': + deprecated: true + module: + allow_updates: false + applications: [] + dependencies: + - name: example-module-apps + version: '0.1' + description: Demonstration of deploy-tools dependencies + env_vars: [] + exclude_from_defaults: false + load_script: [] + name: example-module-deps + unload_script: [] + version: '0.2' + example-module-extra: + '1.0': + deprecated: false + module: + allow_updates: false + applications: + - app_type: shell + name: test-extra-echo + script: + - echo $EXTRA_VALUE + dependencies: [] + description: Demonstration of adding a module in a later sync + env_vars: + - name: EXTRA_VALUE + value: Added after initial deployment + exclude_from_defaults: false + load_script: [] + name: example-module-extra + unload_script: [] + version: '1.0' settings: default_versions: {} diff --git a/tests/samples/03-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 b/tests/samples/03-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 new file mode 120000 index 00000000..cd04ecdf --- /dev/null +++ b/tests/samples/03-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/example-module-deps/0.2/modulefile \ No newline at end of file diff --git a/tests/samples/03-removed/deploy-tools-output/modulefiles/example-module-apps/.version b/tests/samples/03-deprecated/deploy-tools-output/modulefiles/example-module-apps/.version similarity index 100% rename from tests/samples/03-removed/deploy-tools-output/modulefiles/example-module-apps/.version rename to tests/samples/03-deprecated/deploy-tools-output/modulefiles/example-module-apps/.version diff --git a/tests/samples/03-removed/deploy-tools-output/modulefiles/example-module-apps/0.1 b/tests/samples/03-deprecated/deploy-tools-output/modulefiles/example-module-apps/0.1 similarity index 100% rename from tests/samples/03-removed/deploy-tools-output/modulefiles/example-module-apps/0.1 rename to tests/samples/03-deprecated/deploy-tools-output/modulefiles/example-module-apps/0.1 diff --git a/tests/samples/03-deprecated/deploy-tools-output/modulefiles/example-module-extra/.version b/tests/samples/03-deprecated/deploy-tools-output/modulefiles/example-module-extra/.version new file mode 100644 index 00000000..f0d55435 --- /dev/null +++ b/tests/samples/03-deprecated/deploy-tools-output/modulefiles/example-module-extra/.version @@ -0,0 +1,2 @@ +#%Module1.0 +set ModulesVersion 1.0 diff --git a/tests/samples/03-deprecated/deploy-tools-output/modulefiles/example-module-extra/1.0 b/tests/samples/03-deprecated/deploy-tools-output/modulefiles/example-module-extra/1.0 new file mode 120000 index 00000000..59949819 --- /dev/null +++ b/tests/samples/03-deprecated/deploy-tools-output/modulefiles/example-module-extra/1.0 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/example-module-extra/1.0/modulefile \ No newline at end of file diff --git a/tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello b/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello similarity index 100% rename from tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello rename to tests/samples/03-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello diff --git a/tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var b/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var similarity index 100% rename from tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var rename to tests/samples/03-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var diff --git a/tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script b/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script similarity index 100% rename from tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script rename to tests/samples/03-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script diff --git a/tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/module.yaml b/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-apps/0.1/module.yaml similarity index 100% rename from tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/module.yaml rename to tests/samples/03-deprecated/deploy-tools-output/modules/example-module-apps/0.1/module.yaml diff --git a/tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/modulefile b/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-apps/0.1/modulefile similarity index 100% rename from tests/samples/03-removed/deploy-tools-output/modules/example-module-apps/0.1/modulefile rename to tests/samples/03-deprecated/deploy-tools-output/modules/example-module-apps/0.1/modulefile diff --git a/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-deps/0.2/module.yaml b/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-deps/0.2/module.yaml new file mode 100644 index 00000000..0765b12f --- /dev/null +++ b/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-deps/0.2/module.yaml @@ -0,0 +1,12 @@ +allow_updates: false +applications: [] +dependencies: +- name: example-module-apps + version: '0.1' +description: Demonstration of deploy-tools dependencies +env_vars: [] +exclude_from_defaults: false +load_script: [] +name: example-module-deps +unload_script: [] +version: '0.2' diff --git a/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-deps/0.2/modulefile b/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-deps/0.2/modulefile new file mode 100644 index 00000000..a4fbe508 --- /dev/null +++ b/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-deps/0.2/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## example-module-deps - Demonstration of deploy-tools dependencies +## +module-whatis "Demonstration of deploy-tools dependencies" + +if { [module-info mode load] } { + if { [is-loaded example-module-deps] } { + module unload example-module-deps + } +} + +module load example-module-apps/0.1 + +prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-deps/0.2/entrypoints" diff --git a/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo b/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo new file mode 100755 index 00000000..77e9301a --- /dev/null +++ b/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo @@ -0,0 +1,7 @@ +#! /bin/bash + +if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then + set -x +fi + +echo $EXTRA_VALUE diff --git a/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-extra/1.0/module.yaml b/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-extra/1.0/module.yaml new file mode 100644 index 00000000..3283a97d --- /dev/null +++ b/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-extra/1.0/module.yaml @@ -0,0 +1,16 @@ +allow_updates: false +applications: +- app_type: shell + name: test-extra-echo + script: + - echo $EXTRA_VALUE +dependencies: [] +description: Demonstration of adding a module in a later sync +env_vars: +- name: EXTRA_VALUE + value: Added after initial deployment +exclude_from_defaults: false +load_script: [] +name: example-module-extra +unload_script: [] +version: '1.0' diff --git a/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-extra/1.0/modulefile b/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-extra/1.0/modulefile new file mode 100644 index 00000000..1f731a5b --- /dev/null +++ b/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-extra/1.0/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## example-module-extra - Demonstration of adding a module in a later sync +## +module-whatis "Demonstration of adding a module in a later sync" + +if { [module-info mode load] } { + if { [is-loaded example-module-extra] } { + module unload example-module-extra + } +} + +setenv EXTRA_VALUE "Added after initial deployment" + +prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-extra/1.0/entrypoints" diff --git a/tests/samples/02-deprecated/deploy-tools-output/deployment.yaml b/tests/samples/04-removed/deploy-tools-output/deployment.yaml similarity index 76% rename from tests/samples/02-deprecated/deploy-tools-output/deployment.yaml rename to tests/samples/04-removed/deploy-tools-output/deployment.yaml index 9a59c4f8..06f200f2 100644 --- a/tests/samples/02-deprecated/deploy-tools-output/deployment.yaml +++ b/tests/samples/04-removed/deploy-tools-output/deployment.yaml @@ -42,21 +42,25 @@ releases: name: example-module-apps unload_script: [] version: '0.1' - example-module-deps: - '0.2': - deprecated: true + example-module-extra: + '1.0': + deprecated: false module: allow_updates: false - applications: [] - dependencies: - - name: example-module-apps - version: '0.1' - description: Demonstration of deploy-tools dependencies - env_vars: [] + applications: + - app_type: shell + name: test-extra-echo + script: + - echo $EXTRA_VALUE + dependencies: [] + description: Demonstration of adding a module in a later sync + env_vars: + - name: EXTRA_VALUE + value: Added after initial deployment exclude_from_defaults: false load_script: [] - name: example-module-deps + name: example-module-extra unload_script: [] - version: '0.2' + version: '1.0' settings: default_versions: {} diff --git a/tests/samples/04-removed/deploy-tools-output/modulefiles/example-module-apps/.version b/tests/samples/04-removed/deploy-tools-output/modulefiles/example-module-apps/.version new file mode 100644 index 00000000..d9b8f921 --- /dev/null +++ b/tests/samples/04-removed/deploy-tools-output/modulefiles/example-module-apps/.version @@ -0,0 +1,2 @@ +#%Module1.0 +set ModulesVersion 0.1 diff --git a/tests/samples/04-removed/deploy-tools-output/modulefiles/example-module-apps/0.1 b/tests/samples/04-removed/deploy-tools-output/modulefiles/example-module-apps/0.1 new file mode 120000 index 00000000..53b90576 --- /dev/null +++ b/tests/samples/04-removed/deploy-tools-output/modulefiles/example-module-apps/0.1 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/example-module-apps/0.1/modulefile \ No newline at end of file diff --git a/tests/samples/04-removed/deploy-tools-output/modulefiles/example-module-extra/.version b/tests/samples/04-removed/deploy-tools-output/modulefiles/example-module-extra/.version new file mode 100644 index 00000000..f0d55435 --- /dev/null +++ b/tests/samples/04-removed/deploy-tools-output/modulefiles/example-module-extra/.version @@ -0,0 +1,2 @@ +#%Module1.0 +set ModulesVersion 1.0 diff --git a/tests/samples/04-removed/deploy-tools-output/modulefiles/example-module-extra/1.0 b/tests/samples/04-removed/deploy-tools-output/modulefiles/example-module-extra/1.0 new file mode 120000 index 00000000..59949819 --- /dev/null +++ b/tests/samples/04-removed/deploy-tools-output/modulefiles/example-module-extra/1.0 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/example-module-extra/1.0/modulefile \ No newline at end of file diff --git a/tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello b/tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello new file mode 100755 index 00000000..d43f0d44 --- /dev/null +++ b/tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello @@ -0,0 +1,44 @@ +#! /bin/bash + +# Arguments: +# ${@} = Remaining args to pass to the command + +# Halt on error +set -e + +# Mounts for container +mounts="" +# Additional arguments for apptainer +apptainer_args="" +# Sif file path +sif_file="$(dirname $0)/../sif_files/a553018b87553334a94c33cb04eb025c.sif" +# Command to run in container +command="cowsay" +# Options and arguments to pass to command +command_args="Hello" + +# Raise an error if sif file does not exist +if [[ ! -f ${sif_file} ]]; then + echo "ERROR: sif file ${sif_file} does not exist" 1>&2 + exit 1 +fi + +# add mounts of host binaries into /usr/bin +for i in ; do + binary=$(which $i) + mounts="${mounts},${binary}:/usr/bin/${i}" +done + +# Set up mounts if any have been configured +if [[ ! -z ${mounts} ]]; then + opts="-B ${mounts}" +fi + +opts=${opts}" --env DISPLAY=${DISPLAY}" +opts=${opts}" ${apptainer_args}" + + +if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then + set -x +fi +apptainer exec ${opts} ${sif_file} ${command} ${command_args} "${@}" diff --git a/tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var b/tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var new file mode 100755 index 00000000..0a367ddf --- /dev/null +++ b/tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var @@ -0,0 +1,7 @@ +#! /bin/bash + +if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then + set -x +fi + +echo $OTHER_VALUE diff --git a/tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script b/tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script new file mode 100755 index 00000000..6ca6871d --- /dev/null +++ b/tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script @@ -0,0 +1,9 @@ +#! /bin/bash + +if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then + set -x +fi + +echo This is the first line of a shell script +echo and this is the second line. +echo Your input is ${1} diff --git a/tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/module.yaml b/tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/module.yaml new file mode 100644 index 00000000..51a06102 --- /dev/null +++ b/tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/module.yaml @@ -0,0 +1,39 @@ +allow_updates: false +applications: +- app_type: apptainer + container: + path: docker://ghcr.io/apptainer/lolcow + version: latest + entrypoints: + - command: cowsay + name: cowsay-hello + options: + apptainer_args: '' + command_args: Hello + host_binaries: [] + mounts: [] + global_options: + apptainer_args: '' + command_args: '' + host_binaries: [] + mounts: [] +- app_type: shell + name: test-echo-module-var + script: + - echo $OTHER_VALUE +- app_type: shell + name: test-shell-script + script: + - echo This is the first line of a shell script + - echo and this is the second line. + - echo Your input is ${1} +dependencies: [] +description: Demonstration of a module configuration folder +env_vars: +- name: OTHER_VALUE + value: Version 0.1 +exclude_from_defaults: false +load_script: [] +name: example-module-apps +unload_script: [] +version: '0.1' diff --git a/tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/modulefile b/tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/modulefile new file mode 100644 index 00000000..b6458983 --- /dev/null +++ b/tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## example-module-apps - Demonstration of a module configuration folder +## +module-whatis "Demonstration of a module configuration folder" + +if { [module-info mode load] } { + if { [is-loaded example-module-apps] } { + module unload example-module-apps + } +} + +setenv OTHER_VALUE "Version 0.1" + +prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-apps/0.1/entrypoints" diff --git a/tests/samples/04-removed/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo b/tests/samples/04-removed/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo new file mode 100755 index 00000000..77e9301a --- /dev/null +++ b/tests/samples/04-removed/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo @@ -0,0 +1,7 @@ +#! /bin/bash + +if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then + set -x +fi + +echo $EXTRA_VALUE diff --git a/tests/samples/04-removed/deploy-tools-output/modules/example-module-extra/1.0/module.yaml b/tests/samples/04-removed/deploy-tools-output/modules/example-module-extra/1.0/module.yaml new file mode 100644 index 00000000..3283a97d --- /dev/null +++ b/tests/samples/04-removed/deploy-tools-output/modules/example-module-extra/1.0/module.yaml @@ -0,0 +1,16 @@ +allow_updates: false +applications: +- app_type: shell + name: test-extra-echo + script: + - echo $EXTRA_VALUE +dependencies: [] +description: Demonstration of adding a module in a later sync +env_vars: +- name: EXTRA_VALUE + value: Added after initial deployment +exclude_from_defaults: false +load_script: [] +name: example-module-extra +unload_script: [] +version: '1.0' diff --git a/tests/samples/04-removed/deploy-tools-output/modules/example-module-extra/1.0/modulefile b/tests/samples/04-removed/deploy-tools-output/modules/example-module-extra/1.0/modulefile new file mode 100644 index 00000000..1f731a5b --- /dev/null +++ b/tests/samples/04-removed/deploy-tools-output/modules/example-module-extra/1.0/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## example-module-extra - Demonstration of adding a module in a later sync +## +module-whatis "Demonstration of adding a module in a later sync" + +if { [module-info mode load] } { + if { [is-loaded example-module-extra] } { + module unload example-module-extra + } +} + +setenv EXTRA_VALUE "Added after initial deployment" + +prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-extra/1.0/entrypoints" diff --git a/tests/test_golden_master.py b/tests/test_golden_master.py index b0dd73ff..ae8351ea 100644 --- a/tests/test_golden_master.py +++ b/tests/test_golden_master.py @@ -5,7 +5,7 @@ # Fixed deployment path so that generated modulefiles (which embed absolute paths) match # the committed golden master output. The lifecycle stages below all share this single -# deployment area, as deprecation and removal build on the previous deployment state. +# deployment area, as each stage builds on the previous deployment state. DEPLOYMENT_DIRNAME = "deploy-tools-output" TEMP_OUT = Path("/tmp") / DEPLOYMENT_DIRNAME @@ -47,19 +47,25 @@ def test_module_lifecycle(samples: Path, configs: Path): run_cli("sync", "--from-scratch", TEMP_OUT, configs / "01-initial") _assert_expected_files_match(samples / "01-initial" / DEPLOYMENT_DIRNAME, TEMP_OUT) - # Stage 2: deprecate example-module-deps/0.2. Its modulefile link should move out of + # Stage 2: deploy a brand-new module on an incremental (non from-scratch) sync. Its + # files and modulefile link should appear, while the modules from stage 1 are left + # untouched (verified by the stage-2 golden master, which still contains them). + run_cli("sync", TEMP_OUT, configs / "02-added") + _assert_expected_files_match(samples / "02-added" / DEPLOYMENT_DIRNAME, TEMP_OUT) + + # Stage 3: deprecate example-module-deps/0.2. Its modulefile link should move out of # the live modulefiles area and into the deprecated area, while the built module is # left in place. - run_cli("sync", TEMP_OUT, configs / "02-deprecated") + run_cli("sync", TEMP_OUT, configs / "03-deprecated") _assert_expected_files_match( - samples / "02-deprecated" / DEPLOYMENT_DIRNAME, TEMP_OUT + samples / "03-deprecated" / DEPLOYMENT_DIRNAME, TEMP_OUT ) _assert_absent(TEMP_OUT, "modulefiles/example-module-deps") - # Stage 3: remove the now-deprecated example-module-deps/0.2 entirely. Both its + # Stage 4: remove the now-deprecated example-module-deps/0.2 entirely. Both its # modulefile link and built module should be gone. - run_cli("sync", TEMP_OUT, configs / "03-removed") - _assert_expected_files_match(samples / "03-removed" / DEPLOYMENT_DIRNAME, TEMP_OUT) + run_cli("sync", TEMP_OUT, configs / "04-removed") + _assert_expected_files_match(samples / "04-removed" / DEPLOYMENT_DIRNAME, TEMP_OUT) _assert_absent( TEMP_OUT, "modules/example-module-deps", From 65071d60238de7c27de369bb8bd0b4813c49baa5 Mon Sep 17 00:00:00 2001 From: Martin Gaughran Date: Mon, 15 Jun 2026 14:35:01 +0000 Subject: [PATCH 05/19] Cover module update and restore in golden master tests --- .../02-added/example-module-extra/1.0.yaml | 4 + .../example-module-apps/0.1.yaml | 0 .../03-updated/example-module-deps/0.2.yaml | 12 +++ .../03-updated/example-module-extra/1.0.yaml | 21 +++++ .../settings.yaml | 0 .../example-module-apps/0.1.yaml | 0 .../example-module-deps/0.2.yaml | 0 .../example-module-extra/1.0.yaml | 24 ++++++ .../settings.yaml | 0 .../05-restored/example-module-apps/0.1.yaml | 37 +++++++++ .../05-restored/example-module-deps/0.2.yaml | 16 ++++ .../example-module-extra/1.0.yaml | 4 +- tests/configs/05-restored/settings.yaml | 3 + .../06-removed/example-module-apps/0.1.yaml | 37 +++++++++ .../example-module-extra/1.0.yaml | 4 +- tests/configs/06-removed/settings.yaml | 3 + tests/generate_samples.sh | 20 +++-- .../deploy-tools-output/deployment.yaml | 2 +- .../example-module-extra/1.0/module.yaml | 2 +- .../deploy-tools-output/deployment.yaml | 82 +++++++++++++++++++ .../modulefiles/example-module-apps/.version | 0 .../modulefiles/example-module-apps/0.1 | 0 .../modulefiles/example-module-deps/.version | 2 + .../modulefiles/example-module-deps/0.2 | 0 .../modulefiles/example-module-extra/.version | 0 .../modulefiles/example-module-extra/1.0 | 0 .../0.1/entrypoints/cowsay-hello | 0 .../0.1/entrypoints/test-echo-module-var | 0 .../0.1/entrypoints/test-shell-script | 0 .../example-module-apps/0.1/module.yaml | 0 .../example-module-apps/0.1/modulefile | 0 .../example-module-deps/0.2/module.yaml | 0 .../example-module-deps/0.2/modulefile | 0 .../1.0/entrypoints/test-extra-echo | 0 .../example-module-extra/1.0/module.yaml | 4 +- .../example-module-extra/1.0/modulefile | 2 +- .../deploy-tools-output/deployment.yaml | 82 +++++++++++++++++++ .../modulefiles/example-module-deps/0.2 | 1 + .../modulefiles/example-module-extra/1.0 | 0 .../modulefiles/example-module-apps/.version | 0 .../modulefiles/example-module-apps/0.1 | 0 .../0.1/entrypoints/cowsay-hello | 0 .../0.1/entrypoints/test-echo-module-var | 0 .../0.1/entrypoints/test-shell-script | 0 .../example-module-apps/0.1/module.yaml | 0 .../example-module-apps/0.1/modulefile | 0 .../example-module-deps/0.2/module.yaml | 12 +++ .../example-module-deps/0.2/modulefile | 15 ++++ .../1.0/entrypoints/test-extra-echo | 0 .../example-module-extra/1.0/module.yaml | 4 +- .../example-module-extra/1.0/modulefile | 2 +- .../deploy-tools-output/deployment.yaml | 4 +- .../modulefiles/example-module-deps/0.2 | 1 + .../modulefiles/example-module-apps/.version | 2 + .../modulefiles/example-module-apps/0.1 | 1 + .../modulefiles/example-module-extra/.version | 0 .../modulefiles/example-module-extra/1.0 | 1 + .../0.1/entrypoints/cowsay-hello | 44 ++++++++++ .../0.1/entrypoints/test-echo-module-var | 7 ++ .../0.1/entrypoints/test-shell-script | 9 ++ .../example-module-apps/0.1/module.yaml | 39 +++++++++ .../example-module-apps/0.1/modulefile | 15 ++++ .../example-module-deps/0.2/module.yaml | 12 +++ .../example-module-deps/0.2/modulefile | 15 ++++ .../1.0/entrypoints/test-extra-echo | 7 ++ .../example-module-extra/1.0/module.yaml | 16 ++++ .../example-module-extra/1.0/modulefile | 15 ++++ .../deploy-tools-output/deployment.yaml | 4 +- .../modulefiles/example-module-apps/.version | 2 + .../modulefiles/example-module-apps/0.1 | 1 + .../modulefiles/example-module-extra/.version | 2 + .../modulefiles/example-module-extra/1.0 | 1 + .../0.1/entrypoints/cowsay-hello | 44 ++++++++++ .../0.1/entrypoints/test-echo-module-var | 7 ++ .../0.1/entrypoints/test-shell-script | 9 ++ .../example-module-apps/0.1/module.yaml | 39 +++++++++ .../example-module-apps/0.1/modulefile | 15 ++++ .../1.0/entrypoints/test-extra-echo | 7 ++ .../example-module-extra/1.0/module.yaml | 16 ++++ .../example-module-extra/1.0/modulefile | 15 ++++ tests/test_golden_master.py | 40 ++++++--- 81 files changed, 753 insertions(+), 32 deletions(-) rename tests/configs/{03-deprecated => 03-updated}/example-module-apps/0.1.yaml (100%) create mode 100644 tests/configs/03-updated/example-module-deps/0.2.yaml create mode 100644 tests/configs/03-updated/example-module-extra/1.0.yaml rename tests/configs/{03-deprecated => 03-updated}/settings.yaml (100%) rename tests/configs/{04-removed => 04-deprecated}/example-module-apps/0.1.yaml (100%) rename tests/configs/{03-deprecated => 04-deprecated}/example-module-deps/0.2.yaml (100%) create mode 100644 tests/configs/04-deprecated/example-module-extra/1.0.yaml rename tests/configs/{04-removed => 04-deprecated}/settings.yaml (100%) create mode 100644 tests/configs/05-restored/example-module-apps/0.1.yaml create mode 100644 tests/configs/05-restored/example-module-deps/0.2.yaml rename tests/configs/{03-deprecated => 05-restored}/example-module-extra/1.0.yaml (85%) create mode 100644 tests/configs/05-restored/settings.yaml create mode 100644 tests/configs/06-removed/example-module-apps/0.1.yaml rename tests/configs/{04-removed => 06-removed}/example-module-extra/1.0.yaml (85%) create mode 100644 tests/configs/06-removed/settings.yaml create mode 100644 tests/samples/03-updated/deploy-tools-output/deployment.yaml rename tests/samples/{03-deprecated => 03-updated}/deploy-tools-output/modulefiles/example-module-apps/.version (100%) rename tests/samples/{03-deprecated => 03-updated}/deploy-tools-output/modulefiles/example-module-apps/0.1 (100%) create mode 100644 tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-deps/.version rename tests/samples/{03-deprecated/deploy-tools-output/deprecated => 03-updated/deploy-tools-output}/modulefiles/example-module-deps/0.2 (100%) rename tests/samples/{03-deprecated => 03-updated}/deploy-tools-output/modulefiles/example-module-extra/.version (100%) rename tests/samples/{03-deprecated => 03-updated}/deploy-tools-output/modulefiles/example-module-extra/1.0 (100%) rename tests/samples/{03-deprecated => 03-updated}/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello (100%) rename tests/samples/{03-deprecated => 03-updated}/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var (100%) rename tests/samples/{03-deprecated => 03-updated}/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script (100%) rename tests/samples/{03-deprecated => 03-updated}/deploy-tools-output/modules/example-module-apps/0.1/module.yaml (100%) rename tests/samples/{03-deprecated => 03-updated}/deploy-tools-output/modules/example-module-apps/0.1/modulefile (100%) rename tests/samples/{03-deprecated => 03-updated}/deploy-tools-output/modules/example-module-deps/0.2/module.yaml (100%) rename tests/samples/{03-deprecated => 03-updated}/deploy-tools-output/modules/example-module-deps/0.2/modulefile (100%) rename tests/samples/{03-deprecated => 03-updated}/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo (100%) rename tests/samples/{04-removed => 03-updated}/deploy-tools-output/modules/example-module-extra/1.0/module.yaml (83%) rename tests/samples/{03-deprecated => 03-updated}/deploy-tools-output/modules/example-module-extra/1.0/modulefile (87%) create mode 100644 tests/samples/04-deprecated/deploy-tools-output/deployment.yaml create mode 120000 tests/samples/04-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 rename tests/samples/{04-removed/deploy-tools-output => 04-deprecated/deploy-tools-output/deprecated}/modulefiles/example-module-extra/1.0 (100%) rename tests/samples/{04-removed => 04-deprecated}/deploy-tools-output/modulefiles/example-module-apps/.version (100%) rename tests/samples/{04-removed => 04-deprecated}/deploy-tools-output/modulefiles/example-module-apps/0.1 (100%) rename tests/samples/{04-removed => 04-deprecated}/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello (100%) rename tests/samples/{04-removed => 04-deprecated}/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var (100%) rename tests/samples/{04-removed => 04-deprecated}/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script (100%) rename tests/samples/{04-removed => 04-deprecated}/deploy-tools-output/modules/example-module-apps/0.1/module.yaml (100%) rename tests/samples/{04-removed => 04-deprecated}/deploy-tools-output/modules/example-module-apps/0.1/modulefile (100%) create mode 100644 tests/samples/04-deprecated/deploy-tools-output/modules/example-module-deps/0.2/module.yaml create mode 100644 tests/samples/04-deprecated/deploy-tools-output/modules/example-module-deps/0.2/modulefile rename tests/samples/{04-removed => 04-deprecated}/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo (100%) rename tests/samples/{03-deprecated => 04-deprecated}/deploy-tools-output/modules/example-module-extra/1.0/module.yaml (83%) rename tests/samples/{04-removed => 04-deprecated}/deploy-tools-output/modules/example-module-extra/1.0/modulefile (87%) rename tests/samples/{03-deprecated => 05-restored}/deploy-tools-output/deployment.yaml (96%) create mode 120000 tests/samples/05-restored/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 create mode 100644 tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-apps/.version create mode 120000 tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-apps/0.1 rename tests/samples/{04-removed => 05-restored}/deploy-tools-output/modulefiles/example-module-extra/.version (100%) create mode 120000 tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-extra/1.0 create mode 100755 tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello create mode 100755 tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var create mode 100755 tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script create mode 100644 tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/module.yaml create mode 100644 tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/modulefile create mode 100644 tests/samples/05-restored/deploy-tools-output/modules/example-module-deps/0.2/module.yaml create mode 100644 tests/samples/05-restored/deploy-tools-output/modules/example-module-deps/0.2/modulefile create mode 100755 tests/samples/05-restored/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo create mode 100644 tests/samples/05-restored/deploy-tools-output/modules/example-module-extra/1.0/module.yaml create mode 100644 tests/samples/05-restored/deploy-tools-output/modules/example-module-extra/1.0/modulefile rename tests/samples/{04-removed => 06-removed}/deploy-tools-output/deployment.yaml (95%) create mode 100644 tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-apps/.version create mode 120000 tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-apps/0.1 create mode 100644 tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-extra/.version create mode 120000 tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-extra/1.0 create mode 100755 tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello create mode 100755 tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var create mode 100755 tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script create mode 100644 tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/module.yaml create mode 100644 tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/modulefile create mode 100755 tests/samples/06-removed/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo create mode 100644 tests/samples/06-removed/deploy-tools-output/modules/example-module-extra/1.0/module.yaml create mode 100644 tests/samples/06-removed/deploy-tools-output/modules/example-module-extra/1.0/modulefile diff --git a/tests/configs/02-added/example-module-extra/1.0.yaml b/tests/configs/02-added/example-module-extra/1.0.yaml index 8443e1bf..f417b4b4 100644 --- a/tests/configs/02-added/example-module-extra/1.0.yaml +++ b/tests/configs/02-added/example-module-extra/1.0.yaml @@ -15,3 +15,7 @@ module: name: test-extra-echo script: - echo $EXTRA_VALUE + + # Allow in-place updates to this version, so a later sync can change its + # configuration without bumping the version number. + allow_updates: true diff --git a/tests/configs/03-deprecated/example-module-apps/0.1.yaml b/tests/configs/03-updated/example-module-apps/0.1.yaml similarity index 100% rename from tests/configs/03-deprecated/example-module-apps/0.1.yaml rename to tests/configs/03-updated/example-module-apps/0.1.yaml diff --git a/tests/configs/03-updated/example-module-deps/0.2.yaml b/tests/configs/03-updated/example-module-deps/0.2.yaml new file mode 100644 index 00000000..4e5c3fc4 --- /dev/null +++ b/tests/configs/03-updated/example-module-deps/0.2.yaml @@ -0,0 +1,12 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: example-module-deps + version: "0.2" + description: Demonstration of deploy-tools dependencies + + dependencies: + - name: example-module-apps + version: "0.1" + + applications: [] diff --git a/tests/configs/03-updated/example-module-extra/1.0.yaml b/tests/configs/03-updated/example-module-extra/1.0.yaml new file mode 100644 index 00000000..c3219c9e --- /dev/null +++ b/tests/configs/03-updated/example-module-extra/1.0.yaml @@ -0,0 +1,21 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: example-module-extra + version: "1.0" + description: Demonstration of adding a module in a later sync + + env_vars: + - name: EXTRA_VALUE + # Changing this value (permitted by allow_updates) triggers an in-place + # update of the already-deployed version. + value: Updated in a later sync + + applications: + - app_type: shell + + name: test-extra-echo + script: + - echo $EXTRA_VALUE + + allow_updates: true diff --git a/tests/configs/03-deprecated/settings.yaml b/tests/configs/03-updated/settings.yaml similarity index 100% rename from tests/configs/03-deprecated/settings.yaml rename to tests/configs/03-updated/settings.yaml diff --git a/tests/configs/04-removed/example-module-apps/0.1.yaml b/tests/configs/04-deprecated/example-module-apps/0.1.yaml similarity index 100% rename from tests/configs/04-removed/example-module-apps/0.1.yaml rename to tests/configs/04-deprecated/example-module-apps/0.1.yaml diff --git a/tests/configs/03-deprecated/example-module-deps/0.2.yaml b/tests/configs/04-deprecated/example-module-deps/0.2.yaml similarity index 100% rename from tests/configs/03-deprecated/example-module-deps/0.2.yaml rename to tests/configs/04-deprecated/example-module-deps/0.2.yaml diff --git a/tests/configs/04-deprecated/example-module-extra/1.0.yaml b/tests/configs/04-deprecated/example-module-extra/1.0.yaml new file mode 100644 index 00000000..13b5a5fd --- /dev/null +++ b/tests/configs/04-deprecated/example-module-extra/1.0.yaml @@ -0,0 +1,24 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: example-module-extra + version: "1.0" + description: Demonstration of adding a module in a later sync + + env_vars: + - name: EXTRA_VALUE + value: Updated in a later sync + + applications: + - app_type: shell + + name: test-extra-echo + script: + - echo $EXTRA_VALUE + + allow_updates: true + +# Deprecate this release so a later sync can demonstrate restoring it. The module +# config above is otherwise unchanged; only this flag flips, so the sync is treated +# as a deprecation rather than an update. +deprecated: true diff --git a/tests/configs/04-removed/settings.yaml b/tests/configs/04-deprecated/settings.yaml similarity index 100% rename from tests/configs/04-removed/settings.yaml rename to tests/configs/04-deprecated/settings.yaml diff --git a/tests/configs/05-restored/example-module-apps/0.1.yaml b/tests/configs/05-restored/example-module-apps/0.1.yaml new file mode 100644 index 00000000..0a934518 --- /dev/null +++ b/tests/configs/05-restored/example-module-apps/0.1.yaml @@ -0,0 +1,37 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: example-module-apps + version: "0.1" + description: Demonstration of a module configuration folder + + env_vars: + - name: OTHER_VALUE + value: Version 0.1 + + applications: + - app_type: apptainer + + container: + path: docker://ghcr.io/apptainer/lolcow + version: latest + + entrypoints: + - name: cowsay-hello + command: cowsay + options: + command_args: Hello + + - app_type: shell + + name: test-echo-module-var + script: + - echo $OTHER_VALUE + + - app_type: shell + + name: test-shell-script + script: + - "echo This is the first line of a shell script" + - "echo and this is the second line." + - "echo Your input is ${1}" diff --git a/tests/configs/05-restored/example-module-deps/0.2.yaml b/tests/configs/05-restored/example-module-deps/0.2.yaml new file mode 100644 index 00000000..e327b454 --- /dev/null +++ b/tests/configs/05-restored/example-module-deps/0.2.yaml @@ -0,0 +1,16 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: example-module-deps + version: "0.2" + description: Demonstration of deploy-tools dependencies + + dependencies: + - name: example-module-apps + version: "0.1" + + applications: [] + +# Mark this release as deprecated: its modulefile link moves into the deprecated area +# while the built module remains available, as a precursor to full removal. +deprecated: true diff --git a/tests/configs/03-deprecated/example-module-extra/1.0.yaml b/tests/configs/05-restored/example-module-extra/1.0.yaml similarity index 85% rename from tests/configs/03-deprecated/example-module-extra/1.0.yaml rename to tests/configs/05-restored/example-module-extra/1.0.yaml index 8443e1bf..7e2ad635 100644 --- a/tests/configs/03-deprecated/example-module-extra/1.0.yaml +++ b/tests/configs/05-restored/example-module-extra/1.0.yaml @@ -7,7 +7,7 @@ module: env_vars: - name: EXTRA_VALUE - value: Added after initial deployment + value: Updated in a later sync applications: - app_type: shell @@ -15,3 +15,5 @@ module: name: test-extra-echo script: - echo $EXTRA_VALUE + + allow_updates: true diff --git a/tests/configs/05-restored/settings.yaml b/tests/configs/05-restored/settings.yaml new file mode 100644 index 00000000..70f60017 --- /dev/null +++ b/tests/configs/05-restored/settings.yaml @@ -0,0 +1,3 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/deployment-settings.json + +default_versions: {} diff --git a/tests/configs/06-removed/example-module-apps/0.1.yaml b/tests/configs/06-removed/example-module-apps/0.1.yaml new file mode 100644 index 00000000..0a934518 --- /dev/null +++ b/tests/configs/06-removed/example-module-apps/0.1.yaml @@ -0,0 +1,37 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: example-module-apps + version: "0.1" + description: Demonstration of a module configuration folder + + env_vars: + - name: OTHER_VALUE + value: Version 0.1 + + applications: + - app_type: apptainer + + container: + path: docker://ghcr.io/apptainer/lolcow + version: latest + + entrypoints: + - name: cowsay-hello + command: cowsay + options: + command_args: Hello + + - app_type: shell + + name: test-echo-module-var + script: + - echo $OTHER_VALUE + + - app_type: shell + + name: test-shell-script + script: + - "echo This is the first line of a shell script" + - "echo and this is the second line." + - "echo Your input is ${1}" diff --git a/tests/configs/04-removed/example-module-extra/1.0.yaml b/tests/configs/06-removed/example-module-extra/1.0.yaml similarity index 85% rename from tests/configs/04-removed/example-module-extra/1.0.yaml rename to tests/configs/06-removed/example-module-extra/1.0.yaml index 8443e1bf..7e2ad635 100644 --- a/tests/configs/04-removed/example-module-extra/1.0.yaml +++ b/tests/configs/06-removed/example-module-extra/1.0.yaml @@ -7,7 +7,7 @@ module: env_vars: - name: EXTRA_VALUE - value: Added after initial deployment + value: Updated in a later sync applications: - app_type: shell @@ -15,3 +15,5 @@ module: name: test-extra-echo script: - echo $EXTRA_VALUE + + allow_updates: true diff --git a/tests/configs/06-removed/settings.yaml b/tests/configs/06-removed/settings.yaml new file mode 100644 index 00000000..70f60017 --- /dev/null +++ b/tests/configs/06-removed/settings.yaml @@ -0,0 +1,3 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/deployment-settings.json + +default_versions: {} diff --git a/tests/generate_samples.sh b/tests/generate_samples.sh index b62879ce..a3c9aeaf 100755 --- a/tests/generate_samples.sh +++ b/tests/generate_samples.sh @@ -41,10 +41,18 @@ save_sample 01-initial deploy-tools sync "${TMP_DIR}" "${CONFIGS_DIR}/02-added" save_sample 02-added -# Stage 3: deprecate example-module-deps/0.2 (modulefile link moves to deprecated area). -deploy-tools sync "${TMP_DIR}" "${CONFIGS_DIR}/03-deprecated" -save_sample 03-deprecated +# Stage 3: update example-module-extra/1.0 in place (allowed via allow_updates). +deploy-tools sync "${TMP_DIR}" "${CONFIGS_DIR}/03-updated" +save_sample 03-updated -# Stage 4: remove the now-deprecated example-module-deps/0.2 entirely. -deploy-tools sync "${TMP_DIR}" "${CONFIGS_DIR}/04-removed" -save_sample 04-removed +# Stage 4: deprecate example-module-deps/0.2 and example-module-extra/1.0. +deploy-tools sync "${TMP_DIR}" "${CONFIGS_DIR}/04-deprecated" +save_sample 04-deprecated + +# Stage 5: restore (un-deprecate) example-module-extra/1.0. +deploy-tools sync "${TMP_DIR}" "${CONFIGS_DIR}/05-restored" +save_sample 05-restored + +# Stage 6: remove the now-deprecated example-module-deps/0.2 entirely. +deploy-tools sync "${TMP_DIR}" "${CONFIGS_DIR}/06-removed" +save_sample 06-removed diff --git a/tests/samples/02-added/deploy-tools-output/deployment.yaml b/tests/samples/02-added/deploy-tools-output/deployment.yaml index 40f48db8..2097eb13 100644 --- a/tests/samples/02-added/deploy-tools-output/deployment.yaml +++ b/tests/samples/02-added/deploy-tools-output/deployment.yaml @@ -62,7 +62,7 @@ releases: '1.0': deprecated: false module: - allow_updates: false + allow_updates: true applications: - app_type: shell name: test-extra-echo diff --git a/tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/module.yaml b/tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/module.yaml index 3283a97d..b0c6e016 100644 --- a/tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/module.yaml +++ b/tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/module.yaml @@ -1,4 +1,4 @@ -allow_updates: false +allow_updates: true applications: - app_type: shell name: test-extra-echo diff --git a/tests/samples/03-updated/deploy-tools-output/deployment.yaml b/tests/samples/03-updated/deploy-tools-output/deployment.yaml new file mode 100644 index 00000000..b74eb428 --- /dev/null +++ b/tests/samples/03-updated/deploy-tools-output/deployment.yaml @@ -0,0 +1,82 @@ +releases: + example-module-apps: + '0.1': + deprecated: false + module: + allow_updates: false + applications: + - app_type: apptainer + container: + path: docker://ghcr.io/apptainer/lolcow + version: latest + entrypoints: + - command: cowsay + name: cowsay-hello + options: + apptainer_args: '' + command_args: Hello + host_binaries: [] + mounts: [] + global_options: + apptainer_args: '' + command_args: '' + host_binaries: [] + mounts: [] + - app_type: shell + name: test-echo-module-var + script: + - echo $OTHER_VALUE + - app_type: shell + name: test-shell-script + script: + - echo This is the first line of a shell script + - echo and this is the second line. + - echo Your input is ${1} + dependencies: [] + description: Demonstration of a module configuration folder + env_vars: + - name: OTHER_VALUE + value: Version 0.1 + exclude_from_defaults: false + load_script: [] + name: example-module-apps + unload_script: [] + version: '0.1' + example-module-deps: + '0.2': + deprecated: false + module: + allow_updates: false + applications: [] + dependencies: + - name: example-module-apps + version: '0.1' + description: Demonstration of deploy-tools dependencies + env_vars: [] + exclude_from_defaults: false + load_script: [] + name: example-module-deps + unload_script: [] + version: '0.2' + example-module-extra: + '1.0': + deprecated: false + module: + allow_updates: true + applications: + - app_type: shell + name: test-extra-echo + script: + - echo $EXTRA_VALUE + dependencies: [] + description: Demonstration of adding a module in a later sync + env_vars: + - name: EXTRA_VALUE + value: Updated in a later sync + exclude_from_defaults: false + load_script: [] + name: example-module-extra + unload_script: [] + version: '1.0' +settings: + default_versions: {} diff --git a/tests/samples/03-deprecated/deploy-tools-output/modulefiles/example-module-apps/.version b/tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-apps/.version similarity index 100% rename from tests/samples/03-deprecated/deploy-tools-output/modulefiles/example-module-apps/.version rename to tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-apps/.version diff --git a/tests/samples/03-deprecated/deploy-tools-output/modulefiles/example-module-apps/0.1 b/tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-apps/0.1 similarity index 100% rename from tests/samples/03-deprecated/deploy-tools-output/modulefiles/example-module-apps/0.1 rename to tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-apps/0.1 diff --git a/tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-deps/.version b/tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-deps/.version new file mode 100644 index 00000000..26a66b44 --- /dev/null +++ b/tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-deps/.version @@ -0,0 +1,2 @@ +#%Module1.0 +set ModulesVersion 0.2 diff --git a/tests/samples/03-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 b/tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-deps/0.2 similarity index 100% rename from tests/samples/03-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 rename to tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-deps/0.2 diff --git a/tests/samples/03-deprecated/deploy-tools-output/modulefiles/example-module-extra/.version b/tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-extra/.version similarity index 100% rename from tests/samples/03-deprecated/deploy-tools-output/modulefiles/example-module-extra/.version rename to tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-extra/.version diff --git a/tests/samples/03-deprecated/deploy-tools-output/modulefiles/example-module-extra/1.0 b/tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-extra/1.0 similarity index 100% rename from tests/samples/03-deprecated/deploy-tools-output/modulefiles/example-module-extra/1.0 rename to tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-extra/1.0 diff --git a/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello b/tests/samples/03-updated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello similarity index 100% rename from tests/samples/03-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello rename to tests/samples/03-updated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello diff --git a/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var b/tests/samples/03-updated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var similarity index 100% rename from tests/samples/03-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var rename to tests/samples/03-updated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var diff --git a/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script b/tests/samples/03-updated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script similarity index 100% rename from tests/samples/03-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script rename to tests/samples/03-updated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script diff --git a/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-apps/0.1/module.yaml b/tests/samples/03-updated/deploy-tools-output/modules/example-module-apps/0.1/module.yaml similarity index 100% rename from tests/samples/03-deprecated/deploy-tools-output/modules/example-module-apps/0.1/module.yaml rename to tests/samples/03-updated/deploy-tools-output/modules/example-module-apps/0.1/module.yaml diff --git a/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-apps/0.1/modulefile b/tests/samples/03-updated/deploy-tools-output/modules/example-module-apps/0.1/modulefile similarity index 100% rename from tests/samples/03-deprecated/deploy-tools-output/modules/example-module-apps/0.1/modulefile rename to tests/samples/03-updated/deploy-tools-output/modules/example-module-apps/0.1/modulefile diff --git a/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-deps/0.2/module.yaml b/tests/samples/03-updated/deploy-tools-output/modules/example-module-deps/0.2/module.yaml similarity index 100% rename from tests/samples/03-deprecated/deploy-tools-output/modules/example-module-deps/0.2/module.yaml rename to tests/samples/03-updated/deploy-tools-output/modules/example-module-deps/0.2/module.yaml diff --git a/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-deps/0.2/modulefile b/tests/samples/03-updated/deploy-tools-output/modules/example-module-deps/0.2/modulefile similarity index 100% rename from tests/samples/03-deprecated/deploy-tools-output/modules/example-module-deps/0.2/modulefile rename to tests/samples/03-updated/deploy-tools-output/modules/example-module-deps/0.2/modulefile diff --git a/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo b/tests/samples/03-updated/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo similarity index 100% rename from tests/samples/03-deprecated/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo rename to tests/samples/03-updated/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo diff --git a/tests/samples/04-removed/deploy-tools-output/modules/example-module-extra/1.0/module.yaml b/tests/samples/03-updated/deploy-tools-output/modules/example-module-extra/1.0/module.yaml similarity index 83% rename from tests/samples/04-removed/deploy-tools-output/modules/example-module-extra/1.0/module.yaml rename to tests/samples/03-updated/deploy-tools-output/modules/example-module-extra/1.0/module.yaml index 3283a97d..a592a777 100644 --- a/tests/samples/04-removed/deploy-tools-output/modules/example-module-extra/1.0/module.yaml +++ b/tests/samples/03-updated/deploy-tools-output/modules/example-module-extra/1.0/module.yaml @@ -1,4 +1,4 @@ -allow_updates: false +allow_updates: true applications: - app_type: shell name: test-extra-echo @@ -8,7 +8,7 @@ dependencies: [] description: Demonstration of adding a module in a later sync env_vars: - name: EXTRA_VALUE - value: Added after initial deployment + value: Updated in a later sync exclude_from_defaults: false load_script: [] name: example-module-extra diff --git a/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-extra/1.0/modulefile b/tests/samples/03-updated/deploy-tools-output/modules/example-module-extra/1.0/modulefile similarity index 87% rename from tests/samples/03-deprecated/deploy-tools-output/modules/example-module-extra/1.0/modulefile rename to tests/samples/03-updated/deploy-tools-output/modules/example-module-extra/1.0/modulefile index 1f731a5b..f3ede93d 100644 --- a/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-extra/1.0/modulefile +++ b/tests/samples/03-updated/deploy-tools-output/modules/example-module-extra/1.0/modulefile @@ -10,6 +10,6 @@ if { [module-info mode load] } { } } -setenv EXTRA_VALUE "Added after initial deployment" +setenv EXTRA_VALUE "Updated in a later sync" prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-extra/1.0/entrypoints" diff --git a/tests/samples/04-deprecated/deploy-tools-output/deployment.yaml b/tests/samples/04-deprecated/deploy-tools-output/deployment.yaml new file mode 100644 index 00000000..6871902f --- /dev/null +++ b/tests/samples/04-deprecated/deploy-tools-output/deployment.yaml @@ -0,0 +1,82 @@ +releases: + example-module-apps: + '0.1': + deprecated: false + module: + allow_updates: false + applications: + - app_type: apptainer + container: + path: docker://ghcr.io/apptainer/lolcow + version: latest + entrypoints: + - command: cowsay + name: cowsay-hello + options: + apptainer_args: '' + command_args: Hello + host_binaries: [] + mounts: [] + global_options: + apptainer_args: '' + command_args: '' + host_binaries: [] + mounts: [] + - app_type: shell + name: test-echo-module-var + script: + - echo $OTHER_VALUE + - app_type: shell + name: test-shell-script + script: + - echo This is the first line of a shell script + - echo and this is the second line. + - echo Your input is ${1} + dependencies: [] + description: Demonstration of a module configuration folder + env_vars: + - name: OTHER_VALUE + value: Version 0.1 + exclude_from_defaults: false + load_script: [] + name: example-module-apps + unload_script: [] + version: '0.1' + example-module-deps: + '0.2': + deprecated: true + module: + allow_updates: false + applications: [] + dependencies: + - name: example-module-apps + version: '0.1' + description: Demonstration of deploy-tools dependencies + env_vars: [] + exclude_from_defaults: false + load_script: [] + name: example-module-deps + unload_script: [] + version: '0.2' + example-module-extra: + '1.0': + deprecated: true + module: + allow_updates: true + applications: + - app_type: shell + name: test-extra-echo + script: + - echo $EXTRA_VALUE + dependencies: [] + description: Demonstration of adding a module in a later sync + env_vars: + - name: EXTRA_VALUE + value: Updated in a later sync + exclude_from_defaults: false + load_script: [] + name: example-module-extra + unload_script: [] + version: '1.0' +settings: + default_versions: {} diff --git a/tests/samples/04-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 b/tests/samples/04-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 new file mode 120000 index 00000000..cd04ecdf --- /dev/null +++ b/tests/samples/04-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/example-module-deps/0.2/modulefile \ No newline at end of file diff --git a/tests/samples/04-removed/deploy-tools-output/modulefiles/example-module-extra/1.0 b/tests/samples/04-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-extra/1.0 similarity index 100% rename from tests/samples/04-removed/deploy-tools-output/modulefiles/example-module-extra/1.0 rename to tests/samples/04-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-extra/1.0 diff --git a/tests/samples/04-removed/deploy-tools-output/modulefiles/example-module-apps/.version b/tests/samples/04-deprecated/deploy-tools-output/modulefiles/example-module-apps/.version similarity index 100% rename from tests/samples/04-removed/deploy-tools-output/modulefiles/example-module-apps/.version rename to tests/samples/04-deprecated/deploy-tools-output/modulefiles/example-module-apps/.version diff --git a/tests/samples/04-removed/deploy-tools-output/modulefiles/example-module-apps/0.1 b/tests/samples/04-deprecated/deploy-tools-output/modulefiles/example-module-apps/0.1 similarity index 100% rename from tests/samples/04-removed/deploy-tools-output/modulefiles/example-module-apps/0.1 rename to tests/samples/04-deprecated/deploy-tools-output/modulefiles/example-module-apps/0.1 diff --git a/tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello b/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello similarity index 100% rename from tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello rename to tests/samples/04-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello diff --git a/tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var b/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var similarity index 100% rename from tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var rename to tests/samples/04-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var diff --git a/tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script b/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script similarity index 100% rename from tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script rename to tests/samples/04-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script diff --git a/tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/module.yaml b/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-apps/0.1/module.yaml similarity index 100% rename from tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/module.yaml rename to tests/samples/04-deprecated/deploy-tools-output/modules/example-module-apps/0.1/module.yaml diff --git a/tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/modulefile b/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-apps/0.1/modulefile similarity index 100% rename from tests/samples/04-removed/deploy-tools-output/modules/example-module-apps/0.1/modulefile rename to tests/samples/04-deprecated/deploy-tools-output/modules/example-module-apps/0.1/modulefile diff --git a/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-deps/0.2/module.yaml b/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-deps/0.2/module.yaml new file mode 100644 index 00000000..0765b12f --- /dev/null +++ b/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-deps/0.2/module.yaml @@ -0,0 +1,12 @@ +allow_updates: false +applications: [] +dependencies: +- name: example-module-apps + version: '0.1' +description: Demonstration of deploy-tools dependencies +env_vars: [] +exclude_from_defaults: false +load_script: [] +name: example-module-deps +unload_script: [] +version: '0.2' diff --git a/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-deps/0.2/modulefile b/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-deps/0.2/modulefile new file mode 100644 index 00000000..a4fbe508 --- /dev/null +++ b/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-deps/0.2/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## example-module-deps - Demonstration of deploy-tools dependencies +## +module-whatis "Demonstration of deploy-tools dependencies" + +if { [module-info mode load] } { + if { [is-loaded example-module-deps] } { + module unload example-module-deps + } +} + +module load example-module-apps/0.1 + +prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-deps/0.2/entrypoints" diff --git a/tests/samples/04-removed/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo b/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo similarity index 100% rename from tests/samples/04-removed/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo rename to tests/samples/04-deprecated/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo diff --git a/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-extra/1.0/module.yaml b/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-extra/1.0/module.yaml similarity index 83% rename from tests/samples/03-deprecated/deploy-tools-output/modules/example-module-extra/1.0/module.yaml rename to tests/samples/04-deprecated/deploy-tools-output/modules/example-module-extra/1.0/module.yaml index 3283a97d..a592a777 100644 --- a/tests/samples/03-deprecated/deploy-tools-output/modules/example-module-extra/1.0/module.yaml +++ b/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-extra/1.0/module.yaml @@ -1,4 +1,4 @@ -allow_updates: false +allow_updates: true applications: - app_type: shell name: test-extra-echo @@ -8,7 +8,7 @@ dependencies: [] description: Demonstration of adding a module in a later sync env_vars: - name: EXTRA_VALUE - value: Added after initial deployment + value: Updated in a later sync exclude_from_defaults: false load_script: [] name: example-module-extra diff --git a/tests/samples/04-removed/deploy-tools-output/modules/example-module-extra/1.0/modulefile b/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-extra/1.0/modulefile similarity index 87% rename from tests/samples/04-removed/deploy-tools-output/modules/example-module-extra/1.0/modulefile rename to tests/samples/04-deprecated/deploy-tools-output/modules/example-module-extra/1.0/modulefile index 1f731a5b..f3ede93d 100644 --- a/tests/samples/04-removed/deploy-tools-output/modules/example-module-extra/1.0/modulefile +++ b/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-extra/1.0/modulefile @@ -10,6 +10,6 @@ if { [module-info mode load] } { } } -setenv EXTRA_VALUE "Added after initial deployment" +setenv EXTRA_VALUE "Updated in a later sync" prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-extra/1.0/entrypoints" diff --git a/tests/samples/03-deprecated/deploy-tools-output/deployment.yaml b/tests/samples/05-restored/deploy-tools-output/deployment.yaml similarity index 96% rename from tests/samples/03-deprecated/deploy-tools-output/deployment.yaml rename to tests/samples/05-restored/deploy-tools-output/deployment.yaml index 9698f394..a603e950 100644 --- a/tests/samples/03-deprecated/deploy-tools-output/deployment.yaml +++ b/tests/samples/05-restored/deploy-tools-output/deployment.yaml @@ -62,7 +62,7 @@ releases: '1.0': deprecated: false module: - allow_updates: false + allow_updates: true applications: - app_type: shell name: test-extra-echo @@ -72,7 +72,7 @@ releases: description: Demonstration of adding a module in a later sync env_vars: - name: EXTRA_VALUE - value: Added after initial deployment + value: Updated in a later sync exclude_from_defaults: false load_script: [] name: example-module-extra diff --git a/tests/samples/05-restored/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 b/tests/samples/05-restored/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 new file mode 120000 index 00000000..cd04ecdf --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/example-module-deps/0.2/modulefile \ No newline at end of file diff --git a/tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-apps/.version b/tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-apps/.version new file mode 100644 index 00000000..d9b8f921 --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-apps/.version @@ -0,0 +1,2 @@ +#%Module1.0 +set ModulesVersion 0.1 diff --git a/tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-apps/0.1 b/tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-apps/0.1 new file mode 120000 index 00000000..53b90576 --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-apps/0.1 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/example-module-apps/0.1/modulefile \ No newline at end of file diff --git a/tests/samples/04-removed/deploy-tools-output/modulefiles/example-module-extra/.version b/tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-extra/.version similarity index 100% rename from tests/samples/04-removed/deploy-tools-output/modulefiles/example-module-extra/.version rename to tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-extra/.version diff --git a/tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-extra/1.0 b/tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-extra/1.0 new file mode 120000 index 00000000..59949819 --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-extra/1.0 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/example-module-extra/1.0/modulefile \ No newline at end of file diff --git a/tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello b/tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello new file mode 100755 index 00000000..d43f0d44 --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello @@ -0,0 +1,44 @@ +#! /bin/bash + +# Arguments: +# ${@} = Remaining args to pass to the command + +# Halt on error +set -e + +# Mounts for container +mounts="" +# Additional arguments for apptainer +apptainer_args="" +# Sif file path +sif_file="$(dirname $0)/../sif_files/a553018b87553334a94c33cb04eb025c.sif" +# Command to run in container +command="cowsay" +# Options and arguments to pass to command +command_args="Hello" + +# Raise an error if sif file does not exist +if [[ ! -f ${sif_file} ]]; then + echo "ERROR: sif file ${sif_file} does not exist" 1>&2 + exit 1 +fi + +# add mounts of host binaries into /usr/bin +for i in ; do + binary=$(which $i) + mounts="${mounts},${binary}:/usr/bin/${i}" +done + +# Set up mounts if any have been configured +if [[ ! -z ${mounts} ]]; then + opts="-B ${mounts}" +fi + +opts=${opts}" --env DISPLAY=${DISPLAY}" +opts=${opts}" ${apptainer_args}" + + +if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then + set -x +fi +apptainer exec ${opts} ${sif_file} ${command} ${command_args} "${@}" diff --git a/tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var b/tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var new file mode 100755 index 00000000..0a367ddf --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var @@ -0,0 +1,7 @@ +#! /bin/bash + +if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then + set -x +fi + +echo $OTHER_VALUE diff --git a/tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script b/tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script new file mode 100755 index 00000000..6ca6871d --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script @@ -0,0 +1,9 @@ +#! /bin/bash + +if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then + set -x +fi + +echo This is the first line of a shell script +echo and this is the second line. +echo Your input is ${1} diff --git a/tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/module.yaml b/tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/module.yaml new file mode 100644 index 00000000..51a06102 --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/module.yaml @@ -0,0 +1,39 @@ +allow_updates: false +applications: +- app_type: apptainer + container: + path: docker://ghcr.io/apptainer/lolcow + version: latest + entrypoints: + - command: cowsay + name: cowsay-hello + options: + apptainer_args: '' + command_args: Hello + host_binaries: [] + mounts: [] + global_options: + apptainer_args: '' + command_args: '' + host_binaries: [] + mounts: [] +- app_type: shell + name: test-echo-module-var + script: + - echo $OTHER_VALUE +- app_type: shell + name: test-shell-script + script: + - echo This is the first line of a shell script + - echo and this is the second line. + - echo Your input is ${1} +dependencies: [] +description: Demonstration of a module configuration folder +env_vars: +- name: OTHER_VALUE + value: Version 0.1 +exclude_from_defaults: false +load_script: [] +name: example-module-apps +unload_script: [] +version: '0.1' diff --git a/tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/modulefile b/tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/modulefile new file mode 100644 index 00000000..b6458983 --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## example-module-apps - Demonstration of a module configuration folder +## +module-whatis "Demonstration of a module configuration folder" + +if { [module-info mode load] } { + if { [is-loaded example-module-apps] } { + module unload example-module-apps + } +} + +setenv OTHER_VALUE "Version 0.1" + +prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-apps/0.1/entrypoints" diff --git a/tests/samples/05-restored/deploy-tools-output/modules/example-module-deps/0.2/module.yaml b/tests/samples/05-restored/deploy-tools-output/modules/example-module-deps/0.2/module.yaml new file mode 100644 index 00000000..0765b12f --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modules/example-module-deps/0.2/module.yaml @@ -0,0 +1,12 @@ +allow_updates: false +applications: [] +dependencies: +- name: example-module-apps + version: '0.1' +description: Demonstration of deploy-tools dependencies +env_vars: [] +exclude_from_defaults: false +load_script: [] +name: example-module-deps +unload_script: [] +version: '0.2' diff --git a/tests/samples/05-restored/deploy-tools-output/modules/example-module-deps/0.2/modulefile b/tests/samples/05-restored/deploy-tools-output/modules/example-module-deps/0.2/modulefile new file mode 100644 index 00000000..a4fbe508 --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modules/example-module-deps/0.2/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## example-module-deps - Demonstration of deploy-tools dependencies +## +module-whatis "Demonstration of deploy-tools dependencies" + +if { [module-info mode load] } { + if { [is-loaded example-module-deps] } { + module unload example-module-deps + } +} + +module load example-module-apps/0.1 + +prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-deps/0.2/entrypoints" diff --git a/tests/samples/05-restored/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo b/tests/samples/05-restored/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo new file mode 100755 index 00000000..77e9301a --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo @@ -0,0 +1,7 @@ +#! /bin/bash + +if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then + set -x +fi + +echo $EXTRA_VALUE diff --git a/tests/samples/05-restored/deploy-tools-output/modules/example-module-extra/1.0/module.yaml b/tests/samples/05-restored/deploy-tools-output/modules/example-module-extra/1.0/module.yaml new file mode 100644 index 00000000..a592a777 --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modules/example-module-extra/1.0/module.yaml @@ -0,0 +1,16 @@ +allow_updates: true +applications: +- app_type: shell + name: test-extra-echo + script: + - echo $EXTRA_VALUE +dependencies: [] +description: Demonstration of adding a module in a later sync +env_vars: +- name: EXTRA_VALUE + value: Updated in a later sync +exclude_from_defaults: false +load_script: [] +name: example-module-extra +unload_script: [] +version: '1.0' diff --git a/tests/samples/05-restored/deploy-tools-output/modules/example-module-extra/1.0/modulefile b/tests/samples/05-restored/deploy-tools-output/modules/example-module-extra/1.0/modulefile new file mode 100644 index 00000000..f3ede93d --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modules/example-module-extra/1.0/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## example-module-extra - Demonstration of adding a module in a later sync +## +module-whatis "Demonstration of adding a module in a later sync" + +if { [module-info mode load] } { + if { [is-loaded example-module-extra] } { + module unload example-module-extra + } +} + +setenv EXTRA_VALUE "Updated in a later sync" + +prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-extra/1.0/entrypoints" diff --git a/tests/samples/04-removed/deploy-tools-output/deployment.yaml b/tests/samples/06-removed/deploy-tools-output/deployment.yaml similarity index 95% rename from tests/samples/04-removed/deploy-tools-output/deployment.yaml rename to tests/samples/06-removed/deploy-tools-output/deployment.yaml index 06f200f2..f3aa403c 100644 --- a/tests/samples/04-removed/deploy-tools-output/deployment.yaml +++ b/tests/samples/06-removed/deploy-tools-output/deployment.yaml @@ -46,7 +46,7 @@ releases: '1.0': deprecated: false module: - allow_updates: false + allow_updates: true applications: - app_type: shell name: test-extra-echo @@ -56,7 +56,7 @@ releases: description: Demonstration of adding a module in a later sync env_vars: - name: EXTRA_VALUE - value: Added after initial deployment + value: Updated in a later sync exclude_from_defaults: false load_script: [] name: example-module-extra diff --git a/tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-apps/.version b/tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-apps/.version new file mode 100644 index 00000000..d9b8f921 --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-apps/.version @@ -0,0 +1,2 @@ +#%Module1.0 +set ModulesVersion 0.1 diff --git a/tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-apps/0.1 b/tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-apps/0.1 new file mode 120000 index 00000000..53b90576 --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-apps/0.1 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/example-module-apps/0.1/modulefile \ No newline at end of file diff --git a/tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-extra/.version b/tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-extra/.version new file mode 100644 index 00000000..f0d55435 --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-extra/.version @@ -0,0 +1,2 @@ +#%Module1.0 +set ModulesVersion 1.0 diff --git a/tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-extra/1.0 b/tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-extra/1.0 new file mode 120000 index 00000000..59949819 --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-extra/1.0 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/example-module-extra/1.0/modulefile \ No newline at end of file diff --git a/tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello b/tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello new file mode 100755 index 00000000..d43f0d44 --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello @@ -0,0 +1,44 @@ +#! /bin/bash + +# Arguments: +# ${@} = Remaining args to pass to the command + +# Halt on error +set -e + +# Mounts for container +mounts="" +# Additional arguments for apptainer +apptainer_args="" +# Sif file path +sif_file="$(dirname $0)/../sif_files/a553018b87553334a94c33cb04eb025c.sif" +# Command to run in container +command="cowsay" +# Options and arguments to pass to command +command_args="Hello" + +# Raise an error if sif file does not exist +if [[ ! -f ${sif_file} ]]; then + echo "ERROR: sif file ${sif_file} does not exist" 1>&2 + exit 1 +fi + +# add mounts of host binaries into /usr/bin +for i in ; do + binary=$(which $i) + mounts="${mounts},${binary}:/usr/bin/${i}" +done + +# Set up mounts if any have been configured +if [[ ! -z ${mounts} ]]; then + opts="-B ${mounts}" +fi + +opts=${opts}" --env DISPLAY=${DISPLAY}" +opts=${opts}" ${apptainer_args}" + + +if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then + set -x +fi +apptainer exec ${opts} ${sif_file} ${command} ${command_args} "${@}" diff --git a/tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var b/tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var new file mode 100755 index 00000000..0a367ddf --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var @@ -0,0 +1,7 @@ +#! /bin/bash + +if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then + set -x +fi + +echo $OTHER_VALUE diff --git a/tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script b/tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script new file mode 100755 index 00000000..6ca6871d --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script @@ -0,0 +1,9 @@ +#! /bin/bash + +if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then + set -x +fi + +echo This is the first line of a shell script +echo and this is the second line. +echo Your input is ${1} diff --git a/tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/module.yaml b/tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/module.yaml new file mode 100644 index 00000000..51a06102 --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/module.yaml @@ -0,0 +1,39 @@ +allow_updates: false +applications: +- app_type: apptainer + container: + path: docker://ghcr.io/apptainer/lolcow + version: latest + entrypoints: + - command: cowsay + name: cowsay-hello + options: + apptainer_args: '' + command_args: Hello + host_binaries: [] + mounts: [] + global_options: + apptainer_args: '' + command_args: '' + host_binaries: [] + mounts: [] +- app_type: shell + name: test-echo-module-var + script: + - echo $OTHER_VALUE +- app_type: shell + name: test-shell-script + script: + - echo This is the first line of a shell script + - echo and this is the second line. + - echo Your input is ${1} +dependencies: [] +description: Demonstration of a module configuration folder +env_vars: +- name: OTHER_VALUE + value: Version 0.1 +exclude_from_defaults: false +load_script: [] +name: example-module-apps +unload_script: [] +version: '0.1' diff --git a/tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/modulefile b/tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/modulefile new file mode 100644 index 00000000..b6458983 --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## example-module-apps - Demonstration of a module configuration folder +## +module-whatis "Demonstration of a module configuration folder" + +if { [module-info mode load] } { + if { [is-loaded example-module-apps] } { + module unload example-module-apps + } +} + +setenv OTHER_VALUE "Version 0.1" + +prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-apps/0.1/entrypoints" diff --git a/tests/samples/06-removed/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo b/tests/samples/06-removed/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo new file mode 100755 index 00000000..77e9301a --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo @@ -0,0 +1,7 @@ +#! /bin/bash + +if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then + set -x +fi + +echo $EXTRA_VALUE diff --git a/tests/samples/06-removed/deploy-tools-output/modules/example-module-extra/1.0/module.yaml b/tests/samples/06-removed/deploy-tools-output/modules/example-module-extra/1.0/module.yaml new file mode 100644 index 00000000..a592a777 --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modules/example-module-extra/1.0/module.yaml @@ -0,0 +1,16 @@ +allow_updates: true +applications: +- app_type: shell + name: test-extra-echo + script: + - echo $EXTRA_VALUE +dependencies: [] +description: Demonstration of adding a module in a later sync +env_vars: +- name: EXTRA_VALUE + value: Updated in a later sync +exclude_from_defaults: false +load_script: [] +name: example-module-extra +unload_script: [] +version: '1.0' diff --git a/tests/samples/06-removed/deploy-tools-output/modules/example-module-extra/1.0/modulefile b/tests/samples/06-removed/deploy-tools-output/modules/example-module-extra/1.0/modulefile new file mode 100644 index 00000000..f3ede93d --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modules/example-module-extra/1.0/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## example-module-extra - Demonstration of adding a module in a later sync +## +module-whatis "Demonstration of adding a module in a later sync" + +if { [module-info mode load] } { + if { [is-loaded example-module-extra] } { + module unload example-module-extra + } +} + +setenv EXTRA_VALUE "Updated in a later sync" + +prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-extra/1.0/entrypoints" diff --git a/tests/test_golden_master.py b/tests/test_golden_master.py index ae8351ea..64b06ec3 100644 --- a/tests/test_golden_master.py +++ b/tests/test_golden_master.py @@ -48,24 +48,40 @@ def test_module_lifecycle(samples: Path, configs: Path): _assert_expected_files_match(samples / "01-initial" / DEPLOYMENT_DIRNAME, TEMP_OUT) # Stage 2: deploy a brand-new module on an incremental (non from-scratch) sync. Its - # files and modulefile link should appear, while the modules from stage 1 are left - # untouched (verified by the stage-2 golden master, which still contains them). + # files and modulefile link should appear, while the modules already deployed are + # left untouched (this stage's golden master still contains them unchanged). run_cli("sync", TEMP_OUT, configs / "02-added") _assert_expected_files_match(samples / "02-added" / DEPLOYMENT_DIRNAME, TEMP_OUT) - # Stage 3: deprecate example-module-deps/0.2. Its modulefile link should move out of - # the live modulefiles area and into the deprecated area, while the built module is - # left in place. - run_cli("sync", TEMP_OUT, configs / "03-deprecated") + # Stage 3: update example-module-extra/1.0 in place. Its config changed and it was + # deployed with allow_updates, so the module is rebuilt and replaced; the golden + # master captures the new modulefile contents. + run_cli("sync", TEMP_OUT, configs / "03-updated") + _assert_expected_files_match(samples / "03-updated" / DEPLOYMENT_DIRNAME, TEMP_OUT) + + # Stage 4: deprecate example-module-deps/0.2 (en route to removal) and + # example-module-extra/1.0 (to set up the restore that follows). Both modulefile + # links move out of the live area into the deprecated area; built modules stay put. + run_cli("sync", TEMP_OUT, configs / "04-deprecated") _assert_expected_files_match( - samples / "03-deprecated" / DEPLOYMENT_DIRNAME, TEMP_OUT + samples / "04-deprecated" / DEPLOYMENT_DIRNAME, TEMP_OUT ) - _assert_absent(TEMP_OUT, "modulefiles/example-module-deps") + _assert_absent( + TEMP_OUT, + "modulefiles/example-module-deps", + "modulefiles/example-module-extra", + ) + + # Stage 5: restore example-module-extra/1.0 by un-deprecating it. Its modulefile + # link moves back into the live area; example-module-deps/0.2 stays deprecated. + run_cli("sync", TEMP_OUT, configs / "05-restored") + _assert_expected_files_match(samples / "05-restored" / DEPLOYMENT_DIRNAME, TEMP_OUT) + _assert_absent(TEMP_OUT, "deprecated/modulefiles/example-module-extra") - # Stage 4: remove the now-deprecated example-module-deps/0.2 entirely. Both its - # modulefile link and built module should be gone. - run_cli("sync", TEMP_OUT, configs / "04-removed") - _assert_expected_files_match(samples / "04-removed" / DEPLOYMENT_DIRNAME, TEMP_OUT) + # Stage 6: remove the now-deprecated example-module-deps/0.2 entirely. Both its + # modulefile link and built module should be gone; example-module-extra remains. + run_cli("sync", TEMP_OUT, configs / "06-removed") + _assert_expected_files_match(samples / "06-removed" / DEPLOYMENT_DIRNAME, TEMP_OUT) _assert_absent( TEMP_OUT, "modules/example-module-deps", From 971af9cdec1c8608c6fbc8303e38d82849f8824b Mon Sep 17 00:00:00 2001 From: Martin Gaughran Date: Mon, 15 Jun 2026 15:53:54 +0000 Subject: [PATCH 06/19] Add golden-master tests for the validate command This includes sorting output to ensure it is deterministic. The 'file' utility has been installed to allow tests to run on the devcontainer. --- Dockerfile | 2 +- src/deploy_tools/print_updates.py | 9 +++++++-- tests/conftest.py | 3 ++- tests/generate_samples.sh | 18 ++++++++++++++++++ tests/samples/01-initial/validate.txt | 7 +++++++ tests/samples/02-added/validate.txt | 5 +++++ tests/samples/03-updated/validate.txt | 4 ++++ tests/samples/04-deprecated/validate.txt | 7 +++++++ tests/samples/05-restored/validate.txt | 5 +++++ tests/samples/06-removed/validate.txt | 4 ++++ tests/test_golden_master.py | 20 ++++++++++++++++++++ 11 files changed, 80 insertions(+), 4 deletions(-) create mode 100644 tests/samples/01-initial/validate.txt create mode 100644 tests/samples/02-added/validate.txt create mode 100644 tests/samples/03-updated/validate.txt create mode 100644 tests/samples/04-deprecated/validate.txt create mode 100644 tests/samples/05-restored/validate.txt create mode 100644 tests/samples/06-removed/validate.txt diff --git a/Dockerfile b/Dockerfile index f58d2be2..f7f4188f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM ghcr.io/diamondlightsource/ubuntu-devcontainer:noble AS developer # Add any system dependencies for the developer/build environment here RUN apt-get update -y && apt-get install -y --no-install-recommends \ - graphviz environment-modules wget \ + graphviz environment-modules wget file \ && cd /tmp \ && wget https://github.com/apptainer/apptainer/releases/download/v1.3.3/apptainer_1.3.3_amd64.deb \ && apt install -y ./apptainer_1.3.3_amd64.deb \ diff --git a/src/deploy_tools/print_updates.py b/src/deploy_tools/print_updates.py index 9e324834..66a655ce 100644 --- a/src/deploy_tools/print_updates.py +++ b/src/deploy_tools/print_updates.py @@ -25,7 +25,10 @@ def _print_module_updates(release_changes: ReleaseChanges) -> None: if releases: print(f"Modules to be {action}:") - for release in releases: + # Sort for stable output: release lists follow config load (glob) order. + for release in sorted( + releases, key=lambda r: (r.module.name, r.module.version) + ): print(f"{release.module.name}/{release.module.version}") print() @@ -39,7 +42,9 @@ def _print_version_updates( module_names = old_defaults.keys() | new_defaults.keys() update_messages: list[str] = [] - for name in module_names: + # Sort for stable output: module_names is a set, whose iteration order depends on + # PYTHONHASHSEED. + for name in sorted(module_names): old = old_defaults.get(name, "None") new = new_defaults.get(name, "None") if not old == new: diff --git a/tests/conftest.py b/tests/conftest.py index b100119b..42ba1736 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -8,11 +8,12 @@ runner = CliRunner() -def run_cli(*args: str | Path): +def run_cli(*args: str | Path) -> str: result = runner.invoke(app, [str(x) for x in args]) if result.exception: raise result.exception assert result.exit_code == 0, result + return result.stdout @pytest.fixture diff --git a/tests/generate_samples.sh b/tests/generate_samples.sh index a3c9aeaf..e908b5c2 100755 --- a/tests/generate_samples.sh +++ b/tests/generate_samples.sh @@ -29,30 +29,48 @@ save_sample () { rm -rf "${dest}"/.git* } +# Capture the change summary that 'validate' prints for the upcoming sync. validate is +# read-only and previews the next sync, so it runs against the deployment area in its +# current (pre-sync) state. The 'set -x' trace goes to stderr, so only the summary is +# written to the file. +capture_validate () { + local stage=${1} + shift + mkdir -p "${SAMPLES_DIR}/${stage}" + deploy-tools validate "$@" "${TMP_DIR}" "${CONFIGS_DIR}/${stage}" \ + > "${SAMPLES_DIR}/${stage}/validate.txt" +} + # The lifecycle stages share a single deployment area and must run in order, as # each stage builds on the previous deployment state. Only the first sync # uses --from-scratch. # Stage 1: deploy the initial configuration into an empty area. +capture_validate 01-initial --from-scratch deploy-tools sync --from-scratch "${TMP_DIR}" "${CONFIGS_DIR}/01-initial" save_sample 01-initial # Stage 2: add a new module (example-module-extra/1.0) on an incremental sync. +capture_validate 02-added deploy-tools sync "${TMP_DIR}" "${CONFIGS_DIR}/02-added" save_sample 02-added # Stage 3: update example-module-extra/1.0 in place (allowed via allow_updates). +capture_validate 03-updated deploy-tools sync "${TMP_DIR}" "${CONFIGS_DIR}/03-updated" save_sample 03-updated # Stage 4: deprecate example-module-deps/0.2 and example-module-extra/1.0. +capture_validate 04-deprecated deploy-tools sync "${TMP_DIR}" "${CONFIGS_DIR}/04-deprecated" save_sample 04-deprecated # Stage 5: restore (un-deprecate) example-module-extra/1.0. +capture_validate 05-restored deploy-tools sync "${TMP_DIR}" "${CONFIGS_DIR}/05-restored" save_sample 05-restored # Stage 6: remove the now-deprecated example-module-deps/0.2 entirely. +capture_validate 06-removed deploy-tools sync "${TMP_DIR}" "${CONFIGS_DIR}/06-removed" save_sample 06-removed diff --git a/tests/samples/01-initial/validate.txt b/tests/samples/01-initial/validate.txt new file mode 100644 index 00000000..b843b82d --- /dev/null +++ b/tests/samples/01-initial/validate.txt @@ -0,0 +1,7 @@ +Modules to be deployed: +example-module-apps/0.1 +example-module-deps/0.2 + +Updated module defaults: +example-module-apps None -> 0.1 +example-module-deps None -> 0.2 diff --git a/tests/samples/02-added/validate.txt b/tests/samples/02-added/validate.txt new file mode 100644 index 00000000..1daad81a --- /dev/null +++ b/tests/samples/02-added/validate.txt @@ -0,0 +1,5 @@ +Modules to be deployed: +example-module-extra/1.0 + +Updated module defaults: +example-module-extra None -> 1.0 diff --git a/tests/samples/03-updated/validate.txt b/tests/samples/03-updated/validate.txt new file mode 100644 index 00000000..5f1247dc --- /dev/null +++ b/tests/samples/03-updated/validate.txt @@ -0,0 +1,4 @@ +Modules to be updated: +example-module-extra/1.0 + +No default version changes diff --git a/tests/samples/04-deprecated/validate.txt b/tests/samples/04-deprecated/validate.txt new file mode 100644 index 00000000..04665b25 --- /dev/null +++ b/tests/samples/04-deprecated/validate.txt @@ -0,0 +1,7 @@ +Modules to be deprecated: +example-module-deps/0.2 +example-module-extra/1.0 + +Updated module defaults: +example-module-deps 0.2 -> None +example-module-extra 1.0 -> None diff --git a/tests/samples/05-restored/validate.txt b/tests/samples/05-restored/validate.txt new file mode 100644 index 00000000..9bde4baf --- /dev/null +++ b/tests/samples/05-restored/validate.txt @@ -0,0 +1,5 @@ +Modules to be restored: +example-module-extra/1.0 + +Updated module defaults: +example-module-extra None -> 1.0 diff --git a/tests/samples/06-removed/validate.txt b/tests/samples/06-removed/validate.txt new file mode 100644 index 00000000..a5d50c54 --- /dev/null +++ b/tests/samples/06-removed/validate.txt @@ -0,0 +1,4 @@ +Modules to be removed: +example-module-deps/0.2 + +No default version changes diff --git a/tests/test_golden_master.py b/tests/test_golden_master.py index 64b06ec3..adb7fb7c 100644 --- a/tests/test_golden_master.py +++ b/tests/test_golden_master.py @@ -38,30 +38,48 @@ def _assert_absent(root: Path, *relative_paths: str) -> None: assert not path.exists(), f"Path {path} should not exist." +def _assert_validate_matches(expected_dir: Path, *cli_args: str | Path) -> None: + """Assert ``validate``'s printed summary matches the committed golden master. + + ``validate`` is read-only and previews the next sync, so it is run against the + deployment area in its pre-sync state. + """ + expected = (expected_dir / "validate.txt").read_text() + assert run_cli("validate", *cli_args) == expected + + def test_module_lifecycle(samples: Path, configs: Path): # make sure the output directory is empty and exists rmtree(TEMP_OUT, ignore_errors=True) TEMP_OUT.mkdir(exist_ok=True) # Stage 1: deploy the initial configuration into an empty area. + _assert_validate_matches( + samples / "01-initial", "--from-scratch", TEMP_OUT, configs / "01-initial" + ) run_cli("sync", "--from-scratch", TEMP_OUT, configs / "01-initial") _assert_expected_files_match(samples / "01-initial" / DEPLOYMENT_DIRNAME, TEMP_OUT) # Stage 2: deploy a brand-new module on an incremental (non from-scratch) sync. Its # files and modulefile link should appear, while the modules already deployed are # left untouched (this stage's golden master still contains them unchanged). + _assert_validate_matches(samples / "02-added", TEMP_OUT, configs / "02-added") run_cli("sync", TEMP_OUT, configs / "02-added") _assert_expected_files_match(samples / "02-added" / DEPLOYMENT_DIRNAME, TEMP_OUT) # Stage 3: update example-module-extra/1.0 in place. Its config changed and it was # deployed with allow_updates, so the module is rebuilt and replaced; the golden # master captures the new modulefile contents. + _assert_validate_matches(samples / "03-updated", TEMP_OUT, configs / "03-updated") run_cli("sync", TEMP_OUT, configs / "03-updated") _assert_expected_files_match(samples / "03-updated" / DEPLOYMENT_DIRNAME, TEMP_OUT) # Stage 4: deprecate example-module-deps/0.2 (en route to removal) and # example-module-extra/1.0 (to set up the restore that follows). Both modulefile # links move out of the live area into the deprecated area; built modules stay put. + _assert_validate_matches( + samples / "04-deprecated", TEMP_OUT, configs / "04-deprecated" + ) run_cli("sync", TEMP_OUT, configs / "04-deprecated") _assert_expected_files_match( samples / "04-deprecated" / DEPLOYMENT_DIRNAME, TEMP_OUT @@ -74,12 +92,14 @@ def test_module_lifecycle(samples: Path, configs: Path): # Stage 5: restore example-module-extra/1.0 by un-deprecating it. Its modulefile # link moves back into the live area; example-module-deps/0.2 stays deprecated. + _assert_validate_matches(samples / "05-restored", TEMP_OUT, configs / "05-restored") run_cli("sync", TEMP_OUT, configs / "05-restored") _assert_expected_files_match(samples / "05-restored" / DEPLOYMENT_DIRNAME, TEMP_OUT) _assert_absent(TEMP_OUT, "deprecated/modulefiles/example-module-extra") # Stage 6: remove the now-deprecated example-module-deps/0.2 entirely. Both its # modulefile link and built module should be gone; example-module-extra remains. + _assert_validate_matches(samples / "06-removed", TEMP_OUT, configs / "06-removed") run_cli("sync", TEMP_OUT, configs / "06-removed") _assert_expected_files_match(samples / "06-removed" / DEPLOYMENT_DIRNAME, TEMP_OUT) _assert_absent( From b20d8f817d32e575d02ff69ebc23521da4d909f5 Mon Sep 17 00:00:00 2001 From: Martin Gaughran Date: Mon, 15 Jun 2026 16:58:34 +0000 Subject: [PATCH 07/19] Use google docstring format for tests --- tests/test_golden_master.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/test_golden_master.py b/tests/test_golden_master.py index adb7fb7c..92bb9a7f 100644 --- a/tests/test_golden_master.py +++ b/tests/test_golden_master.py @@ -16,6 +16,10 @@ def _assert_expected_files_match(expected_root: Path, actual_root: Path) -> None This is a one-directional check: files present in the deployment area but absent from the golden master (e.g. ``.sif`` images, the ``.git`` directory) are ignored. Use ``_assert_absent`` to verify that files have actually been removed. + + Args: + expected_root: Root of the committed golden master tree. + actual_root: Root of the deployment area to check against it. """ for expected in expected_root.glob("**/*"): if expected.is_dir(): @@ -32,7 +36,12 @@ def _assert_expected_files_match(expected_root: Path, actual_root: Path) -> None def _assert_absent(root: Path, *relative_paths: str) -> None: - """Assert that none of the given paths exist under ``root``.""" + """Assert that none of the given paths exist under ``root``. + + Args: + root: The base directory to resolve paths against. + relative_paths: Paths, relative to ``root``, that must not exist. + """ for relative_path in relative_paths: path = root / relative_path assert not path.exists(), f"Path {path} should not exist." @@ -43,6 +52,10 @@ def _assert_validate_matches(expected_dir: Path, *cli_args: str | Path) -> None: ``validate`` is read-only and previews the next sync, so it is run against the deployment area in its pre-sync state. + + Args: + expected_dir: Stage directory containing the expected ``validate.txt``. + cli_args: Arguments passed to the ``validate`` CLI command. """ expected = (expected_dir / "validate.txt").read_text() assert run_cli("validate", *cli_args) == expected From e3b8131a9286c8f0a2ddd7631910faddf9de4b57 Mon Sep 17 00:00:00 2001 From: Martin Gaughran Date: Wed, 17 Jun 2026 12:36:37 +0000 Subject: [PATCH 08/19] Use single DeployToolsError as base class for actionable errors These are caught in the main() function and printed without traceback to reduce clutter in failed runs. --- src/deploy_tools/__main__.py | 11 ++++++++++- src/deploy_tools/app_builder.py | 3 ++- src/deploy_tools/apptainer.py | 4 +++- src/deploy_tools/compare.py | 3 ++- src/deploy_tools/errors.py | 10 ++++++++++ src/deploy_tools/models/save_and_load.py | 3 ++- src/deploy_tools/snapshot.py | 3 ++- src/deploy_tools/validate.py | 3 ++- 8 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 src/deploy_tools/errors.py diff --git a/src/deploy_tools/__main__.py b/src/deploy_tools/__main__.py index a24be0c8..4a609f48 100644 --- a/src/deploy_tools/__main__.py +++ b/src/deploy_tools/__main__.py @@ -1,4 +1,5 @@ import logging +import sys from pathlib import Path from typing import Annotated @@ -6,6 +7,7 @@ from . import __version__ from .compare import compare_to_snapshot +from .errors import DeployToolsError from .models.schema import generate_schema from .sync import synchronise from .validate import validate_and_test_configuration @@ -203,7 +205,14 @@ def common( def main() -> None: - app() + try: + app() + except DeployToolsError as exc: + # Expected, actionable failures carry a complete user-facing message, so present + # just that and exit non-zero. Any other exception propagates to Typer's + # excepthook and surfaces as a full traceback, as befits an unexpected bug. + typer.secho(f"Error: {exc}", fg=typer.colors.RED, err=True) + sys.exit(1) if __name__ == "__main__": diff --git a/src/deploy_tools/app_builder.py b/src/deploy_tools/app_builder.py index 26ee889d..1cf4f921 100644 --- a/src/deploy_tools/app_builder.py +++ b/src/deploy_tools/app_builder.py @@ -7,6 +7,7 @@ from deploy_tools.models.binary_app import BinaryApp, HashType from .apptainer import create_sif_file +from .errors import DeployToolsError from .layout import ModuleBuildLayout from .models.apptainer_app import ApptainerApp from .models.module import Application, Module @@ -16,7 +17,7 @@ ALL_READ_EXECUTE_PERMISSIONS = 0o555 -class AppBuilderError(Exception): +class AppBuilderError(DeployToolsError): """Raised when building an application's files fails.""" diff --git a/src/deploy_tools/apptainer.py b/src/deploy_tools/apptainer.py index 5581fda7..642b751c 100644 --- a/src/deploy_tools/apptainer.py +++ b/src/deploy_tools/apptainer.py @@ -1,8 +1,10 @@ import subprocess from pathlib import Path +from .errors import DeployToolsError -class ApptainerError(Exception): + +class ApptainerError(DeployToolsError): """Raised when building an Apptainer SIF file fails.""" diff --git a/src/deploy_tools/compare.py b/src/deploy_tools/compare.py index 40ed6732..570f4547 100644 --- a/src/deploy_tools/compare.py +++ b/src/deploy_tools/compare.py @@ -7,6 +7,7 @@ import yaml from pydantic import TypeAdapter +from .errors import DeployToolsError from .layout import Layout from .models.deployment import ( DefaultVersionsByName, @@ -23,7 +24,7 @@ logger = logging.getLogger(__name__) -class ComparisonError(Exception): +class ComparisonError(DeployToolsError): """Raised when comparing the deployment area to its snapshot fails.""" diff --git a/src/deploy_tools/errors.py b/src/deploy_tools/errors.py new file mode 100644 index 00000000..cfa7683e --- /dev/null +++ b/src/deploy_tools/errors.py @@ -0,0 +1,10 @@ +class DeployToolsError(Exception): + """Base class for expected, user-facing deploy-tools errors. + + These represent actionable failure conditions, such as invalid configuration or a + corrupt deployment area, where the exception message is itself the guidance the + operator needs. The CLI catches this base class at the top level and prints the + message without a traceback (see ``deploy_tools.__main__.main``). Any exception that + is *not* a ``DeployToolsError`` is treated as an unexpected bug and surfaces with a + full traceback. + """ diff --git a/src/deploy_tools/models/save_and_load.py b/src/deploy_tools/models/save_and_load.py index f176938c..818cd969 100644 --- a/src/deploy_tools/models/save_and_load.py +++ b/src/deploy_tools/models/save_and_load.py @@ -6,6 +6,7 @@ import yaml from pydantic import BaseModel +from ..errors import DeployToolsError from .deployment import ( Deployment, DeploymentSettings, @@ -17,7 +18,7 @@ DEPLOYMENT_SETTINGS = "settings" + YAML_FILE_SUFFIX -class LoadError(Exception): +class LoadError(DeployToolsError): """Raised when configuration files cannot be loaded into the model.""" diff --git a/src/deploy_tools/snapshot.py b/src/deploy_tools/snapshot.py index 1e4da9bc..ad2c2540 100644 --- a/src/deploy_tools/snapshot.py +++ b/src/deploy_tools/snapshot.py @@ -3,6 +3,7 @@ from git import Repo +from .errors import DeployToolsError from .layout import Layout from .models.deployment import Deployment, DeploymentSettings from .models.save_and_load import load_from_yaml, save_as_yaml @@ -10,7 +11,7 @@ logger = logging.getLogger(__name__) -class SnapshotError(Exception): +class SnapshotError(DeployToolsError): """Raised when a deployment snapshot is missing or in an unexpected state.""" diff --git a/src/deploy_tools/validate.py b/src/deploy_tools/validate.py index fdbdeb08..5c2bec9a 100644 --- a/src/deploy_tools/validate.py +++ b/src/deploy_tools/validate.py @@ -6,6 +6,7 @@ from natsort import natsorted from .build import build +from .errors import DeployToolsError from .layout import Layout from .models.changes import DeploymentChanges, ReleaseChanges from .models.deployment import ( @@ -25,7 +26,7 @@ SCRIPT_INDICATOR_PHRASE = "shell script" -class ValidationError(Exception): +class ValidationError(DeployToolsError): """Raised when the deployment configuration fails validation.""" From f175bffe267a023ea189ef705cf10ee36e2ef194 Mon Sep 17 00:00:00 2001 From: Martin Gaughran Date: Wed, 17 Jun 2026 14:40:34 +0000 Subject: [PATCH 09/19] Stub the external call to apptainer in tests This removes the need to depend on an image pull in CI. --- tests/conftest.py | 19 +++++++++++++++++++ tests/test_golden_master.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 42ba1736..aaa46d1a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -29,3 +29,22 @@ def samples(): @pytest.fixture def configs(): return Path(__file__).parent / "configs" + + +@pytest.fixture +def stub_apptainer_pull(monkeypatch: pytest.MonkeyPatch) -> None: + """Stub the external ``apptainer pull`` so builds need no binary or network. + + Only the external command is replaced; ``create_sif_file``'s own logic (path + validation, parent-directory creation) still runs. The golden-master comparison + ignores ``.sif`` files, so a no-op suffices. Without this, building an Apptainer + module hard-fails on a runner without apptainer or does a real registry pull. + + Args: + monkeypatch: The pytest ``monkeypatch`` fixture. + """ + + def _no_pull(*args: object, **kwargs: object) -> None: + return None + + monkeypatch.setattr("deploy_tools.apptainer.run_command", _no_pull) diff --git a/tests/test_golden_master.py b/tests/test_golden_master.py index 92bb9a7f..a831392a 100644 --- a/tests/test_golden_master.py +++ b/tests/test_golden_master.py @@ -61,7 +61,7 @@ def _assert_validate_matches(expected_dir: Path, *cli_args: str | Path) -> None: assert run_cli("validate", *cli_args) == expected -def test_module_lifecycle(samples: Path, configs: Path): +def test_module_lifecycle(samples: Path, configs: Path, stub_apptainer_pull: None): # make sure the output directory is empty and exists rmtree(TEMP_OUT, ignore_errors=True) TEMP_OUT.mkdir(exist_ok=True) From 62f9051523e8fb8b0a9ba9fe739bdec68d1fa2a9 Mon Sep 17 00:00:00 2001 From: Martin Gaughran Date: Wed, 17 Jun 2026 13:47:50 +0000 Subject: [PATCH 10/19] Wrap external tool calls to improve error messages and error handling --- src/deploy_tools/apptainer.py | 4 +-- src/deploy_tools/external_tools.py | 51 ++++++++++++++++++++++++++++++ src/deploy_tools/validate.py | 12 +++---- 3 files changed, 58 insertions(+), 9 deletions(-) create mode 100644 src/deploy_tools/external_tools.py diff --git a/src/deploy_tools/apptainer.py b/src/deploy_tools/apptainer.py index 642b751c..d183ea4a 100644 --- a/src/deploy_tools/apptainer.py +++ b/src/deploy_tools/apptainer.py @@ -1,7 +1,7 @@ -import subprocess from pathlib import Path from .errors import DeployToolsError +from .external_tools import run_command class ApptainerError(DeployToolsError): @@ -29,4 +29,4 @@ def create_sif_file( ) commands = ["apptainer", "pull", output_path, container_url] - subprocess.run(commands, check=True) + run_command(commands, check=True) diff --git a/src/deploy_tools/external_tools.py b/src/deploy_tools/external_tools.py new file mode 100644 index 00000000..cb72ccfe --- /dev/null +++ b/src/deploy_tools/external_tools.py @@ -0,0 +1,51 @@ +import subprocess +from pathlib import Path +from typing import Any + +from .errors import DeployToolsError + + +class ExternalToolError(DeployToolsError): + """Raised when a required external command-line tool is missing or fails.""" + + +def run_command( + command: list[str | Path], + *, + check: bool = False, + capture_output: bool = False, + text: bool = False, +) -> subprocess.CompletedProcess[Any]: + """Run an external command, surfacing tool problems as clean domain errors. + + Wraps ``subprocess.run`` so that a missing executable (or, when ``check`` is set, a + non-zero exit) is reported as an ``ExternalToolError`` rather than a raw + ``FileNotFoundError``/``CalledProcessError`` traceback. + + Args: + command: The command to run, as a list whose first element is the executable. + check: If True, raise when the command exits with a non-zero status. + capture_output: If True, capture the command's stdout and stderr. + text: If True, decode captured output as text rather than bytes. + + Returns: + The ``subprocess.CompletedProcess`` for the finished command. + + Raises: + ExternalToolError: If the executable cannot be found, or ``check`` is set and + the command exits with a non-zero status. + """ + executable = str(command[0]) + try: + return subprocess.run( + command, check=check, capture_output=capture_output, text=text + ) + except FileNotFoundError as exc: + raise ExternalToolError( + f"Required external tool not found: '{executable}'.\n" + f"Ensure it is installed and available on PATH." + ) from exc + except subprocess.CalledProcessError as exc: + raise ExternalToolError( + f"External tool '{executable}' failed with exit status {exc.returncode}." + ) from exc diff --git a/src/deploy_tools/validate.py b/src/deploy_tools/validate.py index 5c2bec9a..84bdd533 100644 --- a/src/deploy_tools/validate.py +++ b/src/deploy_tools/validate.py @@ -1,5 +1,4 @@ import logging -import subprocess from pathlib import Path from tempfile import TemporaryDirectory @@ -7,6 +6,7 @@ from .build import build from .errors import DeployToolsError +from .external_tools import run_command from .layout import Layout from .models.changes import DeploymentChanges, ReleaseChanges from .models.deployment import ( @@ -243,9 +243,7 @@ def _is_shell_script(file: Path) -> bool: This uses the output of the Linux 'file' command, which is dependent on the shebang line as well as the OS. Both are controlled in our deployment. """ - result = subprocess.run( - ["file", f"{file.absolute()}"], capture_output=True, text=True - ) + result = run_command(["file", str(file.absolute())], capture_output=True, text=True) return SCRIPT_INDICATOR_PHRASE in result.stdout @@ -258,12 +256,12 @@ def _check_bash_syntax(file: Path) -> None: This is also unable to check that all required functions and tools are available, so some typos are likely to pass. """ - result = subprocess.run( - ["bash", "-n", f"{file.absolute()}"], + result = run_command( + ["bash", "-n", str(file.absolute())], capture_output=True, text=True, ) - if result.stderr: + if result.returncode != 0: raise ValidationError( f"Output script {file.absolute()} is invalid with errors:\n{result.stderr}" ) From c3c31761c2442905f6b0af0fcfb958bb1ff15a2d Mon Sep 17 00:00:00 2001 From: Martin Gaughran Date: Mon, 29 Jun 2026 11:04:42 +0000 Subject: [PATCH 11/19] Add ANN to ruff for consistent type hinting --- pyproject.toml | 3 +++ src/deploy_tools/app_builder.py | 2 +- src/deploy_tools/compare.py | 2 +- src/deploy_tools/layout.py | 2 +- tests/conftest.py | 6 +++--- tests/test_cli.py | 2 +- tests/test_golden_master.py | 4 +++- tests/test_schema_gen.py | 2 +- 8 files changed, 14 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6441f42d..56076383 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -174,6 +174,7 @@ commands = [ src = ["src", "tests"] line-length = 88 lint.select = [ + "ANN", # flake8-annotations - https://docs.astral.sh/ruff/rules/#flake8-annotations-ann "B", # flake8-bugbear - https://docs.astral.sh/ruff/rules/#flake8-bugbear-b "C4", # flake8-comprehensions - https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4 "E", # pycodestyle errors - https://docs.astral.sh/ruff/rules/#error-e @@ -190,3 +191,5 @@ lint.select = [ # See https://github.com/DiamondLightSource/python-copier-template/issues/154 # Remove this line to forbid private member access in tests "tests/**/*" = ["SLF001"] +# Managed by the copier template; left unannotated to avoid divergence +".github/pages/make_switcher.py" = ["ANN"] diff --git a/src/deploy_tools/app_builder.py b/src/deploy_tools/app_builder.py index 1cf4f921..913ebc0b 100644 --- a/src/deploy_tools/app_builder.py +++ b/src/deploy_tools/app_builder.py @@ -28,7 +28,7 @@ def __init__(self, templater: Templater, build_layout: ModuleBuildLayout) -> Non self._templater = templater self._build_layout = build_layout - def create_application_files(self, app: Application, module: Module): + def create_application_files(self, app: Application, module: Module) -> None: """Create the entrypoint and supporting files for an application. The files produced depend on the application type (Apptainer, shell or binary). diff --git a/src/deploy_tools/compare.py b/src/deploy_tools/compare.py index 570f4547..61a0ce96 100644 --- a/src/deploy_tools/compare.py +++ b/src/deploy_tools/compare.py @@ -183,7 +183,7 @@ def _compare_default_versions(snapshot: Deployment, actual: Deployment) -> None: ) -def _get_dict_diff(d1: dict[str, Any], d2: dict[str, Any]): +def _get_dict_diff(d1: dict[str, Any], d2: dict[str, Any]) -> str: return "\n" + "\n".join( difflib.ndiff( _yaml_dumps(d1).splitlines(), diff --git a/src/deploy_tools/layout.py b/src/deploy_tools/layout.py index 43f0d41e..3d8b98d7 100644 --- a/src/deploy_tools/layout.py +++ b/src/deploy_tools/layout.py @@ -47,7 +47,7 @@ def get_sif_files_folder(self, name: str, version: str) -> Path: return self.get_module_folder(name, version) / self.SIF_FILES_FOLDER @property - def build_root(self): + def build_root(self) -> Path: """Root path of the build area.""" return self._root diff --git a/tests/conftest.py b/tests/conftest.py index aaa46d1a..63ebc0e7 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -17,17 +17,17 @@ def run_cli(*args: str | Path) -> str: @pytest.fixture -def schemas(): +def schemas() -> Path: return Path(__file__).parent.parent / "src" / "deploy_tools" / "models" / "schemas" @pytest.fixture -def samples(): +def samples() -> Path: return Path(__file__).parent / "samples" @pytest.fixture -def configs(): +def configs() -> Path: return Path(__file__).parent / "configs" diff --git a/tests/test_cli.py b/tests/test_cli.py index 745afdd8..cdbd77b1 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -4,6 +4,6 @@ from deploy_tools import __version__ -def test_cli_version(): +def test_cli_version() -> None: cmd = [sys.executable, "-m", "deploy_tools", "--version"] assert subprocess.check_output(cmd).decode().strip() == __version__ diff --git a/tests/test_golden_master.py b/tests/test_golden_master.py index a831392a..b1ee6f7c 100644 --- a/tests/test_golden_master.py +++ b/tests/test_golden_master.py @@ -61,7 +61,9 @@ def _assert_validate_matches(expected_dir: Path, *cli_args: str | Path) -> None: assert run_cli("validate", *cli_args) == expected -def test_module_lifecycle(samples: Path, configs: Path, stub_apptainer_pull: None): +def test_module_lifecycle( + samples: Path, configs: Path, stub_apptainer_pull: None +) -> None: # make sure the output directory is empty and exists rmtree(TEMP_OUT, ignore_errors=True) TEMP_OUT.mkdir(exist_ok=True) diff --git a/tests/test_schema_gen.py b/tests/test_schema_gen.py index 31ecf3a7..3c1d6c57 100644 --- a/tests/test_schema_gen.py +++ b/tests/test_schema_gen.py @@ -8,7 +8,7 @@ ) -def test_schema_gen(schemas: Path): +def test_schema_gen(schemas: Path) -> None: with tempfile.TemporaryDirectory() as tmp: tmp_path = Path(tmp) From 11a3474a24c6d690393b16e131483fe7858d9804 Mon Sep 17 00:00:00 2001 From: Martin Gaughran Date: Wed, 17 Jun 2026 16:59:43 +0000 Subject: [PATCH 12/19] Use tmp_path for all test builds to make parallel-safe --- tests/test_golden_master.py | 86 +++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 36 deletions(-) diff --git a/tests/test_golden_master.py b/tests/test_golden_master.py index b1ee6f7c..8c97f264 100644 --- a/tests/test_golden_master.py +++ b/tests/test_golden_master.py @@ -1,13 +1,12 @@ from pathlib import Path -from shutil import rmtree from conftest import run_cli -# Fixed deployment path so that generated modulefiles (which embed absolute paths) match -# the committed golden master output. The lifecycle stages below all share this single -# deployment area, as each stage builds on the previous deployment state. +# Generated modulefiles embed the absolute deployment path. generate_samples.sh builds +# the committed golden master against this fixed root; the test deploys under a per-test +# tmp_path (parallel-safe, self-cleaning) and normalises this prefix away when diffing. DEPLOYMENT_DIRNAME = "deploy-tools-output" -TEMP_OUT = Path("/tmp") / DEPLOYMENT_DIRNAME +SAMPLE_DEPLOY_ROOT = Path("/tmp") / DEPLOYMENT_DIRNAME def _assert_expected_files_match(expected_root: Path, actual_root: Path) -> None: @@ -17,22 +16,40 @@ def _assert_expected_files_match(expected_root: Path, actual_root: Path) -> None from the golden master (e.g. ``.sif`` images, the ``.git`` directory) are ignored. Use ``_assert_absent`` to verify that files have actually been removed. + The committed master embeds ``SAMPLE_DEPLOY_ROOT`` as the deployment path, in both + file contents and absolute modulefile-link targets; that prefix is normalised to + ``actual_root`` before comparing, so the deployment can happen anywhere. + Args: expected_root: Root of the committed golden master tree. actual_root: Root of the deployment area to check against it. """ for expected in expected_root.glob("**/*"): + actual = actual_root / expected.relative_to(expected_root) + + # Modulefiles are symlinks whose absolute target embeds the deployment root; + # compare the normalised target, don't follow the (dangling) committed link. + if expected.is_symlink(): + assert actual.is_symlink(), f"{actual} is not a symlink." + expected_target = str(expected.readlink()).replace( + str(SAMPLE_DEPLOY_ROOT), str(actual_root) + ) + assert expected_target == str(actual.readlink()), ( + f"Symlink {actual} points to the wrong target." + ) + continue + if expected.is_dir(): continue # check that the file exists in the output directory - actual = actual_root / expected.relative_to(expected_root) assert actual.exists(), f"File {actual} does not exist." - # check that the file contents are the same - assert expected.read_text() == actual.read_text(), ( - f"File {actual} is different." + # compare contents, normalising the embedded deployment-root prefix + expected_text = expected.read_text().replace( + str(SAMPLE_DEPLOY_ROOT), str(actual_root) ) + assert expected_text == actual.read_text(), f"File {actual} is different." def _assert_absent(root: Path, *relative_paths: str) -> None: @@ -62,65 +79,62 @@ def _assert_validate_matches(expected_dir: Path, *cli_args: str | Path) -> None: def test_module_lifecycle( - samples: Path, configs: Path, stub_apptainer_pull: None + samples: Path, configs: Path, stub_apptainer_pull: None, tmp_path: Path ) -> None: - # make sure the output directory is empty and exists - rmtree(TEMP_OUT, ignore_errors=True) - TEMP_OUT.mkdir(exist_ok=True) + # tmp_path is a fresh, empty, per-test directory; the stages below share it as one + # deployment area, each building on the previous state, with no cross-run leakage. # Stage 1: deploy the initial configuration into an empty area. _assert_validate_matches( - samples / "01-initial", "--from-scratch", TEMP_OUT, configs / "01-initial" + samples / "01-initial", "--from-scratch", tmp_path, configs / "01-initial" ) - run_cli("sync", "--from-scratch", TEMP_OUT, configs / "01-initial") - _assert_expected_files_match(samples / "01-initial" / DEPLOYMENT_DIRNAME, TEMP_OUT) + run_cli("sync", "--from-scratch", tmp_path, configs / "01-initial") + _assert_expected_files_match(samples / "01-initial" / DEPLOYMENT_DIRNAME, tmp_path) # Stage 2: deploy a brand-new module on an incremental (non from-scratch) sync. Its # files and modulefile link should appear, while the modules already deployed are # left untouched (this stage's golden master still contains them unchanged). - _assert_validate_matches(samples / "02-added", TEMP_OUT, configs / "02-added") - run_cli("sync", TEMP_OUT, configs / "02-added") - _assert_expected_files_match(samples / "02-added" / DEPLOYMENT_DIRNAME, TEMP_OUT) + _assert_validate_matches(samples / "02-added", tmp_path, configs / "02-added") + run_cli("sync", tmp_path, configs / "02-added") + _assert_expected_files_match(samples / "02-added" / DEPLOYMENT_DIRNAME, tmp_path) # Stage 3: update example-module-extra/1.0 in place. Its config changed and it was # deployed with allow_updates, so the module is rebuilt and replaced; the golden # master captures the new modulefile contents. - _assert_validate_matches(samples / "03-updated", TEMP_OUT, configs / "03-updated") - run_cli("sync", TEMP_OUT, configs / "03-updated") - _assert_expected_files_match(samples / "03-updated" / DEPLOYMENT_DIRNAME, TEMP_OUT) + _assert_validate_matches(samples / "03-updated", tmp_path, configs / "03-updated") + run_cli("sync", tmp_path, configs / "03-updated") + _assert_expected_files_match(samples / "03-updated" / DEPLOYMENT_DIRNAME, tmp_path) # Stage 4: deprecate example-module-deps/0.2 (en route to removal) and # example-module-extra/1.0 (to set up the restore that follows). Both modulefile # links move out of the live area into the deprecated area; built modules stay put. _assert_validate_matches( - samples / "04-deprecated", TEMP_OUT, configs / "04-deprecated" + samples / "04-deprecated", tmp_path, configs / "04-deprecated" ) - run_cli("sync", TEMP_OUT, configs / "04-deprecated") + run_cli("sync", tmp_path, configs / "04-deprecated") _assert_expected_files_match( - samples / "04-deprecated" / DEPLOYMENT_DIRNAME, TEMP_OUT + samples / "04-deprecated" / DEPLOYMENT_DIRNAME, tmp_path ) _assert_absent( - TEMP_OUT, + tmp_path, "modulefiles/example-module-deps", "modulefiles/example-module-extra", ) # Stage 5: restore example-module-extra/1.0 by un-deprecating it. Its modulefile # link moves back into the live area; example-module-deps/0.2 stays deprecated. - _assert_validate_matches(samples / "05-restored", TEMP_OUT, configs / "05-restored") - run_cli("sync", TEMP_OUT, configs / "05-restored") - _assert_expected_files_match(samples / "05-restored" / DEPLOYMENT_DIRNAME, TEMP_OUT) - _assert_absent(TEMP_OUT, "deprecated/modulefiles/example-module-extra") + _assert_validate_matches(samples / "05-restored", tmp_path, configs / "05-restored") + run_cli("sync", tmp_path, configs / "05-restored") + _assert_expected_files_match(samples / "05-restored" / DEPLOYMENT_DIRNAME, tmp_path) + _assert_absent(tmp_path, "deprecated/modulefiles/example-module-extra") # Stage 6: remove the now-deprecated example-module-deps/0.2 entirely. Both its # modulefile link and built module should be gone; example-module-extra remains. - _assert_validate_matches(samples / "06-removed", TEMP_OUT, configs / "06-removed") - run_cli("sync", TEMP_OUT, configs / "06-removed") - _assert_expected_files_match(samples / "06-removed" / DEPLOYMENT_DIRNAME, TEMP_OUT) + _assert_validate_matches(samples / "06-removed", tmp_path, configs / "06-removed") + run_cli("sync", tmp_path, configs / "06-removed") + _assert_expected_files_match(samples / "06-removed" / DEPLOYMENT_DIRNAME, tmp_path) _assert_absent( - TEMP_OUT, + tmp_path, "modules/example-module-deps", "deprecated/modulefiles/example-module-deps", ) - - rmtree(TEMP_OUT, ignore_errors=True) From 9bd07d48d1e8df17f529759f578806e0ca66957d Mon Sep 17 00:00:00 2001 From: Martin Gaughran Date: Fri, 19 Jun 2026 16:59:31 +0000 Subject: [PATCH 13/19] Reorganise golden master test configuration for consistency --- .../01-initial/example-module-apps/0.1.yaml | 0 .../01-initial/example-module-deps/0.2.yaml | 0 .../01-initial/settings.yaml | 0 .../02-added/example-module-apps/0.1.yaml | 0 .../02-added/example-module-deps/0.2.yaml | 0 .../02-added/example-module-extra/1.0.yaml | 0 .../02-added/settings.yaml | 0 .../03-updated/example-module-apps/0.1.yaml | 0 .../03-updated/example-module-deps/0.2.yaml | 0 .../03-updated/example-module-extra/1.0.yaml | 0 .../03-updated/settings.yaml | 0 .../example-module-apps/0.1.yaml | 0 .../example-module-deps/0.2.yaml | 0 .../example-module-extra/1.0.yaml | 0 .../04-deprecated/settings.yaml | 0 .../05-restored/example-module-apps/0.1.yaml | 0 .../05-restored/example-module-deps/0.2.yaml | 0 .../05-restored/example-module-extra/1.0.yaml | 0 .../05-restored/settings.yaml | 0 .../06-removed/example-module-apps/0.1.yaml | 0 .../06-removed/example-module-extra/1.0.yaml | 0 .../06-removed/settings.yaml | 0 tests/generate_samples.sh | 15 ++++---- tests/test_golden_master.py | 37 +++++++++++++------ 24 files changed, 33 insertions(+), 19 deletions(-) rename tests/configs/{ => golden-master}/01-initial/example-module-apps/0.1.yaml (100%) rename tests/configs/{ => golden-master}/01-initial/example-module-deps/0.2.yaml (100%) rename tests/configs/{ => golden-master}/01-initial/settings.yaml (100%) rename tests/configs/{ => golden-master}/02-added/example-module-apps/0.1.yaml (100%) rename tests/configs/{ => golden-master}/02-added/example-module-deps/0.2.yaml (100%) rename tests/configs/{ => golden-master}/02-added/example-module-extra/1.0.yaml (100%) rename tests/configs/{ => golden-master}/02-added/settings.yaml (100%) rename tests/configs/{ => golden-master}/03-updated/example-module-apps/0.1.yaml (100%) rename tests/configs/{ => golden-master}/03-updated/example-module-deps/0.2.yaml (100%) rename tests/configs/{ => golden-master}/03-updated/example-module-extra/1.0.yaml (100%) rename tests/configs/{ => golden-master}/03-updated/settings.yaml (100%) rename tests/configs/{ => golden-master}/04-deprecated/example-module-apps/0.1.yaml (100%) rename tests/configs/{ => golden-master}/04-deprecated/example-module-deps/0.2.yaml (100%) rename tests/configs/{ => golden-master}/04-deprecated/example-module-extra/1.0.yaml (100%) rename tests/configs/{ => golden-master}/04-deprecated/settings.yaml (100%) rename tests/configs/{ => golden-master}/05-restored/example-module-apps/0.1.yaml (100%) rename tests/configs/{ => golden-master}/05-restored/example-module-deps/0.2.yaml (100%) rename tests/configs/{ => golden-master}/05-restored/example-module-extra/1.0.yaml (100%) rename tests/configs/{ => golden-master}/05-restored/settings.yaml (100%) rename tests/configs/{ => golden-master}/06-removed/example-module-apps/0.1.yaml (100%) rename tests/configs/{ => golden-master}/06-removed/example-module-extra/1.0.yaml (100%) rename tests/configs/{ => golden-master}/06-removed/settings.yaml (100%) diff --git a/tests/configs/01-initial/example-module-apps/0.1.yaml b/tests/configs/golden-master/01-initial/example-module-apps/0.1.yaml similarity index 100% rename from tests/configs/01-initial/example-module-apps/0.1.yaml rename to tests/configs/golden-master/01-initial/example-module-apps/0.1.yaml diff --git a/tests/configs/01-initial/example-module-deps/0.2.yaml b/tests/configs/golden-master/01-initial/example-module-deps/0.2.yaml similarity index 100% rename from tests/configs/01-initial/example-module-deps/0.2.yaml rename to tests/configs/golden-master/01-initial/example-module-deps/0.2.yaml diff --git a/tests/configs/01-initial/settings.yaml b/tests/configs/golden-master/01-initial/settings.yaml similarity index 100% rename from tests/configs/01-initial/settings.yaml rename to tests/configs/golden-master/01-initial/settings.yaml diff --git a/tests/configs/02-added/example-module-apps/0.1.yaml b/tests/configs/golden-master/02-added/example-module-apps/0.1.yaml similarity index 100% rename from tests/configs/02-added/example-module-apps/0.1.yaml rename to tests/configs/golden-master/02-added/example-module-apps/0.1.yaml diff --git a/tests/configs/02-added/example-module-deps/0.2.yaml b/tests/configs/golden-master/02-added/example-module-deps/0.2.yaml similarity index 100% rename from tests/configs/02-added/example-module-deps/0.2.yaml rename to tests/configs/golden-master/02-added/example-module-deps/0.2.yaml diff --git a/tests/configs/02-added/example-module-extra/1.0.yaml b/tests/configs/golden-master/02-added/example-module-extra/1.0.yaml similarity index 100% rename from tests/configs/02-added/example-module-extra/1.0.yaml rename to tests/configs/golden-master/02-added/example-module-extra/1.0.yaml diff --git a/tests/configs/02-added/settings.yaml b/tests/configs/golden-master/02-added/settings.yaml similarity index 100% rename from tests/configs/02-added/settings.yaml rename to tests/configs/golden-master/02-added/settings.yaml diff --git a/tests/configs/03-updated/example-module-apps/0.1.yaml b/tests/configs/golden-master/03-updated/example-module-apps/0.1.yaml similarity index 100% rename from tests/configs/03-updated/example-module-apps/0.1.yaml rename to tests/configs/golden-master/03-updated/example-module-apps/0.1.yaml diff --git a/tests/configs/03-updated/example-module-deps/0.2.yaml b/tests/configs/golden-master/03-updated/example-module-deps/0.2.yaml similarity index 100% rename from tests/configs/03-updated/example-module-deps/0.2.yaml rename to tests/configs/golden-master/03-updated/example-module-deps/0.2.yaml diff --git a/tests/configs/03-updated/example-module-extra/1.0.yaml b/tests/configs/golden-master/03-updated/example-module-extra/1.0.yaml similarity index 100% rename from tests/configs/03-updated/example-module-extra/1.0.yaml rename to tests/configs/golden-master/03-updated/example-module-extra/1.0.yaml diff --git a/tests/configs/03-updated/settings.yaml b/tests/configs/golden-master/03-updated/settings.yaml similarity index 100% rename from tests/configs/03-updated/settings.yaml rename to tests/configs/golden-master/03-updated/settings.yaml diff --git a/tests/configs/04-deprecated/example-module-apps/0.1.yaml b/tests/configs/golden-master/04-deprecated/example-module-apps/0.1.yaml similarity index 100% rename from tests/configs/04-deprecated/example-module-apps/0.1.yaml rename to tests/configs/golden-master/04-deprecated/example-module-apps/0.1.yaml diff --git a/tests/configs/04-deprecated/example-module-deps/0.2.yaml b/tests/configs/golden-master/04-deprecated/example-module-deps/0.2.yaml similarity index 100% rename from tests/configs/04-deprecated/example-module-deps/0.2.yaml rename to tests/configs/golden-master/04-deprecated/example-module-deps/0.2.yaml diff --git a/tests/configs/04-deprecated/example-module-extra/1.0.yaml b/tests/configs/golden-master/04-deprecated/example-module-extra/1.0.yaml similarity index 100% rename from tests/configs/04-deprecated/example-module-extra/1.0.yaml rename to tests/configs/golden-master/04-deprecated/example-module-extra/1.0.yaml diff --git a/tests/configs/04-deprecated/settings.yaml b/tests/configs/golden-master/04-deprecated/settings.yaml similarity index 100% rename from tests/configs/04-deprecated/settings.yaml rename to tests/configs/golden-master/04-deprecated/settings.yaml diff --git a/tests/configs/05-restored/example-module-apps/0.1.yaml b/tests/configs/golden-master/05-restored/example-module-apps/0.1.yaml similarity index 100% rename from tests/configs/05-restored/example-module-apps/0.1.yaml rename to tests/configs/golden-master/05-restored/example-module-apps/0.1.yaml diff --git a/tests/configs/05-restored/example-module-deps/0.2.yaml b/tests/configs/golden-master/05-restored/example-module-deps/0.2.yaml similarity index 100% rename from tests/configs/05-restored/example-module-deps/0.2.yaml rename to tests/configs/golden-master/05-restored/example-module-deps/0.2.yaml diff --git a/tests/configs/05-restored/example-module-extra/1.0.yaml b/tests/configs/golden-master/05-restored/example-module-extra/1.0.yaml similarity index 100% rename from tests/configs/05-restored/example-module-extra/1.0.yaml rename to tests/configs/golden-master/05-restored/example-module-extra/1.0.yaml diff --git a/tests/configs/05-restored/settings.yaml b/tests/configs/golden-master/05-restored/settings.yaml similarity index 100% rename from tests/configs/05-restored/settings.yaml rename to tests/configs/golden-master/05-restored/settings.yaml diff --git a/tests/configs/06-removed/example-module-apps/0.1.yaml b/tests/configs/golden-master/06-removed/example-module-apps/0.1.yaml similarity index 100% rename from tests/configs/06-removed/example-module-apps/0.1.yaml rename to tests/configs/golden-master/06-removed/example-module-apps/0.1.yaml diff --git a/tests/configs/06-removed/example-module-extra/1.0.yaml b/tests/configs/golden-master/06-removed/example-module-extra/1.0.yaml similarity index 100% rename from tests/configs/06-removed/example-module-extra/1.0.yaml rename to tests/configs/golden-master/06-removed/example-module-extra/1.0.yaml diff --git a/tests/configs/06-removed/settings.yaml b/tests/configs/golden-master/06-removed/settings.yaml similarity index 100% rename from tests/configs/06-removed/settings.yaml rename to tests/configs/golden-master/06-removed/settings.yaml diff --git a/tests/generate_samples.sh b/tests/generate_samples.sh index e908b5c2..0837c051 100755 --- a/tests/generate_samples.sh +++ b/tests/generate_samples.sh @@ -5,6 +5,7 @@ set -xe THIS_DIR=$(realpath $(dirname ${0})) SAMPLES_DIR=${THIS_DIR}/samples CONFIGS_DIR=${THIS_DIR}/configs +GM_CONFIGS_DIR=${CONFIGS_DIR}/golden-master TMP_DIR=/tmp/deploy-tools-output rm -rf "${SAMPLES_DIR}" @@ -37,7 +38,7 @@ capture_validate () { local stage=${1} shift mkdir -p "${SAMPLES_DIR}/${stage}" - deploy-tools validate "$@" "${TMP_DIR}" "${CONFIGS_DIR}/${stage}" \ + deploy-tools validate "$@" "${TMP_DIR}" "${GM_CONFIGS_DIR}/${stage}" \ > "${SAMPLES_DIR}/${stage}/validate.txt" } @@ -47,30 +48,30 @@ capture_validate () { # Stage 1: deploy the initial configuration into an empty area. capture_validate 01-initial --from-scratch -deploy-tools sync --from-scratch "${TMP_DIR}" "${CONFIGS_DIR}/01-initial" +deploy-tools sync --from-scratch "${TMP_DIR}" "${GM_CONFIGS_DIR}/01-initial" save_sample 01-initial # Stage 2: add a new module (example-module-extra/1.0) on an incremental sync. capture_validate 02-added -deploy-tools sync "${TMP_DIR}" "${CONFIGS_DIR}/02-added" +deploy-tools sync "${TMP_DIR}" "${GM_CONFIGS_DIR}/02-added" save_sample 02-added # Stage 3: update example-module-extra/1.0 in place (allowed via allow_updates). capture_validate 03-updated -deploy-tools sync "${TMP_DIR}" "${CONFIGS_DIR}/03-updated" +deploy-tools sync "${TMP_DIR}" "${GM_CONFIGS_DIR}/03-updated" save_sample 03-updated # Stage 4: deprecate example-module-deps/0.2 and example-module-extra/1.0. capture_validate 04-deprecated -deploy-tools sync "${TMP_DIR}" "${CONFIGS_DIR}/04-deprecated" +deploy-tools sync "${TMP_DIR}" "${GM_CONFIGS_DIR}/04-deprecated" save_sample 04-deprecated # Stage 5: restore (un-deprecate) example-module-extra/1.0. capture_validate 05-restored -deploy-tools sync "${TMP_DIR}" "${CONFIGS_DIR}/05-restored" +deploy-tools sync "${TMP_DIR}" "${GM_CONFIGS_DIR}/05-restored" save_sample 05-restored # Stage 6: remove the now-deprecated example-module-deps/0.2 entirely. capture_validate 06-removed -deploy-tools sync "${TMP_DIR}" "${CONFIGS_DIR}/06-removed" +deploy-tools sync "${TMP_DIR}" "${GM_CONFIGS_DIR}/06-removed" save_sample 06-removed diff --git a/tests/test_golden_master.py b/tests/test_golden_master.py index 8c97f264..4d5e7989 100644 --- a/tests/test_golden_master.py +++ b/tests/test_golden_master.py @@ -86,32 +86,41 @@ def test_module_lifecycle( # Stage 1: deploy the initial configuration into an empty area. _assert_validate_matches( - samples / "01-initial", "--from-scratch", tmp_path, configs / "01-initial" + samples / "01-initial", + "--from-scratch", + tmp_path, + configs / "golden-master" / "01-initial", + ) + run_cli( + "sync", "--from-scratch", tmp_path, configs / "golden-master" / "01-initial" ) - run_cli("sync", "--from-scratch", tmp_path, configs / "01-initial") _assert_expected_files_match(samples / "01-initial" / DEPLOYMENT_DIRNAME, tmp_path) # Stage 2: deploy a brand-new module on an incremental (non from-scratch) sync. Its # files and modulefile link should appear, while the modules already deployed are # left untouched (this stage's golden master still contains them unchanged). - _assert_validate_matches(samples / "02-added", tmp_path, configs / "02-added") - run_cli("sync", tmp_path, configs / "02-added") + _assert_validate_matches( + samples / "02-added", tmp_path, configs / "golden-master" / "02-added" + ) + run_cli("sync", tmp_path, configs / "golden-master" / "02-added") _assert_expected_files_match(samples / "02-added" / DEPLOYMENT_DIRNAME, tmp_path) # Stage 3: update example-module-extra/1.0 in place. Its config changed and it was # deployed with allow_updates, so the module is rebuilt and replaced; the golden # master captures the new modulefile contents. - _assert_validate_matches(samples / "03-updated", tmp_path, configs / "03-updated") - run_cli("sync", tmp_path, configs / "03-updated") + _assert_validate_matches( + samples / "03-updated", tmp_path, configs / "golden-master" / "03-updated" + ) + run_cli("sync", tmp_path, configs / "golden-master" / "03-updated") _assert_expected_files_match(samples / "03-updated" / DEPLOYMENT_DIRNAME, tmp_path) # Stage 4: deprecate example-module-deps/0.2 (en route to removal) and # example-module-extra/1.0 (to set up the restore that follows). Both modulefile # links move out of the live area into the deprecated area; built modules stay put. _assert_validate_matches( - samples / "04-deprecated", tmp_path, configs / "04-deprecated" + samples / "04-deprecated", tmp_path, configs / "golden-master" / "04-deprecated" ) - run_cli("sync", tmp_path, configs / "04-deprecated") + run_cli("sync", tmp_path, configs / "golden-master" / "04-deprecated") _assert_expected_files_match( samples / "04-deprecated" / DEPLOYMENT_DIRNAME, tmp_path ) @@ -123,15 +132,19 @@ def test_module_lifecycle( # Stage 5: restore example-module-extra/1.0 by un-deprecating it. Its modulefile # link moves back into the live area; example-module-deps/0.2 stays deprecated. - _assert_validate_matches(samples / "05-restored", tmp_path, configs / "05-restored") - run_cli("sync", tmp_path, configs / "05-restored") + _assert_validate_matches( + samples / "05-restored", tmp_path, configs / "golden-master" / "05-restored" + ) + run_cli("sync", tmp_path, configs / "golden-master" / "05-restored") _assert_expected_files_match(samples / "05-restored" / DEPLOYMENT_DIRNAME, tmp_path) _assert_absent(tmp_path, "deprecated/modulefiles/example-module-extra") # Stage 6: remove the now-deprecated example-module-deps/0.2 entirely. Both its # modulefile link and built module should be gone; example-module-extra remains. - _assert_validate_matches(samples / "06-removed", tmp_path, configs / "06-removed") - run_cli("sync", tmp_path, configs / "06-removed") + _assert_validate_matches( + samples / "06-removed", tmp_path, configs / "golden-master" / "06-removed" + ) + run_cli("sync", tmp_path, configs / "golden-master" / "06-removed") _assert_expected_files_match(samples / "06-removed" / DEPLOYMENT_DIRNAME, tmp_path) _assert_absent( tmp_path, From 61614a16aa2afd749251c79b5b64e4664d634aca Mon Sep 17 00:00:00 2001 From: Martin Gaughran Date: Fri, 19 Jun 2026 17:01:57 +0000 Subject: [PATCH 14/19] Extract common helper for golden master test stages --- tests/test_golden_master.py | 107 +++++++++++++++++++----------------- 1 file changed, 57 insertions(+), 50 deletions(-) diff --git a/tests/test_golden_master.py b/tests/test_golden_master.py index 4d5e7989..d64e9e5a 100644 --- a/tests/test_golden_master.py +++ b/tests/test_golden_master.py @@ -78,6 +78,33 @@ def _assert_validate_matches(expected_dir: Path, *cli_args: str | Path) -> None: assert run_cli("validate", *cli_args) == expected +def _run_stage( + samples: Path, + configs: Path, + area: Path, + stage: str, + *, + from_scratch: bool = False, + absent: tuple[str, ...] = (), +) -> None: + """Preview, sync, and verify one lifecycle stage against its golden master. + + Args: + samples: The committed golden-master samples directory. + configs: The ``configs`` fixture (root of the test configurations). + area: The shared deployment area, built up across stages. + stage: The lifecycle stage name, e.g. ``04-deprecated``. + from_scratch: Whether this stage deploys into an empty area. + absent: Paths, relative to ``area``, that must not exist after the sync. + """ + flags = ["--from-scratch"] if from_scratch else [] + stage_config = configs / "golden-master" / stage + _assert_validate_matches(samples / stage, *flags, area, stage_config) + run_cli("sync", *flags, area, stage_config) + _assert_expected_files_match(samples / stage / DEPLOYMENT_DIRNAME, area) + _assert_absent(area, *absent) + + def test_module_lifecycle( samples: Path, configs: Path, stub_apptainer_pull: None, tmp_path: Path ) -> None: @@ -85,69 +112,49 @@ def test_module_lifecycle( # deployment area, each building on the previous state, with no cross-run leakage. # Stage 1: deploy the initial configuration into an empty area. - _assert_validate_matches( - samples / "01-initial", - "--from-scratch", - tmp_path, - configs / "golden-master" / "01-initial", - ) - run_cli( - "sync", "--from-scratch", tmp_path, configs / "golden-master" / "01-initial" - ) - _assert_expected_files_match(samples / "01-initial" / DEPLOYMENT_DIRNAME, tmp_path) + _run_stage(samples, configs, tmp_path, "01-initial", from_scratch=True) - # Stage 2: deploy a brand-new module on an incremental (non from-scratch) sync. Its - # files and modulefile link should appear, while the modules already deployed are - # left untouched (this stage's golden master still contains them unchanged). - _assert_validate_matches( - samples / "02-added", tmp_path, configs / "golden-master" / "02-added" - ) - run_cli("sync", tmp_path, configs / "golden-master" / "02-added") - _assert_expected_files_match(samples / "02-added" / DEPLOYMENT_DIRNAME, tmp_path) - - # Stage 3: update example-module-extra/1.0 in place. Its config changed and it was - # deployed with allow_updates, so the module is rebuilt and replaced; the golden - # master captures the new modulefile contents. - _assert_validate_matches( - samples / "03-updated", tmp_path, configs / "golden-master" / "03-updated" - ) - run_cli("sync", tmp_path, configs / "golden-master" / "03-updated") - _assert_expected_files_match(samples / "03-updated" / DEPLOYMENT_DIRNAME, tmp_path) + # Stage 2: deploy a brand-new module on an incremental (non from-scratch) sync; the + # modules already deployed are left untouched. + _run_stage(samples, configs, tmp_path, "02-added") + + # Stage 3: update example-module-extra/1.0 in place (allowed via allow_updates), so + # the module is rebuilt and its modulefile contents change. + _run_stage(samples, configs, tmp_path, "03-updated") # Stage 4: deprecate example-module-deps/0.2 (en route to removal) and # example-module-extra/1.0 (to set up the restore that follows). Both modulefile # links move out of the live area into the deprecated area; built modules stay put. - _assert_validate_matches( - samples / "04-deprecated", tmp_path, configs / "golden-master" / "04-deprecated" - ) - run_cli("sync", tmp_path, configs / "golden-master" / "04-deprecated") - _assert_expected_files_match( - samples / "04-deprecated" / DEPLOYMENT_DIRNAME, tmp_path - ) - _assert_absent( + _run_stage( + samples, + configs, tmp_path, - "modulefiles/example-module-deps", - "modulefiles/example-module-extra", + "04-deprecated", + absent=( + "modulefiles/example-module-deps", + "modulefiles/example-module-extra", + ), ) # Stage 5: restore example-module-extra/1.0 by un-deprecating it. Its modulefile # link moves back into the live area; example-module-deps/0.2 stays deprecated. - _assert_validate_matches( - samples / "05-restored", tmp_path, configs / "golden-master" / "05-restored" + _run_stage( + samples, + configs, + tmp_path, + "05-restored", + absent=("deprecated/modulefiles/example-module-extra",), ) - run_cli("sync", tmp_path, configs / "golden-master" / "05-restored") - _assert_expected_files_match(samples / "05-restored" / DEPLOYMENT_DIRNAME, tmp_path) - _assert_absent(tmp_path, "deprecated/modulefiles/example-module-extra") # Stage 6: remove the now-deprecated example-module-deps/0.2 entirely. Both its # modulefile link and built module should be gone; example-module-extra remains. - _assert_validate_matches( - samples / "06-removed", tmp_path, configs / "golden-master" / "06-removed" - ) - run_cli("sync", tmp_path, configs / "golden-master" / "06-removed") - _assert_expected_files_match(samples / "06-removed" / DEPLOYMENT_DIRNAME, tmp_path) - _assert_absent( + _run_stage( + samples, + configs, tmp_path, - "modules/example-module-deps", - "deprecated/modulefiles/example-module-deps", + "06-removed", + absent=( + "modules/example-module-deps", + "deprecated/modulefiles/example-module-deps", + ), ) From 9ab34d0a5bb3d09334ba6696a14f046b4969aa81 Mon Sep 17 00:00:00 2001 From: Martin Gaughran Date: Mon, 22 Jun 2026 10:20:30 +0000 Subject: [PATCH 15/19] Refactor golden master tests for improved structure and naming --- .../{example-module-apps => apps}/0.1.yaml | 4 +- .../golden-master/01-initial/deps/0.2.yaml | 14 ++++ .../01-initial/example-module-deps/0.2.yaml | 12 ---- .../01-initial/versions/1.0.yaml | 8 +++ .../apps}/0.1.yaml | 4 +- .../golden-master/02-added/deps/0.2.yaml | 14 ++++ .../02-added/example-module-deps/0.2.yaml | 12 ---- .../02-added/example-module-extra/1.0.yaml | 21 ------ .../golden-master/02-added/updatable/1.0.yaml | 21 ++++++ .../golden-master/02-added/versions/1.0.yaml | 8 +++ .../golden-master/02-added/versions/2.0.yaml | 8 +++ .../apps}/0.1.yaml | 4 +- .../golden-master/03-updated/deps/0.2.yaml | 14 ++++ .../03-updated/example-module-deps/0.2.yaml | 12 ---- .../1.0.yaml | 13 ++-- .../03-updated/versions/1.0.yaml | 8 +++ .../03-updated/versions/2.0.yaml | 8 +++ .../03-updated/versions/2.1rc1.yaml | 12 ++++ .../apps}/0.1.yaml | 4 +- .../golden-master/04-deprecated/deps/0.2.yaml | 14 ++++ .../example-module-deps/0.2.yaml | 16 ----- .../example-module-extra/1.0.yaml | 24 ------- .../04-deprecated/updatable/1.0.yaml | 20 ++++++ .../04-deprecated/versions/1.0.yaml | 10 +++ .../04-deprecated/versions/2.0.yaml | 8 +++ .../04-deprecated/versions/2.1rc1.yaml | 14 ++++ .../golden-master/05-restored/apps/0.1.yaml | 37 ++++++++++ .../golden-master/05-restored/deps/0.2.yaml | 14 ++++ .../05-restored/example-module-apps/0.1.yaml | 37 ---------- .../05-restored/example-module-deps/0.2.yaml | 16 ----- .../05-restored/example-module-extra/1.0.yaml | 19 ----- .../05-restored/updatable/1.0.yaml | 20 ++++++ .../05-restored/versions/1.0.yaml | 10 +++ .../05-restored/versions/2.0.yaml | 8 +++ .../05-restored/versions/2.1rc1.yaml | 12 ++++ .../golden-master/06-removed/apps/0.1.yaml | 37 ++++++++++ .../golden-master/06-removed/deps/0.2.yaml | 14 ++++ .../06-removed/example-module-apps/0.1.yaml | 37 ---------- .../06-removed/example-module-extra/1.0.yaml | 19 ----- .../06-removed/updatable/1.0.yaml | 20 ++++++ .../06-removed/versions/2.0.yaml | 8 +++ .../06-removed/versions/2.1rc1.yaml | 12 ++++ tests/generate_samples.sh | 14 ++-- .../deploy-tools-output/deployment.yaml | 30 ++++++-- .../{example-module-apps => apps}/.version | 0 .../deploy-tools-output/modulefiles/apps/0.1 | 1 + .../{example-module-deps => deps}/.version | 0 .../deploy-tools-output/modulefiles/deps/0.2 | 1 + .../modulefiles/example-module-apps/0.1 | 1 - .../modulefiles/example-module-deps/0.2 | 1 - .../modulefiles/versions}/.version | 0 .../modulefiles/versions/1.0 | 1 + .../0.1/entrypoints/cowsay-hello | 0 .../0.1/entrypoints/test-echo-module-var | 0 .../0.1/entrypoints/test-shell-script | 0 .../0.1/module.yaml | 4 +- .../modules/apps/0.1/modulefile | 15 ++++ .../modules/deps}/0.2/module.yaml | 8 ++- .../modules/deps/0.2/modulefile | 16 +++++ .../example-module-apps/0.1/modulefile | 15 ---- .../example-module-deps/0.2/modulefile | 15 ---- .../modules/versions/1.0/module.yaml | 10 +++ .../modules/versions/1.0/modulefile | 13 ++++ tests/samples/01-initial/validate.txt | 10 +-- .../deploy-tools-output/deployment.yaml | 55 ++++++++++---- .../{example-module-apps => apps}/.version | 0 .../deploy-tools-output/modulefiles/apps/0.1 | 1 + .../{example-module-deps => deps}/.version | 0 .../deploy-tools-output/modulefiles/deps/0.2 | 1 + .../modulefiles/example-module-apps/0.1 | 1 - .../modulefiles/example-module-deps/0.2 | 1 - .../modulefiles/example-module-extra/1.0 | 1 - .../modulefiles/updatable}/.version | 0 .../modulefiles/updatable/1.0 | 1 + .../modulefiles/versions/.version | 2 + .../modulefiles/versions/1.0 | 1 + .../modulefiles/versions/2.0 | 1 + .../0.1/entrypoints/cowsay-hello | 0 .../0.1/entrypoints/test-echo-module-var | 0 .../0.1/entrypoints/test-shell-script | 0 .../modules/apps}/0.1/module.yaml | 4 +- .../modules/apps/0.1/modulefile | 15 ++++ .../modules/deps}/0.2/module.yaml | 8 ++- .../modules/deps/0.2/modulefile | 16 +++++ .../example-module-apps/0.1/modulefile | 15 ---- .../example-module-deps/0.2/modulefile | 15 ---- .../example-module-extra/1.0/modulefile | 15 ---- .../1.0/entrypoints/test-updatable-echo} | 2 +- .../1.0/module.yaml | 10 +-- .../modules/updatable/1.0/modulefile | 15 ++++ .../modules/versions/1.0/module.yaml | 10 +++ .../modules/versions/1.0/modulefile | 13 ++++ .../modules/versions/2.0/module.yaml | 10 +++ .../modules/versions/2.0/modulefile | 13 ++++ tests/samples/02-added/validate.txt | 6 +- .../deploy-tools-output/deployment.yaml | 68 ++++++++++++++---- .../{example-module-apps => apps}/.version | 0 .../deploy-tools-output/modulefiles/apps/0.1 | 1 + .../{example-module-deps => deps}/.version | 0 .../deploy-tools-output/modulefiles/deps/0.2 | 1 + .../modulefiles/example-module-apps/0.1 | 1 - .../modulefiles/example-module-deps/0.2 | 1 - .../modulefiles/example-module-extra/1.0 | 1 - .../modulefiles/updatable}/.version | 0 .../modulefiles/updatable/1.0 | 1 + .../modulefiles/versions/.version | 2 + .../modulefiles/versions/1.0 | 1 + .../modulefiles/versions/2.0 | 1 + .../modulefiles/versions/2.1rc1 | 1 + .../0.1/entrypoints/cowsay-hello | 0 .../0.1/entrypoints/test-echo-module-var | 0 .../0.1/entrypoints/test-shell-script | 0 .../modules/apps}/0.1/module.yaml | 4 +- .../modules/apps/0.1/modulefile | 15 ++++ .../0.2/module.yaml | 8 ++- .../modules/deps/0.2/modulefile | 16 +++++ .../example-module-apps/0.1/modulefile | 15 ---- .../example-module-deps/0.2/modulefile | 15 ---- .../example-module-extra/1.0/modulefile | 15 ---- .../1.0/entrypoints/test-updatable-echo} | 2 +- .../modules/updatable}/1.0/module.yaml | 10 +-- .../modules/updatable/1.0/modulefile | 15 ++++ .../modules/versions/1.0/module.yaml | 10 +++ .../modules/versions/1.0/modulefile | 13 ++++ .../modules/versions/2.0/module.yaml | 10 +++ .../modules/versions/2.0/modulefile | 13 ++++ .../modules/versions/2.1rc1/module.yaml | 10 +++ .../modules/versions/2.1rc1/modulefile | 13 ++++ tests/samples/03-updated/validate.txt | 5 +- .../deploy-tools-output/deployment.yaml | 72 +++++++++++++++---- .../modulefiles/example-module-deps/0.2 | 1 - .../modulefiles/example-module-extra/1.0 | 1 - .../deprecated/modulefiles/versions/1.0 | 1 + .../deprecated/modulefiles/versions/2.1rc1 | 1 + .../{example-module-apps => apps}/.version | 0 .../deploy-tools-output/modulefiles/apps/0.1 | 1 + .../modulefiles/deps/.version | 2 + .../deploy-tools-output/modulefiles/deps/0.2 | 1 + .../modulefiles/example-module-apps/0.1 | 1 - .../modulefiles/updatable}/.version | 0 .../modulefiles/updatable/1.0 | 1 + .../modulefiles/versions/.version | 2 + .../modulefiles/versions/2.0 | 1 + .../0.1/entrypoints/cowsay-hello | 0 .../0.1/entrypoints/test-echo-module-var | 0 .../0.1/entrypoints/test-shell-script | 0 .../0.1/module.yaml | 4 +- .../modules/apps/0.1/modulefile | 15 ++++ .../modules/deps}/0.2/module.yaml | 8 ++- .../modules/deps/0.2/modulefile | 16 +++++ .../example-module-apps/0.1/modulefile | 15 ---- .../example-module-deps/0.2/modulefile | 15 ---- .../example-module-extra/1.0/modulefile | 15 ---- .../1.0/entrypoints/test-updatable-echo} | 2 +- .../modules/updatable}/1.0/module.yaml | 10 +-- .../modules/updatable/1.0/modulefile | 15 ++++ .../modules/versions/1.0/module.yaml | 10 +++ .../modules/versions/1.0/modulefile | 13 ++++ .../modules/versions/2.0/module.yaml | 10 +++ .../modules/versions/2.0/modulefile | 13 ++++ .../modules/versions/2.1rc1/module.yaml | 10 +++ .../modules/versions/2.1rc1/modulefile | 13 ++++ tests/samples/04-deprecated/validate.txt | 8 +-- .../deploy-tools-output/deployment.yaml | 70 ++++++++++++++---- .../modulefiles/example-module-deps/0.2 | 1 - .../deprecated/modulefiles/versions/1.0 | 1 + .../{example-module-apps => apps}/.version | 0 .../deploy-tools-output/modulefiles/apps/0.1 | 1 + .../modulefiles/deps/.version | 2 + .../deploy-tools-output/modulefiles/deps/0.2 | 1 + .../modulefiles/example-module-apps/0.1 | 1 - .../modulefiles/example-module-extra/1.0 | 1 - .../modulefiles/updatable/.version | 2 + .../modulefiles/updatable/1.0 | 1 + .../modulefiles/versions/.version | 2 + .../modulefiles/versions/2.0 | 1 + .../modulefiles/versions/2.1rc1 | 1 + .../0.1/entrypoints/cowsay-hello | 0 .../0.1/entrypoints/test-echo-module-var | 0 .../0.1/entrypoints/test-shell-script | 0 .../modules/apps/0.1/module.yaml | 39 ++++++++++ .../modules/apps/0.1/modulefile | 15 ++++ .../modules/deps/0.2/module.yaml | 14 ++++ .../modules/deps/0.2/modulefile | 16 +++++ .../example-module-apps/0.1/module.yaml | 39 ---------- .../example-module-apps/0.1/modulefile | 15 ---- .../example-module-deps/0.2/module.yaml | 12 ---- .../example-module-deps/0.2/modulefile | 15 ---- .../example-module-extra/1.0/modulefile | 15 ---- .../1.0/entrypoints/test-updatable-echo} | 2 +- .../modules/updatable}/1.0/module.yaml | 10 +-- .../modules/updatable/1.0/modulefile | 15 ++++ .../modules/versions/1.0/module.yaml | 10 +++ .../modules/versions/1.0/modulefile | 13 ++++ .../modules/versions/2.0/module.yaml | 10 +++ .../modules/versions/2.0/modulefile | 13 ++++ .../modules/versions/2.1rc1/module.yaml | 10 +++ .../modules/versions/2.1rc1/modulefile | 13 ++++ tests/samples/05-restored/validate.txt | 5 +- .../deploy-tools-output/deployment.yaml | 63 +++++++++++++--- .../{example-module-apps => apps}/.version | 0 .../deploy-tools-output/modulefiles/apps/0.1 | 1 + .../modulefiles/deps/.version | 2 + .../deploy-tools-output/modulefiles/deps/0.2 | 1 + .../modulefiles/example-module-apps/0.1 | 1 - .../modulefiles/example-module-extra/1.0 | 1 - .../modulefiles/updatable/.version | 2 + .../modulefiles/updatable/1.0 | 1 + .../modulefiles/versions/.version | 2 + .../modulefiles/versions/2.0 | 1 + .../modulefiles/versions/2.1rc1 | 1 + .../0.1/entrypoints/cowsay-hello | 0 .../0.1/entrypoints/test-echo-module-var | 0 .../0.1/entrypoints/test-shell-script | 0 .../modules/apps/0.1/module.yaml | 39 ++++++++++ .../modules/apps/0.1/modulefile | 15 ++++ .../modules/deps/0.2/module.yaml | 14 ++++ .../modules/deps/0.2/modulefile | 16 +++++ .../example-module-apps/0.1/module.yaml | 39 ---------- .../example-module-apps/0.1/modulefile | 15 ---- .../1.0/entrypoints/test-extra-echo | 7 -- .../example-module-extra/1.0/modulefile | 15 ---- .../1.0/entrypoints/test-updatable-echo | 7 ++ .../modules/updatable}/1.0/module.yaml | 10 +-- .../modules/updatable/1.0/modulefile | 15 ++++ .../modules/versions/2.0/module.yaml | 10 +++ .../modules/versions/2.0/modulefile | 13 ++++ .../modules/versions/2.1rc1/module.yaml | 10 +++ .../modules/versions/2.1rc1/modulefile | 13 ++++ tests/samples/06-removed/validate.txt | 2 +- tests/test_golden_master.py | 34 ++++----- 231 files changed, 1522 insertions(+), 753 deletions(-) rename tests/configs/golden-master/01-initial/{example-module-apps => apps}/0.1.yaml (89%) create mode 100644 tests/configs/golden-master/01-initial/deps/0.2.yaml delete mode 100644 tests/configs/golden-master/01-initial/example-module-deps/0.2.yaml create mode 100644 tests/configs/golden-master/01-initial/versions/1.0.yaml rename tests/configs/golden-master/{04-deprecated/example-module-apps => 02-added/apps}/0.1.yaml (89%) create mode 100644 tests/configs/golden-master/02-added/deps/0.2.yaml delete mode 100644 tests/configs/golden-master/02-added/example-module-deps/0.2.yaml delete mode 100644 tests/configs/golden-master/02-added/example-module-extra/1.0.yaml create mode 100644 tests/configs/golden-master/02-added/updatable/1.0.yaml create mode 100644 tests/configs/golden-master/02-added/versions/1.0.yaml create mode 100644 tests/configs/golden-master/02-added/versions/2.0.yaml rename tests/configs/golden-master/{02-added/example-module-apps => 03-updated/apps}/0.1.yaml (89%) create mode 100644 tests/configs/golden-master/03-updated/deps/0.2.yaml delete mode 100644 tests/configs/golden-master/03-updated/example-module-deps/0.2.yaml rename tests/configs/golden-master/03-updated/{example-module-extra => updatable}/1.0.yaml (57%) create mode 100644 tests/configs/golden-master/03-updated/versions/1.0.yaml create mode 100644 tests/configs/golden-master/03-updated/versions/2.0.yaml create mode 100644 tests/configs/golden-master/03-updated/versions/2.1rc1.yaml rename tests/configs/golden-master/{03-updated/example-module-apps => 04-deprecated/apps}/0.1.yaml (89%) create mode 100644 tests/configs/golden-master/04-deprecated/deps/0.2.yaml delete mode 100644 tests/configs/golden-master/04-deprecated/example-module-deps/0.2.yaml delete mode 100644 tests/configs/golden-master/04-deprecated/example-module-extra/1.0.yaml create mode 100644 tests/configs/golden-master/04-deprecated/updatable/1.0.yaml create mode 100644 tests/configs/golden-master/04-deprecated/versions/1.0.yaml create mode 100644 tests/configs/golden-master/04-deprecated/versions/2.0.yaml create mode 100644 tests/configs/golden-master/04-deprecated/versions/2.1rc1.yaml create mode 100644 tests/configs/golden-master/05-restored/apps/0.1.yaml create mode 100644 tests/configs/golden-master/05-restored/deps/0.2.yaml delete mode 100644 tests/configs/golden-master/05-restored/example-module-apps/0.1.yaml delete mode 100644 tests/configs/golden-master/05-restored/example-module-deps/0.2.yaml delete mode 100644 tests/configs/golden-master/05-restored/example-module-extra/1.0.yaml create mode 100644 tests/configs/golden-master/05-restored/updatable/1.0.yaml create mode 100644 tests/configs/golden-master/05-restored/versions/1.0.yaml create mode 100644 tests/configs/golden-master/05-restored/versions/2.0.yaml create mode 100644 tests/configs/golden-master/05-restored/versions/2.1rc1.yaml create mode 100644 tests/configs/golden-master/06-removed/apps/0.1.yaml create mode 100644 tests/configs/golden-master/06-removed/deps/0.2.yaml delete mode 100644 tests/configs/golden-master/06-removed/example-module-apps/0.1.yaml delete mode 100644 tests/configs/golden-master/06-removed/example-module-extra/1.0.yaml create mode 100644 tests/configs/golden-master/06-removed/updatable/1.0.yaml create mode 100644 tests/configs/golden-master/06-removed/versions/2.0.yaml create mode 100644 tests/configs/golden-master/06-removed/versions/2.1rc1.yaml rename tests/samples/01-initial/deploy-tools-output/modulefiles/{example-module-apps => apps}/.version (100%) create mode 120000 tests/samples/01-initial/deploy-tools-output/modulefiles/apps/0.1 rename tests/samples/01-initial/deploy-tools-output/modulefiles/{example-module-deps => deps}/.version (100%) create mode 120000 tests/samples/01-initial/deploy-tools-output/modulefiles/deps/0.2 delete mode 120000 tests/samples/01-initial/deploy-tools-output/modulefiles/example-module-apps/0.1 delete mode 120000 tests/samples/01-initial/deploy-tools-output/modulefiles/example-module-deps/0.2 rename tests/samples/{02-added/deploy-tools-output/modulefiles/example-module-extra => 01-initial/deploy-tools-output/modulefiles/versions}/.version (100%) create mode 120000 tests/samples/01-initial/deploy-tools-output/modulefiles/versions/1.0 rename tests/samples/01-initial/deploy-tools-output/modules/{example-module-apps => apps}/0.1/entrypoints/cowsay-hello (100%) rename tests/samples/01-initial/deploy-tools-output/modules/{example-module-apps => apps}/0.1/entrypoints/test-echo-module-var (100%) rename tests/samples/01-initial/deploy-tools-output/modules/{example-module-apps => apps}/0.1/entrypoints/test-shell-script (100%) rename tests/samples/01-initial/deploy-tools-output/modules/{example-module-apps => apps}/0.1/module.yaml (90%) create mode 100644 tests/samples/01-initial/deploy-tools-output/modules/apps/0.1/modulefile rename tests/samples/{04-deprecated/deploy-tools-output/modules/example-module-deps => 01-initial/deploy-tools-output/modules/deps}/0.2/module.yaml (59%) create mode 100644 tests/samples/01-initial/deploy-tools-output/modules/deps/0.2/modulefile delete mode 100644 tests/samples/01-initial/deploy-tools-output/modules/example-module-apps/0.1/modulefile delete mode 100644 tests/samples/01-initial/deploy-tools-output/modules/example-module-deps/0.2/modulefile create mode 100644 tests/samples/01-initial/deploy-tools-output/modules/versions/1.0/module.yaml create mode 100644 tests/samples/01-initial/deploy-tools-output/modules/versions/1.0/modulefile rename tests/samples/02-added/deploy-tools-output/modulefiles/{example-module-apps => apps}/.version (100%) create mode 120000 tests/samples/02-added/deploy-tools-output/modulefiles/apps/0.1 rename tests/samples/02-added/deploy-tools-output/modulefiles/{example-module-deps => deps}/.version (100%) create mode 120000 tests/samples/02-added/deploy-tools-output/modulefiles/deps/0.2 delete mode 120000 tests/samples/02-added/deploy-tools-output/modulefiles/example-module-apps/0.1 delete mode 120000 tests/samples/02-added/deploy-tools-output/modulefiles/example-module-deps/0.2 delete mode 120000 tests/samples/02-added/deploy-tools-output/modulefiles/example-module-extra/1.0 rename tests/samples/{03-updated/deploy-tools-output/modulefiles/example-module-extra => 02-added/deploy-tools-output/modulefiles/updatable}/.version (100%) create mode 120000 tests/samples/02-added/deploy-tools-output/modulefiles/updatable/1.0 create mode 100644 tests/samples/02-added/deploy-tools-output/modulefiles/versions/.version create mode 120000 tests/samples/02-added/deploy-tools-output/modulefiles/versions/1.0 create mode 120000 tests/samples/02-added/deploy-tools-output/modulefiles/versions/2.0 rename tests/samples/02-added/deploy-tools-output/modules/{example-module-apps => apps}/0.1/entrypoints/cowsay-hello (100%) rename tests/samples/02-added/deploy-tools-output/modules/{example-module-apps => apps}/0.1/entrypoints/test-echo-module-var (100%) rename tests/samples/02-added/deploy-tools-output/modules/{example-module-apps => apps}/0.1/entrypoints/test-shell-script (100%) rename tests/samples/{03-updated/deploy-tools-output/modules/example-module-apps => 02-added/deploy-tools-output/modules/apps}/0.1/module.yaml (90%) create mode 100644 tests/samples/02-added/deploy-tools-output/modules/apps/0.1/modulefile rename tests/samples/{01-initial/deploy-tools-output/modules/example-module-deps => 02-added/deploy-tools-output/modules/deps}/0.2/module.yaml (59%) create mode 100644 tests/samples/02-added/deploy-tools-output/modules/deps/0.2/modulefile delete mode 100644 tests/samples/02-added/deploy-tools-output/modules/example-module-apps/0.1/modulefile delete mode 100644 tests/samples/02-added/deploy-tools-output/modules/example-module-deps/0.2/modulefile delete mode 100644 tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/modulefile rename tests/samples/02-added/deploy-tools-output/modules/{example-module-extra/1.0/entrypoints/test-extra-echo => updatable/1.0/entrypoints/test-updatable-echo} (76%) rename tests/samples/02-added/deploy-tools-output/modules/{example-module-extra => updatable}/1.0/module.yaml (56%) create mode 100644 tests/samples/02-added/deploy-tools-output/modules/updatable/1.0/modulefile create mode 100644 tests/samples/02-added/deploy-tools-output/modules/versions/1.0/module.yaml create mode 100644 tests/samples/02-added/deploy-tools-output/modules/versions/1.0/modulefile create mode 100644 tests/samples/02-added/deploy-tools-output/modules/versions/2.0/module.yaml create mode 100644 tests/samples/02-added/deploy-tools-output/modules/versions/2.0/modulefile rename tests/samples/03-updated/deploy-tools-output/modulefiles/{example-module-apps => apps}/.version (100%) create mode 120000 tests/samples/03-updated/deploy-tools-output/modulefiles/apps/0.1 rename tests/samples/03-updated/deploy-tools-output/modulefiles/{example-module-deps => deps}/.version (100%) create mode 120000 tests/samples/03-updated/deploy-tools-output/modulefiles/deps/0.2 delete mode 120000 tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-apps/0.1 delete mode 120000 tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-deps/0.2 delete mode 120000 tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-extra/1.0 rename tests/samples/{05-restored/deploy-tools-output/modulefiles/example-module-extra => 03-updated/deploy-tools-output/modulefiles/updatable}/.version (100%) create mode 120000 tests/samples/03-updated/deploy-tools-output/modulefiles/updatable/1.0 create mode 100644 tests/samples/03-updated/deploy-tools-output/modulefiles/versions/.version create mode 120000 tests/samples/03-updated/deploy-tools-output/modulefiles/versions/1.0 create mode 120000 tests/samples/03-updated/deploy-tools-output/modulefiles/versions/2.0 create mode 120000 tests/samples/03-updated/deploy-tools-output/modulefiles/versions/2.1rc1 rename tests/samples/03-updated/deploy-tools-output/modules/{example-module-apps => apps}/0.1/entrypoints/cowsay-hello (100%) rename tests/samples/03-updated/deploy-tools-output/modules/{example-module-apps => apps}/0.1/entrypoints/test-echo-module-var (100%) rename tests/samples/03-updated/deploy-tools-output/modules/{example-module-apps => apps}/0.1/entrypoints/test-shell-script (100%) rename tests/samples/{02-added/deploy-tools-output/modules/example-module-apps => 03-updated/deploy-tools-output/modules/apps}/0.1/module.yaml (90%) create mode 100644 tests/samples/03-updated/deploy-tools-output/modules/apps/0.1/modulefile rename tests/samples/03-updated/deploy-tools-output/modules/{example-module-deps => deps}/0.2/module.yaml (59%) create mode 100644 tests/samples/03-updated/deploy-tools-output/modules/deps/0.2/modulefile delete mode 100644 tests/samples/03-updated/deploy-tools-output/modules/example-module-apps/0.1/modulefile delete mode 100644 tests/samples/03-updated/deploy-tools-output/modules/example-module-deps/0.2/modulefile delete mode 100644 tests/samples/03-updated/deploy-tools-output/modules/example-module-extra/1.0/modulefile rename tests/samples/03-updated/deploy-tools-output/modules/{example-module-extra/1.0/entrypoints/test-extra-echo => updatable/1.0/entrypoints/test-updatable-echo} (76%) rename tests/samples/{06-removed/deploy-tools-output/modules/example-module-extra => 03-updated/deploy-tools-output/modules/updatable}/1.0/module.yaml (55%) create mode 100644 tests/samples/03-updated/deploy-tools-output/modules/updatable/1.0/modulefile create mode 100644 tests/samples/03-updated/deploy-tools-output/modules/versions/1.0/module.yaml create mode 100644 tests/samples/03-updated/deploy-tools-output/modules/versions/1.0/modulefile create mode 100644 tests/samples/03-updated/deploy-tools-output/modules/versions/2.0/module.yaml create mode 100644 tests/samples/03-updated/deploy-tools-output/modules/versions/2.0/modulefile create mode 100644 tests/samples/03-updated/deploy-tools-output/modules/versions/2.1rc1/module.yaml create mode 100644 tests/samples/03-updated/deploy-tools-output/modules/versions/2.1rc1/modulefile delete mode 120000 tests/samples/04-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 delete mode 120000 tests/samples/04-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-extra/1.0 create mode 120000 tests/samples/04-deprecated/deploy-tools-output/deprecated/modulefiles/versions/1.0 create mode 120000 tests/samples/04-deprecated/deploy-tools-output/deprecated/modulefiles/versions/2.1rc1 rename tests/samples/04-deprecated/deploy-tools-output/modulefiles/{example-module-apps => apps}/.version (100%) create mode 120000 tests/samples/04-deprecated/deploy-tools-output/modulefiles/apps/0.1 create mode 100644 tests/samples/04-deprecated/deploy-tools-output/modulefiles/deps/.version create mode 120000 tests/samples/04-deprecated/deploy-tools-output/modulefiles/deps/0.2 delete mode 120000 tests/samples/04-deprecated/deploy-tools-output/modulefiles/example-module-apps/0.1 rename tests/samples/{06-removed/deploy-tools-output/modulefiles/example-module-extra => 04-deprecated/deploy-tools-output/modulefiles/updatable}/.version (100%) create mode 120000 tests/samples/04-deprecated/deploy-tools-output/modulefiles/updatable/1.0 create mode 100644 tests/samples/04-deprecated/deploy-tools-output/modulefiles/versions/.version create mode 120000 tests/samples/04-deprecated/deploy-tools-output/modulefiles/versions/2.0 rename tests/samples/04-deprecated/deploy-tools-output/modules/{example-module-apps => apps}/0.1/entrypoints/cowsay-hello (100%) rename tests/samples/04-deprecated/deploy-tools-output/modules/{example-module-apps => apps}/0.1/entrypoints/test-echo-module-var (100%) rename tests/samples/04-deprecated/deploy-tools-output/modules/{example-module-apps => apps}/0.1/entrypoints/test-shell-script (100%) rename tests/samples/04-deprecated/deploy-tools-output/modules/{example-module-apps => apps}/0.1/module.yaml (90%) create mode 100644 tests/samples/04-deprecated/deploy-tools-output/modules/apps/0.1/modulefile rename tests/samples/{02-added/deploy-tools-output/modules/example-module-deps => 04-deprecated/deploy-tools-output/modules/deps}/0.2/module.yaml (59%) create mode 100644 tests/samples/04-deprecated/deploy-tools-output/modules/deps/0.2/modulefile delete mode 100644 tests/samples/04-deprecated/deploy-tools-output/modules/example-module-apps/0.1/modulefile delete mode 100644 tests/samples/04-deprecated/deploy-tools-output/modules/example-module-deps/0.2/modulefile delete mode 100644 tests/samples/04-deprecated/deploy-tools-output/modules/example-module-extra/1.0/modulefile rename tests/samples/04-deprecated/deploy-tools-output/modules/{example-module-extra/1.0/entrypoints/test-extra-echo => updatable/1.0/entrypoints/test-updatable-echo} (76%) rename tests/samples/{03-updated/deploy-tools-output/modules/example-module-extra => 04-deprecated/deploy-tools-output/modules/updatable}/1.0/module.yaml (55%) create mode 100644 tests/samples/04-deprecated/deploy-tools-output/modules/updatable/1.0/modulefile create mode 100644 tests/samples/04-deprecated/deploy-tools-output/modules/versions/1.0/module.yaml create mode 100644 tests/samples/04-deprecated/deploy-tools-output/modules/versions/1.0/modulefile create mode 100644 tests/samples/04-deprecated/deploy-tools-output/modules/versions/2.0/module.yaml create mode 100644 tests/samples/04-deprecated/deploy-tools-output/modules/versions/2.0/modulefile create mode 100644 tests/samples/04-deprecated/deploy-tools-output/modules/versions/2.1rc1/module.yaml create mode 100644 tests/samples/04-deprecated/deploy-tools-output/modules/versions/2.1rc1/modulefile delete mode 120000 tests/samples/05-restored/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 create mode 120000 tests/samples/05-restored/deploy-tools-output/deprecated/modulefiles/versions/1.0 rename tests/samples/05-restored/deploy-tools-output/modulefiles/{example-module-apps => apps}/.version (100%) create mode 120000 tests/samples/05-restored/deploy-tools-output/modulefiles/apps/0.1 create mode 100644 tests/samples/05-restored/deploy-tools-output/modulefiles/deps/.version create mode 120000 tests/samples/05-restored/deploy-tools-output/modulefiles/deps/0.2 delete mode 120000 tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-apps/0.1 delete mode 120000 tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-extra/1.0 create mode 100644 tests/samples/05-restored/deploy-tools-output/modulefiles/updatable/.version create mode 120000 tests/samples/05-restored/deploy-tools-output/modulefiles/updatable/1.0 create mode 100644 tests/samples/05-restored/deploy-tools-output/modulefiles/versions/.version create mode 120000 tests/samples/05-restored/deploy-tools-output/modulefiles/versions/2.0 create mode 120000 tests/samples/05-restored/deploy-tools-output/modulefiles/versions/2.1rc1 rename tests/samples/05-restored/deploy-tools-output/modules/{example-module-apps => apps}/0.1/entrypoints/cowsay-hello (100%) rename tests/samples/05-restored/deploy-tools-output/modules/{example-module-apps => apps}/0.1/entrypoints/test-echo-module-var (100%) rename tests/samples/05-restored/deploy-tools-output/modules/{example-module-apps => apps}/0.1/entrypoints/test-shell-script (100%) create mode 100644 tests/samples/05-restored/deploy-tools-output/modules/apps/0.1/module.yaml create mode 100644 tests/samples/05-restored/deploy-tools-output/modules/apps/0.1/modulefile create mode 100644 tests/samples/05-restored/deploy-tools-output/modules/deps/0.2/module.yaml create mode 100644 tests/samples/05-restored/deploy-tools-output/modules/deps/0.2/modulefile delete mode 100644 tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/module.yaml delete mode 100644 tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/modulefile delete mode 100644 tests/samples/05-restored/deploy-tools-output/modules/example-module-deps/0.2/module.yaml delete mode 100644 tests/samples/05-restored/deploy-tools-output/modules/example-module-deps/0.2/modulefile delete mode 100644 tests/samples/05-restored/deploy-tools-output/modules/example-module-extra/1.0/modulefile rename tests/samples/05-restored/deploy-tools-output/modules/{example-module-extra/1.0/entrypoints/test-extra-echo => updatable/1.0/entrypoints/test-updatable-echo} (76%) rename tests/samples/{04-deprecated/deploy-tools-output/modules/example-module-extra => 05-restored/deploy-tools-output/modules/updatable}/1.0/module.yaml (55%) create mode 100644 tests/samples/05-restored/deploy-tools-output/modules/updatable/1.0/modulefile create mode 100644 tests/samples/05-restored/deploy-tools-output/modules/versions/1.0/module.yaml create mode 100644 tests/samples/05-restored/deploy-tools-output/modules/versions/1.0/modulefile create mode 100644 tests/samples/05-restored/deploy-tools-output/modules/versions/2.0/module.yaml create mode 100644 tests/samples/05-restored/deploy-tools-output/modules/versions/2.0/modulefile create mode 100644 tests/samples/05-restored/deploy-tools-output/modules/versions/2.1rc1/module.yaml create mode 100644 tests/samples/05-restored/deploy-tools-output/modules/versions/2.1rc1/modulefile rename tests/samples/06-removed/deploy-tools-output/modulefiles/{example-module-apps => apps}/.version (100%) create mode 120000 tests/samples/06-removed/deploy-tools-output/modulefiles/apps/0.1 create mode 100644 tests/samples/06-removed/deploy-tools-output/modulefiles/deps/.version create mode 120000 tests/samples/06-removed/deploy-tools-output/modulefiles/deps/0.2 delete mode 120000 tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-apps/0.1 delete mode 120000 tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-extra/1.0 create mode 100644 tests/samples/06-removed/deploy-tools-output/modulefiles/updatable/.version create mode 120000 tests/samples/06-removed/deploy-tools-output/modulefiles/updatable/1.0 create mode 100644 tests/samples/06-removed/deploy-tools-output/modulefiles/versions/.version create mode 120000 tests/samples/06-removed/deploy-tools-output/modulefiles/versions/2.0 create mode 120000 tests/samples/06-removed/deploy-tools-output/modulefiles/versions/2.1rc1 rename tests/samples/06-removed/deploy-tools-output/modules/{example-module-apps => apps}/0.1/entrypoints/cowsay-hello (100%) rename tests/samples/06-removed/deploy-tools-output/modules/{example-module-apps => apps}/0.1/entrypoints/test-echo-module-var (100%) rename tests/samples/06-removed/deploy-tools-output/modules/{example-module-apps => apps}/0.1/entrypoints/test-shell-script (100%) create mode 100644 tests/samples/06-removed/deploy-tools-output/modules/apps/0.1/module.yaml create mode 100644 tests/samples/06-removed/deploy-tools-output/modules/apps/0.1/modulefile create mode 100644 tests/samples/06-removed/deploy-tools-output/modules/deps/0.2/module.yaml create mode 100644 tests/samples/06-removed/deploy-tools-output/modules/deps/0.2/modulefile delete mode 100644 tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/module.yaml delete mode 100644 tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/modulefile delete mode 100755 tests/samples/06-removed/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo delete mode 100644 tests/samples/06-removed/deploy-tools-output/modules/example-module-extra/1.0/modulefile create mode 100755 tests/samples/06-removed/deploy-tools-output/modules/updatable/1.0/entrypoints/test-updatable-echo rename tests/samples/{05-restored/deploy-tools-output/modules/example-module-extra => 06-removed/deploy-tools-output/modules/updatable}/1.0/module.yaml (55%) create mode 100644 tests/samples/06-removed/deploy-tools-output/modules/updatable/1.0/modulefile create mode 100644 tests/samples/06-removed/deploy-tools-output/modules/versions/2.0/module.yaml create mode 100644 tests/samples/06-removed/deploy-tools-output/modules/versions/2.0/modulefile create mode 100644 tests/samples/06-removed/deploy-tools-output/modules/versions/2.1rc1/module.yaml create mode 100644 tests/samples/06-removed/deploy-tools-output/modules/versions/2.1rc1/modulefile diff --git a/tests/configs/golden-master/01-initial/example-module-apps/0.1.yaml b/tests/configs/golden-master/01-initial/apps/0.1.yaml similarity index 89% rename from tests/configs/golden-master/01-initial/example-module-apps/0.1.yaml rename to tests/configs/golden-master/01-initial/apps/0.1.yaml index 0a934518..53930c4e 100644 --- a/tests/configs/golden-master/01-initial/example-module-apps/0.1.yaml +++ b/tests/configs/golden-master/01-initial/apps/0.1.yaml @@ -1,9 +1,9 @@ # yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json module: - name: example-module-apps + name: apps version: "0.1" - description: Demonstration of a module configuration folder + description: Module demonstrating shell and Apptainer applications env_vars: - name: OTHER_VALUE diff --git a/tests/configs/golden-master/01-initial/deps/0.2.yaml b/tests/configs/golden-master/01-initial/deps/0.2.yaml new file mode 100644 index 00000000..2556b79f --- /dev/null +++ b/tests/configs/golden-master/01-initial/deps/0.2.yaml @@ -0,0 +1,14 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: deps + version: "0.2" + description: Module demonstrating dependencies + + dependencies: + - name: apps + version: "0.1" + # A version-less dependency is valid only for modules not managed by deploy-tools. + - name: external-module + + applications: [] diff --git a/tests/configs/golden-master/01-initial/example-module-deps/0.2.yaml b/tests/configs/golden-master/01-initial/example-module-deps/0.2.yaml deleted file mode 100644 index 4e5c3fc4..00000000 --- a/tests/configs/golden-master/01-initial/example-module-deps/0.2.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json - -module: - name: example-module-deps - version: "0.2" - description: Demonstration of deploy-tools dependencies - - dependencies: - - name: example-module-apps - version: "0.1" - - applications: [] diff --git a/tests/configs/golden-master/01-initial/versions/1.0.yaml b/tests/configs/golden-master/01-initial/versions/1.0.yaml new file mode 100644 index 00000000..75585310 --- /dev/null +++ b/tests/configs/golden-master/01-initial/versions/1.0.yaml @@ -0,0 +1,8 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: versions + version: "1.0" + description: Module demonstrating multiple versions and default-version selection + + applications: [] diff --git a/tests/configs/golden-master/04-deprecated/example-module-apps/0.1.yaml b/tests/configs/golden-master/02-added/apps/0.1.yaml similarity index 89% rename from tests/configs/golden-master/04-deprecated/example-module-apps/0.1.yaml rename to tests/configs/golden-master/02-added/apps/0.1.yaml index 0a934518..53930c4e 100644 --- a/tests/configs/golden-master/04-deprecated/example-module-apps/0.1.yaml +++ b/tests/configs/golden-master/02-added/apps/0.1.yaml @@ -1,9 +1,9 @@ # yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json module: - name: example-module-apps + name: apps version: "0.1" - description: Demonstration of a module configuration folder + description: Module demonstrating shell and Apptainer applications env_vars: - name: OTHER_VALUE diff --git a/tests/configs/golden-master/02-added/deps/0.2.yaml b/tests/configs/golden-master/02-added/deps/0.2.yaml new file mode 100644 index 00000000..2556b79f --- /dev/null +++ b/tests/configs/golden-master/02-added/deps/0.2.yaml @@ -0,0 +1,14 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: deps + version: "0.2" + description: Module demonstrating dependencies + + dependencies: + - name: apps + version: "0.1" + # A version-less dependency is valid only for modules not managed by deploy-tools. + - name: external-module + + applications: [] diff --git a/tests/configs/golden-master/02-added/example-module-deps/0.2.yaml b/tests/configs/golden-master/02-added/example-module-deps/0.2.yaml deleted file mode 100644 index 4e5c3fc4..00000000 --- a/tests/configs/golden-master/02-added/example-module-deps/0.2.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json - -module: - name: example-module-deps - version: "0.2" - description: Demonstration of deploy-tools dependencies - - dependencies: - - name: example-module-apps - version: "0.1" - - applications: [] diff --git a/tests/configs/golden-master/02-added/example-module-extra/1.0.yaml b/tests/configs/golden-master/02-added/example-module-extra/1.0.yaml deleted file mode 100644 index f417b4b4..00000000 --- a/tests/configs/golden-master/02-added/example-module-extra/1.0.yaml +++ /dev/null @@ -1,21 +0,0 @@ -# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json - -module: - name: example-module-extra - version: "1.0" - description: Demonstration of adding a module in a later sync - - env_vars: - - name: EXTRA_VALUE - value: Added after initial deployment - - applications: - - app_type: shell - - name: test-extra-echo - script: - - echo $EXTRA_VALUE - - # Allow in-place updates to this version, so a later sync can change its - # configuration without bumping the version number. - allow_updates: true diff --git a/tests/configs/golden-master/02-added/updatable/1.0.yaml b/tests/configs/golden-master/02-added/updatable/1.0.yaml new file mode 100644 index 00000000..a6a62504 --- /dev/null +++ b/tests/configs/golden-master/02-added/updatable/1.0.yaml @@ -0,0 +1,21 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: updatable + version: "1.0" + description: Module demonstrating in-place updates (allow_updates) + + env_vars: + - name: UPDATABLE_VALUE + value: Added after initial deployment + + applications: + - app_type: shell + + name: test-updatable-echo + script: + - echo $UPDATABLE_VALUE + + # allow_updates lets a later sync change this version's configuration in place, + # without bumping the version number. + allow_updates: true diff --git a/tests/configs/golden-master/02-added/versions/1.0.yaml b/tests/configs/golden-master/02-added/versions/1.0.yaml new file mode 100644 index 00000000..75585310 --- /dev/null +++ b/tests/configs/golden-master/02-added/versions/1.0.yaml @@ -0,0 +1,8 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: versions + version: "1.0" + description: Module demonstrating multiple versions and default-version selection + + applications: [] diff --git a/tests/configs/golden-master/02-added/versions/2.0.yaml b/tests/configs/golden-master/02-added/versions/2.0.yaml new file mode 100644 index 00000000..ff7bc941 --- /dev/null +++ b/tests/configs/golden-master/02-added/versions/2.0.yaml @@ -0,0 +1,8 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: versions + version: "2.0" + description: Module demonstrating multiple versions and default-version selection + + applications: [] diff --git a/tests/configs/golden-master/02-added/example-module-apps/0.1.yaml b/tests/configs/golden-master/03-updated/apps/0.1.yaml similarity index 89% rename from tests/configs/golden-master/02-added/example-module-apps/0.1.yaml rename to tests/configs/golden-master/03-updated/apps/0.1.yaml index 0a934518..53930c4e 100644 --- a/tests/configs/golden-master/02-added/example-module-apps/0.1.yaml +++ b/tests/configs/golden-master/03-updated/apps/0.1.yaml @@ -1,9 +1,9 @@ # yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json module: - name: example-module-apps + name: apps version: "0.1" - description: Demonstration of a module configuration folder + description: Module demonstrating shell and Apptainer applications env_vars: - name: OTHER_VALUE diff --git a/tests/configs/golden-master/03-updated/deps/0.2.yaml b/tests/configs/golden-master/03-updated/deps/0.2.yaml new file mode 100644 index 00000000..2556b79f --- /dev/null +++ b/tests/configs/golden-master/03-updated/deps/0.2.yaml @@ -0,0 +1,14 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: deps + version: "0.2" + description: Module demonstrating dependencies + + dependencies: + - name: apps + version: "0.1" + # A version-less dependency is valid only for modules not managed by deploy-tools. + - name: external-module + + applications: [] diff --git a/tests/configs/golden-master/03-updated/example-module-deps/0.2.yaml b/tests/configs/golden-master/03-updated/example-module-deps/0.2.yaml deleted file mode 100644 index 4e5c3fc4..00000000 --- a/tests/configs/golden-master/03-updated/example-module-deps/0.2.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json - -module: - name: example-module-deps - version: "0.2" - description: Demonstration of deploy-tools dependencies - - dependencies: - - name: example-module-apps - version: "0.1" - - applications: [] diff --git a/tests/configs/golden-master/03-updated/example-module-extra/1.0.yaml b/tests/configs/golden-master/03-updated/updatable/1.0.yaml similarity index 57% rename from tests/configs/golden-master/03-updated/example-module-extra/1.0.yaml rename to tests/configs/golden-master/03-updated/updatable/1.0.yaml index c3219c9e..72dc3cd5 100644 --- a/tests/configs/golden-master/03-updated/example-module-extra/1.0.yaml +++ b/tests/configs/golden-master/03-updated/updatable/1.0.yaml @@ -1,21 +1,20 @@ # yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json module: - name: example-module-extra + name: updatable version: "1.0" - description: Demonstration of adding a module in a later sync + description: Module demonstrating in-place updates (allow_updates) env_vars: - - name: EXTRA_VALUE - # Changing this value (permitted by allow_updates) triggers an in-place - # update of the already-deployed version. + - name: UPDATABLE_VALUE + # Changing this value (permitted by allow_updates) triggers an in-place update. value: Updated in a later sync applications: - app_type: shell - name: test-extra-echo + name: test-updatable-echo script: - - echo $EXTRA_VALUE + - echo $UPDATABLE_VALUE allow_updates: true diff --git a/tests/configs/golden-master/03-updated/versions/1.0.yaml b/tests/configs/golden-master/03-updated/versions/1.0.yaml new file mode 100644 index 00000000..75585310 --- /dev/null +++ b/tests/configs/golden-master/03-updated/versions/1.0.yaml @@ -0,0 +1,8 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: versions + version: "1.0" + description: Module demonstrating multiple versions and default-version selection + + applications: [] diff --git a/tests/configs/golden-master/03-updated/versions/2.0.yaml b/tests/configs/golden-master/03-updated/versions/2.0.yaml new file mode 100644 index 00000000..ff7bc941 --- /dev/null +++ b/tests/configs/golden-master/03-updated/versions/2.0.yaml @@ -0,0 +1,8 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: versions + version: "2.0" + description: Module demonstrating multiple versions and default-version selection + + applications: [] diff --git a/tests/configs/golden-master/03-updated/versions/2.1rc1.yaml b/tests/configs/golden-master/03-updated/versions/2.1rc1.yaml new file mode 100644 index 00000000..64cd4eed --- /dev/null +++ b/tests/configs/golden-master/03-updated/versions/2.1rc1.yaml @@ -0,0 +1,12 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: versions + version: "2.1rc1" + description: Module demonstrating multiple versions and default-version selection + + # Excluded from automatic default selection, so the default stays at the latest + # stable version even though this prerelease sorts higher. + exclude_from_defaults: true + + applications: [] diff --git a/tests/configs/golden-master/03-updated/example-module-apps/0.1.yaml b/tests/configs/golden-master/04-deprecated/apps/0.1.yaml similarity index 89% rename from tests/configs/golden-master/03-updated/example-module-apps/0.1.yaml rename to tests/configs/golden-master/04-deprecated/apps/0.1.yaml index 0a934518..53930c4e 100644 --- a/tests/configs/golden-master/03-updated/example-module-apps/0.1.yaml +++ b/tests/configs/golden-master/04-deprecated/apps/0.1.yaml @@ -1,9 +1,9 @@ # yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json module: - name: example-module-apps + name: apps version: "0.1" - description: Demonstration of a module configuration folder + description: Module demonstrating shell and Apptainer applications env_vars: - name: OTHER_VALUE diff --git a/tests/configs/golden-master/04-deprecated/deps/0.2.yaml b/tests/configs/golden-master/04-deprecated/deps/0.2.yaml new file mode 100644 index 00000000..2556b79f --- /dev/null +++ b/tests/configs/golden-master/04-deprecated/deps/0.2.yaml @@ -0,0 +1,14 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: deps + version: "0.2" + description: Module demonstrating dependencies + + dependencies: + - name: apps + version: "0.1" + # A version-less dependency is valid only for modules not managed by deploy-tools. + - name: external-module + + applications: [] diff --git a/tests/configs/golden-master/04-deprecated/example-module-deps/0.2.yaml b/tests/configs/golden-master/04-deprecated/example-module-deps/0.2.yaml deleted file mode 100644 index e327b454..00000000 --- a/tests/configs/golden-master/04-deprecated/example-module-deps/0.2.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json - -module: - name: example-module-deps - version: "0.2" - description: Demonstration of deploy-tools dependencies - - dependencies: - - name: example-module-apps - version: "0.1" - - applications: [] - -# Mark this release as deprecated: its modulefile link moves into the deprecated area -# while the built module remains available, as a precursor to full removal. -deprecated: true diff --git a/tests/configs/golden-master/04-deprecated/example-module-extra/1.0.yaml b/tests/configs/golden-master/04-deprecated/example-module-extra/1.0.yaml deleted file mode 100644 index 13b5a5fd..00000000 --- a/tests/configs/golden-master/04-deprecated/example-module-extra/1.0.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json - -module: - name: example-module-extra - version: "1.0" - description: Demonstration of adding a module in a later sync - - env_vars: - - name: EXTRA_VALUE - value: Updated in a later sync - - applications: - - app_type: shell - - name: test-extra-echo - script: - - echo $EXTRA_VALUE - - allow_updates: true - -# Deprecate this release so a later sync can demonstrate restoring it. The module -# config above is otherwise unchanged; only this flag flips, so the sync is treated -# as a deprecation rather than an update. -deprecated: true diff --git a/tests/configs/golden-master/04-deprecated/updatable/1.0.yaml b/tests/configs/golden-master/04-deprecated/updatable/1.0.yaml new file mode 100644 index 00000000..72dc3cd5 --- /dev/null +++ b/tests/configs/golden-master/04-deprecated/updatable/1.0.yaml @@ -0,0 +1,20 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: updatable + version: "1.0" + description: Module demonstrating in-place updates (allow_updates) + + env_vars: + - name: UPDATABLE_VALUE + # Changing this value (permitted by allow_updates) triggers an in-place update. + value: Updated in a later sync + + applications: + - app_type: shell + + name: test-updatable-echo + script: + - echo $UPDATABLE_VALUE + + allow_updates: true diff --git a/tests/configs/golden-master/04-deprecated/versions/1.0.yaml b/tests/configs/golden-master/04-deprecated/versions/1.0.yaml new file mode 100644 index 00000000..2a4216d6 --- /dev/null +++ b/tests/configs/golden-master/04-deprecated/versions/1.0.yaml @@ -0,0 +1,10 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: versions + version: "1.0" + description: Module demonstrating multiple versions and default-version selection + + applications: [] + +deprecated: true diff --git a/tests/configs/golden-master/04-deprecated/versions/2.0.yaml b/tests/configs/golden-master/04-deprecated/versions/2.0.yaml new file mode 100644 index 00000000..ff7bc941 --- /dev/null +++ b/tests/configs/golden-master/04-deprecated/versions/2.0.yaml @@ -0,0 +1,8 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: versions + version: "2.0" + description: Module demonstrating multiple versions and default-version selection + + applications: [] diff --git a/tests/configs/golden-master/04-deprecated/versions/2.1rc1.yaml b/tests/configs/golden-master/04-deprecated/versions/2.1rc1.yaml new file mode 100644 index 00000000..32d53894 --- /dev/null +++ b/tests/configs/golden-master/04-deprecated/versions/2.1rc1.yaml @@ -0,0 +1,14 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: versions + version: "2.1rc1" + description: Module demonstrating multiple versions and default-version selection + + # Excluded from automatic default selection, so the default stays at the latest + # stable version even though this prerelease sorts higher. + exclude_from_defaults: true + + applications: [] + +deprecated: true diff --git a/tests/configs/golden-master/05-restored/apps/0.1.yaml b/tests/configs/golden-master/05-restored/apps/0.1.yaml new file mode 100644 index 00000000..53930c4e --- /dev/null +++ b/tests/configs/golden-master/05-restored/apps/0.1.yaml @@ -0,0 +1,37 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: apps + version: "0.1" + description: Module demonstrating shell and Apptainer applications + + env_vars: + - name: OTHER_VALUE + value: Version 0.1 + + applications: + - app_type: apptainer + + container: + path: docker://ghcr.io/apptainer/lolcow + version: latest + + entrypoints: + - name: cowsay-hello + command: cowsay + options: + command_args: Hello + + - app_type: shell + + name: test-echo-module-var + script: + - echo $OTHER_VALUE + + - app_type: shell + + name: test-shell-script + script: + - "echo This is the first line of a shell script" + - "echo and this is the second line." + - "echo Your input is ${1}" diff --git a/tests/configs/golden-master/05-restored/deps/0.2.yaml b/tests/configs/golden-master/05-restored/deps/0.2.yaml new file mode 100644 index 00000000..2556b79f --- /dev/null +++ b/tests/configs/golden-master/05-restored/deps/0.2.yaml @@ -0,0 +1,14 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: deps + version: "0.2" + description: Module demonstrating dependencies + + dependencies: + - name: apps + version: "0.1" + # A version-less dependency is valid only for modules not managed by deploy-tools. + - name: external-module + + applications: [] diff --git a/tests/configs/golden-master/05-restored/example-module-apps/0.1.yaml b/tests/configs/golden-master/05-restored/example-module-apps/0.1.yaml deleted file mode 100644 index 0a934518..00000000 --- a/tests/configs/golden-master/05-restored/example-module-apps/0.1.yaml +++ /dev/null @@ -1,37 +0,0 @@ -# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json - -module: - name: example-module-apps - version: "0.1" - description: Demonstration of a module configuration folder - - env_vars: - - name: OTHER_VALUE - value: Version 0.1 - - applications: - - app_type: apptainer - - container: - path: docker://ghcr.io/apptainer/lolcow - version: latest - - entrypoints: - - name: cowsay-hello - command: cowsay - options: - command_args: Hello - - - app_type: shell - - name: test-echo-module-var - script: - - echo $OTHER_VALUE - - - app_type: shell - - name: test-shell-script - script: - - "echo This is the first line of a shell script" - - "echo and this is the second line." - - "echo Your input is ${1}" diff --git a/tests/configs/golden-master/05-restored/example-module-deps/0.2.yaml b/tests/configs/golden-master/05-restored/example-module-deps/0.2.yaml deleted file mode 100644 index e327b454..00000000 --- a/tests/configs/golden-master/05-restored/example-module-deps/0.2.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json - -module: - name: example-module-deps - version: "0.2" - description: Demonstration of deploy-tools dependencies - - dependencies: - - name: example-module-apps - version: "0.1" - - applications: [] - -# Mark this release as deprecated: its modulefile link moves into the deprecated area -# while the built module remains available, as a precursor to full removal. -deprecated: true diff --git a/tests/configs/golden-master/05-restored/example-module-extra/1.0.yaml b/tests/configs/golden-master/05-restored/example-module-extra/1.0.yaml deleted file mode 100644 index 7e2ad635..00000000 --- a/tests/configs/golden-master/05-restored/example-module-extra/1.0.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json - -module: - name: example-module-extra - version: "1.0" - description: Demonstration of adding a module in a later sync - - env_vars: - - name: EXTRA_VALUE - value: Updated in a later sync - - applications: - - app_type: shell - - name: test-extra-echo - script: - - echo $EXTRA_VALUE - - allow_updates: true diff --git a/tests/configs/golden-master/05-restored/updatable/1.0.yaml b/tests/configs/golden-master/05-restored/updatable/1.0.yaml new file mode 100644 index 00000000..72dc3cd5 --- /dev/null +++ b/tests/configs/golden-master/05-restored/updatable/1.0.yaml @@ -0,0 +1,20 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: updatable + version: "1.0" + description: Module demonstrating in-place updates (allow_updates) + + env_vars: + - name: UPDATABLE_VALUE + # Changing this value (permitted by allow_updates) triggers an in-place update. + value: Updated in a later sync + + applications: + - app_type: shell + + name: test-updatable-echo + script: + - echo $UPDATABLE_VALUE + + allow_updates: true diff --git a/tests/configs/golden-master/05-restored/versions/1.0.yaml b/tests/configs/golden-master/05-restored/versions/1.0.yaml new file mode 100644 index 00000000..2a4216d6 --- /dev/null +++ b/tests/configs/golden-master/05-restored/versions/1.0.yaml @@ -0,0 +1,10 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: versions + version: "1.0" + description: Module demonstrating multiple versions and default-version selection + + applications: [] + +deprecated: true diff --git a/tests/configs/golden-master/05-restored/versions/2.0.yaml b/tests/configs/golden-master/05-restored/versions/2.0.yaml new file mode 100644 index 00000000..ff7bc941 --- /dev/null +++ b/tests/configs/golden-master/05-restored/versions/2.0.yaml @@ -0,0 +1,8 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: versions + version: "2.0" + description: Module demonstrating multiple versions and default-version selection + + applications: [] diff --git a/tests/configs/golden-master/05-restored/versions/2.1rc1.yaml b/tests/configs/golden-master/05-restored/versions/2.1rc1.yaml new file mode 100644 index 00000000..64cd4eed --- /dev/null +++ b/tests/configs/golden-master/05-restored/versions/2.1rc1.yaml @@ -0,0 +1,12 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: versions + version: "2.1rc1" + description: Module demonstrating multiple versions and default-version selection + + # Excluded from automatic default selection, so the default stays at the latest + # stable version even though this prerelease sorts higher. + exclude_from_defaults: true + + applications: [] diff --git a/tests/configs/golden-master/06-removed/apps/0.1.yaml b/tests/configs/golden-master/06-removed/apps/0.1.yaml new file mode 100644 index 00000000..53930c4e --- /dev/null +++ b/tests/configs/golden-master/06-removed/apps/0.1.yaml @@ -0,0 +1,37 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: apps + version: "0.1" + description: Module demonstrating shell and Apptainer applications + + env_vars: + - name: OTHER_VALUE + value: Version 0.1 + + applications: + - app_type: apptainer + + container: + path: docker://ghcr.io/apptainer/lolcow + version: latest + + entrypoints: + - name: cowsay-hello + command: cowsay + options: + command_args: Hello + + - app_type: shell + + name: test-echo-module-var + script: + - echo $OTHER_VALUE + + - app_type: shell + + name: test-shell-script + script: + - "echo This is the first line of a shell script" + - "echo and this is the second line." + - "echo Your input is ${1}" diff --git a/tests/configs/golden-master/06-removed/deps/0.2.yaml b/tests/configs/golden-master/06-removed/deps/0.2.yaml new file mode 100644 index 00000000..2556b79f --- /dev/null +++ b/tests/configs/golden-master/06-removed/deps/0.2.yaml @@ -0,0 +1,14 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: deps + version: "0.2" + description: Module demonstrating dependencies + + dependencies: + - name: apps + version: "0.1" + # A version-less dependency is valid only for modules not managed by deploy-tools. + - name: external-module + + applications: [] diff --git a/tests/configs/golden-master/06-removed/example-module-apps/0.1.yaml b/tests/configs/golden-master/06-removed/example-module-apps/0.1.yaml deleted file mode 100644 index 0a934518..00000000 --- a/tests/configs/golden-master/06-removed/example-module-apps/0.1.yaml +++ /dev/null @@ -1,37 +0,0 @@ -# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json - -module: - name: example-module-apps - version: "0.1" - description: Demonstration of a module configuration folder - - env_vars: - - name: OTHER_VALUE - value: Version 0.1 - - applications: - - app_type: apptainer - - container: - path: docker://ghcr.io/apptainer/lolcow - version: latest - - entrypoints: - - name: cowsay-hello - command: cowsay - options: - command_args: Hello - - - app_type: shell - - name: test-echo-module-var - script: - - echo $OTHER_VALUE - - - app_type: shell - - name: test-shell-script - script: - - "echo This is the first line of a shell script" - - "echo and this is the second line." - - "echo Your input is ${1}" diff --git a/tests/configs/golden-master/06-removed/example-module-extra/1.0.yaml b/tests/configs/golden-master/06-removed/example-module-extra/1.0.yaml deleted file mode 100644 index 7e2ad635..00000000 --- a/tests/configs/golden-master/06-removed/example-module-extra/1.0.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json - -module: - name: example-module-extra - version: "1.0" - description: Demonstration of adding a module in a later sync - - env_vars: - - name: EXTRA_VALUE - value: Updated in a later sync - - applications: - - app_type: shell - - name: test-extra-echo - script: - - echo $EXTRA_VALUE - - allow_updates: true diff --git a/tests/configs/golden-master/06-removed/updatable/1.0.yaml b/tests/configs/golden-master/06-removed/updatable/1.0.yaml new file mode 100644 index 00000000..72dc3cd5 --- /dev/null +++ b/tests/configs/golden-master/06-removed/updatable/1.0.yaml @@ -0,0 +1,20 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: updatable + version: "1.0" + description: Module demonstrating in-place updates (allow_updates) + + env_vars: + - name: UPDATABLE_VALUE + # Changing this value (permitted by allow_updates) triggers an in-place update. + value: Updated in a later sync + + applications: + - app_type: shell + + name: test-updatable-echo + script: + - echo $UPDATABLE_VALUE + + allow_updates: true diff --git a/tests/configs/golden-master/06-removed/versions/2.0.yaml b/tests/configs/golden-master/06-removed/versions/2.0.yaml new file mode 100644 index 00000000..ff7bc941 --- /dev/null +++ b/tests/configs/golden-master/06-removed/versions/2.0.yaml @@ -0,0 +1,8 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: versions + version: "2.0" + description: Module demonstrating multiple versions and default-version selection + + applications: [] diff --git a/tests/configs/golden-master/06-removed/versions/2.1rc1.yaml b/tests/configs/golden-master/06-removed/versions/2.1rc1.yaml new file mode 100644 index 00000000..64cd4eed --- /dev/null +++ b/tests/configs/golden-master/06-removed/versions/2.1rc1.yaml @@ -0,0 +1,12 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: versions + version: "2.1rc1" + description: Module demonstrating multiple versions and default-version selection + + # Excluded from automatic default selection, so the default stays at the latest + # stable version even though this prerelease sorts higher. + exclude_from_defaults: true + + applications: [] diff --git a/tests/generate_samples.sh b/tests/generate_samples.sh index 0837c051..14924c28 100755 --- a/tests/generate_samples.sh +++ b/tests/generate_samples.sh @@ -44,34 +44,34 @@ capture_validate () { # The lifecycle stages share a single deployment area and must run in order, as # each stage builds on the previous deployment state. Only the first sync -# uses --from-scratch. +# uses --from-scratch. See tests/test_golden_master.py for what each stage demonstrates. -# Stage 1: deploy the initial configuration into an empty area. +# Stage 1 capture_validate 01-initial --from-scratch deploy-tools sync --from-scratch "${TMP_DIR}" "${GM_CONFIGS_DIR}/01-initial" save_sample 01-initial -# Stage 2: add a new module (example-module-extra/1.0) on an incremental sync. +# Stage 2 capture_validate 02-added deploy-tools sync "${TMP_DIR}" "${GM_CONFIGS_DIR}/02-added" save_sample 02-added -# Stage 3: update example-module-extra/1.0 in place (allowed via allow_updates). +# Stage 3 capture_validate 03-updated deploy-tools sync "${TMP_DIR}" "${GM_CONFIGS_DIR}/03-updated" save_sample 03-updated -# Stage 4: deprecate example-module-deps/0.2 and example-module-extra/1.0. +# Stage 4 capture_validate 04-deprecated deploy-tools sync "${TMP_DIR}" "${GM_CONFIGS_DIR}/04-deprecated" save_sample 04-deprecated -# Stage 5: restore (un-deprecate) example-module-extra/1.0. +# Stage 5 capture_validate 05-restored deploy-tools sync "${TMP_DIR}" "${GM_CONFIGS_DIR}/05-restored" save_sample 05-restored -# Stage 6: remove the now-deprecated example-module-deps/0.2 entirely. +# Stage 6 capture_validate 06-removed deploy-tools sync "${TMP_DIR}" "${GM_CONFIGS_DIR}/06-removed" save_sample 06-removed diff --git a/tests/samples/01-initial/deploy-tools-output/deployment.yaml b/tests/samples/01-initial/deploy-tools-output/deployment.yaml index f33dff7d..30b44d83 100644 --- a/tests/samples/01-initial/deploy-tools-output/deployment.yaml +++ b/tests/samples/01-initial/deploy-tools-output/deployment.yaml @@ -1,5 +1,5 @@ releases: - example-module-apps: + apps: '0.1': deprecated: false module: @@ -33,30 +33,46 @@ releases: - echo and this is the second line. - echo Your input is ${1} dependencies: [] - description: Demonstration of a module configuration folder + description: Module demonstrating shell and Apptainer applications env_vars: - name: OTHER_VALUE value: Version 0.1 exclude_from_defaults: false load_script: [] - name: example-module-apps + name: apps unload_script: [] version: '0.1' - example-module-deps: + deps: '0.2': deprecated: false module: allow_updates: false applications: [] dependencies: - - name: example-module-apps + - name: apps version: '0.1' - description: Demonstration of deploy-tools dependencies + - name: external-module + version: null + description: Module demonstrating dependencies env_vars: [] exclude_from_defaults: false load_script: [] - name: example-module-deps + name: deps unload_script: [] version: '0.2' + versions: + '1.0': + deprecated: false + module: + allow_updates: false + applications: [] + dependencies: [] + description: Module demonstrating multiple versions and default-version selection + env_vars: [] + exclude_from_defaults: false + load_script: [] + name: versions + unload_script: [] + version: '1.0' settings: default_versions: {} diff --git a/tests/samples/01-initial/deploy-tools-output/modulefiles/example-module-apps/.version b/tests/samples/01-initial/deploy-tools-output/modulefiles/apps/.version similarity index 100% rename from tests/samples/01-initial/deploy-tools-output/modulefiles/example-module-apps/.version rename to tests/samples/01-initial/deploy-tools-output/modulefiles/apps/.version diff --git a/tests/samples/01-initial/deploy-tools-output/modulefiles/apps/0.1 b/tests/samples/01-initial/deploy-tools-output/modulefiles/apps/0.1 new file mode 120000 index 00000000..69615f97 --- /dev/null +++ b/tests/samples/01-initial/deploy-tools-output/modulefiles/apps/0.1 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/apps/0.1/modulefile \ No newline at end of file diff --git a/tests/samples/01-initial/deploy-tools-output/modulefiles/example-module-deps/.version b/tests/samples/01-initial/deploy-tools-output/modulefiles/deps/.version similarity index 100% rename from tests/samples/01-initial/deploy-tools-output/modulefiles/example-module-deps/.version rename to tests/samples/01-initial/deploy-tools-output/modulefiles/deps/.version diff --git a/tests/samples/01-initial/deploy-tools-output/modulefiles/deps/0.2 b/tests/samples/01-initial/deploy-tools-output/modulefiles/deps/0.2 new file mode 120000 index 00000000..5d82a765 --- /dev/null +++ b/tests/samples/01-initial/deploy-tools-output/modulefiles/deps/0.2 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/deps/0.2/modulefile \ No newline at end of file diff --git a/tests/samples/01-initial/deploy-tools-output/modulefiles/example-module-apps/0.1 b/tests/samples/01-initial/deploy-tools-output/modulefiles/example-module-apps/0.1 deleted file mode 120000 index 53b90576..00000000 --- a/tests/samples/01-initial/deploy-tools-output/modulefiles/example-module-apps/0.1 +++ /dev/null @@ -1 +0,0 @@ -/tmp/deploy-tools-output/modules/example-module-apps/0.1/modulefile \ No newline at end of file diff --git a/tests/samples/01-initial/deploy-tools-output/modulefiles/example-module-deps/0.2 b/tests/samples/01-initial/deploy-tools-output/modulefiles/example-module-deps/0.2 deleted file mode 120000 index cd04ecdf..00000000 --- a/tests/samples/01-initial/deploy-tools-output/modulefiles/example-module-deps/0.2 +++ /dev/null @@ -1 +0,0 @@ -/tmp/deploy-tools-output/modules/example-module-deps/0.2/modulefile \ No newline at end of file diff --git a/tests/samples/02-added/deploy-tools-output/modulefiles/example-module-extra/.version b/tests/samples/01-initial/deploy-tools-output/modulefiles/versions/.version similarity index 100% rename from tests/samples/02-added/deploy-tools-output/modulefiles/example-module-extra/.version rename to tests/samples/01-initial/deploy-tools-output/modulefiles/versions/.version diff --git a/tests/samples/01-initial/deploy-tools-output/modulefiles/versions/1.0 b/tests/samples/01-initial/deploy-tools-output/modulefiles/versions/1.0 new file mode 120000 index 00000000..88618ed2 --- /dev/null +++ b/tests/samples/01-initial/deploy-tools-output/modulefiles/versions/1.0 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/versions/1.0/modulefile \ No newline at end of file diff --git a/tests/samples/01-initial/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello b/tests/samples/01-initial/deploy-tools-output/modules/apps/0.1/entrypoints/cowsay-hello similarity index 100% rename from tests/samples/01-initial/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello rename to tests/samples/01-initial/deploy-tools-output/modules/apps/0.1/entrypoints/cowsay-hello diff --git a/tests/samples/01-initial/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var b/tests/samples/01-initial/deploy-tools-output/modules/apps/0.1/entrypoints/test-echo-module-var similarity index 100% rename from tests/samples/01-initial/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var rename to tests/samples/01-initial/deploy-tools-output/modules/apps/0.1/entrypoints/test-echo-module-var diff --git a/tests/samples/01-initial/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script b/tests/samples/01-initial/deploy-tools-output/modules/apps/0.1/entrypoints/test-shell-script similarity index 100% rename from tests/samples/01-initial/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script rename to tests/samples/01-initial/deploy-tools-output/modules/apps/0.1/entrypoints/test-shell-script diff --git a/tests/samples/01-initial/deploy-tools-output/modules/example-module-apps/0.1/module.yaml b/tests/samples/01-initial/deploy-tools-output/modules/apps/0.1/module.yaml similarity index 90% rename from tests/samples/01-initial/deploy-tools-output/modules/example-module-apps/0.1/module.yaml rename to tests/samples/01-initial/deploy-tools-output/modules/apps/0.1/module.yaml index 51a06102..60d6f708 100644 --- a/tests/samples/01-initial/deploy-tools-output/modules/example-module-apps/0.1/module.yaml +++ b/tests/samples/01-initial/deploy-tools-output/modules/apps/0.1/module.yaml @@ -28,12 +28,12 @@ applications: - echo and this is the second line. - echo Your input is ${1} dependencies: [] -description: Demonstration of a module configuration folder +description: Module demonstrating shell and Apptainer applications env_vars: - name: OTHER_VALUE value: Version 0.1 exclude_from_defaults: false load_script: [] -name: example-module-apps +name: apps unload_script: [] version: '0.1' diff --git a/tests/samples/01-initial/deploy-tools-output/modules/apps/0.1/modulefile b/tests/samples/01-initial/deploy-tools-output/modules/apps/0.1/modulefile new file mode 100644 index 00000000..9aefe70f --- /dev/null +++ b/tests/samples/01-initial/deploy-tools-output/modules/apps/0.1/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## apps - Module demonstrating shell and Apptainer applications +## +module-whatis "Module demonstrating shell and Apptainer applications" + +if { [module-info mode load] } { + if { [is-loaded apps] } { + module unload apps + } +} + +setenv OTHER_VALUE "Version 0.1" + +prepend-path PATH "/tmp/deploy-tools-output/modules/apps/0.1/entrypoints" diff --git a/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-deps/0.2/module.yaml b/tests/samples/01-initial/deploy-tools-output/modules/deps/0.2/module.yaml similarity index 59% rename from tests/samples/04-deprecated/deploy-tools-output/modules/example-module-deps/0.2/module.yaml rename to tests/samples/01-initial/deploy-tools-output/modules/deps/0.2/module.yaml index 0765b12f..641f01a8 100644 --- a/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-deps/0.2/module.yaml +++ b/tests/samples/01-initial/deploy-tools-output/modules/deps/0.2/module.yaml @@ -1,12 +1,14 @@ allow_updates: false applications: [] dependencies: -- name: example-module-apps +- name: apps version: '0.1' -description: Demonstration of deploy-tools dependencies +- name: external-module + version: null +description: Module demonstrating dependencies env_vars: [] exclude_from_defaults: false load_script: [] -name: example-module-deps +name: deps unload_script: [] version: '0.2' diff --git a/tests/samples/01-initial/deploy-tools-output/modules/deps/0.2/modulefile b/tests/samples/01-initial/deploy-tools-output/modules/deps/0.2/modulefile new file mode 100644 index 00000000..56e10614 --- /dev/null +++ b/tests/samples/01-initial/deploy-tools-output/modules/deps/0.2/modulefile @@ -0,0 +1,16 @@ +#%Module1.0 +## +## deps - Module demonstrating dependencies +## +module-whatis "Module demonstrating dependencies" + +if { [module-info mode load] } { + if { [is-loaded deps] } { + module unload deps + } +} + +module load apps/0.1 +module load external-module + +prepend-path PATH "/tmp/deploy-tools-output/modules/deps/0.2/entrypoints" diff --git a/tests/samples/01-initial/deploy-tools-output/modules/example-module-apps/0.1/modulefile b/tests/samples/01-initial/deploy-tools-output/modules/example-module-apps/0.1/modulefile deleted file mode 100644 index b6458983..00000000 --- a/tests/samples/01-initial/deploy-tools-output/modules/example-module-apps/0.1/modulefile +++ /dev/null @@ -1,15 +0,0 @@ -#%Module1.0 -## -## example-module-apps - Demonstration of a module configuration folder -## -module-whatis "Demonstration of a module configuration folder" - -if { [module-info mode load] } { - if { [is-loaded example-module-apps] } { - module unload example-module-apps - } -} - -setenv OTHER_VALUE "Version 0.1" - -prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-apps/0.1/entrypoints" diff --git a/tests/samples/01-initial/deploy-tools-output/modules/example-module-deps/0.2/modulefile b/tests/samples/01-initial/deploy-tools-output/modules/example-module-deps/0.2/modulefile deleted file mode 100644 index a4fbe508..00000000 --- a/tests/samples/01-initial/deploy-tools-output/modules/example-module-deps/0.2/modulefile +++ /dev/null @@ -1,15 +0,0 @@ -#%Module1.0 -## -## example-module-deps - Demonstration of deploy-tools dependencies -## -module-whatis "Demonstration of deploy-tools dependencies" - -if { [module-info mode load] } { - if { [is-loaded example-module-deps] } { - module unload example-module-deps - } -} - -module load example-module-apps/0.1 - -prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-deps/0.2/entrypoints" diff --git a/tests/samples/01-initial/deploy-tools-output/modules/versions/1.0/module.yaml b/tests/samples/01-initial/deploy-tools-output/modules/versions/1.0/module.yaml new file mode 100644 index 00000000..d77ef37a --- /dev/null +++ b/tests/samples/01-initial/deploy-tools-output/modules/versions/1.0/module.yaml @@ -0,0 +1,10 @@ +allow_updates: false +applications: [] +dependencies: [] +description: Module demonstrating multiple versions and default-version selection +env_vars: [] +exclude_from_defaults: false +load_script: [] +name: versions +unload_script: [] +version: '1.0' diff --git a/tests/samples/01-initial/deploy-tools-output/modules/versions/1.0/modulefile b/tests/samples/01-initial/deploy-tools-output/modules/versions/1.0/modulefile new file mode 100644 index 00000000..e9a94d5a --- /dev/null +++ b/tests/samples/01-initial/deploy-tools-output/modules/versions/1.0/modulefile @@ -0,0 +1,13 @@ +#%Module1.0 +## +## versions - Module demonstrating multiple versions and default-version selection +## +module-whatis "Module demonstrating multiple versions and default-version selection" + +if { [module-info mode load] } { + if { [is-loaded versions] } { + module unload versions + } +} + +prepend-path PATH "/tmp/deploy-tools-output/modules/versions/1.0/entrypoints" diff --git a/tests/samples/01-initial/validate.txt b/tests/samples/01-initial/validate.txt index b843b82d..a8729330 100644 --- a/tests/samples/01-initial/validate.txt +++ b/tests/samples/01-initial/validate.txt @@ -1,7 +1,9 @@ Modules to be deployed: -example-module-apps/0.1 -example-module-deps/0.2 +apps/0.1 +deps/0.2 +versions/1.0 Updated module defaults: -example-module-apps None -> 0.1 -example-module-deps None -> 0.2 +apps None -> 0.1 +deps None -> 0.2 +versions None -> 1.0 diff --git a/tests/samples/02-added/deploy-tools-output/deployment.yaml b/tests/samples/02-added/deploy-tools-output/deployment.yaml index 2097eb13..82f81d17 100644 --- a/tests/samples/02-added/deploy-tools-output/deployment.yaml +++ b/tests/samples/02-added/deploy-tools-output/deployment.yaml @@ -1,5 +1,5 @@ releases: - example-module-apps: + apps: '0.1': deprecated: false module: @@ -33,50 +33,79 @@ releases: - echo and this is the second line. - echo Your input is ${1} dependencies: [] - description: Demonstration of a module configuration folder + description: Module demonstrating shell and Apptainer applications env_vars: - name: OTHER_VALUE value: Version 0.1 exclude_from_defaults: false load_script: [] - name: example-module-apps + name: apps unload_script: [] version: '0.1' - example-module-deps: + deps: '0.2': deprecated: false module: allow_updates: false applications: [] dependencies: - - name: example-module-apps + - name: apps version: '0.1' - description: Demonstration of deploy-tools dependencies + - name: external-module + version: null + description: Module demonstrating dependencies env_vars: [] exclude_from_defaults: false load_script: [] - name: example-module-deps + name: deps unload_script: [] version: '0.2' - example-module-extra: + updatable: '1.0': deprecated: false module: allow_updates: true applications: - app_type: shell - name: test-extra-echo + name: test-updatable-echo script: - - echo $EXTRA_VALUE + - echo $UPDATABLE_VALUE dependencies: [] - description: Demonstration of adding a module in a later sync + description: Module demonstrating in-place updates (allow_updates) env_vars: - - name: EXTRA_VALUE + - name: UPDATABLE_VALUE value: Added after initial deployment exclude_from_defaults: false load_script: [] - name: example-module-extra + name: updatable unload_script: [] version: '1.0' + versions: + '1.0': + deprecated: false + module: + allow_updates: false + applications: [] + dependencies: [] + description: Module demonstrating multiple versions and default-version selection + env_vars: [] + exclude_from_defaults: false + load_script: [] + name: versions + unload_script: [] + version: '1.0' + '2.0': + deprecated: false + module: + allow_updates: false + applications: [] + dependencies: [] + description: Module demonstrating multiple versions and default-version selection + env_vars: [] + exclude_from_defaults: false + load_script: [] + name: versions + unload_script: [] + version: '2.0' settings: default_versions: {} diff --git a/tests/samples/02-added/deploy-tools-output/modulefiles/example-module-apps/.version b/tests/samples/02-added/deploy-tools-output/modulefiles/apps/.version similarity index 100% rename from tests/samples/02-added/deploy-tools-output/modulefiles/example-module-apps/.version rename to tests/samples/02-added/deploy-tools-output/modulefiles/apps/.version diff --git a/tests/samples/02-added/deploy-tools-output/modulefiles/apps/0.1 b/tests/samples/02-added/deploy-tools-output/modulefiles/apps/0.1 new file mode 120000 index 00000000..69615f97 --- /dev/null +++ b/tests/samples/02-added/deploy-tools-output/modulefiles/apps/0.1 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/apps/0.1/modulefile \ No newline at end of file diff --git a/tests/samples/02-added/deploy-tools-output/modulefiles/example-module-deps/.version b/tests/samples/02-added/deploy-tools-output/modulefiles/deps/.version similarity index 100% rename from tests/samples/02-added/deploy-tools-output/modulefiles/example-module-deps/.version rename to tests/samples/02-added/deploy-tools-output/modulefiles/deps/.version diff --git a/tests/samples/02-added/deploy-tools-output/modulefiles/deps/0.2 b/tests/samples/02-added/deploy-tools-output/modulefiles/deps/0.2 new file mode 120000 index 00000000..5d82a765 --- /dev/null +++ b/tests/samples/02-added/deploy-tools-output/modulefiles/deps/0.2 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/deps/0.2/modulefile \ No newline at end of file diff --git a/tests/samples/02-added/deploy-tools-output/modulefiles/example-module-apps/0.1 b/tests/samples/02-added/deploy-tools-output/modulefiles/example-module-apps/0.1 deleted file mode 120000 index 53b90576..00000000 --- a/tests/samples/02-added/deploy-tools-output/modulefiles/example-module-apps/0.1 +++ /dev/null @@ -1 +0,0 @@ -/tmp/deploy-tools-output/modules/example-module-apps/0.1/modulefile \ No newline at end of file diff --git a/tests/samples/02-added/deploy-tools-output/modulefiles/example-module-deps/0.2 b/tests/samples/02-added/deploy-tools-output/modulefiles/example-module-deps/0.2 deleted file mode 120000 index cd04ecdf..00000000 --- a/tests/samples/02-added/deploy-tools-output/modulefiles/example-module-deps/0.2 +++ /dev/null @@ -1 +0,0 @@ -/tmp/deploy-tools-output/modules/example-module-deps/0.2/modulefile \ No newline at end of file diff --git a/tests/samples/02-added/deploy-tools-output/modulefiles/example-module-extra/1.0 b/tests/samples/02-added/deploy-tools-output/modulefiles/example-module-extra/1.0 deleted file mode 120000 index 59949819..00000000 --- a/tests/samples/02-added/deploy-tools-output/modulefiles/example-module-extra/1.0 +++ /dev/null @@ -1 +0,0 @@ -/tmp/deploy-tools-output/modules/example-module-extra/1.0/modulefile \ No newline at end of file diff --git a/tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-extra/.version b/tests/samples/02-added/deploy-tools-output/modulefiles/updatable/.version similarity index 100% rename from tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-extra/.version rename to tests/samples/02-added/deploy-tools-output/modulefiles/updatable/.version diff --git a/tests/samples/02-added/deploy-tools-output/modulefiles/updatable/1.0 b/tests/samples/02-added/deploy-tools-output/modulefiles/updatable/1.0 new file mode 120000 index 00000000..bd2fb2bd --- /dev/null +++ b/tests/samples/02-added/deploy-tools-output/modulefiles/updatable/1.0 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/updatable/1.0/modulefile \ No newline at end of file diff --git a/tests/samples/02-added/deploy-tools-output/modulefiles/versions/.version b/tests/samples/02-added/deploy-tools-output/modulefiles/versions/.version new file mode 100644 index 00000000..5d5fbb68 --- /dev/null +++ b/tests/samples/02-added/deploy-tools-output/modulefiles/versions/.version @@ -0,0 +1,2 @@ +#%Module1.0 +set ModulesVersion 2.0 diff --git a/tests/samples/02-added/deploy-tools-output/modulefiles/versions/1.0 b/tests/samples/02-added/deploy-tools-output/modulefiles/versions/1.0 new file mode 120000 index 00000000..88618ed2 --- /dev/null +++ b/tests/samples/02-added/deploy-tools-output/modulefiles/versions/1.0 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/versions/1.0/modulefile \ No newline at end of file diff --git a/tests/samples/02-added/deploy-tools-output/modulefiles/versions/2.0 b/tests/samples/02-added/deploy-tools-output/modulefiles/versions/2.0 new file mode 120000 index 00000000..b0c4f475 --- /dev/null +++ b/tests/samples/02-added/deploy-tools-output/modulefiles/versions/2.0 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/versions/2.0/modulefile \ No newline at end of file diff --git a/tests/samples/02-added/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello b/tests/samples/02-added/deploy-tools-output/modules/apps/0.1/entrypoints/cowsay-hello similarity index 100% rename from tests/samples/02-added/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello rename to tests/samples/02-added/deploy-tools-output/modules/apps/0.1/entrypoints/cowsay-hello diff --git a/tests/samples/02-added/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var b/tests/samples/02-added/deploy-tools-output/modules/apps/0.1/entrypoints/test-echo-module-var similarity index 100% rename from tests/samples/02-added/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var rename to tests/samples/02-added/deploy-tools-output/modules/apps/0.1/entrypoints/test-echo-module-var diff --git a/tests/samples/02-added/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script b/tests/samples/02-added/deploy-tools-output/modules/apps/0.1/entrypoints/test-shell-script similarity index 100% rename from tests/samples/02-added/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script rename to tests/samples/02-added/deploy-tools-output/modules/apps/0.1/entrypoints/test-shell-script diff --git a/tests/samples/03-updated/deploy-tools-output/modules/example-module-apps/0.1/module.yaml b/tests/samples/02-added/deploy-tools-output/modules/apps/0.1/module.yaml similarity index 90% rename from tests/samples/03-updated/deploy-tools-output/modules/example-module-apps/0.1/module.yaml rename to tests/samples/02-added/deploy-tools-output/modules/apps/0.1/module.yaml index 51a06102..60d6f708 100644 --- a/tests/samples/03-updated/deploy-tools-output/modules/example-module-apps/0.1/module.yaml +++ b/tests/samples/02-added/deploy-tools-output/modules/apps/0.1/module.yaml @@ -28,12 +28,12 @@ applications: - echo and this is the second line. - echo Your input is ${1} dependencies: [] -description: Demonstration of a module configuration folder +description: Module demonstrating shell and Apptainer applications env_vars: - name: OTHER_VALUE value: Version 0.1 exclude_from_defaults: false load_script: [] -name: example-module-apps +name: apps unload_script: [] version: '0.1' diff --git a/tests/samples/02-added/deploy-tools-output/modules/apps/0.1/modulefile b/tests/samples/02-added/deploy-tools-output/modules/apps/0.1/modulefile new file mode 100644 index 00000000..9aefe70f --- /dev/null +++ b/tests/samples/02-added/deploy-tools-output/modules/apps/0.1/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## apps - Module demonstrating shell and Apptainer applications +## +module-whatis "Module demonstrating shell and Apptainer applications" + +if { [module-info mode load] } { + if { [is-loaded apps] } { + module unload apps + } +} + +setenv OTHER_VALUE "Version 0.1" + +prepend-path PATH "/tmp/deploy-tools-output/modules/apps/0.1/entrypoints" diff --git a/tests/samples/01-initial/deploy-tools-output/modules/example-module-deps/0.2/module.yaml b/tests/samples/02-added/deploy-tools-output/modules/deps/0.2/module.yaml similarity index 59% rename from tests/samples/01-initial/deploy-tools-output/modules/example-module-deps/0.2/module.yaml rename to tests/samples/02-added/deploy-tools-output/modules/deps/0.2/module.yaml index 0765b12f..641f01a8 100644 --- a/tests/samples/01-initial/deploy-tools-output/modules/example-module-deps/0.2/module.yaml +++ b/tests/samples/02-added/deploy-tools-output/modules/deps/0.2/module.yaml @@ -1,12 +1,14 @@ allow_updates: false applications: [] dependencies: -- name: example-module-apps +- name: apps version: '0.1' -description: Demonstration of deploy-tools dependencies +- name: external-module + version: null +description: Module demonstrating dependencies env_vars: [] exclude_from_defaults: false load_script: [] -name: example-module-deps +name: deps unload_script: [] version: '0.2' diff --git a/tests/samples/02-added/deploy-tools-output/modules/deps/0.2/modulefile b/tests/samples/02-added/deploy-tools-output/modules/deps/0.2/modulefile new file mode 100644 index 00000000..56e10614 --- /dev/null +++ b/tests/samples/02-added/deploy-tools-output/modules/deps/0.2/modulefile @@ -0,0 +1,16 @@ +#%Module1.0 +## +## deps - Module demonstrating dependencies +## +module-whatis "Module demonstrating dependencies" + +if { [module-info mode load] } { + if { [is-loaded deps] } { + module unload deps + } +} + +module load apps/0.1 +module load external-module + +prepend-path PATH "/tmp/deploy-tools-output/modules/deps/0.2/entrypoints" diff --git a/tests/samples/02-added/deploy-tools-output/modules/example-module-apps/0.1/modulefile b/tests/samples/02-added/deploy-tools-output/modules/example-module-apps/0.1/modulefile deleted file mode 100644 index b6458983..00000000 --- a/tests/samples/02-added/deploy-tools-output/modules/example-module-apps/0.1/modulefile +++ /dev/null @@ -1,15 +0,0 @@ -#%Module1.0 -## -## example-module-apps - Demonstration of a module configuration folder -## -module-whatis "Demonstration of a module configuration folder" - -if { [module-info mode load] } { - if { [is-loaded example-module-apps] } { - module unload example-module-apps - } -} - -setenv OTHER_VALUE "Version 0.1" - -prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-apps/0.1/entrypoints" diff --git a/tests/samples/02-added/deploy-tools-output/modules/example-module-deps/0.2/modulefile b/tests/samples/02-added/deploy-tools-output/modules/example-module-deps/0.2/modulefile deleted file mode 100644 index a4fbe508..00000000 --- a/tests/samples/02-added/deploy-tools-output/modules/example-module-deps/0.2/modulefile +++ /dev/null @@ -1,15 +0,0 @@ -#%Module1.0 -## -## example-module-deps - Demonstration of deploy-tools dependencies -## -module-whatis "Demonstration of deploy-tools dependencies" - -if { [module-info mode load] } { - if { [is-loaded example-module-deps] } { - module unload example-module-deps - } -} - -module load example-module-apps/0.1 - -prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-deps/0.2/entrypoints" diff --git a/tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/modulefile b/tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/modulefile deleted file mode 100644 index 1f731a5b..00000000 --- a/tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/modulefile +++ /dev/null @@ -1,15 +0,0 @@ -#%Module1.0 -## -## example-module-extra - Demonstration of adding a module in a later sync -## -module-whatis "Demonstration of adding a module in a later sync" - -if { [module-info mode load] } { - if { [is-loaded example-module-extra] } { - module unload example-module-extra - } -} - -setenv EXTRA_VALUE "Added after initial deployment" - -prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-extra/1.0/entrypoints" diff --git a/tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo b/tests/samples/02-added/deploy-tools-output/modules/updatable/1.0/entrypoints/test-updatable-echo similarity index 76% rename from tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo rename to tests/samples/02-added/deploy-tools-output/modules/updatable/1.0/entrypoints/test-updatable-echo index 77e9301a..a384ba31 100755 --- a/tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo +++ b/tests/samples/02-added/deploy-tools-output/modules/updatable/1.0/entrypoints/test-updatable-echo @@ -4,4 +4,4 @@ if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then set -x fi -echo $EXTRA_VALUE +echo $UPDATABLE_VALUE diff --git a/tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/module.yaml b/tests/samples/02-added/deploy-tools-output/modules/updatable/1.0/module.yaml similarity index 56% rename from tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/module.yaml rename to tests/samples/02-added/deploy-tools-output/modules/updatable/1.0/module.yaml index b0c6e016..33e5701b 100644 --- a/tests/samples/02-added/deploy-tools-output/modules/example-module-extra/1.0/module.yaml +++ b/tests/samples/02-added/deploy-tools-output/modules/updatable/1.0/module.yaml @@ -1,16 +1,16 @@ allow_updates: true applications: - app_type: shell - name: test-extra-echo + name: test-updatable-echo script: - - echo $EXTRA_VALUE + - echo $UPDATABLE_VALUE dependencies: [] -description: Demonstration of adding a module in a later sync +description: Module demonstrating in-place updates (allow_updates) env_vars: -- name: EXTRA_VALUE +- name: UPDATABLE_VALUE value: Added after initial deployment exclude_from_defaults: false load_script: [] -name: example-module-extra +name: updatable unload_script: [] version: '1.0' diff --git a/tests/samples/02-added/deploy-tools-output/modules/updatable/1.0/modulefile b/tests/samples/02-added/deploy-tools-output/modules/updatable/1.0/modulefile new file mode 100644 index 00000000..48b9284a --- /dev/null +++ b/tests/samples/02-added/deploy-tools-output/modules/updatable/1.0/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## updatable - Module demonstrating in-place updates (allow_updates) +## +module-whatis "Module demonstrating in-place updates (allow_updates)" + +if { [module-info mode load] } { + if { [is-loaded updatable] } { + module unload updatable + } +} + +setenv UPDATABLE_VALUE "Added after initial deployment" + +prepend-path PATH "/tmp/deploy-tools-output/modules/updatable/1.0/entrypoints" diff --git a/tests/samples/02-added/deploy-tools-output/modules/versions/1.0/module.yaml b/tests/samples/02-added/deploy-tools-output/modules/versions/1.0/module.yaml new file mode 100644 index 00000000..d77ef37a --- /dev/null +++ b/tests/samples/02-added/deploy-tools-output/modules/versions/1.0/module.yaml @@ -0,0 +1,10 @@ +allow_updates: false +applications: [] +dependencies: [] +description: Module demonstrating multiple versions and default-version selection +env_vars: [] +exclude_from_defaults: false +load_script: [] +name: versions +unload_script: [] +version: '1.0' diff --git a/tests/samples/02-added/deploy-tools-output/modules/versions/1.0/modulefile b/tests/samples/02-added/deploy-tools-output/modules/versions/1.0/modulefile new file mode 100644 index 00000000..e9a94d5a --- /dev/null +++ b/tests/samples/02-added/deploy-tools-output/modules/versions/1.0/modulefile @@ -0,0 +1,13 @@ +#%Module1.0 +## +## versions - Module demonstrating multiple versions and default-version selection +## +module-whatis "Module demonstrating multiple versions and default-version selection" + +if { [module-info mode load] } { + if { [is-loaded versions] } { + module unload versions + } +} + +prepend-path PATH "/tmp/deploy-tools-output/modules/versions/1.0/entrypoints" diff --git a/tests/samples/02-added/deploy-tools-output/modules/versions/2.0/module.yaml b/tests/samples/02-added/deploy-tools-output/modules/versions/2.0/module.yaml new file mode 100644 index 00000000..470ad008 --- /dev/null +++ b/tests/samples/02-added/deploy-tools-output/modules/versions/2.0/module.yaml @@ -0,0 +1,10 @@ +allow_updates: false +applications: [] +dependencies: [] +description: Module demonstrating multiple versions and default-version selection +env_vars: [] +exclude_from_defaults: false +load_script: [] +name: versions +unload_script: [] +version: '2.0' diff --git a/tests/samples/02-added/deploy-tools-output/modules/versions/2.0/modulefile b/tests/samples/02-added/deploy-tools-output/modules/versions/2.0/modulefile new file mode 100644 index 00000000..0b0bd699 --- /dev/null +++ b/tests/samples/02-added/deploy-tools-output/modules/versions/2.0/modulefile @@ -0,0 +1,13 @@ +#%Module1.0 +## +## versions - Module demonstrating multiple versions and default-version selection +## +module-whatis "Module demonstrating multiple versions and default-version selection" + +if { [module-info mode load] } { + if { [is-loaded versions] } { + module unload versions + } +} + +prepend-path PATH "/tmp/deploy-tools-output/modules/versions/2.0/entrypoints" diff --git a/tests/samples/02-added/validate.txt b/tests/samples/02-added/validate.txt index 1daad81a..8dfaedb8 100644 --- a/tests/samples/02-added/validate.txt +++ b/tests/samples/02-added/validate.txt @@ -1,5 +1,7 @@ Modules to be deployed: -example-module-extra/1.0 +updatable/1.0 +versions/2.0 Updated module defaults: -example-module-extra None -> 1.0 +updatable None -> 1.0 +versions 1.0 -> 2.0 diff --git a/tests/samples/03-updated/deploy-tools-output/deployment.yaml b/tests/samples/03-updated/deploy-tools-output/deployment.yaml index b74eb428..d2064d23 100644 --- a/tests/samples/03-updated/deploy-tools-output/deployment.yaml +++ b/tests/samples/03-updated/deploy-tools-output/deployment.yaml @@ -1,5 +1,5 @@ releases: - example-module-apps: + apps: '0.1': deprecated: false module: @@ -33,50 +33,92 @@ releases: - echo and this is the second line. - echo Your input is ${1} dependencies: [] - description: Demonstration of a module configuration folder + description: Module demonstrating shell and Apptainer applications env_vars: - name: OTHER_VALUE value: Version 0.1 exclude_from_defaults: false load_script: [] - name: example-module-apps + name: apps unload_script: [] version: '0.1' - example-module-deps: + deps: '0.2': deprecated: false module: allow_updates: false applications: [] dependencies: - - name: example-module-apps + - name: apps version: '0.1' - description: Demonstration of deploy-tools dependencies + - name: external-module + version: null + description: Module demonstrating dependencies env_vars: [] exclude_from_defaults: false load_script: [] - name: example-module-deps + name: deps unload_script: [] version: '0.2' - example-module-extra: + updatable: '1.0': deprecated: false module: allow_updates: true applications: - app_type: shell - name: test-extra-echo + name: test-updatable-echo script: - - echo $EXTRA_VALUE + - echo $UPDATABLE_VALUE dependencies: [] - description: Demonstration of adding a module in a later sync + description: Module demonstrating in-place updates (allow_updates) env_vars: - - name: EXTRA_VALUE + - name: UPDATABLE_VALUE value: Updated in a later sync exclude_from_defaults: false load_script: [] - name: example-module-extra + name: updatable unload_script: [] version: '1.0' + versions: + '1.0': + deprecated: false + module: + allow_updates: false + applications: [] + dependencies: [] + description: Module demonstrating multiple versions and default-version selection + env_vars: [] + exclude_from_defaults: false + load_script: [] + name: versions + unload_script: [] + version: '1.0' + '2.0': + deprecated: false + module: + allow_updates: false + applications: [] + dependencies: [] + description: Module demonstrating multiple versions and default-version selection + env_vars: [] + exclude_from_defaults: false + load_script: [] + name: versions + unload_script: [] + version: '2.0' + 2.1rc1: + deprecated: false + module: + allow_updates: false + applications: [] + dependencies: [] + description: Module demonstrating multiple versions and default-version selection + env_vars: [] + exclude_from_defaults: true + load_script: [] + name: versions + unload_script: [] + version: 2.1rc1 settings: default_versions: {} diff --git a/tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-apps/.version b/tests/samples/03-updated/deploy-tools-output/modulefiles/apps/.version similarity index 100% rename from tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-apps/.version rename to tests/samples/03-updated/deploy-tools-output/modulefiles/apps/.version diff --git a/tests/samples/03-updated/deploy-tools-output/modulefiles/apps/0.1 b/tests/samples/03-updated/deploy-tools-output/modulefiles/apps/0.1 new file mode 120000 index 00000000..69615f97 --- /dev/null +++ b/tests/samples/03-updated/deploy-tools-output/modulefiles/apps/0.1 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/apps/0.1/modulefile \ No newline at end of file diff --git a/tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-deps/.version b/tests/samples/03-updated/deploy-tools-output/modulefiles/deps/.version similarity index 100% rename from tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-deps/.version rename to tests/samples/03-updated/deploy-tools-output/modulefiles/deps/.version diff --git a/tests/samples/03-updated/deploy-tools-output/modulefiles/deps/0.2 b/tests/samples/03-updated/deploy-tools-output/modulefiles/deps/0.2 new file mode 120000 index 00000000..5d82a765 --- /dev/null +++ b/tests/samples/03-updated/deploy-tools-output/modulefiles/deps/0.2 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/deps/0.2/modulefile \ No newline at end of file diff --git a/tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-apps/0.1 b/tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-apps/0.1 deleted file mode 120000 index 53b90576..00000000 --- a/tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-apps/0.1 +++ /dev/null @@ -1 +0,0 @@ -/tmp/deploy-tools-output/modules/example-module-apps/0.1/modulefile \ No newline at end of file diff --git a/tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-deps/0.2 b/tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-deps/0.2 deleted file mode 120000 index cd04ecdf..00000000 --- a/tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-deps/0.2 +++ /dev/null @@ -1 +0,0 @@ -/tmp/deploy-tools-output/modules/example-module-deps/0.2/modulefile \ No newline at end of file diff --git a/tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-extra/1.0 b/tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-extra/1.0 deleted file mode 120000 index 59949819..00000000 --- a/tests/samples/03-updated/deploy-tools-output/modulefiles/example-module-extra/1.0 +++ /dev/null @@ -1 +0,0 @@ -/tmp/deploy-tools-output/modules/example-module-extra/1.0/modulefile \ No newline at end of file diff --git a/tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-extra/.version b/tests/samples/03-updated/deploy-tools-output/modulefiles/updatable/.version similarity index 100% rename from tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-extra/.version rename to tests/samples/03-updated/deploy-tools-output/modulefiles/updatable/.version diff --git a/tests/samples/03-updated/deploy-tools-output/modulefiles/updatable/1.0 b/tests/samples/03-updated/deploy-tools-output/modulefiles/updatable/1.0 new file mode 120000 index 00000000..bd2fb2bd --- /dev/null +++ b/tests/samples/03-updated/deploy-tools-output/modulefiles/updatable/1.0 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/updatable/1.0/modulefile \ No newline at end of file diff --git a/tests/samples/03-updated/deploy-tools-output/modulefiles/versions/.version b/tests/samples/03-updated/deploy-tools-output/modulefiles/versions/.version new file mode 100644 index 00000000..5d5fbb68 --- /dev/null +++ b/tests/samples/03-updated/deploy-tools-output/modulefiles/versions/.version @@ -0,0 +1,2 @@ +#%Module1.0 +set ModulesVersion 2.0 diff --git a/tests/samples/03-updated/deploy-tools-output/modulefiles/versions/1.0 b/tests/samples/03-updated/deploy-tools-output/modulefiles/versions/1.0 new file mode 120000 index 00000000..88618ed2 --- /dev/null +++ b/tests/samples/03-updated/deploy-tools-output/modulefiles/versions/1.0 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/versions/1.0/modulefile \ No newline at end of file diff --git a/tests/samples/03-updated/deploy-tools-output/modulefiles/versions/2.0 b/tests/samples/03-updated/deploy-tools-output/modulefiles/versions/2.0 new file mode 120000 index 00000000..b0c4f475 --- /dev/null +++ b/tests/samples/03-updated/deploy-tools-output/modulefiles/versions/2.0 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/versions/2.0/modulefile \ No newline at end of file diff --git a/tests/samples/03-updated/deploy-tools-output/modulefiles/versions/2.1rc1 b/tests/samples/03-updated/deploy-tools-output/modulefiles/versions/2.1rc1 new file mode 120000 index 00000000..10b125b4 --- /dev/null +++ b/tests/samples/03-updated/deploy-tools-output/modulefiles/versions/2.1rc1 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/versions/2.1rc1/modulefile \ No newline at end of file diff --git a/tests/samples/03-updated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello b/tests/samples/03-updated/deploy-tools-output/modules/apps/0.1/entrypoints/cowsay-hello similarity index 100% rename from tests/samples/03-updated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello rename to tests/samples/03-updated/deploy-tools-output/modules/apps/0.1/entrypoints/cowsay-hello diff --git a/tests/samples/03-updated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var b/tests/samples/03-updated/deploy-tools-output/modules/apps/0.1/entrypoints/test-echo-module-var similarity index 100% rename from tests/samples/03-updated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var rename to tests/samples/03-updated/deploy-tools-output/modules/apps/0.1/entrypoints/test-echo-module-var diff --git a/tests/samples/03-updated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script b/tests/samples/03-updated/deploy-tools-output/modules/apps/0.1/entrypoints/test-shell-script similarity index 100% rename from tests/samples/03-updated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script rename to tests/samples/03-updated/deploy-tools-output/modules/apps/0.1/entrypoints/test-shell-script diff --git a/tests/samples/02-added/deploy-tools-output/modules/example-module-apps/0.1/module.yaml b/tests/samples/03-updated/deploy-tools-output/modules/apps/0.1/module.yaml similarity index 90% rename from tests/samples/02-added/deploy-tools-output/modules/example-module-apps/0.1/module.yaml rename to tests/samples/03-updated/deploy-tools-output/modules/apps/0.1/module.yaml index 51a06102..60d6f708 100644 --- a/tests/samples/02-added/deploy-tools-output/modules/example-module-apps/0.1/module.yaml +++ b/tests/samples/03-updated/deploy-tools-output/modules/apps/0.1/module.yaml @@ -28,12 +28,12 @@ applications: - echo and this is the second line. - echo Your input is ${1} dependencies: [] -description: Demonstration of a module configuration folder +description: Module demonstrating shell and Apptainer applications env_vars: - name: OTHER_VALUE value: Version 0.1 exclude_from_defaults: false load_script: [] -name: example-module-apps +name: apps unload_script: [] version: '0.1' diff --git a/tests/samples/03-updated/deploy-tools-output/modules/apps/0.1/modulefile b/tests/samples/03-updated/deploy-tools-output/modules/apps/0.1/modulefile new file mode 100644 index 00000000..9aefe70f --- /dev/null +++ b/tests/samples/03-updated/deploy-tools-output/modules/apps/0.1/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## apps - Module demonstrating shell and Apptainer applications +## +module-whatis "Module demonstrating shell and Apptainer applications" + +if { [module-info mode load] } { + if { [is-loaded apps] } { + module unload apps + } +} + +setenv OTHER_VALUE "Version 0.1" + +prepend-path PATH "/tmp/deploy-tools-output/modules/apps/0.1/entrypoints" diff --git a/tests/samples/03-updated/deploy-tools-output/modules/example-module-deps/0.2/module.yaml b/tests/samples/03-updated/deploy-tools-output/modules/deps/0.2/module.yaml similarity index 59% rename from tests/samples/03-updated/deploy-tools-output/modules/example-module-deps/0.2/module.yaml rename to tests/samples/03-updated/deploy-tools-output/modules/deps/0.2/module.yaml index 0765b12f..641f01a8 100644 --- a/tests/samples/03-updated/deploy-tools-output/modules/example-module-deps/0.2/module.yaml +++ b/tests/samples/03-updated/deploy-tools-output/modules/deps/0.2/module.yaml @@ -1,12 +1,14 @@ allow_updates: false applications: [] dependencies: -- name: example-module-apps +- name: apps version: '0.1' -description: Demonstration of deploy-tools dependencies +- name: external-module + version: null +description: Module demonstrating dependencies env_vars: [] exclude_from_defaults: false load_script: [] -name: example-module-deps +name: deps unload_script: [] version: '0.2' diff --git a/tests/samples/03-updated/deploy-tools-output/modules/deps/0.2/modulefile b/tests/samples/03-updated/deploy-tools-output/modules/deps/0.2/modulefile new file mode 100644 index 00000000..56e10614 --- /dev/null +++ b/tests/samples/03-updated/deploy-tools-output/modules/deps/0.2/modulefile @@ -0,0 +1,16 @@ +#%Module1.0 +## +## deps - Module demonstrating dependencies +## +module-whatis "Module demonstrating dependencies" + +if { [module-info mode load] } { + if { [is-loaded deps] } { + module unload deps + } +} + +module load apps/0.1 +module load external-module + +prepend-path PATH "/tmp/deploy-tools-output/modules/deps/0.2/entrypoints" diff --git a/tests/samples/03-updated/deploy-tools-output/modules/example-module-apps/0.1/modulefile b/tests/samples/03-updated/deploy-tools-output/modules/example-module-apps/0.1/modulefile deleted file mode 100644 index b6458983..00000000 --- a/tests/samples/03-updated/deploy-tools-output/modules/example-module-apps/0.1/modulefile +++ /dev/null @@ -1,15 +0,0 @@ -#%Module1.0 -## -## example-module-apps - Demonstration of a module configuration folder -## -module-whatis "Demonstration of a module configuration folder" - -if { [module-info mode load] } { - if { [is-loaded example-module-apps] } { - module unload example-module-apps - } -} - -setenv OTHER_VALUE "Version 0.1" - -prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-apps/0.1/entrypoints" diff --git a/tests/samples/03-updated/deploy-tools-output/modules/example-module-deps/0.2/modulefile b/tests/samples/03-updated/deploy-tools-output/modules/example-module-deps/0.2/modulefile deleted file mode 100644 index a4fbe508..00000000 --- a/tests/samples/03-updated/deploy-tools-output/modules/example-module-deps/0.2/modulefile +++ /dev/null @@ -1,15 +0,0 @@ -#%Module1.0 -## -## example-module-deps - Demonstration of deploy-tools dependencies -## -module-whatis "Demonstration of deploy-tools dependencies" - -if { [module-info mode load] } { - if { [is-loaded example-module-deps] } { - module unload example-module-deps - } -} - -module load example-module-apps/0.1 - -prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-deps/0.2/entrypoints" diff --git a/tests/samples/03-updated/deploy-tools-output/modules/example-module-extra/1.0/modulefile b/tests/samples/03-updated/deploy-tools-output/modules/example-module-extra/1.0/modulefile deleted file mode 100644 index f3ede93d..00000000 --- a/tests/samples/03-updated/deploy-tools-output/modules/example-module-extra/1.0/modulefile +++ /dev/null @@ -1,15 +0,0 @@ -#%Module1.0 -## -## example-module-extra - Demonstration of adding a module in a later sync -## -module-whatis "Demonstration of adding a module in a later sync" - -if { [module-info mode load] } { - if { [is-loaded example-module-extra] } { - module unload example-module-extra - } -} - -setenv EXTRA_VALUE "Updated in a later sync" - -prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-extra/1.0/entrypoints" diff --git a/tests/samples/03-updated/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo b/tests/samples/03-updated/deploy-tools-output/modules/updatable/1.0/entrypoints/test-updatable-echo similarity index 76% rename from tests/samples/03-updated/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo rename to tests/samples/03-updated/deploy-tools-output/modules/updatable/1.0/entrypoints/test-updatable-echo index 77e9301a..a384ba31 100755 --- a/tests/samples/03-updated/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo +++ b/tests/samples/03-updated/deploy-tools-output/modules/updatable/1.0/entrypoints/test-updatable-echo @@ -4,4 +4,4 @@ if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then set -x fi -echo $EXTRA_VALUE +echo $UPDATABLE_VALUE diff --git a/tests/samples/06-removed/deploy-tools-output/modules/example-module-extra/1.0/module.yaml b/tests/samples/03-updated/deploy-tools-output/modules/updatable/1.0/module.yaml similarity index 55% rename from tests/samples/06-removed/deploy-tools-output/modules/example-module-extra/1.0/module.yaml rename to tests/samples/03-updated/deploy-tools-output/modules/updatable/1.0/module.yaml index a592a777..8b7a0358 100644 --- a/tests/samples/06-removed/deploy-tools-output/modules/example-module-extra/1.0/module.yaml +++ b/tests/samples/03-updated/deploy-tools-output/modules/updatable/1.0/module.yaml @@ -1,16 +1,16 @@ allow_updates: true applications: - app_type: shell - name: test-extra-echo + name: test-updatable-echo script: - - echo $EXTRA_VALUE + - echo $UPDATABLE_VALUE dependencies: [] -description: Demonstration of adding a module in a later sync +description: Module demonstrating in-place updates (allow_updates) env_vars: -- name: EXTRA_VALUE +- name: UPDATABLE_VALUE value: Updated in a later sync exclude_from_defaults: false load_script: [] -name: example-module-extra +name: updatable unload_script: [] version: '1.0' diff --git a/tests/samples/03-updated/deploy-tools-output/modules/updatable/1.0/modulefile b/tests/samples/03-updated/deploy-tools-output/modules/updatable/1.0/modulefile new file mode 100644 index 00000000..b8660602 --- /dev/null +++ b/tests/samples/03-updated/deploy-tools-output/modules/updatable/1.0/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## updatable - Module demonstrating in-place updates (allow_updates) +## +module-whatis "Module demonstrating in-place updates (allow_updates)" + +if { [module-info mode load] } { + if { [is-loaded updatable] } { + module unload updatable + } +} + +setenv UPDATABLE_VALUE "Updated in a later sync" + +prepend-path PATH "/tmp/deploy-tools-output/modules/updatable/1.0/entrypoints" diff --git a/tests/samples/03-updated/deploy-tools-output/modules/versions/1.0/module.yaml b/tests/samples/03-updated/deploy-tools-output/modules/versions/1.0/module.yaml new file mode 100644 index 00000000..d77ef37a --- /dev/null +++ b/tests/samples/03-updated/deploy-tools-output/modules/versions/1.0/module.yaml @@ -0,0 +1,10 @@ +allow_updates: false +applications: [] +dependencies: [] +description: Module demonstrating multiple versions and default-version selection +env_vars: [] +exclude_from_defaults: false +load_script: [] +name: versions +unload_script: [] +version: '1.0' diff --git a/tests/samples/03-updated/deploy-tools-output/modules/versions/1.0/modulefile b/tests/samples/03-updated/deploy-tools-output/modules/versions/1.0/modulefile new file mode 100644 index 00000000..e9a94d5a --- /dev/null +++ b/tests/samples/03-updated/deploy-tools-output/modules/versions/1.0/modulefile @@ -0,0 +1,13 @@ +#%Module1.0 +## +## versions - Module demonstrating multiple versions and default-version selection +## +module-whatis "Module demonstrating multiple versions and default-version selection" + +if { [module-info mode load] } { + if { [is-loaded versions] } { + module unload versions + } +} + +prepend-path PATH "/tmp/deploy-tools-output/modules/versions/1.0/entrypoints" diff --git a/tests/samples/03-updated/deploy-tools-output/modules/versions/2.0/module.yaml b/tests/samples/03-updated/deploy-tools-output/modules/versions/2.0/module.yaml new file mode 100644 index 00000000..470ad008 --- /dev/null +++ b/tests/samples/03-updated/deploy-tools-output/modules/versions/2.0/module.yaml @@ -0,0 +1,10 @@ +allow_updates: false +applications: [] +dependencies: [] +description: Module demonstrating multiple versions and default-version selection +env_vars: [] +exclude_from_defaults: false +load_script: [] +name: versions +unload_script: [] +version: '2.0' diff --git a/tests/samples/03-updated/deploy-tools-output/modules/versions/2.0/modulefile b/tests/samples/03-updated/deploy-tools-output/modules/versions/2.0/modulefile new file mode 100644 index 00000000..0b0bd699 --- /dev/null +++ b/tests/samples/03-updated/deploy-tools-output/modules/versions/2.0/modulefile @@ -0,0 +1,13 @@ +#%Module1.0 +## +## versions - Module demonstrating multiple versions and default-version selection +## +module-whatis "Module demonstrating multiple versions and default-version selection" + +if { [module-info mode load] } { + if { [is-loaded versions] } { + module unload versions + } +} + +prepend-path PATH "/tmp/deploy-tools-output/modules/versions/2.0/entrypoints" diff --git a/tests/samples/03-updated/deploy-tools-output/modules/versions/2.1rc1/module.yaml b/tests/samples/03-updated/deploy-tools-output/modules/versions/2.1rc1/module.yaml new file mode 100644 index 00000000..490f83e9 --- /dev/null +++ b/tests/samples/03-updated/deploy-tools-output/modules/versions/2.1rc1/module.yaml @@ -0,0 +1,10 @@ +allow_updates: false +applications: [] +dependencies: [] +description: Module demonstrating multiple versions and default-version selection +env_vars: [] +exclude_from_defaults: true +load_script: [] +name: versions +unload_script: [] +version: 2.1rc1 diff --git a/tests/samples/03-updated/deploy-tools-output/modules/versions/2.1rc1/modulefile b/tests/samples/03-updated/deploy-tools-output/modules/versions/2.1rc1/modulefile new file mode 100644 index 00000000..a92b4324 --- /dev/null +++ b/tests/samples/03-updated/deploy-tools-output/modules/versions/2.1rc1/modulefile @@ -0,0 +1,13 @@ +#%Module1.0 +## +## versions - Module demonstrating multiple versions and default-version selection +## +module-whatis "Module demonstrating multiple versions and default-version selection" + +if { [module-info mode load] } { + if { [is-loaded versions] } { + module unload versions + } +} + +prepend-path PATH "/tmp/deploy-tools-output/modules/versions/2.1rc1/entrypoints" diff --git a/tests/samples/03-updated/validate.txt b/tests/samples/03-updated/validate.txt index 5f1247dc..32a87670 100644 --- a/tests/samples/03-updated/validate.txt +++ b/tests/samples/03-updated/validate.txt @@ -1,4 +1,7 @@ +Modules to be deployed: +versions/2.1rc1 + Modules to be updated: -example-module-extra/1.0 +updatable/1.0 No default version changes diff --git a/tests/samples/04-deprecated/deploy-tools-output/deployment.yaml b/tests/samples/04-deprecated/deploy-tools-output/deployment.yaml index 6871902f..df83de8b 100644 --- a/tests/samples/04-deprecated/deploy-tools-output/deployment.yaml +++ b/tests/samples/04-deprecated/deploy-tools-output/deployment.yaml @@ -1,5 +1,5 @@ releases: - example-module-apps: + apps: '0.1': deprecated: false module: @@ -33,50 +33,92 @@ releases: - echo and this is the second line. - echo Your input is ${1} dependencies: [] - description: Demonstration of a module configuration folder + description: Module demonstrating shell and Apptainer applications env_vars: - name: OTHER_VALUE value: Version 0.1 exclude_from_defaults: false load_script: [] - name: example-module-apps + name: apps unload_script: [] version: '0.1' - example-module-deps: + deps: '0.2': - deprecated: true + deprecated: false module: allow_updates: false applications: [] dependencies: - - name: example-module-apps + - name: apps version: '0.1' - description: Demonstration of deploy-tools dependencies + - name: external-module + version: null + description: Module demonstrating dependencies env_vars: [] exclude_from_defaults: false load_script: [] - name: example-module-deps + name: deps unload_script: [] version: '0.2' - example-module-extra: + updatable: '1.0': - deprecated: true + deprecated: false module: allow_updates: true applications: - app_type: shell - name: test-extra-echo + name: test-updatable-echo script: - - echo $EXTRA_VALUE + - echo $UPDATABLE_VALUE dependencies: [] - description: Demonstration of adding a module in a later sync + description: Module demonstrating in-place updates (allow_updates) env_vars: - - name: EXTRA_VALUE + - name: UPDATABLE_VALUE value: Updated in a later sync exclude_from_defaults: false load_script: [] - name: example-module-extra + name: updatable + unload_script: [] + version: '1.0' + versions: + '1.0': + deprecated: true + module: + allow_updates: false + applications: [] + dependencies: [] + description: Module demonstrating multiple versions and default-version selection + env_vars: [] + exclude_from_defaults: false + load_script: [] + name: versions unload_script: [] version: '1.0' + '2.0': + deprecated: false + module: + allow_updates: false + applications: [] + dependencies: [] + description: Module demonstrating multiple versions and default-version selection + env_vars: [] + exclude_from_defaults: false + load_script: [] + name: versions + unload_script: [] + version: '2.0' + 2.1rc1: + deprecated: true + module: + allow_updates: false + applications: [] + dependencies: [] + description: Module demonstrating multiple versions and default-version selection + env_vars: [] + exclude_from_defaults: true + load_script: [] + name: versions + unload_script: [] + version: 2.1rc1 settings: default_versions: {} diff --git a/tests/samples/04-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 b/tests/samples/04-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 deleted file mode 120000 index cd04ecdf..00000000 --- a/tests/samples/04-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 +++ /dev/null @@ -1 +0,0 @@ -/tmp/deploy-tools-output/modules/example-module-deps/0.2/modulefile \ No newline at end of file diff --git a/tests/samples/04-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-extra/1.0 b/tests/samples/04-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-extra/1.0 deleted file mode 120000 index 59949819..00000000 --- a/tests/samples/04-deprecated/deploy-tools-output/deprecated/modulefiles/example-module-extra/1.0 +++ /dev/null @@ -1 +0,0 @@ -/tmp/deploy-tools-output/modules/example-module-extra/1.0/modulefile \ No newline at end of file diff --git a/tests/samples/04-deprecated/deploy-tools-output/deprecated/modulefiles/versions/1.0 b/tests/samples/04-deprecated/deploy-tools-output/deprecated/modulefiles/versions/1.0 new file mode 120000 index 00000000..88618ed2 --- /dev/null +++ b/tests/samples/04-deprecated/deploy-tools-output/deprecated/modulefiles/versions/1.0 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/versions/1.0/modulefile \ No newline at end of file diff --git a/tests/samples/04-deprecated/deploy-tools-output/deprecated/modulefiles/versions/2.1rc1 b/tests/samples/04-deprecated/deploy-tools-output/deprecated/modulefiles/versions/2.1rc1 new file mode 120000 index 00000000..10b125b4 --- /dev/null +++ b/tests/samples/04-deprecated/deploy-tools-output/deprecated/modulefiles/versions/2.1rc1 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/versions/2.1rc1/modulefile \ No newline at end of file diff --git a/tests/samples/04-deprecated/deploy-tools-output/modulefiles/example-module-apps/.version b/tests/samples/04-deprecated/deploy-tools-output/modulefiles/apps/.version similarity index 100% rename from tests/samples/04-deprecated/deploy-tools-output/modulefiles/example-module-apps/.version rename to tests/samples/04-deprecated/deploy-tools-output/modulefiles/apps/.version diff --git a/tests/samples/04-deprecated/deploy-tools-output/modulefiles/apps/0.1 b/tests/samples/04-deprecated/deploy-tools-output/modulefiles/apps/0.1 new file mode 120000 index 00000000..69615f97 --- /dev/null +++ b/tests/samples/04-deprecated/deploy-tools-output/modulefiles/apps/0.1 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/apps/0.1/modulefile \ No newline at end of file diff --git a/tests/samples/04-deprecated/deploy-tools-output/modulefiles/deps/.version b/tests/samples/04-deprecated/deploy-tools-output/modulefiles/deps/.version new file mode 100644 index 00000000..26a66b44 --- /dev/null +++ b/tests/samples/04-deprecated/deploy-tools-output/modulefiles/deps/.version @@ -0,0 +1,2 @@ +#%Module1.0 +set ModulesVersion 0.2 diff --git a/tests/samples/04-deprecated/deploy-tools-output/modulefiles/deps/0.2 b/tests/samples/04-deprecated/deploy-tools-output/modulefiles/deps/0.2 new file mode 120000 index 00000000..5d82a765 --- /dev/null +++ b/tests/samples/04-deprecated/deploy-tools-output/modulefiles/deps/0.2 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/deps/0.2/modulefile \ No newline at end of file diff --git a/tests/samples/04-deprecated/deploy-tools-output/modulefiles/example-module-apps/0.1 b/tests/samples/04-deprecated/deploy-tools-output/modulefiles/example-module-apps/0.1 deleted file mode 120000 index 53b90576..00000000 --- a/tests/samples/04-deprecated/deploy-tools-output/modulefiles/example-module-apps/0.1 +++ /dev/null @@ -1 +0,0 @@ -/tmp/deploy-tools-output/modules/example-module-apps/0.1/modulefile \ No newline at end of file diff --git a/tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-extra/.version b/tests/samples/04-deprecated/deploy-tools-output/modulefiles/updatable/.version similarity index 100% rename from tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-extra/.version rename to tests/samples/04-deprecated/deploy-tools-output/modulefiles/updatable/.version diff --git a/tests/samples/04-deprecated/deploy-tools-output/modulefiles/updatable/1.0 b/tests/samples/04-deprecated/deploy-tools-output/modulefiles/updatable/1.0 new file mode 120000 index 00000000..bd2fb2bd --- /dev/null +++ b/tests/samples/04-deprecated/deploy-tools-output/modulefiles/updatable/1.0 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/updatable/1.0/modulefile \ No newline at end of file diff --git a/tests/samples/04-deprecated/deploy-tools-output/modulefiles/versions/.version b/tests/samples/04-deprecated/deploy-tools-output/modulefiles/versions/.version new file mode 100644 index 00000000..5d5fbb68 --- /dev/null +++ b/tests/samples/04-deprecated/deploy-tools-output/modulefiles/versions/.version @@ -0,0 +1,2 @@ +#%Module1.0 +set ModulesVersion 2.0 diff --git a/tests/samples/04-deprecated/deploy-tools-output/modulefiles/versions/2.0 b/tests/samples/04-deprecated/deploy-tools-output/modulefiles/versions/2.0 new file mode 120000 index 00000000..b0c4f475 --- /dev/null +++ b/tests/samples/04-deprecated/deploy-tools-output/modulefiles/versions/2.0 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/versions/2.0/modulefile \ No newline at end of file diff --git a/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello b/tests/samples/04-deprecated/deploy-tools-output/modules/apps/0.1/entrypoints/cowsay-hello similarity index 100% rename from tests/samples/04-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello rename to tests/samples/04-deprecated/deploy-tools-output/modules/apps/0.1/entrypoints/cowsay-hello diff --git a/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var b/tests/samples/04-deprecated/deploy-tools-output/modules/apps/0.1/entrypoints/test-echo-module-var similarity index 100% rename from tests/samples/04-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var rename to tests/samples/04-deprecated/deploy-tools-output/modules/apps/0.1/entrypoints/test-echo-module-var diff --git a/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script b/tests/samples/04-deprecated/deploy-tools-output/modules/apps/0.1/entrypoints/test-shell-script similarity index 100% rename from tests/samples/04-deprecated/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script rename to tests/samples/04-deprecated/deploy-tools-output/modules/apps/0.1/entrypoints/test-shell-script diff --git a/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-apps/0.1/module.yaml b/tests/samples/04-deprecated/deploy-tools-output/modules/apps/0.1/module.yaml similarity index 90% rename from tests/samples/04-deprecated/deploy-tools-output/modules/example-module-apps/0.1/module.yaml rename to tests/samples/04-deprecated/deploy-tools-output/modules/apps/0.1/module.yaml index 51a06102..60d6f708 100644 --- a/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-apps/0.1/module.yaml +++ b/tests/samples/04-deprecated/deploy-tools-output/modules/apps/0.1/module.yaml @@ -28,12 +28,12 @@ applications: - echo and this is the second line. - echo Your input is ${1} dependencies: [] -description: Demonstration of a module configuration folder +description: Module demonstrating shell and Apptainer applications env_vars: - name: OTHER_VALUE value: Version 0.1 exclude_from_defaults: false load_script: [] -name: example-module-apps +name: apps unload_script: [] version: '0.1' diff --git a/tests/samples/04-deprecated/deploy-tools-output/modules/apps/0.1/modulefile b/tests/samples/04-deprecated/deploy-tools-output/modules/apps/0.1/modulefile new file mode 100644 index 00000000..9aefe70f --- /dev/null +++ b/tests/samples/04-deprecated/deploy-tools-output/modules/apps/0.1/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## apps - Module demonstrating shell and Apptainer applications +## +module-whatis "Module demonstrating shell and Apptainer applications" + +if { [module-info mode load] } { + if { [is-loaded apps] } { + module unload apps + } +} + +setenv OTHER_VALUE "Version 0.1" + +prepend-path PATH "/tmp/deploy-tools-output/modules/apps/0.1/entrypoints" diff --git a/tests/samples/02-added/deploy-tools-output/modules/example-module-deps/0.2/module.yaml b/tests/samples/04-deprecated/deploy-tools-output/modules/deps/0.2/module.yaml similarity index 59% rename from tests/samples/02-added/deploy-tools-output/modules/example-module-deps/0.2/module.yaml rename to tests/samples/04-deprecated/deploy-tools-output/modules/deps/0.2/module.yaml index 0765b12f..641f01a8 100644 --- a/tests/samples/02-added/deploy-tools-output/modules/example-module-deps/0.2/module.yaml +++ b/tests/samples/04-deprecated/deploy-tools-output/modules/deps/0.2/module.yaml @@ -1,12 +1,14 @@ allow_updates: false applications: [] dependencies: -- name: example-module-apps +- name: apps version: '0.1' -description: Demonstration of deploy-tools dependencies +- name: external-module + version: null +description: Module demonstrating dependencies env_vars: [] exclude_from_defaults: false load_script: [] -name: example-module-deps +name: deps unload_script: [] version: '0.2' diff --git a/tests/samples/04-deprecated/deploy-tools-output/modules/deps/0.2/modulefile b/tests/samples/04-deprecated/deploy-tools-output/modules/deps/0.2/modulefile new file mode 100644 index 00000000..56e10614 --- /dev/null +++ b/tests/samples/04-deprecated/deploy-tools-output/modules/deps/0.2/modulefile @@ -0,0 +1,16 @@ +#%Module1.0 +## +## deps - Module demonstrating dependencies +## +module-whatis "Module demonstrating dependencies" + +if { [module-info mode load] } { + if { [is-loaded deps] } { + module unload deps + } +} + +module load apps/0.1 +module load external-module + +prepend-path PATH "/tmp/deploy-tools-output/modules/deps/0.2/entrypoints" diff --git a/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-apps/0.1/modulefile b/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-apps/0.1/modulefile deleted file mode 100644 index b6458983..00000000 --- a/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-apps/0.1/modulefile +++ /dev/null @@ -1,15 +0,0 @@ -#%Module1.0 -## -## example-module-apps - Demonstration of a module configuration folder -## -module-whatis "Demonstration of a module configuration folder" - -if { [module-info mode load] } { - if { [is-loaded example-module-apps] } { - module unload example-module-apps - } -} - -setenv OTHER_VALUE "Version 0.1" - -prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-apps/0.1/entrypoints" diff --git a/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-deps/0.2/modulefile b/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-deps/0.2/modulefile deleted file mode 100644 index a4fbe508..00000000 --- a/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-deps/0.2/modulefile +++ /dev/null @@ -1,15 +0,0 @@ -#%Module1.0 -## -## example-module-deps - Demonstration of deploy-tools dependencies -## -module-whatis "Demonstration of deploy-tools dependencies" - -if { [module-info mode load] } { - if { [is-loaded example-module-deps] } { - module unload example-module-deps - } -} - -module load example-module-apps/0.1 - -prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-deps/0.2/entrypoints" diff --git a/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-extra/1.0/modulefile b/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-extra/1.0/modulefile deleted file mode 100644 index f3ede93d..00000000 --- a/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-extra/1.0/modulefile +++ /dev/null @@ -1,15 +0,0 @@ -#%Module1.0 -## -## example-module-extra - Demonstration of adding a module in a later sync -## -module-whatis "Demonstration of adding a module in a later sync" - -if { [module-info mode load] } { - if { [is-loaded example-module-extra] } { - module unload example-module-extra - } -} - -setenv EXTRA_VALUE "Updated in a later sync" - -prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-extra/1.0/entrypoints" diff --git a/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo b/tests/samples/04-deprecated/deploy-tools-output/modules/updatable/1.0/entrypoints/test-updatable-echo similarity index 76% rename from tests/samples/04-deprecated/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo rename to tests/samples/04-deprecated/deploy-tools-output/modules/updatable/1.0/entrypoints/test-updatable-echo index 77e9301a..a384ba31 100755 --- a/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo +++ b/tests/samples/04-deprecated/deploy-tools-output/modules/updatable/1.0/entrypoints/test-updatable-echo @@ -4,4 +4,4 @@ if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then set -x fi -echo $EXTRA_VALUE +echo $UPDATABLE_VALUE diff --git a/tests/samples/03-updated/deploy-tools-output/modules/example-module-extra/1.0/module.yaml b/tests/samples/04-deprecated/deploy-tools-output/modules/updatable/1.0/module.yaml similarity index 55% rename from tests/samples/03-updated/deploy-tools-output/modules/example-module-extra/1.0/module.yaml rename to tests/samples/04-deprecated/deploy-tools-output/modules/updatable/1.0/module.yaml index a592a777..8b7a0358 100644 --- a/tests/samples/03-updated/deploy-tools-output/modules/example-module-extra/1.0/module.yaml +++ b/tests/samples/04-deprecated/deploy-tools-output/modules/updatable/1.0/module.yaml @@ -1,16 +1,16 @@ allow_updates: true applications: - app_type: shell - name: test-extra-echo + name: test-updatable-echo script: - - echo $EXTRA_VALUE + - echo $UPDATABLE_VALUE dependencies: [] -description: Demonstration of adding a module in a later sync +description: Module demonstrating in-place updates (allow_updates) env_vars: -- name: EXTRA_VALUE +- name: UPDATABLE_VALUE value: Updated in a later sync exclude_from_defaults: false load_script: [] -name: example-module-extra +name: updatable unload_script: [] version: '1.0' diff --git a/tests/samples/04-deprecated/deploy-tools-output/modules/updatable/1.0/modulefile b/tests/samples/04-deprecated/deploy-tools-output/modules/updatable/1.0/modulefile new file mode 100644 index 00000000..b8660602 --- /dev/null +++ b/tests/samples/04-deprecated/deploy-tools-output/modules/updatable/1.0/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## updatable - Module demonstrating in-place updates (allow_updates) +## +module-whatis "Module demonstrating in-place updates (allow_updates)" + +if { [module-info mode load] } { + if { [is-loaded updatable] } { + module unload updatable + } +} + +setenv UPDATABLE_VALUE "Updated in a later sync" + +prepend-path PATH "/tmp/deploy-tools-output/modules/updatable/1.0/entrypoints" diff --git a/tests/samples/04-deprecated/deploy-tools-output/modules/versions/1.0/module.yaml b/tests/samples/04-deprecated/deploy-tools-output/modules/versions/1.0/module.yaml new file mode 100644 index 00000000..d77ef37a --- /dev/null +++ b/tests/samples/04-deprecated/deploy-tools-output/modules/versions/1.0/module.yaml @@ -0,0 +1,10 @@ +allow_updates: false +applications: [] +dependencies: [] +description: Module demonstrating multiple versions and default-version selection +env_vars: [] +exclude_from_defaults: false +load_script: [] +name: versions +unload_script: [] +version: '1.0' diff --git a/tests/samples/04-deprecated/deploy-tools-output/modules/versions/1.0/modulefile b/tests/samples/04-deprecated/deploy-tools-output/modules/versions/1.0/modulefile new file mode 100644 index 00000000..e9a94d5a --- /dev/null +++ b/tests/samples/04-deprecated/deploy-tools-output/modules/versions/1.0/modulefile @@ -0,0 +1,13 @@ +#%Module1.0 +## +## versions - Module demonstrating multiple versions and default-version selection +## +module-whatis "Module demonstrating multiple versions and default-version selection" + +if { [module-info mode load] } { + if { [is-loaded versions] } { + module unload versions + } +} + +prepend-path PATH "/tmp/deploy-tools-output/modules/versions/1.0/entrypoints" diff --git a/tests/samples/04-deprecated/deploy-tools-output/modules/versions/2.0/module.yaml b/tests/samples/04-deprecated/deploy-tools-output/modules/versions/2.0/module.yaml new file mode 100644 index 00000000..470ad008 --- /dev/null +++ b/tests/samples/04-deprecated/deploy-tools-output/modules/versions/2.0/module.yaml @@ -0,0 +1,10 @@ +allow_updates: false +applications: [] +dependencies: [] +description: Module demonstrating multiple versions and default-version selection +env_vars: [] +exclude_from_defaults: false +load_script: [] +name: versions +unload_script: [] +version: '2.0' diff --git a/tests/samples/04-deprecated/deploy-tools-output/modules/versions/2.0/modulefile b/tests/samples/04-deprecated/deploy-tools-output/modules/versions/2.0/modulefile new file mode 100644 index 00000000..0b0bd699 --- /dev/null +++ b/tests/samples/04-deprecated/deploy-tools-output/modules/versions/2.0/modulefile @@ -0,0 +1,13 @@ +#%Module1.0 +## +## versions - Module demonstrating multiple versions and default-version selection +## +module-whatis "Module demonstrating multiple versions and default-version selection" + +if { [module-info mode load] } { + if { [is-loaded versions] } { + module unload versions + } +} + +prepend-path PATH "/tmp/deploy-tools-output/modules/versions/2.0/entrypoints" diff --git a/tests/samples/04-deprecated/deploy-tools-output/modules/versions/2.1rc1/module.yaml b/tests/samples/04-deprecated/deploy-tools-output/modules/versions/2.1rc1/module.yaml new file mode 100644 index 00000000..490f83e9 --- /dev/null +++ b/tests/samples/04-deprecated/deploy-tools-output/modules/versions/2.1rc1/module.yaml @@ -0,0 +1,10 @@ +allow_updates: false +applications: [] +dependencies: [] +description: Module demonstrating multiple versions and default-version selection +env_vars: [] +exclude_from_defaults: true +load_script: [] +name: versions +unload_script: [] +version: 2.1rc1 diff --git a/tests/samples/04-deprecated/deploy-tools-output/modules/versions/2.1rc1/modulefile b/tests/samples/04-deprecated/deploy-tools-output/modules/versions/2.1rc1/modulefile new file mode 100644 index 00000000..a92b4324 --- /dev/null +++ b/tests/samples/04-deprecated/deploy-tools-output/modules/versions/2.1rc1/modulefile @@ -0,0 +1,13 @@ +#%Module1.0 +## +## versions - Module demonstrating multiple versions and default-version selection +## +module-whatis "Module demonstrating multiple versions and default-version selection" + +if { [module-info mode load] } { + if { [is-loaded versions] } { + module unload versions + } +} + +prepend-path PATH "/tmp/deploy-tools-output/modules/versions/2.1rc1/entrypoints" diff --git a/tests/samples/04-deprecated/validate.txt b/tests/samples/04-deprecated/validate.txt index 04665b25..c26ad180 100644 --- a/tests/samples/04-deprecated/validate.txt +++ b/tests/samples/04-deprecated/validate.txt @@ -1,7 +1,5 @@ Modules to be deprecated: -example-module-deps/0.2 -example-module-extra/1.0 +versions/1.0 +versions/2.1rc1 -Updated module defaults: -example-module-deps 0.2 -> None -example-module-extra 1.0 -> None +No default version changes diff --git a/tests/samples/05-restored/deploy-tools-output/deployment.yaml b/tests/samples/05-restored/deploy-tools-output/deployment.yaml index a603e950..869b8d29 100644 --- a/tests/samples/05-restored/deploy-tools-output/deployment.yaml +++ b/tests/samples/05-restored/deploy-tools-output/deployment.yaml @@ -1,5 +1,5 @@ releases: - example-module-apps: + apps: '0.1': deprecated: false module: @@ -33,50 +33,92 @@ releases: - echo and this is the second line. - echo Your input is ${1} dependencies: [] - description: Demonstration of a module configuration folder + description: Module demonstrating shell and Apptainer applications env_vars: - name: OTHER_VALUE value: Version 0.1 exclude_from_defaults: false load_script: [] - name: example-module-apps + name: apps unload_script: [] version: '0.1' - example-module-deps: + deps: '0.2': - deprecated: true + deprecated: false module: allow_updates: false applications: [] dependencies: - - name: example-module-apps + - name: apps version: '0.1' - description: Demonstration of deploy-tools dependencies + - name: external-module + version: null + description: Module demonstrating dependencies env_vars: [] exclude_from_defaults: false load_script: [] - name: example-module-deps + name: deps unload_script: [] version: '0.2' - example-module-extra: + updatable: '1.0': deprecated: false module: allow_updates: true applications: - app_type: shell - name: test-extra-echo + name: test-updatable-echo script: - - echo $EXTRA_VALUE + - echo $UPDATABLE_VALUE dependencies: [] - description: Demonstration of adding a module in a later sync + description: Module demonstrating in-place updates (allow_updates) env_vars: - - name: EXTRA_VALUE + - name: UPDATABLE_VALUE value: Updated in a later sync exclude_from_defaults: false load_script: [] - name: example-module-extra + name: updatable unload_script: [] version: '1.0' + versions: + '1.0': + deprecated: true + module: + allow_updates: false + applications: [] + dependencies: [] + description: Module demonstrating multiple versions and default-version selection + env_vars: [] + exclude_from_defaults: false + load_script: [] + name: versions + unload_script: [] + version: '1.0' + '2.0': + deprecated: false + module: + allow_updates: false + applications: [] + dependencies: [] + description: Module demonstrating multiple versions and default-version selection + env_vars: [] + exclude_from_defaults: false + load_script: [] + name: versions + unload_script: [] + version: '2.0' + 2.1rc1: + deprecated: false + module: + allow_updates: false + applications: [] + dependencies: [] + description: Module demonstrating multiple versions and default-version selection + env_vars: [] + exclude_from_defaults: true + load_script: [] + name: versions + unload_script: [] + version: 2.1rc1 settings: default_versions: {} diff --git a/tests/samples/05-restored/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 b/tests/samples/05-restored/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 deleted file mode 120000 index cd04ecdf..00000000 --- a/tests/samples/05-restored/deploy-tools-output/deprecated/modulefiles/example-module-deps/0.2 +++ /dev/null @@ -1 +0,0 @@ -/tmp/deploy-tools-output/modules/example-module-deps/0.2/modulefile \ No newline at end of file diff --git a/tests/samples/05-restored/deploy-tools-output/deprecated/modulefiles/versions/1.0 b/tests/samples/05-restored/deploy-tools-output/deprecated/modulefiles/versions/1.0 new file mode 120000 index 00000000..88618ed2 --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/deprecated/modulefiles/versions/1.0 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/versions/1.0/modulefile \ No newline at end of file diff --git a/tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-apps/.version b/tests/samples/05-restored/deploy-tools-output/modulefiles/apps/.version similarity index 100% rename from tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-apps/.version rename to tests/samples/05-restored/deploy-tools-output/modulefiles/apps/.version diff --git a/tests/samples/05-restored/deploy-tools-output/modulefiles/apps/0.1 b/tests/samples/05-restored/deploy-tools-output/modulefiles/apps/0.1 new file mode 120000 index 00000000..69615f97 --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modulefiles/apps/0.1 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/apps/0.1/modulefile \ No newline at end of file diff --git a/tests/samples/05-restored/deploy-tools-output/modulefiles/deps/.version b/tests/samples/05-restored/deploy-tools-output/modulefiles/deps/.version new file mode 100644 index 00000000..26a66b44 --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modulefiles/deps/.version @@ -0,0 +1,2 @@ +#%Module1.0 +set ModulesVersion 0.2 diff --git a/tests/samples/05-restored/deploy-tools-output/modulefiles/deps/0.2 b/tests/samples/05-restored/deploy-tools-output/modulefiles/deps/0.2 new file mode 120000 index 00000000..5d82a765 --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modulefiles/deps/0.2 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/deps/0.2/modulefile \ No newline at end of file diff --git a/tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-apps/0.1 b/tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-apps/0.1 deleted file mode 120000 index 53b90576..00000000 --- a/tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-apps/0.1 +++ /dev/null @@ -1 +0,0 @@ -/tmp/deploy-tools-output/modules/example-module-apps/0.1/modulefile \ No newline at end of file diff --git a/tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-extra/1.0 b/tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-extra/1.0 deleted file mode 120000 index 59949819..00000000 --- a/tests/samples/05-restored/deploy-tools-output/modulefiles/example-module-extra/1.0 +++ /dev/null @@ -1 +0,0 @@ -/tmp/deploy-tools-output/modules/example-module-extra/1.0/modulefile \ No newline at end of file diff --git a/tests/samples/05-restored/deploy-tools-output/modulefiles/updatable/.version b/tests/samples/05-restored/deploy-tools-output/modulefiles/updatable/.version new file mode 100644 index 00000000..f0d55435 --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modulefiles/updatable/.version @@ -0,0 +1,2 @@ +#%Module1.0 +set ModulesVersion 1.0 diff --git a/tests/samples/05-restored/deploy-tools-output/modulefiles/updatable/1.0 b/tests/samples/05-restored/deploy-tools-output/modulefiles/updatable/1.0 new file mode 120000 index 00000000..bd2fb2bd --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modulefiles/updatable/1.0 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/updatable/1.0/modulefile \ No newline at end of file diff --git a/tests/samples/05-restored/deploy-tools-output/modulefiles/versions/.version b/tests/samples/05-restored/deploy-tools-output/modulefiles/versions/.version new file mode 100644 index 00000000..5d5fbb68 --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modulefiles/versions/.version @@ -0,0 +1,2 @@ +#%Module1.0 +set ModulesVersion 2.0 diff --git a/tests/samples/05-restored/deploy-tools-output/modulefiles/versions/2.0 b/tests/samples/05-restored/deploy-tools-output/modulefiles/versions/2.0 new file mode 120000 index 00000000..b0c4f475 --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modulefiles/versions/2.0 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/versions/2.0/modulefile \ No newline at end of file diff --git a/tests/samples/05-restored/deploy-tools-output/modulefiles/versions/2.1rc1 b/tests/samples/05-restored/deploy-tools-output/modulefiles/versions/2.1rc1 new file mode 120000 index 00000000..10b125b4 --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modulefiles/versions/2.1rc1 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/versions/2.1rc1/modulefile \ No newline at end of file diff --git a/tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello b/tests/samples/05-restored/deploy-tools-output/modules/apps/0.1/entrypoints/cowsay-hello similarity index 100% rename from tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello rename to tests/samples/05-restored/deploy-tools-output/modules/apps/0.1/entrypoints/cowsay-hello diff --git a/tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var b/tests/samples/05-restored/deploy-tools-output/modules/apps/0.1/entrypoints/test-echo-module-var similarity index 100% rename from tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var rename to tests/samples/05-restored/deploy-tools-output/modules/apps/0.1/entrypoints/test-echo-module-var diff --git a/tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script b/tests/samples/05-restored/deploy-tools-output/modules/apps/0.1/entrypoints/test-shell-script similarity index 100% rename from tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script rename to tests/samples/05-restored/deploy-tools-output/modules/apps/0.1/entrypoints/test-shell-script diff --git a/tests/samples/05-restored/deploy-tools-output/modules/apps/0.1/module.yaml b/tests/samples/05-restored/deploy-tools-output/modules/apps/0.1/module.yaml new file mode 100644 index 00000000..60d6f708 --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modules/apps/0.1/module.yaml @@ -0,0 +1,39 @@ +allow_updates: false +applications: +- app_type: apptainer + container: + path: docker://ghcr.io/apptainer/lolcow + version: latest + entrypoints: + - command: cowsay + name: cowsay-hello + options: + apptainer_args: '' + command_args: Hello + host_binaries: [] + mounts: [] + global_options: + apptainer_args: '' + command_args: '' + host_binaries: [] + mounts: [] +- app_type: shell + name: test-echo-module-var + script: + - echo $OTHER_VALUE +- app_type: shell + name: test-shell-script + script: + - echo This is the first line of a shell script + - echo and this is the second line. + - echo Your input is ${1} +dependencies: [] +description: Module demonstrating shell and Apptainer applications +env_vars: +- name: OTHER_VALUE + value: Version 0.1 +exclude_from_defaults: false +load_script: [] +name: apps +unload_script: [] +version: '0.1' diff --git a/tests/samples/05-restored/deploy-tools-output/modules/apps/0.1/modulefile b/tests/samples/05-restored/deploy-tools-output/modules/apps/0.1/modulefile new file mode 100644 index 00000000..9aefe70f --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modules/apps/0.1/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## apps - Module demonstrating shell and Apptainer applications +## +module-whatis "Module demonstrating shell and Apptainer applications" + +if { [module-info mode load] } { + if { [is-loaded apps] } { + module unload apps + } +} + +setenv OTHER_VALUE "Version 0.1" + +prepend-path PATH "/tmp/deploy-tools-output/modules/apps/0.1/entrypoints" diff --git a/tests/samples/05-restored/deploy-tools-output/modules/deps/0.2/module.yaml b/tests/samples/05-restored/deploy-tools-output/modules/deps/0.2/module.yaml new file mode 100644 index 00000000..641f01a8 --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modules/deps/0.2/module.yaml @@ -0,0 +1,14 @@ +allow_updates: false +applications: [] +dependencies: +- name: apps + version: '0.1' +- name: external-module + version: null +description: Module demonstrating dependencies +env_vars: [] +exclude_from_defaults: false +load_script: [] +name: deps +unload_script: [] +version: '0.2' diff --git a/tests/samples/05-restored/deploy-tools-output/modules/deps/0.2/modulefile b/tests/samples/05-restored/deploy-tools-output/modules/deps/0.2/modulefile new file mode 100644 index 00000000..56e10614 --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modules/deps/0.2/modulefile @@ -0,0 +1,16 @@ +#%Module1.0 +## +## deps - Module demonstrating dependencies +## +module-whatis "Module demonstrating dependencies" + +if { [module-info mode load] } { + if { [is-loaded deps] } { + module unload deps + } +} + +module load apps/0.1 +module load external-module + +prepend-path PATH "/tmp/deploy-tools-output/modules/deps/0.2/entrypoints" diff --git a/tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/module.yaml b/tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/module.yaml deleted file mode 100644 index 51a06102..00000000 --- a/tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/module.yaml +++ /dev/null @@ -1,39 +0,0 @@ -allow_updates: false -applications: -- app_type: apptainer - container: - path: docker://ghcr.io/apptainer/lolcow - version: latest - entrypoints: - - command: cowsay - name: cowsay-hello - options: - apptainer_args: '' - command_args: Hello - host_binaries: [] - mounts: [] - global_options: - apptainer_args: '' - command_args: '' - host_binaries: [] - mounts: [] -- app_type: shell - name: test-echo-module-var - script: - - echo $OTHER_VALUE -- app_type: shell - name: test-shell-script - script: - - echo This is the first line of a shell script - - echo and this is the second line. - - echo Your input is ${1} -dependencies: [] -description: Demonstration of a module configuration folder -env_vars: -- name: OTHER_VALUE - value: Version 0.1 -exclude_from_defaults: false -load_script: [] -name: example-module-apps -unload_script: [] -version: '0.1' diff --git a/tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/modulefile b/tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/modulefile deleted file mode 100644 index b6458983..00000000 --- a/tests/samples/05-restored/deploy-tools-output/modules/example-module-apps/0.1/modulefile +++ /dev/null @@ -1,15 +0,0 @@ -#%Module1.0 -## -## example-module-apps - Demonstration of a module configuration folder -## -module-whatis "Demonstration of a module configuration folder" - -if { [module-info mode load] } { - if { [is-loaded example-module-apps] } { - module unload example-module-apps - } -} - -setenv OTHER_VALUE "Version 0.1" - -prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-apps/0.1/entrypoints" diff --git a/tests/samples/05-restored/deploy-tools-output/modules/example-module-deps/0.2/module.yaml b/tests/samples/05-restored/deploy-tools-output/modules/example-module-deps/0.2/module.yaml deleted file mode 100644 index 0765b12f..00000000 --- a/tests/samples/05-restored/deploy-tools-output/modules/example-module-deps/0.2/module.yaml +++ /dev/null @@ -1,12 +0,0 @@ -allow_updates: false -applications: [] -dependencies: -- name: example-module-apps - version: '0.1' -description: Demonstration of deploy-tools dependencies -env_vars: [] -exclude_from_defaults: false -load_script: [] -name: example-module-deps -unload_script: [] -version: '0.2' diff --git a/tests/samples/05-restored/deploy-tools-output/modules/example-module-deps/0.2/modulefile b/tests/samples/05-restored/deploy-tools-output/modules/example-module-deps/0.2/modulefile deleted file mode 100644 index a4fbe508..00000000 --- a/tests/samples/05-restored/deploy-tools-output/modules/example-module-deps/0.2/modulefile +++ /dev/null @@ -1,15 +0,0 @@ -#%Module1.0 -## -## example-module-deps - Demonstration of deploy-tools dependencies -## -module-whatis "Demonstration of deploy-tools dependencies" - -if { [module-info mode load] } { - if { [is-loaded example-module-deps] } { - module unload example-module-deps - } -} - -module load example-module-apps/0.1 - -prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-deps/0.2/entrypoints" diff --git a/tests/samples/05-restored/deploy-tools-output/modules/example-module-extra/1.0/modulefile b/tests/samples/05-restored/deploy-tools-output/modules/example-module-extra/1.0/modulefile deleted file mode 100644 index f3ede93d..00000000 --- a/tests/samples/05-restored/deploy-tools-output/modules/example-module-extra/1.0/modulefile +++ /dev/null @@ -1,15 +0,0 @@ -#%Module1.0 -## -## example-module-extra - Demonstration of adding a module in a later sync -## -module-whatis "Demonstration of adding a module in a later sync" - -if { [module-info mode load] } { - if { [is-loaded example-module-extra] } { - module unload example-module-extra - } -} - -setenv EXTRA_VALUE "Updated in a later sync" - -prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-extra/1.0/entrypoints" diff --git a/tests/samples/05-restored/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo b/tests/samples/05-restored/deploy-tools-output/modules/updatable/1.0/entrypoints/test-updatable-echo similarity index 76% rename from tests/samples/05-restored/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo rename to tests/samples/05-restored/deploy-tools-output/modules/updatable/1.0/entrypoints/test-updatable-echo index 77e9301a..a384ba31 100755 --- a/tests/samples/05-restored/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo +++ b/tests/samples/05-restored/deploy-tools-output/modules/updatable/1.0/entrypoints/test-updatable-echo @@ -4,4 +4,4 @@ if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then set -x fi -echo $EXTRA_VALUE +echo $UPDATABLE_VALUE diff --git a/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-extra/1.0/module.yaml b/tests/samples/05-restored/deploy-tools-output/modules/updatable/1.0/module.yaml similarity index 55% rename from tests/samples/04-deprecated/deploy-tools-output/modules/example-module-extra/1.0/module.yaml rename to tests/samples/05-restored/deploy-tools-output/modules/updatable/1.0/module.yaml index a592a777..8b7a0358 100644 --- a/tests/samples/04-deprecated/deploy-tools-output/modules/example-module-extra/1.0/module.yaml +++ b/tests/samples/05-restored/deploy-tools-output/modules/updatable/1.0/module.yaml @@ -1,16 +1,16 @@ allow_updates: true applications: - app_type: shell - name: test-extra-echo + name: test-updatable-echo script: - - echo $EXTRA_VALUE + - echo $UPDATABLE_VALUE dependencies: [] -description: Demonstration of adding a module in a later sync +description: Module demonstrating in-place updates (allow_updates) env_vars: -- name: EXTRA_VALUE +- name: UPDATABLE_VALUE value: Updated in a later sync exclude_from_defaults: false load_script: [] -name: example-module-extra +name: updatable unload_script: [] version: '1.0' diff --git a/tests/samples/05-restored/deploy-tools-output/modules/updatable/1.0/modulefile b/tests/samples/05-restored/deploy-tools-output/modules/updatable/1.0/modulefile new file mode 100644 index 00000000..b8660602 --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modules/updatable/1.0/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## updatable - Module demonstrating in-place updates (allow_updates) +## +module-whatis "Module demonstrating in-place updates (allow_updates)" + +if { [module-info mode load] } { + if { [is-loaded updatable] } { + module unload updatable + } +} + +setenv UPDATABLE_VALUE "Updated in a later sync" + +prepend-path PATH "/tmp/deploy-tools-output/modules/updatable/1.0/entrypoints" diff --git a/tests/samples/05-restored/deploy-tools-output/modules/versions/1.0/module.yaml b/tests/samples/05-restored/deploy-tools-output/modules/versions/1.0/module.yaml new file mode 100644 index 00000000..d77ef37a --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modules/versions/1.0/module.yaml @@ -0,0 +1,10 @@ +allow_updates: false +applications: [] +dependencies: [] +description: Module demonstrating multiple versions and default-version selection +env_vars: [] +exclude_from_defaults: false +load_script: [] +name: versions +unload_script: [] +version: '1.0' diff --git a/tests/samples/05-restored/deploy-tools-output/modules/versions/1.0/modulefile b/tests/samples/05-restored/deploy-tools-output/modules/versions/1.0/modulefile new file mode 100644 index 00000000..e9a94d5a --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modules/versions/1.0/modulefile @@ -0,0 +1,13 @@ +#%Module1.0 +## +## versions - Module demonstrating multiple versions and default-version selection +## +module-whatis "Module demonstrating multiple versions and default-version selection" + +if { [module-info mode load] } { + if { [is-loaded versions] } { + module unload versions + } +} + +prepend-path PATH "/tmp/deploy-tools-output/modules/versions/1.0/entrypoints" diff --git a/tests/samples/05-restored/deploy-tools-output/modules/versions/2.0/module.yaml b/tests/samples/05-restored/deploy-tools-output/modules/versions/2.0/module.yaml new file mode 100644 index 00000000..470ad008 --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modules/versions/2.0/module.yaml @@ -0,0 +1,10 @@ +allow_updates: false +applications: [] +dependencies: [] +description: Module demonstrating multiple versions and default-version selection +env_vars: [] +exclude_from_defaults: false +load_script: [] +name: versions +unload_script: [] +version: '2.0' diff --git a/tests/samples/05-restored/deploy-tools-output/modules/versions/2.0/modulefile b/tests/samples/05-restored/deploy-tools-output/modules/versions/2.0/modulefile new file mode 100644 index 00000000..0b0bd699 --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modules/versions/2.0/modulefile @@ -0,0 +1,13 @@ +#%Module1.0 +## +## versions - Module demonstrating multiple versions and default-version selection +## +module-whatis "Module demonstrating multiple versions and default-version selection" + +if { [module-info mode load] } { + if { [is-loaded versions] } { + module unload versions + } +} + +prepend-path PATH "/tmp/deploy-tools-output/modules/versions/2.0/entrypoints" diff --git a/tests/samples/05-restored/deploy-tools-output/modules/versions/2.1rc1/module.yaml b/tests/samples/05-restored/deploy-tools-output/modules/versions/2.1rc1/module.yaml new file mode 100644 index 00000000..490f83e9 --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modules/versions/2.1rc1/module.yaml @@ -0,0 +1,10 @@ +allow_updates: false +applications: [] +dependencies: [] +description: Module demonstrating multiple versions and default-version selection +env_vars: [] +exclude_from_defaults: true +load_script: [] +name: versions +unload_script: [] +version: 2.1rc1 diff --git a/tests/samples/05-restored/deploy-tools-output/modules/versions/2.1rc1/modulefile b/tests/samples/05-restored/deploy-tools-output/modules/versions/2.1rc1/modulefile new file mode 100644 index 00000000..a92b4324 --- /dev/null +++ b/tests/samples/05-restored/deploy-tools-output/modules/versions/2.1rc1/modulefile @@ -0,0 +1,13 @@ +#%Module1.0 +## +## versions - Module demonstrating multiple versions and default-version selection +## +module-whatis "Module demonstrating multiple versions and default-version selection" + +if { [module-info mode load] } { + if { [is-loaded versions] } { + module unload versions + } +} + +prepend-path PATH "/tmp/deploy-tools-output/modules/versions/2.1rc1/entrypoints" diff --git a/tests/samples/05-restored/validate.txt b/tests/samples/05-restored/validate.txt index 9bde4baf..4aef44b1 100644 --- a/tests/samples/05-restored/validate.txt +++ b/tests/samples/05-restored/validate.txt @@ -1,5 +1,4 @@ Modules to be restored: -example-module-extra/1.0 +versions/2.1rc1 -Updated module defaults: -example-module-extra None -> 1.0 +No default version changes diff --git a/tests/samples/06-removed/deploy-tools-output/deployment.yaml b/tests/samples/06-removed/deploy-tools-output/deployment.yaml index f3aa403c..c2972e01 100644 --- a/tests/samples/06-removed/deploy-tools-output/deployment.yaml +++ b/tests/samples/06-removed/deploy-tools-output/deployment.yaml @@ -1,5 +1,5 @@ releases: - example-module-apps: + apps: '0.1': deprecated: false module: @@ -33,34 +33,79 @@ releases: - echo and this is the second line. - echo Your input is ${1} dependencies: [] - description: Demonstration of a module configuration folder + description: Module demonstrating shell and Apptainer applications env_vars: - name: OTHER_VALUE value: Version 0.1 exclude_from_defaults: false load_script: [] - name: example-module-apps + name: apps unload_script: [] version: '0.1' - example-module-extra: + deps: + '0.2': + deprecated: false + module: + allow_updates: false + applications: [] + dependencies: + - name: apps + version: '0.1' + - name: external-module + version: null + description: Module demonstrating dependencies + env_vars: [] + exclude_from_defaults: false + load_script: [] + name: deps + unload_script: [] + version: '0.2' + updatable: '1.0': deprecated: false module: allow_updates: true applications: - app_type: shell - name: test-extra-echo + name: test-updatable-echo script: - - echo $EXTRA_VALUE + - echo $UPDATABLE_VALUE dependencies: [] - description: Demonstration of adding a module in a later sync + description: Module demonstrating in-place updates (allow_updates) env_vars: - - name: EXTRA_VALUE + - name: UPDATABLE_VALUE value: Updated in a later sync exclude_from_defaults: false load_script: [] - name: example-module-extra + name: updatable unload_script: [] version: '1.0' + versions: + '2.0': + deprecated: false + module: + allow_updates: false + applications: [] + dependencies: [] + description: Module demonstrating multiple versions and default-version selection + env_vars: [] + exclude_from_defaults: false + load_script: [] + name: versions + unload_script: [] + version: '2.0' + 2.1rc1: + deprecated: false + module: + allow_updates: false + applications: [] + dependencies: [] + description: Module demonstrating multiple versions and default-version selection + env_vars: [] + exclude_from_defaults: true + load_script: [] + name: versions + unload_script: [] + version: 2.1rc1 settings: default_versions: {} diff --git a/tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-apps/.version b/tests/samples/06-removed/deploy-tools-output/modulefiles/apps/.version similarity index 100% rename from tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-apps/.version rename to tests/samples/06-removed/deploy-tools-output/modulefiles/apps/.version diff --git a/tests/samples/06-removed/deploy-tools-output/modulefiles/apps/0.1 b/tests/samples/06-removed/deploy-tools-output/modulefiles/apps/0.1 new file mode 120000 index 00000000..69615f97 --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modulefiles/apps/0.1 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/apps/0.1/modulefile \ No newline at end of file diff --git a/tests/samples/06-removed/deploy-tools-output/modulefiles/deps/.version b/tests/samples/06-removed/deploy-tools-output/modulefiles/deps/.version new file mode 100644 index 00000000..26a66b44 --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modulefiles/deps/.version @@ -0,0 +1,2 @@ +#%Module1.0 +set ModulesVersion 0.2 diff --git a/tests/samples/06-removed/deploy-tools-output/modulefiles/deps/0.2 b/tests/samples/06-removed/deploy-tools-output/modulefiles/deps/0.2 new file mode 120000 index 00000000..5d82a765 --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modulefiles/deps/0.2 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/deps/0.2/modulefile \ No newline at end of file diff --git a/tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-apps/0.1 b/tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-apps/0.1 deleted file mode 120000 index 53b90576..00000000 --- a/tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-apps/0.1 +++ /dev/null @@ -1 +0,0 @@ -/tmp/deploy-tools-output/modules/example-module-apps/0.1/modulefile \ No newline at end of file diff --git a/tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-extra/1.0 b/tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-extra/1.0 deleted file mode 120000 index 59949819..00000000 --- a/tests/samples/06-removed/deploy-tools-output/modulefiles/example-module-extra/1.0 +++ /dev/null @@ -1 +0,0 @@ -/tmp/deploy-tools-output/modules/example-module-extra/1.0/modulefile \ No newline at end of file diff --git a/tests/samples/06-removed/deploy-tools-output/modulefiles/updatable/.version b/tests/samples/06-removed/deploy-tools-output/modulefiles/updatable/.version new file mode 100644 index 00000000..f0d55435 --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modulefiles/updatable/.version @@ -0,0 +1,2 @@ +#%Module1.0 +set ModulesVersion 1.0 diff --git a/tests/samples/06-removed/deploy-tools-output/modulefiles/updatable/1.0 b/tests/samples/06-removed/deploy-tools-output/modulefiles/updatable/1.0 new file mode 120000 index 00000000..bd2fb2bd --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modulefiles/updatable/1.0 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/updatable/1.0/modulefile \ No newline at end of file diff --git a/tests/samples/06-removed/deploy-tools-output/modulefiles/versions/.version b/tests/samples/06-removed/deploy-tools-output/modulefiles/versions/.version new file mode 100644 index 00000000..5d5fbb68 --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modulefiles/versions/.version @@ -0,0 +1,2 @@ +#%Module1.0 +set ModulesVersion 2.0 diff --git a/tests/samples/06-removed/deploy-tools-output/modulefiles/versions/2.0 b/tests/samples/06-removed/deploy-tools-output/modulefiles/versions/2.0 new file mode 120000 index 00000000..b0c4f475 --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modulefiles/versions/2.0 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/versions/2.0/modulefile \ No newline at end of file diff --git a/tests/samples/06-removed/deploy-tools-output/modulefiles/versions/2.1rc1 b/tests/samples/06-removed/deploy-tools-output/modulefiles/versions/2.1rc1 new file mode 120000 index 00000000..10b125b4 --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modulefiles/versions/2.1rc1 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/versions/2.1rc1/modulefile \ No newline at end of file diff --git a/tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello b/tests/samples/06-removed/deploy-tools-output/modules/apps/0.1/entrypoints/cowsay-hello similarity index 100% rename from tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/cowsay-hello rename to tests/samples/06-removed/deploy-tools-output/modules/apps/0.1/entrypoints/cowsay-hello diff --git a/tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var b/tests/samples/06-removed/deploy-tools-output/modules/apps/0.1/entrypoints/test-echo-module-var similarity index 100% rename from tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-echo-module-var rename to tests/samples/06-removed/deploy-tools-output/modules/apps/0.1/entrypoints/test-echo-module-var diff --git a/tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script b/tests/samples/06-removed/deploy-tools-output/modules/apps/0.1/entrypoints/test-shell-script similarity index 100% rename from tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/entrypoints/test-shell-script rename to tests/samples/06-removed/deploy-tools-output/modules/apps/0.1/entrypoints/test-shell-script diff --git a/tests/samples/06-removed/deploy-tools-output/modules/apps/0.1/module.yaml b/tests/samples/06-removed/deploy-tools-output/modules/apps/0.1/module.yaml new file mode 100644 index 00000000..60d6f708 --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modules/apps/0.1/module.yaml @@ -0,0 +1,39 @@ +allow_updates: false +applications: +- app_type: apptainer + container: + path: docker://ghcr.io/apptainer/lolcow + version: latest + entrypoints: + - command: cowsay + name: cowsay-hello + options: + apptainer_args: '' + command_args: Hello + host_binaries: [] + mounts: [] + global_options: + apptainer_args: '' + command_args: '' + host_binaries: [] + mounts: [] +- app_type: shell + name: test-echo-module-var + script: + - echo $OTHER_VALUE +- app_type: shell + name: test-shell-script + script: + - echo This is the first line of a shell script + - echo and this is the second line. + - echo Your input is ${1} +dependencies: [] +description: Module demonstrating shell and Apptainer applications +env_vars: +- name: OTHER_VALUE + value: Version 0.1 +exclude_from_defaults: false +load_script: [] +name: apps +unload_script: [] +version: '0.1' diff --git a/tests/samples/06-removed/deploy-tools-output/modules/apps/0.1/modulefile b/tests/samples/06-removed/deploy-tools-output/modules/apps/0.1/modulefile new file mode 100644 index 00000000..9aefe70f --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modules/apps/0.1/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## apps - Module demonstrating shell and Apptainer applications +## +module-whatis "Module demonstrating shell and Apptainer applications" + +if { [module-info mode load] } { + if { [is-loaded apps] } { + module unload apps + } +} + +setenv OTHER_VALUE "Version 0.1" + +prepend-path PATH "/tmp/deploy-tools-output/modules/apps/0.1/entrypoints" diff --git a/tests/samples/06-removed/deploy-tools-output/modules/deps/0.2/module.yaml b/tests/samples/06-removed/deploy-tools-output/modules/deps/0.2/module.yaml new file mode 100644 index 00000000..641f01a8 --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modules/deps/0.2/module.yaml @@ -0,0 +1,14 @@ +allow_updates: false +applications: [] +dependencies: +- name: apps + version: '0.1' +- name: external-module + version: null +description: Module demonstrating dependencies +env_vars: [] +exclude_from_defaults: false +load_script: [] +name: deps +unload_script: [] +version: '0.2' diff --git a/tests/samples/06-removed/deploy-tools-output/modules/deps/0.2/modulefile b/tests/samples/06-removed/deploy-tools-output/modules/deps/0.2/modulefile new file mode 100644 index 00000000..56e10614 --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modules/deps/0.2/modulefile @@ -0,0 +1,16 @@ +#%Module1.0 +## +## deps - Module demonstrating dependencies +## +module-whatis "Module demonstrating dependencies" + +if { [module-info mode load] } { + if { [is-loaded deps] } { + module unload deps + } +} + +module load apps/0.1 +module load external-module + +prepend-path PATH "/tmp/deploy-tools-output/modules/deps/0.2/entrypoints" diff --git a/tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/module.yaml b/tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/module.yaml deleted file mode 100644 index 51a06102..00000000 --- a/tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/module.yaml +++ /dev/null @@ -1,39 +0,0 @@ -allow_updates: false -applications: -- app_type: apptainer - container: - path: docker://ghcr.io/apptainer/lolcow - version: latest - entrypoints: - - command: cowsay - name: cowsay-hello - options: - apptainer_args: '' - command_args: Hello - host_binaries: [] - mounts: [] - global_options: - apptainer_args: '' - command_args: '' - host_binaries: [] - mounts: [] -- app_type: shell - name: test-echo-module-var - script: - - echo $OTHER_VALUE -- app_type: shell - name: test-shell-script - script: - - echo This is the first line of a shell script - - echo and this is the second line. - - echo Your input is ${1} -dependencies: [] -description: Demonstration of a module configuration folder -env_vars: -- name: OTHER_VALUE - value: Version 0.1 -exclude_from_defaults: false -load_script: [] -name: example-module-apps -unload_script: [] -version: '0.1' diff --git a/tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/modulefile b/tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/modulefile deleted file mode 100644 index b6458983..00000000 --- a/tests/samples/06-removed/deploy-tools-output/modules/example-module-apps/0.1/modulefile +++ /dev/null @@ -1,15 +0,0 @@ -#%Module1.0 -## -## example-module-apps - Demonstration of a module configuration folder -## -module-whatis "Demonstration of a module configuration folder" - -if { [module-info mode load] } { - if { [is-loaded example-module-apps] } { - module unload example-module-apps - } -} - -setenv OTHER_VALUE "Version 0.1" - -prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-apps/0.1/entrypoints" diff --git a/tests/samples/06-removed/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo b/tests/samples/06-removed/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo deleted file mode 100755 index 77e9301a..00000000 --- a/tests/samples/06-removed/deploy-tools-output/modules/example-module-extra/1.0/entrypoints/test-extra-echo +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/bash - -if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then - set -x -fi - -echo $EXTRA_VALUE diff --git a/tests/samples/06-removed/deploy-tools-output/modules/example-module-extra/1.0/modulefile b/tests/samples/06-removed/deploy-tools-output/modules/example-module-extra/1.0/modulefile deleted file mode 100644 index f3ede93d..00000000 --- a/tests/samples/06-removed/deploy-tools-output/modules/example-module-extra/1.0/modulefile +++ /dev/null @@ -1,15 +0,0 @@ -#%Module1.0 -## -## example-module-extra - Demonstration of adding a module in a later sync -## -module-whatis "Demonstration of adding a module in a later sync" - -if { [module-info mode load] } { - if { [is-loaded example-module-extra] } { - module unload example-module-extra - } -} - -setenv EXTRA_VALUE "Updated in a later sync" - -prepend-path PATH "/tmp/deploy-tools-output/modules/example-module-extra/1.0/entrypoints" diff --git a/tests/samples/06-removed/deploy-tools-output/modules/updatable/1.0/entrypoints/test-updatable-echo b/tests/samples/06-removed/deploy-tools-output/modules/updatable/1.0/entrypoints/test-updatable-echo new file mode 100755 index 00000000..a384ba31 --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modules/updatable/1.0/entrypoints/test-updatable-echo @@ -0,0 +1,7 @@ +#! /bin/bash + +if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then + set -x +fi + +echo $UPDATABLE_VALUE diff --git a/tests/samples/05-restored/deploy-tools-output/modules/example-module-extra/1.0/module.yaml b/tests/samples/06-removed/deploy-tools-output/modules/updatable/1.0/module.yaml similarity index 55% rename from tests/samples/05-restored/deploy-tools-output/modules/example-module-extra/1.0/module.yaml rename to tests/samples/06-removed/deploy-tools-output/modules/updatable/1.0/module.yaml index a592a777..8b7a0358 100644 --- a/tests/samples/05-restored/deploy-tools-output/modules/example-module-extra/1.0/module.yaml +++ b/tests/samples/06-removed/deploy-tools-output/modules/updatable/1.0/module.yaml @@ -1,16 +1,16 @@ allow_updates: true applications: - app_type: shell - name: test-extra-echo + name: test-updatable-echo script: - - echo $EXTRA_VALUE + - echo $UPDATABLE_VALUE dependencies: [] -description: Demonstration of adding a module in a later sync +description: Module demonstrating in-place updates (allow_updates) env_vars: -- name: EXTRA_VALUE +- name: UPDATABLE_VALUE value: Updated in a later sync exclude_from_defaults: false load_script: [] -name: example-module-extra +name: updatable unload_script: [] version: '1.0' diff --git a/tests/samples/06-removed/deploy-tools-output/modules/updatable/1.0/modulefile b/tests/samples/06-removed/deploy-tools-output/modules/updatable/1.0/modulefile new file mode 100644 index 00000000..b8660602 --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modules/updatable/1.0/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## updatable - Module demonstrating in-place updates (allow_updates) +## +module-whatis "Module demonstrating in-place updates (allow_updates)" + +if { [module-info mode load] } { + if { [is-loaded updatable] } { + module unload updatable + } +} + +setenv UPDATABLE_VALUE "Updated in a later sync" + +prepend-path PATH "/tmp/deploy-tools-output/modules/updatable/1.0/entrypoints" diff --git a/tests/samples/06-removed/deploy-tools-output/modules/versions/2.0/module.yaml b/tests/samples/06-removed/deploy-tools-output/modules/versions/2.0/module.yaml new file mode 100644 index 00000000..470ad008 --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modules/versions/2.0/module.yaml @@ -0,0 +1,10 @@ +allow_updates: false +applications: [] +dependencies: [] +description: Module demonstrating multiple versions and default-version selection +env_vars: [] +exclude_from_defaults: false +load_script: [] +name: versions +unload_script: [] +version: '2.0' diff --git a/tests/samples/06-removed/deploy-tools-output/modules/versions/2.0/modulefile b/tests/samples/06-removed/deploy-tools-output/modules/versions/2.0/modulefile new file mode 100644 index 00000000..0b0bd699 --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modules/versions/2.0/modulefile @@ -0,0 +1,13 @@ +#%Module1.0 +## +## versions - Module demonstrating multiple versions and default-version selection +## +module-whatis "Module demonstrating multiple versions and default-version selection" + +if { [module-info mode load] } { + if { [is-loaded versions] } { + module unload versions + } +} + +prepend-path PATH "/tmp/deploy-tools-output/modules/versions/2.0/entrypoints" diff --git a/tests/samples/06-removed/deploy-tools-output/modules/versions/2.1rc1/module.yaml b/tests/samples/06-removed/deploy-tools-output/modules/versions/2.1rc1/module.yaml new file mode 100644 index 00000000..490f83e9 --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modules/versions/2.1rc1/module.yaml @@ -0,0 +1,10 @@ +allow_updates: false +applications: [] +dependencies: [] +description: Module demonstrating multiple versions and default-version selection +env_vars: [] +exclude_from_defaults: true +load_script: [] +name: versions +unload_script: [] +version: 2.1rc1 diff --git a/tests/samples/06-removed/deploy-tools-output/modules/versions/2.1rc1/modulefile b/tests/samples/06-removed/deploy-tools-output/modules/versions/2.1rc1/modulefile new file mode 100644 index 00000000..a92b4324 --- /dev/null +++ b/tests/samples/06-removed/deploy-tools-output/modules/versions/2.1rc1/modulefile @@ -0,0 +1,13 @@ +#%Module1.0 +## +## versions - Module demonstrating multiple versions and default-version selection +## +module-whatis "Module demonstrating multiple versions and default-version selection" + +if { [module-info mode load] } { + if { [is-loaded versions] } { + module unload versions + } +} + +prepend-path PATH "/tmp/deploy-tools-output/modules/versions/2.1rc1/entrypoints" diff --git a/tests/samples/06-removed/validate.txt b/tests/samples/06-removed/validate.txt index a5d50c54..962cf72a 100644 --- a/tests/samples/06-removed/validate.txt +++ b/tests/samples/06-removed/validate.txt @@ -1,4 +1,4 @@ Modules to be removed: -example-module-deps/0.2 +versions/1.0 No default version changes diff --git a/tests/test_golden_master.py b/tests/test_golden_master.py index d64e9e5a..423d0b72 100644 --- a/tests/test_golden_master.py +++ b/tests/test_golden_master.py @@ -111,50 +111,50 @@ def test_module_lifecycle( # tmp_path is a fresh, empty, per-test directory; the stages below share it as one # deployment area, each building on the previous state, with no cross-run leakage. - # Stage 1: deploy the initial configuration into an empty area. + # Stage 1: deploy apps, deps, and versions/1.0 into an empty area. _run_stage(samples, configs, tmp_path, "01-initial", from_scratch=True) - # Stage 2: deploy a brand-new module on an incremental (non from-scratch) sync; the - # modules already deployed are left untouched. + # Stage 2: on an incremental sync, add the updatable module and a second version + # (versions/2.0); the default version migrates from 1.0 to 2.0. _run_stage(samples, configs, tmp_path, "02-added") - # Stage 3: update example-module-extra/1.0 in place (allowed via allow_updates), so - # the module is rebuilt and its modulefile contents change. + # Stage 3: update updatable/1.0 in place (allowed via allow_updates) and add an + # excluded prerelease (versions/2.1rc1); the default stays 2.0. _run_stage(samples, configs, tmp_path, "03-updated") - # Stage 4: deprecate example-module-deps/0.2 (en route to removal) and - # example-module-extra/1.0 (to set up the restore that follows). Both modulefile - # links move out of the live area into the deprecated area; built modules stay put. + # Stage 4: deprecate versions/1.0 (en route to removal) and versions/2.1rc1 (to set + # up the restore that follows). Their live modulefile links move into the deprecated + # area; the built modules and versions/2.0 (still the default) stay put. _run_stage( samples, configs, tmp_path, "04-deprecated", absent=( - "modulefiles/example-module-deps", - "modulefiles/example-module-extra", + "modulefiles/versions/1.0", + "modulefiles/versions/2.1rc1", ), ) - # Stage 5: restore example-module-extra/1.0 by un-deprecating it. Its modulefile - # link moves back into the live area; example-module-deps/0.2 stays deprecated. + # Stage 5: restore versions/2.1rc1 by un-deprecating it. Its modulefile link moves + # back into the live area; versions/1.0 stays deprecated. _run_stage( samples, configs, tmp_path, "05-restored", - absent=("deprecated/modulefiles/example-module-extra",), + absent=("deprecated/modulefiles/versions/2.1rc1",), ) - # Stage 6: remove the now-deprecated example-module-deps/0.2 entirely. Both its - # modulefile link and built module should be gone; example-module-extra remains. + # Stage 6: remove the now-deprecated versions/1.0 entirely. Both its modulefile link + # and built module should be gone; versions/2.0 and 2.1rc1 remain. _run_stage( samples, configs, tmp_path, "06-removed", absent=( - "modules/example-module-deps", - "deprecated/modulefiles/example-module-deps", + "modules/versions/1.0", + "deprecated/modulefiles/versions/1.0", ), ) From fb387c59ad503feffaff7d7ff4b4a50783cf312c Mon Sep 17 00:00:00 2001 From: Martin Gaughran Date: Mon, 29 Jun 2026 12:15:41 +0000 Subject: [PATCH 16/19] Revert demo configuration to original files These were stripped down for the golden master tests, but those are now using separate configuration. --- .../demo_configuration/argocd/v2.14.10.yaml | 13 +++++ .../dls-pmac-control/0.1.yaml | 29 ++++++++++ .../dls-pmac-control/0.2.yaml | 29 ++++++++++ .../demo_configuration/ec/i13-1.yaml | 19 +++++++ .../demo_configuration/ec/p47.yaml | 20 +++++++ .../edge-containers-cli/0.1.yaml | 54 +++++++++++++++++++ .../example-module-apps/0.1.yaml | 13 ++++- .../example-module-deps/0.2.yaml | 2 + .../demo_configuration/phoebus/0.1.yaml | 20 +++++++ .../demo_configuration/settings.yaml | 3 +- 10 files changed, 199 insertions(+), 3 deletions(-) create mode 100644 src/deploy_tools/demo_configuration/argocd/v2.14.10.yaml create mode 100644 src/deploy_tools/demo_configuration/dls-pmac-control/0.1.yaml create mode 100644 src/deploy_tools/demo_configuration/dls-pmac-control/0.2.yaml create mode 100644 src/deploy_tools/demo_configuration/ec/i13-1.yaml create mode 100644 src/deploy_tools/demo_configuration/ec/p47.yaml create mode 100644 src/deploy_tools/demo_configuration/edge-containers-cli/0.1.yaml create mode 100644 src/deploy_tools/demo_configuration/phoebus/0.1.yaml diff --git a/src/deploy_tools/demo_configuration/argocd/v2.14.10.yaml b/src/deploy_tools/demo_configuration/argocd/v2.14.10.yaml new file mode 100644 index 00000000..a0b09c3e --- /dev/null +++ b/src/deploy_tools/demo_configuration/argocd/v2.14.10.yaml @@ -0,0 +1,13 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: argocd + version: v2.14.10 + description: Demonstration of binary download + + applications: + - app_type: binary + name: argocd + url: https://github.com/argoproj/argo-cd/releases/download/v2.14.10/argocd-linux-amd64 + hash_type: sha256 + hash: d1750274a336f0a090abf196a832cee14cb9f1c2fc3d20d80b0dbfeff83550fa diff --git a/src/deploy_tools/demo_configuration/dls-pmac-control/0.1.yaml b/src/deploy_tools/demo_configuration/dls-pmac-control/0.1.yaml new file mode 100644 index 00000000..12865f7d --- /dev/null +++ b/src/deploy_tools/demo_configuration/dls-pmac-control/0.1.yaml @@ -0,0 +1,29 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: dls-pmac-control + version: "0.1" + description: Demonstration of the deploy-tools process + + env_vars: + - name: EXAMPLE_VALUE + value: Test message EXAMPLE_VALUE from example-module-file version 0.1 + + applications: + - app_type: apptainer + + container: + path: docker://ghcr.io/diamondlightsource/dls-pmac-control + version: "3.2.0b1" + + entrypoints: + - name: dls-pmac-control + command: dls-pmac-control + options: + apptainer_args: -e + + - app_type: shell + + name: test-echo-module-file + script: + - echo $EXAMPLE_VALUE diff --git a/src/deploy_tools/demo_configuration/dls-pmac-control/0.2.yaml b/src/deploy_tools/demo_configuration/dls-pmac-control/0.2.yaml new file mode 100644 index 00000000..4302f7dd --- /dev/null +++ b/src/deploy_tools/demo_configuration/dls-pmac-control/0.2.yaml @@ -0,0 +1,29 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: dls-pmac-control + version: "0.2" + description: Demonstration of the deploy-tools process + + env_vars: + - name: EXAMPLE_VALUE + value: Test message EXAMPLE_VALUE from example-module-file version 0.2 + + applications: + - app_type: apptainer + + container: + path: docker://ghcr.io/diamondlightsource/dls-pmac-control + version: "3.2.0b1" + + entrypoints: + - name: dls-pmac-control + command: dls-pmac-control + options: + apptainer_args: -e + + - app_type: shell + + name: test-echo-module-file + script: + - echo $EXAMPLE_VALUE diff --git a/src/deploy_tools/demo_configuration/ec/i13-1.yaml b/src/deploy_tools/demo_configuration/ec/i13-1.yaml new file mode 100644 index 00000000..8ee73cb4 --- /dev/null +++ b/src/deploy_tools/demo_configuration/ec/i13-1.yaml @@ -0,0 +1,19 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: ec + version: i13-1 + description: ec command line tool configured for i13-1 + + dependencies: + - name: edge-containers-cli + - name: k8s-i13-1 + version: local + + env_vars: + - name: EC_TARGET + value: i13-1-beamline/i13-1 + - name: EC_SERVICES_REPO + value: https://gitlab.diamond.ac.uk/controls/containers/beamline/i13-1-services.git + + applications: [] diff --git a/src/deploy_tools/demo_configuration/ec/p47.yaml b/src/deploy_tools/demo_configuration/ec/p47.yaml new file mode 100644 index 00000000..47291088 --- /dev/null +++ b/src/deploy_tools/demo_configuration/ec/p47.yaml @@ -0,0 +1,20 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: ec + version: p47 + description: ec command line tool configured for p47 + + dependencies: + - name: edge-containers-cli + version: "0.1" + - name: pollux + version: local + + env_vars: + - name: EC_TARGET + value: p47-beamline/p47 + - name: EC_SERVICES_REPO + value: https://github.com/epics-containers/p47-services + + applications: [] diff --git a/src/deploy_tools/demo_configuration/edge-containers-cli/0.1.yaml b/src/deploy_tools/demo_configuration/edge-containers-cli/0.1.yaml new file mode 100644 index 00000000..30536008 --- /dev/null +++ b/src/deploy_tools/demo_configuration/edge-containers-cli/0.1.yaml @@ -0,0 +1,54 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: edge-containers-cli + version: "0.1" + description: ec command line tool for kubernetes IOCs + + dependencies: + - name: argocd + version: v2.14.10 + + env_vars: + - name: EC_CLI_BACKEND + value: ARGOCD + - name: EC_LOG_URL + value: "https://graylog.diamond.ac.uk/search?rangetype=relative&fields=message%2Csource&width=1489&highlightMessage=&relative=172800&q=pod_name%3A{service_name}*" + + applications: + - app_type: apptainer + + container: + path: docker://ghcr.io/epics-containers/edge-containers-cli + version: "4.4.1" + + entrypoints: + - name: ec + command: ec + # for debugging enter the container with bash shell + - name: ec-bash + command: bash + + global_options: + mounts: + # places to get argocd and kubectl config from + - /dls/science/users/:/dls/science/users/ + - /scratch:/scratch + - /dls_sw/apps:/dls_sw/apps + host_binaries: + # argocd deploy-tools + - argocd + # other kubernetes tools from the beamline cluster module + - kubectl + - helm + - kubelogin + - klogout + - kustomize + - kubeseal + - kubectl-oidc_login + + - app_type: shell + name: ec-login + script: + - argocd login argocd.diamond.ac.uk --grpc-web --sso + - kubectl version diff --git a/src/deploy_tools/demo_configuration/example-module-apps/0.1.yaml b/src/deploy_tools/demo_configuration/example-module-apps/0.1.yaml index 0a934518..1145a3ac 100644 --- a/src/deploy_tools/demo_configuration/example-module-apps/0.1.yaml +++ b/src/deploy_tools/demo_configuration/example-module-apps/0.1.yaml @@ -7,7 +7,7 @@ module: env_vars: - name: OTHER_VALUE - value: Version 0.1 + value: Test message OTHER_VALUE from example-module-folder applications: - app_type: apptainer @@ -22,9 +22,18 @@ module: options: command_args: Hello + - name: show-directory + command: ls + options: + command_args: -al /dls_sw_test + + global_options: + mounts: + - /dls_sw:/dls_sw_test:ro + - app_type: shell - name: test-echo-module-var + name: test-echo-module-folder script: - echo $OTHER_VALUE diff --git a/src/deploy_tools/demo_configuration/example-module-deps/0.2.yaml b/src/deploy_tools/demo_configuration/example-module-deps/0.2.yaml index 4e5c3fc4..7b9da8d1 100644 --- a/src/deploy_tools/demo_configuration/example-module-deps/0.2.yaml +++ b/src/deploy_tools/demo_configuration/example-module-deps/0.2.yaml @@ -6,6 +6,8 @@ module: description: Demonstration of deploy-tools dependencies dependencies: + - name: dls-pmac-control + version: "0.1" - name: example-module-apps version: "0.1" diff --git a/src/deploy_tools/demo_configuration/phoebus/0.1.yaml b/src/deploy_tools/demo_configuration/phoebus/0.1.yaml new file mode 100644 index 00000000..33ef8af0 --- /dev/null +++ b/src/deploy_tools/demo_configuration/phoebus/0.1.yaml @@ -0,0 +1,20 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: phoebus + version: "0.1" + description: Containerised release of CSS Phoebus + + applications: + - app_type: apptainer + + container: + path: docker://ghcr.io/epics-containers/ec-phoebus + version: "4.7.3ec2" + + entrypoints: + - name: phoebus + command: java -jar /phoebus/phoebus.jar -server 7010 + options: + apptainer_args: --env DISPLAY=${DISPLAY} -e + command_args: -server 7010 diff --git a/src/deploy_tools/demo_configuration/settings.yaml b/src/deploy_tools/demo_configuration/settings.yaml index 70f60017..8009f5a5 100644 --- a/src/deploy_tools/demo_configuration/settings.yaml +++ b/src/deploy_tools/demo_configuration/settings.yaml @@ -1,3 +1,4 @@ # yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/deployment-settings.json -default_versions: {} +default_versions: + dls-pmac-control: "0.1" From b75113207a32b437b8fb8fd8855ac04664760384 Mon Sep 17 00:00:00 2001 From: Martin Gaughran Date: Tue, 30 Jun 2026 12:21:46 +0000 Subject: [PATCH 17/19] Remove unused schema paths variable from tests --- tests/test_schema_gen.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/test_schema_gen.py b/tests/test_schema_gen.py index 3c1d6c57..8cbddfaa 100644 --- a/tests/test_schema_gen.py +++ b/tests/test_schema_gen.py @@ -3,10 +3,6 @@ from conftest import run_cli -PATH_TO_SCHEMAS = ( - Path(__file__).parent.parent / "src" / "deploy_tools" / "models" / "schemas" -) - def test_schema_gen(schemas: Path) -> None: with tempfile.TemporaryDirectory() as tmp: From 591326d024627c8278443e2e51d33a819647f50b Mon Sep 17 00:00:00 2001 From: Martin Gaughran Date: Tue, 30 Jun 2026 12:34:29 +0000 Subject: [PATCH 18/19] Remove comment in print_updates.py that refers to PYTHONHASHSEED Instead, we clearly indicate that the type is a set (and that therefore sorting is necessary). --- src/deploy_tools/print_updates.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/deploy_tools/print_updates.py b/src/deploy_tools/print_updates.py index 66a655ce..61bf9b4e 100644 --- a/src/deploy_tools/print_updates.py +++ b/src/deploy_tools/print_updates.py @@ -39,11 +39,9 @@ def _print_module_updates(release_changes: ReleaseChanges) -> None: def _print_version_updates( old_defaults: DefaultVersionsByName, new_defaults: DefaultVersionsByName ) -> None: - module_names = old_defaults.keys() | new_defaults.keys() + module_names: set[str] = old_defaults.keys() | new_defaults.keys() update_messages: list[str] = [] - # Sort for stable output: module_names is a set, whose iteration order depends on - # PYTHONHASHSEED. for name in sorted(module_names): old = old_defaults.get(name, "None") new = new_defaults.get(name, "None") From 22028aa446c29e106c0e3f3bb48798fea43fac70 Mon Sep 17 00:00:00 2001 From: Martin Gaughran Date: Tue, 30 Jun 2026 13:33:59 +0000 Subject: [PATCH 19/19] Rework golden master tests to ensure each stage name is accurate The 'updatable' module has now been added from the start, and both new versions are added in 02-added. The test description has been updated to reflect these changes. --- .../01-initial/updatable/1.0.yaml | 21 +++++++++++++++++++ .../golden-master/02-added/updatable/1.0.yaml | 2 +- .../02-added/versions/2.1rc1.yaml | 12 +++++++++++ .../deploy-tools-output/deployment.yaml | 20 ++++++++++++++++++ .../modulefiles/updatable/.version | 2 ++ .../modulefiles/updatable/1.0 | 1 + .../1.0/entrypoints/test-updatable-echo | 7 +++++++ .../modules/updatable/1.0/module.yaml | 16 ++++++++++++++ .../modules/updatable/1.0/modulefile | 15 +++++++++++++ tests/samples/01-initial/validate.txt | 2 ++ .../deploy-tools-output/deployment.yaml | 15 ++++++++++++- .../modulefiles/versions/2.1rc1 | 1 + .../modules/updatable/1.0/module.yaml | 2 +- .../modules/updatable/1.0/modulefile | 2 +- .../modules/versions/2.1rc1/module.yaml | 10 +++++++++ .../modules/versions/2.1rc1/modulefile | 13 ++++++++++++ tests/samples/02-added/validate.txt | 3 +-- tests/samples/03-updated/validate.txt | 3 --- tests/test_golden_master.py | 10 ++++----- 19 files changed, 143 insertions(+), 14 deletions(-) create mode 100644 tests/configs/golden-master/01-initial/updatable/1.0.yaml create mode 100644 tests/configs/golden-master/02-added/versions/2.1rc1.yaml create mode 100644 tests/samples/01-initial/deploy-tools-output/modulefiles/updatable/.version create mode 120000 tests/samples/01-initial/deploy-tools-output/modulefiles/updatable/1.0 create mode 100755 tests/samples/01-initial/deploy-tools-output/modules/updatable/1.0/entrypoints/test-updatable-echo create mode 100644 tests/samples/01-initial/deploy-tools-output/modules/updatable/1.0/module.yaml create mode 100644 tests/samples/01-initial/deploy-tools-output/modules/updatable/1.0/modulefile create mode 120000 tests/samples/02-added/deploy-tools-output/modulefiles/versions/2.1rc1 create mode 100644 tests/samples/02-added/deploy-tools-output/modules/versions/2.1rc1/module.yaml create mode 100644 tests/samples/02-added/deploy-tools-output/modules/versions/2.1rc1/modulefile diff --git a/tests/configs/golden-master/01-initial/updatable/1.0.yaml b/tests/configs/golden-master/01-initial/updatable/1.0.yaml new file mode 100644 index 00000000..f2d2d152 --- /dev/null +++ b/tests/configs/golden-master/01-initial/updatable/1.0.yaml @@ -0,0 +1,21 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: updatable + version: "1.0" + description: Module demonstrating in-place updates (allow_updates) + + env_vars: + - name: UPDATABLE_VALUE + value: Set at initial deployment + + applications: + - app_type: shell + + name: test-updatable-echo + script: + - echo $UPDATABLE_VALUE + + # allow_updates lets a later sync change this version's configuration in place, + # without bumping the version number. + allow_updates: true diff --git a/tests/configs/golden-master/02-added/updatable/1.0.yaml b/tests/configs/golden-master/02-added/updatable/1.0.yaml index a6a62504..f2d2d152 100644 --- a/tests/configs/golden-master/02-added/updatable/1.0.yaml +++ b/tests/configs/golden-master/02-added/updatable/1.0.yaml @@ -7,7 +7,7 @@ module: env_vars: - name: UPDATABLE_VALUE - value: Added after initial deployment + value: Set at initial deployment applications: - app_type: shell diff --git a/tests/configs/golden-master/02-added/versions/2.1rc1.yaml b/tests/configs/golden-master/02-added/versions/2.1rc1.yaml new file mode 100644 index 00000000..64cd4eed --- /dev/null +++ b/tests/configs/golden-master/02-added/versions/2.1rc1.yaml @@ -0,0 +1,12 @@ +# yaml-language-server: $schema=/workspaces/deploy-tools/src/deploy_tools/models/schemas/release.json + +module: + name: versions + version: "2.1rc1" + description: Module demonstrating multiple versions and default-version selection + + # Excluded from automatic default selection, so the default stays at the latest + # stable version even though this prerelease sorts higher. + exclude_from_defaults: true + + applications: [] diff --git a/tests/samples/01-initial/deploy-tools-output/deployment.yaml b/tests/samples/01-initial/deploy-tools-output/deployment.yaml index 30b44d83..368ad142 100644 --- a/tests/samples/01-initial/deploy-tools-output/deployment.yaml +++ b/tests/samples/01-initial/deploy-tools-output/deployment.yaml @@ -60,6 +60,26 @@ releases: name: deps unload_script: [] version: '0.2' + updatable: + '1.0': + deprecated: false + module: + allow_updates: true + applications: + - app_type: shell + name: test-updatable-echo + script: + - echo $UPDATABLE_VALUE + dependencies: [] + description: Module demonstrating in-place updates (allow_updates) + env_vars: + - name: UPDATABLE_VALUE + value: Set at initial deployment + exclude_from_defaults: false + load_script: [] + name: updatable + unload_script: [] + version: '1.0' versions: '1.0': deprecated: false diff --git a/tests/samples/01-initial/deploy-tools-output/modulefiles/updatable/.version b/tests/samples/01-initial/deploy-tools-output/modulefiles/updatable/.version new file mode 100644 index 00000000..f0d55435 --- /dev/null +++ b/tests/samples/01-initial/deploy-tools-output/modulefiles/updatable/.version @@ -0,0 +1,2 @@ +#%Module1.0 +set ModulesVersion 1.0 diff --git a/tests/samples/01-initial/deploy-tools-output/modulefiles/updatable/1.0 b/tests/samples/01-initial/deploy-tools-output/modulefiles/updatable/1.0 new file mode 120000 index 00000000..bd2fb2bd --- /dev/null +++ b/tests/samples/01-initial/deploy-tools-output/modulefiles/updatable/1.0 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/updatable/1.0/modulefile \ No newline at end of file diff --git a/tests/samples/01-initial/deploy-tools-output/modules/updatable/1.0/entrypoints/test-updatable-echo b/tests/samples/01-initial/deploy-tools-output/modules/updatable/1.0/entrypoints/test-updatable-echo new file mode 100755 index 00000000..a384ba31 --- /dev/null +++ b/tests/samples/01-initial/deploy-tools-output/modules/updatable/1.0/entrypoints/test-updatable-echo @@ -0,0 +1,7 @@ +#! /bin/bash + +if [[ -n "${DEPLOY_TOOLS_VERBOSE}" ]]; then + set -x +fi + +echo $UPDATABLE_VALUE diff --git a/tests/samples/01-initial/deploy-tools-output/modules/updatable/1.0/module.yaml b/tests/samples/01-initial/deploy-tools-output/modules/updatable/1.0/module.yaml new file mode 100644 index 00000000..7c85e7bc --- /dev/null +++ b/tests/samples/01-initial/deploy-tools-output/modules/updatable/1.0/module.yaml @@ -0,0 +1,16 @@ +allow_updates: true +applications: +- app_type: shell + name: test-updatable-echo + script: + - echo $UPDATABLE_VALUE +dependencies: [] +description: Module demonstrating in-place updates (allow_updates) +env_vars: +- name: UPDATABLE_VALUE + value: Set at initial deployment +exclude_from_defaults: false +load_script: [] +name: updatable +unload_script: [] +version: '1.0' diff --git a/tests/samples/01-initial/deploy-tools-output/modules/updatable/1.0/modulefile b/tests/samples/01-initial/deploy-tools-output/modules/updatable/1.0/modulefile new file mode 100644 index 00000000..a1da9b1d --- /dev/null +++ b/tests/samples/01-initial/deploy-tools-output/modules/updatable/1.0/modulefile @@ -0,0 +1,15 @@ +#%Module1.0 +## +## updatable - Module demonstrating in-place updates (allow_updates) +## +module-whatis "Module demonstrating in-place updates (allow_updates)" + +if { [module-info mode load] } { + if { [is-loaded updatable] } { + module unload updatable + } +} + +setenv UPDATABLE_VALUE "Set at initial deployment" + +prepend-path PATH "/tmp/deploy-tools-output/modules/updatable/1.0/entrypoints" diff --git a/tests/samples/01-initial/validate.txt b/tests/samples/01-initial/validate.txt index a8729330..6e5adaf0 100644 --- a/tests/samples/01-initial/validate.txt +++ b/tests/samples/01-initial/validate.txt @@ -1,9 +1,11 @@ Modules to be deployed: apps/0.1 deps/0.2 +updatable/1.0 versions/1.0 Updated module defaults: apps None -> 0.1 deps None -> 0.2 +updatable None -> 1.0 versions None -> 1.0 diff --git a/tests/samples/02-added/deploy-tools-output/deployment.yaml b/tests/samples/02-added/deploy-tools-output/deployment.yaml index 82f81d17..9270aa75 100644 --- a/tests/samples/02-added/deploy-tools-output/deployment.yaml +++ b/tests/samples/02-added/deploy-tools-output/deployment.yaml @@ -74,7 +74,7 @@ releases: description: Module demonstrating in-place updates (allow_updates) env_vars: - name: UPDATABLE_VALUE - value: Added after initial deployment + value: Set at initial deployment exclude_from_defaults: false load_script: [] name: updatable @@ -107,5 +107,18 @@ releases: name: versions unload_script: [] version: '2.0' + 2.1rc1: + deprecated: false + module: + allow_updates: false + applications: [] + dependencies: [] + description: Module demonstrating multiple versions and default-version selection + env_vars: [] + exclude_from_defaults: true + load_script: [] + name: versions + unload_script: [] + version: 2.1rc1 settings: default_versions: {} diff --git a/tests/samples/02-added/deploy-tools-output/modulefiles/versions/2.1rc1 b/tests/samples/02-added/deploy-tools-output/modulefiles/versions/2.1rc1 new file mode 120000 index 00000000..10b125b4 --- /dev/null +++ b/tests/samples/02-added/deploy-tools-output/modulefiles/versions/2.1rc1 @@ -0,0 +1 @@ +/tmp/deploy-tools-output/modules/versions/2.1rc1/modulefile \ No newline at end of file diff --git a/tests/samples/02-added/deploy-tools-output/modules/updatable/1.0/module.yaml b/tests/samples/02-added/deploy-tools-output/modules/updatable/1.0/module.yaml index 33e5701b..7c85e7bc 100644 --- a/tests/samples/02-added/deploy-tools-output/modules/updatable/1.0/module.yaml +++ b/tests/samples/02-added/deploy-tools-output/modules/updatable/1.0/module.yaml @@ -8,7 +8,7 @@ dependencies: [] description: Module demonstrating in-place updates (allow_updates) env_vars: - name: UPDATABLE_VALUE - value: Added after initial deployment + value: Set at initial deployment exclude_from_defaults: false load_script: [] name: updatable diff --git a/tests/samples/02-added/deploy-tools-output/modules/updatable/1.0/modulefile b/tests/samples/02-added/deploy-tools-output/modules/updatable/1.0/modulefile index 48b9284a..a1da9b1d 100644 --- a/tests/samples/02-added/deploy-tools-output/modules/updatable/1.0/modulefile +++ b/tests/samples/02-added/deploy-tools-output/modules/updatable/1.0/modulefile @@ -10,6 +10,6 @@ if { [module-info mode load] } { } } -setenv UPDATABLE_VALUE "Added after initial deployment" +setenv UPDATABLE_VALUE "Set at initial deployment" prepend-path PATH "/tmp/deploy-tools-output/modules/updatable/1.0/entrypoints" diff --git a/tests/samples/02-added/deploy-tools-output/modules/versions/2.1rc1/module.yaml b/tests/samples/02-added/deploy-tools-output/modules/versions/2.1rc1/module.yaml new file mode 100644 index 00000000..490f83e9 --- /dev/null +++ b/tests/samples/02-added/deploy-tools-output/modules/versions/2.1rc1/module.yaml @@ -0,0 +1,10 @@ +allow_updates: false +applications: [] +dependencies: [] +description: Module demonstrating multiple versions and default-version selection +env_vars: [] +exclude_from_defaults: true +load_script: [] +name: versions +unload_script: [] +version: 2.1rc1 diff --git a/tests/samples/02-added/deploy-tools-output/modules/versions/2.1rc1/modulefile b/tests/samples/02-added/deploy-tools-output/modules/versions/2.1rc1/modulefile new file mode 100644 index 00000000..a92b4324 --- /dev/null +++ b/tests/samples/02-added/deploy-tools-output/modules/versions/2.1rc1/modulefile @@ -0,0 +1,13 @@ +#%Module1.0 +## +## versions - Module demonstrating multiple versions and default-version selection +## +module-whatis "Module demonstrating multiple versions and default-version selection" + +if { [module-info mode load] } { + if { [is-loaded versions] } { + module unload versions + } +} + +prepend-path PATH "/tmp/deploy-tools-output/modules/versions/2.1rc1/entrypoints" diff --git a/tests/samples/02-added/validate.txt b/tests/samples/02-added/validate.txt index 8dfaedb8..fd11578e 100644 --- a/tests/samples/02-added/validate.txt +++ b/tests/samples/02-added/validate.txt @@ -1,7 +1,6 @@ Modules to be deployed: -updatable/1.0 versions/2.0 +versions/2.1rc1 Updated module defaults: -updatable None -> 1.0 versions 1.0 -> 2.0 diff --git a/tests/samples/03-updated/validate.txt b/tests/samples/03-updated/validate.txt index 32a87670..f2ea1924 100644 --- a/tests/samples/03-updated/validate.txt +++ b/tests/samples/03-updated/validate.txt @@ -1,6 +1,3 @@ -Modules to be deployed: -versions/2.1rc1 - Modules to be updated: updatable/1.0 diff --git a/tests/test_golden_master.py b/tests/test_golden_master.py index 423d0b72..9085cc1f 100644 --- a/tests/test_golden_master.py +++ b/tests/test_golden_master.py @@ -111,15 +111,15 @@ def test_module_lifecycle( # tmp_path is a fresh, empty, per-test directory; the stages below share it as one # deployment area, each building on the previous state, with no cross-run leakage. - # Stage 1: deploy apps, deps, and versions/1.0 into an empty area. + # Stage 1: deploy apps, deps, updatable/1.0, and versions/1.0 into an empty area. _run_stage(samples, configs, tmp_path, "01-initial", from_scratch=True) - # Stage 2: on an incremental sync, add the updatable module and a second version - # (versions/2.0); the default version migrates from 1.0 to 2.0. + # Stage 2: on an incremental sync, add a second version (versions/2.0) and an + # excluded prerelease (versions/2.1rc1). The versions default moves from 1.0 to 2.0. _run_stage(samples, configs, tmp_path, "02-added") - # Stage 3: update updatable/1.0 in place (allowed via allow_updates) and add an - # excluded prerelease (versions/2.1rc1); the default stays 2.0. + # Stage 3: update updatable/1.0 in place (allowed via allow_updates) without bumping + # its version. _run_stage(samples, configs, tmp_path, "03-updated") # Stage 4: deprecate versions/1.0 (en route to removal) and versions/2.1rc1 (to set