-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDLSITE-4211 add travisfile and tests structure
There are actually quit a few things i'm not a fan of from my first playing with bats - one was the fact there isn't a good way to get output from failed tests! So because of that I have also included the bats-assert and bats-error libraries. See https://github.com/ztombol/bats-docs for details of the assertion lib.
- Loading branch information
1 parent
af32548
commit 6eab377
Showing
8 changed files
with
1,106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
language: php | ||
php: | ||
- '7.0' | ||
sudo: false | ||
cache: | ||
directories: | ||
- $HOME/cachedir | ||
install: git clone --depth 1 https://github.com/sstephenson/bats.git $HOME/bats | ||
before_script: | ||
- 'git config --global user.email "travis@localhost" && git config --global user.name "Travis CI"' | ||
- "export LOCAL_CI_TESTS_CACHEDIR=$HOME/cachedir && mkdir -p $LOCAL_CI_TESTS_CACHEDIR" | ||
- "export LOCAL_CI_TESTS_GITDIR=$HOME/gitdir && git clone git://github.com/moodle/moodle $LOCAL_CI_TESTS_GITDIR" | ||
script: | ||
- $HOME/bats/bin/bats tests | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bats | ||
|
||
load libs/shared_setup | ||
|
||
# This test is just used as some quick output because some tests are v.slow | ||
@test "Git is setup for tests." { | ||
[ -d "$gitdir/.git" ]; | ||
assert_success | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
source "$(dirname "${BASH_SOURCE[0]}")/src/assert.bash" |
Oops, something went wrong.