Skip to content

Commit

Permalink
add Mononoke integration tests CI (#26)
Browse files Browse the repository at this point in the history
Summary:
This diff adds a minimal workflow for running integrations tests for Mononoke. Currently only one test is run and it fails.

This also splits the regular Mononoke CI into separate files for Linux and Mac to match the current style in Eden repo.
There are the "scopeguard::defer" fixes here that somehow escaped the CI tests.
Some tweaks have been made to "integration_runner_real.py" to make it runnable outside FB context.
Lastly the change from using "[[ -v ... ]" to "[[ -n "${...:-}" ]]; in "library.sh" was made because the former is not supported by the default Bash version preinstalled on modern MacOS.

Pull Request resolved: #26

Reviewed By: krallin

Differential Revision: D22541344

Pulled By: lukaspiatkowski

fbshipit-source-id: 5023d147823166a8754be852c29b1e7b0e6d9f5f
  • Loading branch information
lukaspiatkowski authored and facebook-github-bot committed Jul 16, 2020
1 parent 9d2a577 commit 0dd3c4e
Show file tree
Hide file tree
Showing 13 changed files with 448 additions and 165 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/mononoke-integration_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Mononoke Integration Tests Linux

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
tests:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: Check space
run: df -h
- name: Clean space as per https://github.com/actions/virtual-environments/issues/709
run: sudo rm -rf "/usr/local/share/boost" && sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Check space
run: df -h
- name: Install Rust Stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
profile: minimal
- name: Install Python 2.7
uses: actions/setup-python@v2
with:
python-version: '2.7'
- name: Install system deps
run: sudo python3 build/fbcode_builder/getdeps.py --allow-system-packages install-system-deps --recursive eden_scm
- name: Build eden_scm dependencies
run: >-
python3 build/fbcode_builder/getdeps.py build
--allow-system-packages
--scratch-path /tmp/build
--only-deps
--src-dir=.
eden_scm
- name: Build eden_scm
run: >-
python3 build/fbcode_builder/getdeps.py build
--allow-system-packages
--scratch-path /tmp/build
--no-deps
--src-dir=.
eden_scm
- name: Build mononoke dependencies
run: >-
python3 build/fbcode_builder/getdeps.py build
--scratch-path /tmp/build
--only-deps
--src-dir=.
mononoke
- name: Build mononoke
run: >-
python3 build/fbcode_builder/getdeps.py build
--scratch-path /tmp/build
--no-deps
--src-dir=.
mononoke
- name: Install Python 3.7
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install click
- name: Check space
run: df -h
- name: Run Monononke integration tests
run: |
for dir in /tmp/build/installed/python-click-*/lib/fb-py-libs/python-click/click; do
export PYTHONPATH="${dir}${PYTHONPATH:+:${PYTHONPATH}}"
done
python3 eden/mononoke/tests/integration/run_tests_getdeps.py /tmp/build/installed /tmp/build/build/mononoke_integration_test
continue-on-error: true
78 changes: 78 additions & 0 deletions .github/workflows/mononoke-integration_mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Mononoke Integration Tests Mac

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
tests:
runs-on: macOS-latest
env:
DEVELOPER_DIR: /Applications/Xcode_10.3.app/Contents/Developer
steps:
- uses: actions/checkout@v1
- name: Check space
run: df -h
- name: Install Rust Stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
profile: minimal
- name: Install Python 2.7
uses: actions/setup-python@v2
with:
python-version: '2.7'
- name: Install system deps
run: sudo python3 build/fbcode_builder/getdeps.py --allow-system-packages install-system-deps --recursive eden_scm
- name: Build eden_scm dependencies
run: >-
python3 build/fbcode_builder/getdeps.py build
--allow-system-packages
--scratch-path /tmp/build
--only-deps
--src-dir=.
eden_scm
- name: Build eden_scm
run: >-
python3 build/fbcode_builder/getdeps.py build
--allow-system-packages
--scratch-path /tmp/build
--no-deps
--src-dir=.
eden_scm
- name: Build mononoke dependencies
run: >-
python3 build/fbcode_builder/getdeps.py build
--scratch-path /tmp/build
--only-deps
--src-dir=.
mononoke
- name: Build mononoke
run: >-
python3 build/fbcode_builder/getdeps.py build
--scratch-path /tmp/build
--no-deps
--src-dir=.
mononoke
- name: Install Python 3.7
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install click
- name: Check space
run: df -h
- name: Run Monononke integration tests
run: |
for dir in /tmp/build/installed/python-click-*/lib/fb-py-libs/python-click/click; do
export PYTHONPATH="${dir}${PYTHONPATH:+:${PYTHONPATH}}"
done
python3 eden/mononoke/tests/integration/run_tests_getdeps.py /tmp/build/installed /tmp/build/build/mononoke_integration_test
continue-on-error: true
113 changes: 0 additions & 113 deletions .github/workflows/mononoke.yml

This file was deleted.

57 changes: 57 additions & 0 deletions .github/workflows/mononoke_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Mononoke Linux

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: Check space
run: df -h
- name: Clean space as per https://github.com/actions/virtual-environments/issues/709
run: sudo rm -rf "/usr/local/share/boost" && sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Check space
run: df -h
- name: Install Rust Stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
profile: minimal
- name: Build dependencies
run: python3 build/fbcode_builder/getdeps.py build --only-deps --src-dir=. mononoke
- name: Build mononoke
run: python3 build/fbcode_builder/getdeps.py build --no-deps --src-dir=. mononoke
- name: Check space
run: df -h
- name: Test mononoke
run: python3 build/fbcode_builder/getdeps.py test --src-dir=. mononoke
- name: Check space
run: df -h
- name: Install Rust Beta
uses: actions-rs/toolchain@v1
with:
toolchain: beta
default: true
profile: minimal
- name: Test mononoke with beta toolchain
run: python3 build/fbcode_builder/getdeps.py test --src-dir=. mononoke
continue-on-error: true
- name: Install Rust Nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
default: true
profile: minimal
- name: Test mononoke with nightly toolchain
run: python3 build/fbcode_builder/getdeps.py test --src-dir=. mononoke
continue-on-error: true
- name: Check space
run: df -h
55 changes: 55 additions & 0 deletions .github/workflows/mononoke_mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Mononoke Mac

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
runs-on: macOS-latest
env:
DEVELOPER_DIR: /Applications/Xcode_10.3.app/Contents/Developer
steps:
- uses: actions/checkout@v1
- name: Check space
run: df -h
- name: Install Rust Stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
profile: minimal
- name: Build dependencies
run: python3 build/fbcode_builder/getdeps.py build --only-deps --src-dir=. mononoke
- name: Build mononoke
run: python3 build/fbcode_builder/getdeps.py build --no-deps --src-dir=. mononoke
- name: Check space
run: df -h
- name: Test mononoke
run: python3 build/fbcode_builder/getdeps.py test --src-dir=. mononoke
- name: Check space
run: df -h
- name: Install Rust Beta
uses: actions-rs/toolchain@v1
with:
toolchain: beta
default: true
profile: minimal
- name: Test mononoke with beta toolchain
run: python3 build/fbcode_builder/getdeps.py test --src-dir=. mononoke
continue-on-error: true
- name: Install Rust Nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
default: true
profile: minimal
- name: Test mononoke with nightly toolchain
run: python3 build/fbcode_builder/getdeps.py test --src-dir=. mononoke
continue-on-error: true
- name: Check space
run: df -h
Loading

0 comments on commit 0dd3c4e

Please sign in to comment.