sync - Ashraf-Ali-aa/repauto GitHub Wiki
Supported Format
Allure is the default format that Repauto consumes. Good thing about it is that they have all kinds of adapters which can transform almost any format into allure format.
Folder Structure for Data
Here is an example of folder structure of test results data.
root
| project_1
| | project.yml
| | test_run_1
| | | 2015-01-01-01-01
| | | | allure
| | | | | 06a...511-testsuite.xml
| | | | | 7a0...19a-attachment.jpg
| | | | status.yml
Configuration for data sync located in config/initializers/data_sync.rb.
Here is the config for above data structure.
DataSync.configure do |config|
# root folder where your data resides.
config.root = Pathname.new('data')
# pattern to find projects.
config.project_pattern = "#{config.root}/*"
# relative to project path
config.test_run_pattern = '*/*'
# relative to test run path
config.allure_file_pattern = 'allure/*'
# optional status file
config.status_file_name = 'status.yml'
# if exists under test run folder,
# do not delete the folder even auto_cleanup is enabled
config.keep_file_name = 'in_progress'
# delete imported files, delete test run folder if done.
config.auto_cleanup = true
end
project.yml
This file includes information of the project. An example:
---
stream: Retail # group name for project
project: Awesome App 1.0 # actual project name
You can put more info in the file, it will be imported into DB and updated every sync.
Auto Cleanup
If set to true, allure files (in above example, files under allure folder) will be deleted after they are imported into DB one by one during importing. The test run folder will be deleted once Repauto thinks it is done according to status file or keep file.
Status File
This file is optional for a test run. Example:
start_time: 1439345141322
end_time: 1439345241322
status: done
The timestamps are UTC time in milliseconds. When the status set to done, after the import, the test run folder will be deleted when auto_cleanup is set to true. Normally you will need to write code in before and after hook methods to generate this file. Otherwise use keep_file.
Keep File
In order to inform syncing process that the test run is still in progress, and there will be more data coming, you need to put a keep file under test run folder. In the example above, simply put a file named in_progress under test run folder before test run. And delete it afterwards.