Skip to content

Commit

Permalink
Merge pull request #7 from garciasdos/feature/add_unit_test
Browse files Browse the repository at this point in the history
Feature/add unit test
  • Loading branch information
ArnaudRinquin authored Jun 22, 2020
2 parents 0ead50e + a0584dd commit a09ea50
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 21 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: CD
on:
push:
branches: [ master ]
branches:
- master
pull_request:
branches:
- master
jobs:
# This workflow contains a single job called "build"
build:
Expand All @@ -18,5 +22,7 @@ jobs:
env:
GIT_CRYPT_KEY: "AEdJVENSWVBUS0VZAAAAAgAAAAAAAAABAAAABAAAAAAAAAADAAAAIF85B7kFpHjz49GStZm1ctyWQv+o3qvHlbAiMB/VgJQRAAAABQAAAEC4OV4QgSqUqF1ChA9uz6JT3F80yV5KjxMm6YqBZX+zRwsgWMqK+164ptiSy+Pfo+IrPH5boZfebV6IdCHl8/4NAAAAAA=="

- name: Github Action gen-sh-unittest
uses: vargiuscuola/gen-sh-unittest@master
- name: GitHub Action to run shunit2 tests
uses: TheColvinCo/[email protected]
env:
SHUNIT_TEST_FOLDER: "tests/"
15 changes: 3 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### Example Workflow file

```
```yaml
jobs:
deploy:
name: Test git-crypt-unlock
Expand All @@ -25,17 +25,8 @@ jobs:
git-crypt export-key ./tmp-key && cat ./tmp-key | base64 | pbcopy && rm ./tmp-key
```

## Development

There are few dependencies

- git-crypt
- docker
- node (for npm script convenience and [gha](https://github.com/tschoffelen/gha) dependency)

### Running tests

```
npm install
npm test
```shell script
./test/entrypoint_test.sh
```
6 changes: 0 additions & 6 deletions test/entrypoint_test.sh

This file was deleted.

File renamed without changes.
10 changes: 10 additions & 0 deletions tests/entrypoint_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh -l

EXPECTED_TEXT="this is a secret file"
TEXT=$(cat test.txt)

testIsUnlockingInTheRightWay() {
assertEquals "$EXPECTED_TEXT" "$TEXT"
}

. /usr/bin/shunit2
File renamed without changes.

0 comments on commit a09ea50

Please sign in to comment.