From c85697eee8ce3dac5480a3ba2b31cc4943e1d8e6 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 7 Apr 2022 14:57:35 -0400 Subject: Better snapshot deployments for Aedifex. --- stdlib/source/test/aedifex/command/deploy.lux | 33 +++++++++++++++------------ 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'stdlib/source/test/aedifex/command/deploy.lux') diff --git a/stdlib/source/test/aedifex/command/deploy.lux b/stdlib/source/test/aedifex/command/deploy.lux index 7cdba510d..0aec02f72 100644 --- a/stdlib/source/test/aedifex/command/deploy.lux +++ b/stdlib/source/test/aedifex/command/deploy.lux @@ -25,12 +25,13 @@ ["[0]" set]]] [math ["[0]" random]] + [tool + [compiler + [meta + ["[0]" export]]]] [world ["[0]" file] ["[0]" program {"+" Program}]]]] - [program - [compositor - ["[0]" export]]] [// ["$[0]" install] ["$[0]" version] @@ -45,18 +46,19 @@ ["[1][0]" pom] ["[1][0]" hash] ["[1][0]" repository {"+" Repository} + ["[1]/[0]" local] ["[1]/[0]" remote]] ["[1][0]" artifact {"+" Artifact} ["[1]/[0]" extension]]]]]) -(def: (execute! program repository fs artifact profile) - (-> (Program Async) (Repository Async) (file.System Async) +(def: (execute! program local remote fs artifact profile) + (-> (Program Async) (Repository Async) (Repository Async) (file.System Async) Artifact ///.Profile (Async (Try Text))) (do ///action.monad [.let [console ($version.echo "")] _ ($install.make_sources! fs (the ///.#sources profile)) - _ (/.do! console repository fs artifact profile)] + _ (/.do! console local remote fs artifact profile)] (# console read_line []))) (def: .public test @@ -73,27 +75,28 @@ home (random.ascii/alpha 5) working_directory (random.ascii/alpha 5) - .let [repository (///repository.mock $repository.mock - $repository.empty) - fs (file.mock (# file.default separator)) - program (program.async (program.mock environment.empty home working_directory))]] + .let [fs (file.mock (# file.default separator)) + program (program.async (program.mock environment.empty home working_directory)) + local (///repository/local.repository program fs) + remote (///repository.mock $repository.mock + $repository.empty)]] (in (do [! async.monad] [verdict (do [! ///action.monad] - [logging (..execute! program repository fs artifact profile) + [logging (..execute! program local remote fs artifact profile) expected_library (|> profile (the ///.#sources) set.list (export.library fs) (# ! each (format.result tar.writer))) - actual_pom (# repository download (///repository/remote.uri (the ///artifact.#version artifact) artifact ///artifact/extension.pom)) - actual_library (# repository download (///repository/remote.uri (the ///artifact.#version artifact) artifact ///artifact/extension.lux_library)) - actual_sha-1 (# repository download (///repository/remote.uri (the ///artifact.#version artifact) artifact (format ///artifact/extension.lux_library ///artifact/extension.sha-1))) + actual_pom (# remote download (///repository/remote.uri (the ///artifact.#version artifact) artifact ///artifact/extension.pom)) + actual_library (# remote download (///repository/remote.uri (the ///artifact.#version artifact) artifact ///artifact/extension.lux_library)) + actual_sha-1 (# remote download (///repository/remote.uri (the ///artifact.#version artifact) artifact (format ///artifact/extension.lux_library ///artifact/extension.sha-1))) actual_sha-1 (# async.monad in (do try.monad [actual_sha-1 (# utf8.codec decoded actual_sha-1)] (# ///hash.sha-1_codec decoded actual_sha-1))) - actual_md5 (# repository download (///repository/remote.uri (the ///artifact.#version artifact) artifact (format ///artifact/extension.lux_library ///artifact/extension.md5))) + actual_md5 (# remote download (///repository/remote.uri (the ///artifact.#version artifact) artifact (format ///artifact/extension.lux_library ///artifact/extension.md5))) actual_md5 (# async.monad in (do try.monad [actual_md5 (# utf8.codec decoded actual_md5)] -- cgit v1.2.3