mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-01 03:13:15 +08:00
E2E tests for the @actions/artifact package (#421)
* End-to-end artifact tests * E2E tests for artifact package
This commit is contained in:
25
scripts/test-artifact-file.sh
Executable file
25
scripts/test-artifact-file.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
path="$1"
|
||||
expectedContent="$2"
|
||||
|
||||
if [ "$path" == "" ]; then
|
||||
echo "File path not provided"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$expectedContent" == "" ]; then
|
||||
echo "Expected file contents not provided"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "$path" ]; then
|
||||
echo "Expected file $path does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
actualContent=$(cat $path)
|
||||
if [ "$actualContent" != "$expectedContent" ];then
|
||||
echo "File contents are not correct, expected $expectedContent, recieved $actualContent"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user