Skip to content

Commit

Permalink
Add Support for Manual Testing [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
RashulChutani committed Dec 19, 2022
1 parent 7a52f4d commit 622e332
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/manual-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: manual-tests
on:
workflow_dispatch:
inputs:
test:
description: 'Test:'
default: 'ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py::test_torch_instance_arctan_,tensorflow'
required: true
permissions:
actions: read
jobs:
run_tests:
runs-on: ubuntu-latest
steps:
- name: Checkout Ivy 🛎
uses: actions/checkout@v2
with:
path: ivy
persist-credentials: false
submodules: "recursive"

- name: Get Job URL
uses: Tiryoh/gha-jobid-action@v0
id: jobs
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
job_name: ${{ github.job }}

- name: Run Tests
id: tests
run: |
pip install pymongo
cd ivy
python setup_tests.py ${{ github.event.inputs.name }}
python run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} ${{ steps.jobs.outputs.html_url }}
continue-on-error: true

- name: Check on failures
if: steps.tests.outcome != 'success'
run: exit 1
20 changes: 20 additions & 0 deletions setup_tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import sys

BACKENDS = ["numpy", "jax", "tensorflow", "torch"]


def main():
if len(sys.argv) < 2:
return
test = sys.argv[1]
if "," in test:
with open("tests_to_run", "w") as f:
f.write(test + "\n")
else:
with open("tests_to_run", "w") as f:
for backend in BACKENDS:
f.write(f"{test},{backend}\n")


if __name__ == "__main__":
main()

0 comments on commit 622e332

Please sign in to comment.