You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/community/contribution_guidelines/index.rst
+7-8Lines changed: 7 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,16 +20,15 @@ Push your tests in the Giskard repo
20
20
21
21
* Clone the Giskard repository
22
22
* Create a GitHub branch with the base as main, starting with `test-contribution/name-of-your-branch`
23
-
* From the root of the cloned repo run `./gradlew generateProto`. This will generate the module`generated` that you will need to create your tests.
24
-
* Write your test inside one of the classes (`MetamorphicTests`, `HeuristicTests`, `PerformanceTests` or `DriftTests`) inside this `repo <https://github.com/Giskard-AI/giskard/tree/main/giskard-ml-worker/ml\_worker/testing>`__. If your test does not fit these classes, you can also create a custom class in a new file.
25
-
* We recommend writing unit tests for your test functions: this is the way you can execute and debug your test! Unit tests should be placed in `this directory <https://github.com/Giskard-AI/giskard/tree/main/giskard-ml-worker/test>`__.
23
+
* Write your test inside one of the classes (`MetamorphicTests`, `HeuristicTests`, `PerformanceTests` or `DriftTests`) inside this `repo <https://github.com/Giskard-AI/giskard/tree/main/giskard/testing>`__. If your test does not fit these classes, you can also create a custom class in a new file.
24
+
* We recommend writing unit tests for your test functions: this is the way you can execute and debug your test! Unit tests should be placed in `this directory <https://github.com/Giskard-AI/giskard/tree/main/tests>`__.
26
25
27
26
.. hint::
28
27
**Fixtures**
29
28
30
29
A unit test is executed with a *test model* and *test data* provided as fixtures.
31
30
32
-
For example, in `test_precision <https://github.com/Giskard-AI/giskard/blob/main/giskard-ml-worker/test/test\_performance.py#L73>`_ function, we use *german_credit_data* and *german_credit_model* as fixtures. If necessary, you can create your own fixtures; check `this directory <https://github.com/Giskard-AI/giskard/tree/main/giskard-ml-worker/test/fixtures>`__ to know how.
31
+
For example, in `test_precision <https://github.com/Giskard-AI/giskard/blob/main/giskard/testing/tests/performance.py>`_ function, we use *german_credit_data* and *german_credit_model* as fixtures. If necessary, you can create your own fixtures; check `this directory <https://github.com/Giskard-AI/giskard/tree/main/tests/fixtures>`__ to know how.
33
32
34
33
* Create a Pull Request
35
34
@@ -38,9 +37,9 @@ Push your tests in the Giskard repo
38
37
39
38
Let us guide you with an **example where you want to create a heuristic test function**:
40
39
41
-
* Since you are writing a heuristic test, you will select heuristic\_tests.py from the list of files under https://github.com/Giskard-AI/giskard/tree/main/giskard-ml-worker/ml\_worker/testing
40
+
* Since you are writing a heuristic test, you will select heuristic\_tests.py from the list of files under https://github.com/Giskard-AI/giskard/tree/main/giskard/testing
42
41
* In heuristic\_tests.py, write your code under **class HeuristicTests(AbstractTestCollection) after the existing codes**
43
-
* To write the unit test we select test\_heuristic.py under the list of files https://github.com/Giskard-AI/giskard/tree/main/giskard-ml-worker/test
42
+
* To write the unit test we select test\_heuristic.py under the list of files https://github.com/Giskard-AI/giskard/tree/main/tests
44
43
* Follow the pattern of parameterizing the inputs which helps you to test the function using different fixtures. You can read more about parameterizing unit tests here https://docs.pytest.org/en/7.1.x/example/parametrize.html
45
-
* If you want to create your own dataset, You can create your own fixture python file under https://github.com/Giskard-AI/giskard/tree/main/giskard-ml-worker/test/fixtures
46
-
* You can use https://github.com/Giskard-AI/giskard/blob/main/giskard-ml-worker/test/fixtures/german\_credit\_scoring.py for your reference. Make sure you return the model, data(with target) and test\_data(without target) in the expected format.
44
+
* If you want to create your own dataset, You can create your own fixture python file under https://github.com/Giskard-AI/giskard/tree/main/tests
45
+
* You can use https://github.com/Giskard-AI/giskard/tree/main/tests/fixtures/german\_credit\_scoring.py for your reference. Make sure you return the model, data(with target) and test\_data(without target) in the expected format.
0 commit comments