Skip to content

Commit

Permalink
feat: validate downloaded file after saved changes on powershell
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonPaulGithub committed Mar 14, 2024
1 parent 129cfda commit 55ee022
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 101 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,23 @@ jobs:
SN_LOG: "all"
timeout-minutes: 2

- name: Validate downloaded file after saved changes
run: cargo run --bin safe --release -- --log-output-dest=data-dir files upload "./resources/test_doc.txt" --retry-strategy quick
- name: Validate downloaded file after saved changes for Windows
if: matrix.os == 'windows-latest'
run: |
echo "upload the test document"
cargo run --bin safe --release -- --log-output-dest=data-dir files upload "./resources/test_doc.txt" --retry-strategy quick
echo "validate the test document contains the number 1 in its alphabetic data"
$condition = Get-Content ./resources/test_doc.txt | ForEach-Object {$_ -Replace "[^0-9]", ""}
if ( $condition -ne 1) { exit 1 }
echo "add the values 2 and 3 to the test document"
"23" >> "./resources/test_doc.txt"
echo "Upload the recently changed test document"
cargo run --bin safe --release -- --log-output-dest=data-dir files upload "./resources/test_doc.txt" --retry-strategy quick
echo "Download the test document"
cargo run --bin safe --release -- --log-output-dest=data-dir files download --retry-strategy quick
echo "Test if the document includes the new values 2 and 3"
$condition = Get-Content C:\Users\runneradmin\Downloads\safe_files\test_doc.txt | ForEach-Object {$_ -Replace "[^0-9]", ""}
if ( $condition -ne 123) { exit 1 }
env:
SN_LOG: "all"
timeout-minutes: 2
Expand Down
Loading

0 comments on commit 55ee022

Please sign in to comment.