Skip to content

Commit

Permalink
Bug Fixes Test Coverage [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
RashulChutani committed Oct 19, 2022
1 parent 5d8950f commit 099e44a
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 13 deletions.
31 changes: 30 additions & 1 deletion .github/workflows/intelligent-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
fetch-depth: 100

- name: Determine and Run Tests
id: tests
run: |
git clone https://github.com/unifyai/Mapping.git
pip install pydriller
Expand All @@ -26,6 +27,8 @@ jobs:
cd ..
mkdir tests
cp ivy/tests.pbz2 tests/
python run_tests.py
continue-on-error: true

- name: Push Mapping
uses: cpina/github-action-push-to-another-repository@main
Expand All @@ -39,6 +42,10 @@ jobs:
commit-message: Update Mapping
target-branch: master

- name: Check on failures
if: steps.tests.outcome != 'success'
run: exit 1

run_tests_2:
runs-on: ubuntu-latest
steps:
Expand All @@ -51,6 +58,7 @@ jobs:
fetch-depth: 100

- name: Determine and Run Tests
id: tests
run: |
git clone https://github.com/unifyai/Mapping_2.git
pip install pydriller
Expand All @@ -60,6 +68,8 @@ jobs:
cd ..
mkdir tests
cp ivy/tests.pbz2 tests/
python run_tests.py
continue-on-error: true

- name: Push Mapping
uses: cpina/github-action-push-to-another-repository@main
Expand All @@ -73,6 +83,10 @@ jobs:
commit-message: Update Mapping
target-branch: master

- name: Check on failures
if: steps.tests.outcome != 'success'
run: exit 1

run_tests_3:
runs-on: ubuntu-latest
steps:
Expand All @@ -85,6 +99,7 @@ jobs:
fetch-depth: 100

- name: Determine and Run Tests
id: tests
run: |
git clone https://github.com/unifyai/Mapping_3.git
pip install pydriller
Expand All @@ -94,6 +109,8 @@ jobs:
cd ..
mkdir tests
cp ivy/tests.pbz2 tests/
python run_tests.py
continue-on-error: true

- name: Push Mapping
uses: cpina/github-action-push-to-another-repository@main
Expand All @@ -107,8 +124,14 @@ jobs:
commit-message: Update Mapping
target-branch: master

- name: Check on failures
if: steps.tests.outcome != 'success'
run: exit 1


run_tests_4:
runs-on: ubuntu-latest
id: tests
steps:
- name: Checkout Ivy 🛎
uses: actions/checkout@v2
Expand All @@ -128,6 +151,8 @@ jobs:
cd ..
mkdir tests
cp ivy/tests.pbz2 tests/
python run_tests.py
continue-on-error: true
- name: Push Mapping
uses: cpina/github-action-push-to-another-repository@main
Expand All @@ -139,4 +164,8 @@ jobs:
destination-repository-name: 'Mapping_4'
user-email: rashul.chutani@gmail.com
commit-message: Update Mapping
target-branch: master
target-branch: master

- name: Check on failures
if: steps.tests.outcome != 'success'
run: exit 1
16 changes: 4 additions & 12 deletions determine_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,7 @@
print(tests["index_mapping"][test_index])
print("----------------------------")

# Run Tests
failed = False
for test_index in tests_to_run:
test = tests["index_mapping"][test_index]
ret = os.system(
f'docker run --rm -v "$(pwd)":/ivy -v "$(pwd)"/.hypothesis:/.hypothesis unifyai/ivy:latest python3 -m pytest {test}' # noqa
)
if ret != 0:
failed = True

if failed:
exit(1)
with open("tests_to_run", "w") as f:
for test_index in tests_to_run:
test = tests["index_mapping"][test_index]
f.write(test + "\n")
18 changes: 18 additions & 0 deletions run_tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Run Tests
import os

if __name__ == "__main__":
failed = False
with open("tests_to_run", "r") as f:
for line in f:
test = line[:-1]
print(test)
ret = os.system(
f'docker run --rm -v "$(pwd)":/ivy -v "$(pwd)"/.hypothesis:/.hypothesis unifyai/ivy:latest python3 -m pytest {test}'
# noqa
)
if ret != 0:
failed = True

if failed:
exit(1)

0 comments on commit 099e44a

Please sign in to comment.