Skip to content

Commit d812806

Browse files
README
1 parent 2375904 commit d812806

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test_data_model/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
This directory contains the decentralized method to test new and existing data models
2+
3+
The file [master_tests.py](https://github.com/smart-data-models/data-models/blob/master/test_data_model/master_tests.py) executes all the files in the tests directory as long as they are included in this line of code
4+
test_files = ["test_valid_json", "test_file_exists", "test_schema_descriptions", "test_schema_metadata", "test_duplicated_attributes"]
5+
6+
so if you create a new test you need to extend this line with your file. Bear in mind these points
7+
1) that the file you create has to have a function with the same name of the file inside. The file [test_schema_descriptions.py](https://github.com/smart-data-models/data-models/blob/master/test_data_model/tests/test_schema_descriptions.py) has a function named test_schema_descriptions
8+
2) the functions return 3 values. test_name, success, output. test_name is the description of the test run, success is a boolean value indicating if the overall test has been successful. output contains all the messages for the issues or success passed tests. in a json format to be easily manageable.
9+
10+
The file [master_tests.py](https://github.com/smart-data-models/data-models/blob/master/test_data_model/master_tests.py) is invoked this way
11+
'python3 master_tests.py <repo_url_or_local_path> <email> <only_report_errors>'
12+
- '<repo_url_or_local_path>'. Is the local path or url for the repository where the data model is located. It does not matter because any case the files are copied locally and removed once the tests has finished. Independently if you are going to test one file or all of them you pass as parameter the root of the directory where the files are located. Teh expect structure is described in the [contribution manual](https://bit.ly/contribution_manual). In example https://github.com/smart-data-models/dataModel.Weather/tree/master/WeatherObserved
13+
- '<email>' is the email of the user running the test
14+
- '<only_report_errors>' is a boolean (true or 1) to show just only those unsuccessful tests
15+

0 commit comments

Comments
 (0)