Skip to content

Commit

Permalink
Integration test scaffold
Browse files Browse the repository at this point in the history
  • Loading branch information
lucksus committed Nov 22, 2022
1 parent 199247f commit 92b3cbd
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 1 deletion.
51 changes: 50 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,53 @@ jobs:
run: |
choco install swi-prolog
$env:path += ";C:\Program Files\swipl\bin"
yarn run test:windows
yarn run test:windows
integration:
name: Integration test

steps:
- name: Fetch source code
uses: actions/checkout@v2

- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
override: true
toolchain: 1.63.0

- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Yarn Install
run: yarn install

- name: Yarn Build
run: yarn build

- name: Build AD4M-Host
if: matrix.platform == 'macos-latest'
run: yarn run package-macos

- name: Build AD4M-Host
if: matrix.platform == 'windows-latest'
run: yarn run package-windows

- name: Build AD4M-Host
if: matrix.platform == 'ubuntu-latest'
run: yarn run package-linux

- name: Build AD4M cli
run: cd cli && cargo build

- name: Run test script
run: ./tests/integration.sh

9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[submodule "tests/bats"]
path = tests/bats
url = https://github.com/bats-core/bats-core.git
[submodule "tests/test_helper/bats-support"]
path = tests/test_helper/bats-support
url = https://github.com/bats-core/bats-support.git
[submodule "tests/test_helper/bats-assert"]
path = tests/test_helper/bats-assert
url = https://github.com/bats-core/bats-assert.git
1 change: 1 addition & 0 deletions tests/bats
Submodule bats added at dc3121
16 changes: 16 additions & 0 deletions tests/integration.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
setup() {
load 'test_helper/bats-support/load'
load 'test_helper/bats-assert/load'
}

@test "can run ad4m-host" {
./host/dist/ad4m-macos-x64
}

get_ad4m_cli_banner() {
./cli/target/debug/ad4m 2>&1
}
@test "can run ad4m-cli" {
run get_ad4m_cli_banner
assert_output --partial 'AD4M command line interface'
}
1 change: 1 addition & 0 deletions tests/test_helper/bats-assert
Submodule bats-assert added at 78fa63
1 change: 1 addition & 0 deletions tests/test_helper/bats-support
Submodule bats-support added at 3c8fad

0 comments on commit 92b3cbd

Please sign in to comment.