Skip to content

Commit

Permalink
Issue #176 Update tests to be run in macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
coolbrg authored and praveenkumar committed Feb 9, 2018
1 parent 3c2fd3d commit cefeb97
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,27 @@ make release
<a name="tests"></a>
## Tests

Tests are written as a shell script in `tests/test.sh`.
Tests are written as a shell script in `tests/test.sh`.

Build ISO:
```
$ make
```
Note: Running the tests in Windows OS is unsupported.

#### Build ISO

Setup your build environment by following the instructions provided in [Building the CentOS ISO](#building-the-centos-iso) section as per your preferred OS.

Note: Building ISO might require you to have Vagrant environment if you are not using host other than CentOS.

#### Run the tests:

Once the ISO is built from above step, use following command to run tests:

Run the tests:
```
$ make test
```

If you want to see the logs generated by test, run the test as:
```
$ SHOW_LOG=--show-job-log make test
```
Note: If you are using the Vagrant environment, you need to exit from it and come back to host to run the above command.

This command will fetch the latest [Minishift](http://github/minishift/minishift) binary and run the [tests](tests/test.sh).

<a name="ci-setup"></a>
## CI Setup
Expand Down
8 changes: 6 additions & 2 deletions tests/utils/minishift_latest_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
import requests
import re
import os
import platform

OS = os.getenv('OS', 'linux')
distributionInfo = platform.platform()

matchObj = re.match( r'linux|darwin', distributionInfo, re.I)
OS= matchObj.group().lower()

def main():
pattern = re.compile(".*%s-amd64.(tgz|zip)$" % OS)
pattern = re.compile(".*%s-amd64.tgz$" % OS)
r = requests.get('https://api.github.com/repos/minishift/minishift/releases/latest')
for asset in r.json()['assets']:
if pattern.match(asset['name']):
Expand Down

0 comments on commit cefeb97

Please sign in to comment.