diff --git a/src/batou/component.py b/src/batou/component.py index 7ece331b..47ee2ab6 100644 --- a/src/batou/component.py +++ b/src/batou/component.py @@ -406,7 +406,7 @@ def deploy(self, predict_only=False): ) if took_too_long: output.annotate( - f"{self.host.name} > {self._breadcrumbs} [{self.timer.humanize('total', 'verify', 'update', 'sub')}]" + f"{self.host.name} > {self._breadcrumbs} [{self.timer.humanize('total', 'verify', 'update', 'sub')}] " + ", ".join(steps_too_long) + " took too long", ) diff --git a/src/batou/lib/tests/test_file.py b/src/batou/lib/tests/test_file.py index 841611b6..679dd2a2 100644 --- a/src/batou/lib/tests/test_file.py +++ b/src/batou/lib/tests/test_file.py @@ -504,7 +504,7 @@ def test_content_large_diff_logged(output, root): assert output.backend.output == Ellipsis( """\ -localhost > MyComponent > Content('work/mycomponent/path') +localhost > MyComponent > Content('work/mycomponent/path'): update More than 20 lines of diff. Showing first and last 5 lines. see ... for the full diff. path --- @@ -549,7 +549,7 @@ def test_json_diff(output, root): assert output.backend.output == Ellipsis( """\ -localhost > MyComponent > JSONContent('work/mycomponent/target.json') +localhost > MyComponent > JSONContent('work/mycomponent/target.json'): update target.json --- target.json +++ target.json @@ -1,3 +1,4 @@ @@ -574,7 +574,7 @@ def test_json_diff_not_for_sensitive(output, root): assert output.backend.output == Ellipsis( """\ -localhost > MyComponent > JSONContent('work/mycomponent/target.json') +localhost > MyComponent > JSONContent('work/mycomponent/target.json'): update Not showing diff as it contains sensitive data. """ ) @@ -731,7 +731,7 @@ def test_yaml_diff(output, root): # fmt: off assert output.backend.output == Ellipsis("""\ -localhost > MyComponent > YAMLContent(\'work/mycomponent/target.yaml\') +localhost > MyComponent > YAMLContent(\'work/mycomponent/target.yaml\'): update target.yaml --- target.yaml +++ target.yaml @@ -1,3 +1,2 @@ @@ -757,7 +757,7 @@ def test_yaml_diff_not_for_sensitive(output, root): assert output.backend.output == Ellipsis( """\ -localhost > MyComponent > YAMLContent('work/mycomponent/target.yaml') +localhost > MyComponent > YAMLContent('work/mycomponent/target.yaml'): update Not showing diff as it contains sensitive data. """ ) diff --git a/src/batou/tests/test_endtoend.py b/src/batou/tests/test_endtoend.py index a412bd15..d5d88c76 100644 --- a/src/batou/tests/test_endtoend.py +++ b/src/batou/tests/test_endtoend.py @@ -276,12 +276,12 @@ def test_diff_is_not_shown_for_keys_in_secrets(tmp_path, monkeypatch, capsys): localhost: Connecting via local (1/1) ================================== Deploying =================================== localhost: Scheduling component hello ... -localhost > Hello > File('work/hello/hello') > Presence('hello') -localhost > Hello > File('work/hello/hello') > Content('hello') +localhost > Hello > File('work/hello/hello') > Presence('hello'): update +localhost > Hello > File('work/hello/hello') > Content('hello'): update Not showing diff as it contains sensitive data, see ...diff for the diff. -localhost > Hello > File('work/hello/other-secrets.yaml') > Presence('other-secrets.yaml') -localhost > Hello > File('work/hello/other-secrets.yaml') > Content('other-secrets.yaml') +localhost > Hello > File('work/hello/other-secrets.yaml') > Presence('other-secrets.yaml'): update +localhost > Hello > File('work/hello/other-secrets.yaml') > Content('other-secrets.yaml'): update Not showing diff as it contains sensitive data, see ...diff for the diff. =================================== Summary ==================================== @@ -318,29 +318,29 @@ def test_diff_for_keys_in_secrets_overridable(tmp_path, monkeypatch, capsys): localhost: Connecting via local (1/1) ================================== Deploying =================================== localhost: Scheduling component sensitivevalues ... -localhost > SensitiveValues > File('work/sensitivevalues/client_ed25519.key') > Presence('client_ed25519.key') -localhost > SensitiveValues > File('work/sensitivevalues/client_ed25519.key') > Content('client_ed25519.key') +localhost > SensitiveValues > File('work/sensitivevalues/client_ed25519.key') > Presence('client_ed25519.key'): update +localhost > SensitiveValues > File('work/sensitivevalues/client_ed25519.key') > Content('client_ed25519.key'): update Not showing diff as it contains sensitive data, see ...diff for the diff. -localhost > SensitiveValues > File('work/sensitivevalues/client_ed25519.pub') > Presence('client_ed25519.pub') -localhost > SensitiveValues > File('work/sensitivevalues/client_ed25519.pub') > Content('client_ed25519.pub') +localhost > SensitiveValues > File('work/sensitivevalues/client_ed25519.pub') > Presence('client_ed25519.pub'): update +localhost > SensitiveValues > File('work/sensitivevalues/client_ed25519.pub') > Content('client_ed25519.pub'): update Not showing diff as it contains sensitive data, see ...diff for the diff. -localhost > SensitiveValues > File('work/sensitivevalues/hostkey_sensitive_auto_rsa.pub') > Presence('hostkey_sensitive_auto_rsa.pub') -localhost > SensitiveValues > File('work/sensitivevalues/hostkey_sensitive_auto_rsa.pub') > Content('hostkey_sensitive_auto_rsa.pub') +localhost > SensitiveValues > File('work/sensitivevalues/hostkey_sensitive_auto_rsa.pub') > Presence('hostkey_sensitive_auto_rsa.pub'): update +localhost > SensitiveValues > File('work/sensitivevalues/hostkey_sensitive_auto_rsa.pub') > Content('hostkey_sensitive_auto_rsa.pub'): update hostkey_sensitive_auto_rsa.pub --- hostkey_sensitive_auto_rsa.pub +++ hostkey_sensitive_auto_rsa.pub @@ -0,0 +1 @@ hostkey_sensitive_auto_rsa.pub +ssh-rsa ... batou-example-host -localhost > SensitiveValues > File('work/sensitivevalues/hostkey_sensitive_auto_ed25519.pub') > Presence('hostkey_sensitive_auto_ed25519.pub') -localhost > SensitiveValues > File('work/sensitivevalues/hostkey_sensitive_auto_ed25519.pub') > Content('hostkey_sensitive_auto_ed25519.pub') +localhost > SensitiveValues > File('work/sensitivevalues/hostkey_sensitive_auto_ed25519.pub') > Presence('hostkey_sensitive_auto_ed25519.pub'): update +localhost > SensitiveValues > File('work/sensitivevalues/hostkey_sensitive_auto_ed25519.pub') > Content('hostkey_sensitive_auto_ed25519.pub'): update Not showing diff as it contains sensitive data, see ...diff for the diff. -localhost > SensitiveValues > File('work/sensitivevalues/hostkey_sensitive_masked_rsa.pub') > Presence('hostkey_sensitive_masked_rsa.pub') -localhost > SensitiveValues > File('work/sensitivevalues/hostkey_sensitive_masked_rsa.pub') > Content('hostkey_sensitive_masked_rsa.pub') +localhost > SensitiveValues > File('work/sensitivevalues/hostkey_sensitive_masked_rsa.pub') > Presence('hostkey_sensitive_masked_rsa.pub'): update +localhost > SensitiveValues > File('work/sensitivevalues/hostkey_sensitive_masked_rsa.pub') > Content('hostkey_sensitive_masked_rsa.pub'): update Not showing diff as it contains sensitive data. -localhost > SensitiveValues > File('work/sensitivevalues/hostkey_sensitive_clear_ed25519.pub') > Presence('hostkey_sensitive_clear_ed25519.pub') -localhost > SensitiveValues > File('work/sensitivevalues/hostkey_sensitive_clear_ed25519.pub') > Content('hostkey_sensitive_clear_ed25519.pub') +localhost > SensitiveValues > File('work/sensitivevalues/hostkey_sensitive_clear_ed25519.pub') > Presence('hostkey_sensitive_clear_ed25519.pub'): update +localhost > SensitiveValues > File('work/sensitivevalues/hostkey_sensitive_clear_ed25519.pub') > Content('hostkey_sensitive_clear_ed25519.pub'): update hostkey_sensitive_clear_ed25519.pub --- hostkey_sensitive_clear_ed25519.pub +++ hostkey_sensitive_clear_ed25519.pub @@ -0,0 +1 @@ @@ -366,7 +366,7 @@ def test_durations_are_shown_for_components(): localhost: Connecting via local (1/1) ================================== Deploying =================================== localhost: Scheduling component takeslongtime ... -localhost > Takeslongtime [total=...s, verify=...s, update=NaN, sub=NaN] +localhost > Takeslongtime [total=...s, verify=...s, update=NaN, sub=NaN] verify took too long =================================== Summary ==================================== Deployment took total=...s, connect=...s, deploy=...s ============================= DEPLOYMENT FINISHED ============================== diff --git a/src/batou/tests/test_environment.py b/src/batou/tests/test_environment.py index 8b42e6e2..79fd36e8 100644 --- a/src/batou/tests/test_environment.py +++ b/src/batou/tests/test_environment.py @@ -308,7 +308,7 @@ def test_log_in_component_configure_is_put_out(output, sample_service): log = "\n".join(c[0][0].strip() for c in output.call_args_list) assert ( """\ -localhost > Hello +localhost > Hello: update localhost: verify: asdf=None\ """ == log