Compare commits
4 Commits
0.3.0.post
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| 507abf1c76 | |||
|
|
054d9329fd | ||
|
|
e95b59ae3d | ||
|
|
7e6aacc82f |
4
Jenkinsfile
vendored
4
Jenkinsfile
vendored
@@ -184,7 +184,7 @@ pipeline {
|
|||||||
sh("virtualenv --pip=embed --setuptools=embed --wheel=embed --no-periodic-update --activators bash,python TOOLS_ENV")
|
sh("virtualenv --pip=embed --setuptools=embed --wheel=embed --no-periodic-update --activators bash,python TOOLS_ENV")
|
||||||
|
|
||||||
sh(". ~/BUILD_ENV/bin/activate && pip install --upgrade setuptools build pip")
|
sh(". ~/BUILD_ENV/bin/activate && pip install --upgrade setuptools build pip")
|
||||||
sh(". ~/BUILD_ENV/bin/activate && pip install --upgrade 'copier==8.*' jinja2-slug toml")
|
sh(". ~/BUILD_ENV/bin/activate && pip install --upgrade 'copier==9.*' jinja2-slug toml")
|
||||||
|
|
||||||
sh(". ~/TEST_ENV/bin/activate && pip install --upgrade pip")
|
sh(". ~/TEST_ENV/bin/activate && pip install --upgrade pip")
|
||||||
|
|
||||||
@@ -546,7 +546,7 @@ pipeline {
|
|||||||
dir("gitrepo") {
|
dir("gitrepo") {
|
||||||
junit 'helpers-results/cl_unit_test/*.xml'
|
junit 'helpers-results/cl_unit_test/*.xml'
|
||||||
// using cobertura format (= coverage xml format)
|
// using cobertura format (= coverage xml format)
|
||||||
publishCoverage adapters: [cobertura(mergeToOneReport: true, path: "helpers-results/cl_unit_test_coverage/test_coverage.xml")]
|
recordCoverage(tools: [[parser: 'COBERTURA', pattern: 'helpers-results/cl_unit_test_coverage/test_coverage.xml']])
|
||||||
publishHTML([
|
publishHTML([
|
||||||
reportDir: "helpers-results/cl_unit_test_coverage",
|
reportDir: "helpers-results/cl_unit_test_coverage",
|
||||||
reportFiles: "index.html",
|
reportFiles: "index.html",
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ class dabdatasync_args(Tap):
|
|||||||
self.command: Union[str, None] = cast(Union[str, None], self.command) # pylint: disable=attribute-defined-outside-init
|
self.command: Union[str, None] = cast(Union[str, None], self.command) # pylint: disable=attribute-defined-outside-init
|
||||||
|
|
||||||
|
|
||||||
def fct_main(i_args: list[str]) -> None: # pylint: disable=too-many-branches,too-complex
|
def fct_main(i_args: list[str]) -> None: # pylint: disable=too-many-branches,too-complex,too-many-statements
|
||||||
"""CLI main function"""
|
"""CLI main function"""
|
||||||
parser: dabdatasync_args = dabdatasync_args(prog=__Name__, description=__Summuary__)
|
parser: dabdatasync_args = dabdatasync_args(prog=__Name__, description=__Summuary__)
|
||||||
|
|
||||||
@@ -104,13 +104,13 @@ def fct_main(i_args: list[str]) -> None: # pylint: disable=too-many-branches,to
|
|||||||
if args.help:
|
if args.help:
|
||||||
print(parser.format_help())
|
print(parser.format_help())
|
||||||
|
|
||||||
for name, subparser in parser._subparsers.choices.items(): # type: ignore[union-attr]
|
for name, subparser in parser._subparsers.choices.items(): # type: ignore[union-attr] # pylint: disable=protected-access
|
||||||
print("=========================")
|
print("=========================")
|
||||||
print(f"Subparser {{{name}}}")
|
print(f"Subparser {{{name}}}")
|
||||||
print(subparser.format_help())
|
print(subparser.format_help())
|
||||||
|
|
||||||
if args.help or args.version:
|
if args.help or args.version:
|
||||||
exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
logger.remove()
|
logger.remove()
|
||||||
if args.verbosity:
|
if args.verbosity:
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ class TestDabDataSync(unittest.TestCase):
|
|||||||
nextcloud_pwd = pwd_file.read()
|
nextcloud_pwd = pwd_file.read()
|
||||||
else:
|
else:
|
||||||
raise RuntimeError("NextCloud pwd file not found")
|
raise RuntimeError("NextCloud pwd file not found")
|
||||||
|
|
||||||
files = glob.glob(str(testdir_path / "*.json"))
|
files = glob.glob(str(testdir_path / "*.json"))
|
||||||
files += glob.glob(str(testdir_path / "*.json"))
|
files += glob.glob(str(testdir_path / "*.json"))
|
||||||
for file in files:
|
for file in files:
|
||||||
@@ -61,6 +62,19 @@ class TestDabDataSync(unittest.TestCase):
|
|||||||
shutil.rmtree(testdir_path / "test_data", ignore_errors=True)
|
shutil.rmtree(testdir_path / "test_data", ignore_errors=True)
|
||||||
shutil.rmtree(testdir_path / "test_data2", ignore_errors=True)
|
shutil.rmtree(testdir_path / "test_data2", ignore_errors=True)
|
||||||
|
|
||||||
|
files = glob.glob(str(testdir_path / "*.json"))
|
||||||
|
files += glob.glob(str(testdir_path / "*.json"))
|
||||||
|
for file in files:
|
||||||
|
with open(file) as f:
|
||||||
|
data = json.load(f)
|
||||||
|
try:
|
||||||
|
data["Args"]["FSSync_NextCloud_Password"]["value"] = ""
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
os.remove(file)
|
||||||
|
with open(file, "w") as f:
|
||||||
|
json.dump(data, f, sort_keys=True, indent=4)
|
||||||
|
|
||||||
def test_version(self):
|
def test_version(self):
|
||||||
self.assertNotEqual(dabdatasync.__version__, "?.?.?")
|
self.assertNotEqual(dabdatasync.__version__, "?.?.?")
|
||||||
|
|
||||||
@@ -341,6 +355,26 @@ class TestDabDataSync(unittest.TestCase):
|
|||||||
with open(testdir_path / "test_data2" / "SAVE_FILE.txt", "rt", encoding="utf-8") as testfile:
|
with open(testdir_path / "test_data2" / "SAVE_FILE.txt", "rt", encoding="utf-8") as testfile:
|
||||||
self.assertEqual(testfile.read(), "MODIFIED_VALUE")
|
self.assertEqual(testfile.read(), "MODIFIED_VALUE")
|
||||||
|
|
||||||
|
def test_load_remote_empty(self):
|
||||||
|
dabdatasync.DataSync_Factory.manifest_path = testdir_path / "test_manifest_nextcloud.json"
|
||||||
|
datasync = dabdatasync.DataSync_Factory.get_DataSync()
|
||||||
|
|
||||||
|
datasync[0].wipe_remote_data()
|
||||||
|
|
||||||
|
with open(testdir_path / "test_data" / "SAVE_FILE.txt", "rt", encoding="utf-8") as testfile:
|
||||||
|
self.assertEqual(testfile.read(), "SAVED_VALUE")
|
||||||
|
|
||||||
|
with open(testdir_path / "test_data2" / "SAVE_FILE.txt", "rt", encoding="utf-8") as testfile:
|
||||||
|
self.assertEqual(testfile.read(), "SAVED_VALUE")
|
||||||
|
|
||||||
|
datasync[0].pull_data()
|
||||||
|
|
||||||
|
with open(testdir_path / "test_data" / "SAVE_FILE.txt", "rt", encoding="utf-8") as testfile:
|
||||||
|
self.assertEqual(testfile.read(), "SAVED_VALUE")
|
||||||
|
|
||||||
|
with open(testdir_path / "test_data2" / "SAVE_FILE.txt", "rt", encoding="utf-8") as testfile:
|
||||||
|
self.assertEqual(testfile.read(), "SAVED_VALUE")
|
||||||
|
|
||||||
def load_nextcloud_gen(self, compressor):
|
def load_nextcloud_gen(self, compressor):
|
||||||
dabdatasync.DataSync_Factory.manifest_path = testdir_path / "test_manifest_nextcloud.json"
|
dabdatasync.DataSync_Factory.manifest_path = testdir_path / "test_manifest_nextcloud.json"
|
||||||
datasync = dabdatasync.DataSync_Factory.get_DataSync()
|
datasync = dabdatasync.DataSync_Factory.get_DataSync()
|
||||||
|
|||||||
@@ -178,18 +178,6 @@
|
|||||||
"type": "BOOL",
|
"type": "BOOL",
|
||||||
"value": true
|
"value": true
|
||||||
},
|
},
|
||||||
"FSSYNC_INITIAL_FETCH": {
|
|
||||||
"type": "BOOL",
|
|
||||||
"value": true
|
|
||||||
},
|
|
||||||
"FSSYNC_POSTSYNC_CMD": {
|
|
||||||
"type": "STRING",
|
|
||||||
"value": ""
|
|
||||||
},
|
|
||||||
"FSSYNC_PRESYNC_CMD": {
|
|
||||||
"type": "STRING",
|
|
||||||
"value": ""
|
|
||||||
},
|
|
||||||
"FSSYNC_RECORD": {
|
"FSSYNC_RECORD": {
|
||||||
"type": "T_ARRAY_FSSYNC_RECORD",
|
"type": "T_ARRAY_FSSYNC_RECORD",
|
||||||
"value": [
|
"value": [
|
||||||
@@ -239,7 +227,7 @@
|
|||||||
},
|
},
|
||||||
"FSSync_NextCloud_Password": {
|
"FSSync_NextCloud_Password": {
|
||||||
"type": "STRING",
|
"type": "STRING",
|
||||||
"value": "F3P8m-nQHik-NSmb2-mnFEF-s85RE"
|
"value": ""
|
||||||
},
|
},
|
||||||
"FSSync_NextCloud_Path": {
|
"FSSync_NextCloud_Path": {
|
||||||
"type": "STRING",
|
"type": "STRING",
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
},
|
},
|
||||||
"FSSync_NextCloud_Password": {
|
"FSSync_NextCloud_Password": {
|
||||||
"type": "STRING",
|
"type": "STRING",
|
||||||
"value": "F3P8m-nQHik-NSmb2-mnFEF-s85RE"
|
"value": ""
|
||||||
},
|
},
|
||||||
"FSSync_NextCloud_Path": {
|
"FSSync_NextCloud_Path": {
|
||||||
"type": "STRING",
|
"type": "STRING",
|
||||||
|
|||||||
Reference in New Issue
Block a user