Skip to content

Commit

Permalink
Revert "fix stat check in tests"
Browse files Browse the repository at this point in the history
This reverts commit e4001ec.
  • Loading branch information
Jose Nogueira committed Jul 5, 2024
1 parent e4001ec commit 8cae193
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .ocamlformat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=0.26.2
version=0.24.1
profile=default
ocaml-version=4.14.0

Expand All @@ -17,3 +17,4 @@ nested-match=align # deprecated
parens-ite=true
parens-tuple=multi-line-only
type-decl=sparse

3 changes: 2 additions & 1 deletion tests/create_command.t
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ Should succeed - create a secret in a new folder, with info about recipients add

If the secret is a staging secret, its only recipient should be @everyone.


Newly created secrets should have permissions 0o644
$ check_permissions $PASSAGE_DIR/secrets/new/secret.age
$ stat -c "%a" $PASSAGE_DIR/secrets/new/secret.age
644

Should succeed - handle secrets with comments too
Expand Down
2 changes: 1 addition & 1 deletion tests/refresh_command.t
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Should show individual operations on secrets when -v is passed
I: refreshed 6 secrets, skipped 4, failed 0

Refreshed secrets should have the same permissions as before (0o644)
$ check_permissions $PASSAGE_DIR/secrets/test_secret.age
$ stat -c "%a" $PASSAGE_DIR/secrets/test_secret.age
644

Secret content should be the same before and after refresh.
Expand Down
4 changes: 2 additions & 2 deletions tests/replace_command.t
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ Should succeed - replace a secret that does not yet exist in a folder where we a
new secret line 3\123\65

Newly created secrets should have permissions 0o644
$ check_permissions $PASSAGE_DIR/secrets/00/new_secret_singleline.age
$ stat -c "%a" $PASSAGE_DIR/secrets/00/new_secret_singleline.age
644
$ check_permissions $PASSAGE_DIR/secrets/00/new_secret_multiline.age
$ stat -c "%a" $PASSAGE_DIR/secrets/00/new_secret_multiline.age
644

Should fail - replace a secret that does not yet exist in a folder where we are NOT listed on the .keys (invariant)
Expand Down
11 changes: 0 additions & 11 deletions tests/setup_fixtures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,6 @@ setup_multiline_secret_with_comments() {
EOF
}

check_permissions() {
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
stat -c "%a" $1
elif [[ "$OSTYPE" == "darwin"* ]]; then
stat -f "%A" $1
else
echo "Unsupported OS"
exit 1
fi
}

# $PASSAGE_DIR/secrets/
# ├── .keys
# ├── 00
Expand Down

0 comments on commit 8cae193

Please sign in to comment.