@cloudant/couchbackup 2.9.9-SNAPSHOT.99 → 2.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.scannerwork/report-task.txt +2 -2
- package/.scannerwork/scanner-report/analysis-warnings.pb +2 -2
- package/.scannerwork/scanner-report/analysis.log +1 -1
- package/.scannerwork/scanner-report/changesets-36.pb +1 -0
- package/.scannerwork/scanner-report/changesets-45.pb +1 -0
- package/.scannerwork/scanner-report/changesets-47.pb +1 -0
- package/.scannerwork/scanner-report/changesets-49.pb +1 -0
- package/.scannerwork/scanner-report/changesets-64.pb +1 -0
- package/.scannerwork/scanner-report/changesets-66.pb +1 -0
- package/.scannerwork/scanner-report/changesets-68.pb +1 -0
- package/.scannerwork/scanner-report/component-1.pb +1 -1
- package/.scannerwork/scanner-report/component-19.pb +1 -1
- package/.scannerwork/scanner-report/component-2.pb +1 -1
- package/.scannerwork/scanner-report/component-20.pb +1 -1
- package/.scannerwork/scanner-report/component-21.pb +1 -1
- package/.scannerwork/scanner-report/component-22.pb +1 -1
- package/.scannerwork/scanner-report/component-23.pb +1 -1
- package/.scannerwork/scanner-report/component-24.pb +1 -1
- package/.scannerwork/scanner-report/component-25.pb +1 -1
- package/.scannerwork/scanner-report/component-26.pb +1 -1
- package/.scannerwork/scanner-report/component-27.pb +1 -1
- package/.scannerwork/scanner-report/component-28.pb +1 -1
- package/.scannerwork/scanner-report/component-29.pb +1 -1
- package/.scannerwork/scanner-report/component-3.pb +1 -1
- package/.scannerwork/scanner-report/component-30.pb +1 -1
- package/.scannerwork/scanner-report/component-31.pb +1 -1
- package/.scannerwork/scanner-report/component-32.pb +1 -1
- package/.scannerwork/scanner-report/component-33.pb +1 -1
- package/.scannerwork/scanner-report/component-34.pb +1 -1
- package/.scannerwork/scanner-report/component-35.pb +1 -1
- package/.scannerwork/scanner-report/component-36.pb +1 -0
- package/.scannerwork/scanner-report/component-37.pb +1 -1
- package/.scannerwork/scanner-report/component-38.pb +1 -1
- package/.scannerwork/scanner-report/component-39.pb +1 -1
- package/.scannerwork/scanner-report/component-4.pb +1 -1
- package/.scannerwork/scanner-report/component-40.pb +1 -1
- package/.scannerwork/scanner-report/component-45.pb +1 -0
- package/.scannerwork/scanner-report/component-47.pb +1 -1
- package/.scannerwork/scanner-report/component-49.pb +1 -0
- package/.scannerwork/scanner-report/component-50.pb +1 -1
- package/.scannerwork/scanner-report/component-52.pb +1 -1
- package/.scannerwork/scanner-report/component-56.pb +1 -1
- package/.scannerwork/scanner-report/component-57.pb +1 -1
- package/.scannerwork/scanner-report/component-58.pb +1 -1
- package/.scannerwork/scanner-report/component-59.pb +1 -1
- package/.scannerwork/scanner-report/component-60.pb +1 -1
- package/.scannerwork/scanner-report/component-61.pb +1 -1
- package/.scannerwork/scanner-report/component-62.pb +1 -1
- package/.scannerwork/scanner-report/component-63.pb +1 -1
- package/.scannerwork/scanner-report/component-64.pb +1 -1
- package/.scannerwork/scanner-report/component-65.pb +1 -1
- package/.scannerwork/scanner-report/component-66.pb +1 -0
- package/.scannerwork/scanner-report/component-67.pb +1 -1
- package/.scannerwork/scanner-report/component-68.pb +1 -0
- package/.scannerwork/scanner-report/component-69.pb +1 -0
- package/.scannerwork/scanner-report/coverages-19.pb +0 -0
- package/.scannerwork/scanner-report/coverages-2.pb +0 -0
- package/.scannerwork/scanner-report/coverages-20.pb +0 -0
- package/.scannerwork/scanner-report/coverages-21.pb +0 -0
- package/.scannerwork/scanner-report/coverages-22.pb +0 -0
- package/.scannerwork/scanner-report/coverages-23.pb +0 -0
- package/.scannerwork/scanner-report/coverages-24.pb +0 -0
- package/.scannerwork/scanner-report/coverages-25.pb +0 -0
- package/.scannerwork/scanner-report/coverages-26.pb +0 -0
- package/.scannerwork/scanner-report/coverages-27.pb +0 -0
- package/.scannerwork/scanner-report/coverages-28.pb +0 -0
- package/.scannerwork/scanner-report/coverages-29.pb +0 -0
- package/.scannerwork/scanner-report/coverages-3.pb +0 -0
- package/.scannerwork/scanner-report/coverages-30.pb +0 -0
- package/.scannerwork/scanner-report/coverages-31.pb +0 -0
- package/.scannerwork/scanner-report/coverages-32.pb +0 -0
- package/.scannerwork/scanner-report/coverages-33.pb +0 -0
- package/.scannerwork/scanner-report/coverages-34.pb +0 -0
- package/.scannerwork/scanner-report/coverages-35.pb +0 -0
- package/.scannerwork/scanner-report/coverages-36.pb +0 -0
- package/.scannerwork/scanner-report/coverages-37.pb +0 -0
- package/.scannerwork/scanner-report/coverages-38.pb +0 -0
- package/.scannerwork/scanner-report/coverages-39.pb +0 -0
- package/.scannerwork/scanner-report/coverages-45.pb +0 -0
- package/.scannerwork/scanner-report/coverages-47.pb +0 -0
- package/.scannerwork/scanner-report/coverages-49.pb +0 -0
- package/.scannerwork/scanner-report/coverages-52.pb +0 -0
- package/.scannerwork/scanner-report/coverages-56.pb +0 -0
- package/.scannerwork/scanner-report/coverages-57.pb +0 -0
- package/.scannerwork/scanner-report/coverages-58.pb +0 -0
- package/.scannerwork/scanner-report/coverages-59.pb +0 -0
- package/.scannerwork/scanner-report/coverages-60.pb +0 -0
- package/.scannerwork/scanner-report/coverages-61.pb +0 -0
- package/.scannerwork/scanner-report/coverages-62.pb +0 -0
- package/.scannerwork/scanner-report/coverages-63.pb +0 -0
- package/.scannerwork/scanner-report/coverages-64.pb +0 -0
- package/.scannerwork/scanner-report/coverages-65.pb +0 -0
- package/.scannerwork/scanner-report/coverages-66.pb +0 -0
- package/.scannerwork/scanner-report/coverages-67.pb +0 -0
- package/.scannerwork/scanner-report/duplications-20.pb +0 -2
- package/.scannerwork/scanner-report/duplications-22.pb +3 -0
- package/.scannerwork/scanner-report/duplications-28.pb +3 -0
- package/.scannerwork/scanner-report/duplications-29.pb +2 -0
- package/.scannerwork/scanner-report/duplications-3.pb +0 -2
- package/.scannerwork/scanner-report/duplications-30.pb +2 -0
- package/.scannerwork/scanner-report/duplications-31.pb +0 -2
- package/.scannerwork/scanner-report/duplications-33.pb +0 -3
- package/.scannerwork/scanner-report/duplications-34.pb +3 -0
- package/.scannerwork/scanner-report/duplications-37.pb +2 -0
- package/.scannerwork/scanner-report/duplications-47.pb +2 -0
- package/.scannerwork/scanner-report/duplications-49.pb +2 -0
- package/.scannerwork/scanner-report/duplications-56.pb +2 -0
- package/.scannerwork/scanner-report/duplications-63.pb +2 -0
- package/.scannerwork/scanner-report/duplications-65.pb +0 -2
- package/.scannerwork/scanner-report/duplications-66.pb +0 -0
- package/.scannerwork/scanner-report/duplications-67.pb +0 -2
- package/.scannerwork/scanner-report/duplications-68.pb +0 -0
- package/.scannerwork/scanner-report/issues-28.pb +4 -0
- package/.scannerwork/scanner-report/issues-33.pb +2 -3
- package/.scannerwork/scanner-report/measures-19.pb +0 -0
- package/.scannerwork/scanner-report/measures-2.pb +0 -0
- package/.scannerwork/scanner-report/measures-20.pb +0 -0
- package/.scannerwork/scanner-report/measures-21.pb +0 -0
- package/.scannerwork/scanner-report/measures-22.pb +0 -0
- package/.scannerwork/scanner-report/measures-23.pb +0 -0
- package/.scannerwork/scanner-report/measures-24.pb +0 -0
- package/.scannerwork/scanner-report/measures-25.pb +0 -0
- package/.scannerwork/scanner-report/measures-26.pb +0 -0
- package/.scannerwork/scanner-report/measures-27.pb +0 -0
- package/.scannerwork/scanner-report/measures-28.pb +0 -0
- package/.scannerwork/scanner-report/measures-29.pb +0 -0
- package/.scannerwork/scanner-report/measures-3.pb +0 -0
- package/.scannerwork/scanner-report/measures-30.pb +0 -0
- package/.scannerwork/scanner-report/measures-31.pb +0 -0
- package/.scannerwork/scanner-report/measures-32.pb +0 -0
- package/.scannerwork/scanner-report/measures-33.pb +0 -0
- package/.scannerwork/scanner-report/measures-34.pb +0 -0
- package/.scannerwork/scanner-report/measures-35.pb +0 -0
- package/.scannerwork/scanner-report/measures-36.pb +0 -0
- package/.scannerwork/scanner-report/measures-37.pb +0 -0
- package/.scannerwork/scanner-report/measures-38.pb +0 -0
- package/.scannerwork/scanner-report/measures-39.pb +0 -0
- package/.scannerwork/scanner-report/measures-4.pb +0 -0
- package/.scannerwork/scanner-report/measures-40.pb +0 -0
- package/.scannerwork/scanner-report/measures-45.pb +0 -0
- package/.scannerwork/scanner-report/measures-47.pb +0 -0
- package/.scannerwork/scanner-report/measures-49.pb +0 -0
- package/.scannerwork/scanner-report/measures-50.pb +0 -0
- package/.scannerwork/scanner-report/measures-52.pb +0 -0
- package/.scannerwork/scanner-report/measures-56.pb +0 -0
- package/.scannerwork/scanner-report/measures-57.pb +0 -0
- package/.scannerwork/scanner-report/measures-58.pb +0 -0
- package/.scannerwork/scanner-report/measures-59.pb +0 -0
- package/.scannerwork/scanner-report/measures-60.pb +0 -0
- package/.scannerwork/scanner-report/measures-61.pb +0 -0
- package/.scannerwork/scanner-report/measures-62.pb +0 -0
- package/.scannerwork/scanner-report/measures-63.pb +0 -0
- package/.scannerwork/scanner-report/measures-64.pb +0 -0
- package/.scannerwork/scanner-report/measures-65.pb +0 -0
- package/.scannerwork/scanner-report/measures-66.pb +0 -0
- package/.scannerwork/scanner-report/measures-67.pb +0 -0
- package/.scannerwork/scanner-report/measures-68.pb +0 -0
- package/.scannerwork/scanner-report/metadata.pb +0 -0
- package/.scannerwork/scanner-report/source-19.txt +84 -18
- package/.scannerwork/scanner-report/source-2.txt +39 -401
- package/.scannerwork/scanner-report/source-20.txt +15 -274
- package/.scannerwork/scanner-report/source-21.txt +348 -18
- package/.scannerwork/scanner-report/source-22.txt +91 -35
- package/.scannerwork/scanner-report/source-23.txt +43 -346
- package/.scannerwork/scanner-report/source-24.txt +73 -16
- package/.scannerwork/scanner-report/source-25.txt +125 -51
- package/.scannerwork/scanner-report/source-26.txt +136 -9
- package/.scannerwork/scanner-report/source-27.txt +598 -41
- package/.scannerwork/scanner-report/source-28.txt +187 -99
- package/.scannerwork/scanner-report/source-29.txt +203 -25
- package/.scannerwork/scanner-report/source-3.txt +52 -200
- package/.scannerwork/scanner-report/source-30.txt +254 -108
- package/.scannerwork/scanner-report/source-31.txt +17 -127
- package/.scannerwork/scanner-report/source-32.txt +6 -96
- package/.scannerwork/scanner-report/source-33.txt +27 -224
- package/.scannerwork/scanner-report/source-34.txt +114 -125
- package/.scannerwork/scanner-report/source-35.txt +37 -61
- package/.scannerwork/scanner-report/source-36.txt +36 -0
- package/.scannerwork/scanner-report/source-37.txt +120 -52
- package/.scannerwork/scanner-report/source-38.txt +48 -36
- package/.scannerwork/scanner-report/source-39.txt +125 -92
- package/.scannerwork/scanner-report/source-4.txt +509 -625
- package/.scannerwork/scanner-report/source-40.txt +393 -51
- package/.scannerwork/scanner-report/source-45.txt +418 -0
- package/.scannerwork/scanner-report/source-47.txt +175 -509
- package/.scannerwork/scanner-report/source-49.txt +190 -0
- package/.scannerwork/scanner-report/source-50.txt +167 -281
- package/.scannerwork/scanner-report/source-52.txt +94 -21
- package/.scannerwork/scanner-report/source-56.txt +73 -35
- package/.scannerwork/scanner-report/source-57.txt +111 -93
- package/.scannerwork/scanner-report/source-58.txt +88 -74
- package/.scannerwork/scanner-report/source-59.txt +94 -14
- package/.scannerwork/scanner-report/source-60.txt +147 -133
- package/.scannerwork/scanner-report/source-61.txt +83 -59
- package/.scannerwork/scanner-report/source-62.txt +33 -157
- package/.scannerwork/scanner-report/source-63.txt +56 -99
- package/.scannerwork/scanner-report/source-64.txt +41 -509
- package/.scannerwork/scanner-report/source-65.txt +65 -160
- package/.scannerwork/scanner-report/source-66.txt +31 -0
- package/.scannerwork/scanner-report/source-67.txt +144 -170
- package/.scannerwork/scanner-report/source-68.txt +281 -0
- package/{test-19-results.xml → .scannerwork/scanner-report/source-69.txt} +139 -139
- package/.scannerwork/scanner-report/symbols-19.pb +68 -9
- package/.scannerwork/scanner-report/symbols-2.pb +19 -610
- package/.scannerwork/scanner-report/symbols-20.pb +9 -485
- package/.scannerwork/scanner-report/symbols-21.pb +494 -11
- package/.scannerwork/scanner-report/symbols-22.pb +76 -42
- package/.scannerwork/scanner-report/symbols-23.pb +43 -494
- package/.scannerwork/scanner-report/symbols-24.pb +60 -17
- package/.scannerwork/scanner-report/symbols-25.pb +116 -36
- package/.scannerwork/scanner-report/symbols-26.pb +112 -9
- package/.scannerwork/scanner-report/symbols-27.pb +1253 -44
- package/.scannerwork/scanner-report/symbols-28.pb +385 -103
- package/.scannerwork/scanner-report/symbols-29.pb +417 -26
- package/.scannerwork/scanner-report/symbols-3.pb +29 -417
- package/.scannerwork/scanner-report/symbols-30.pb +486 -85
- package/.scannerwork/scanner-report/symbols-31.pb +17 -102
- package/.scannerwork/scanner-report/symbols-32.pb +9 -77
- package/.scannerwork/scanner-report/symbols-33.pb +26 -393
- package/.scannerwork/scanner-report/symbols-34.pb +97 -116
- package/.scannerwork/scanner-report/symbols-35.pb +36 -60
- package/.scannerwork/scanner-report/symbols-36.pb +11 -0
- package/.scannerwork/scanner-report/symbols-37.pb +102 -30
- package/.scannerwork/scanner-report/symbols-38.pb +44 -18
- package/.scannerwork/scanner-report/symbols-39.pb +85 -28
- package/.scannerwork/scanner-report/symbols-45.pb +610 -0
- package/.scannerwork/scanner-report/symbols-47.pb +153 -0
- package/.scannerwork/scanner-report/symbols-49.pb +180 -0
- package/.scannerwork/scanner-report/symbols-52.pb +28 -18
- package/.scannerwork/scanner-report/symbols-56.pb +42 -13
- package/.scannerwork/scanner-report/symbols-57.pb +33 -59
- package/.scannerwork/scanner-report/symbols-58.pb +30 -42
- package/.scannerwork/scanner-report/symbols-59.pb +58 -13
- package/.scannerwork/scanner-report/symbols-60.pb +129 -111
- package/.scannerwork/scanner-report/symbols-61.pb +41 -45
- package/.scannerwork/scanner-report/symbols-62.pb +14 -143
- package/.scannerwork/scanner-report/symbols-63.pb +42 -30
- package/.scannerwork/scanner-report/symbols-64.pb +18 -0
- package/.scannerwork/scanner-report/symbols-65.pb +45 -152
- package/.scannerwork/scanner-report/symbols-66.pb +14 -0
- package/.scannerwork/scanner-report/symbols-67.pb +126 -180
- package/.scannerwork/scanner-report/syntax-highlightings-19.pb +70 -15
- package/.scannerwork/scanner-report/syntax-highlightings-2.pb +58 -624
- package/.scannerwork/scanner-report/syntax-highlightings-20.pb +14 -623
- package/.scannerwork/scanner-report/syntax-highlightings-21.pb +596 -25
- package/.scannerwork/scanner-report/syntax-highlightings-22.pb +119 -43
- package/.scannerwork/scanner-report/syntax-highlightings-23.pb +46 -594
- package/.scannerwork/scanner-report/syntax-highlightings-24.pb +74 -27
- package/.scannerwork/scanner-report/syntax-highlightings-25.pb +98 -59
- package/.scannerwork/scanner-report/syntax-highlightings-26.pb +189 -14
- package/.scannerwork/scanner-report/syntax-highlightings-27.pb +843 -66
- package/.scannerwork/scanner-report/syntax-highlightings-28.pb +269 -163
- package/.scannerwork/scanner-report/syntax-highlightings-29.pb +291 -28
- package/.scannerwork/scanner-report/syntax-highlightings-3.pb +76 -304
- package/.scannerwork/scanner-report/syntax-highlightings-30.pb +610 -142
- package/.scannerwork/scanner-report/syntax-highlightings-31.pb +27 -191
- package/.scannerwork/scanner-report/syntax-highlightings-32.pb +13 -123
- package/.scannerwork/scanner-report/syntax-highlightings-33.pb +29 -290
- package/.scannerwork/scanner-report/syntax-highlightings-34.pb +147 -99
- package/.scannerwork/scanner-report/syntax-highlightings-35.pb +55 -70
- package/.scannerwork/scanner-report/syntax-highlightings-36.pb +59 -0
- package/.scannerwork/scanner-report/syntax-highlightings-37.pb +200 -76
- package/.scannerwork/scanner-report/syntax-highlightings-38.pb +85 -57
- package/.scannerwork/scanner-report/syntax-highlightings-39.pb +156 -103
- package/.scannerwork/scanner-report/syntax-highlightings-4.pb +3396 -536
- package/.scannerwork/scanner-report/syntax-highlightings-40.pb +3526 -727
- package/.scannerwork/scanner-report/syntax-highlightings-45.pb +648 -0
- package/.scannerwork/scanner-report/syntax-highlightings-47.pb +199 -3733
- package/.scannerwork/scanner-report/syntax-highlightings-49.pb +225 -0
- package/.scannerwork/scanner-report/syntax-highlightings-50.pb +863 -199
- package/.scannerwork/scanner-report/syntax-highlightings-52.pb +108 -20
- package/.scannerwork/scanner-report/syntax-highlightings-56.pb +57 -21
- package/.scannerwork/scanner-report/syntax-highlightings-57.pb +85 -89
- package/.scannerwork/scanner-report/syntax-highlightings-58.pb +77 -80
- package/.scannerwork/scanner-report/syntax-highlightings-59.pb +103 -15
- package/.scannerwork/scanner-report/syntax-highlightings-60.pb +166 -136
- package/.scannerwork/scanner-report/syntax-highlightings-61.pb +81 -60
- package/.scannerwork/scanner-report/syntax-highlightings-62.pb +17 -206
- package/.scannerwork/scanner-report/syntax-highlightings-63.pb +44 -79
- package/.scannerwork/scanner-report/syntax-highlightings-64.pb +39 -3736
- package/.scannerwork/scanner-report/syntax-highlightings-65.pb +64 -183
- package/.scannerwork/scanner-report/syntax-highlightings-66.pb +45 -0
- package/.scannerwork/scanner-report/syntax-highlightings-67.pb +154 -166
- package/.scannerwork/scanner-report/syntax-highlightings-68.pb +285 -0
- package/.scannerwork/scanner-report/{syntax-highlightings-43.pb → syntax-highlightings-69.pb} +98 -99
- package/CHANGES.md +4 -0
- package/README.md +1 -1
- package/package.json +4 -4
- package/test-16-results.xml +152 -152
- package/test-18-results.xml +156 -156
- package/{.scannerwork/scanner-report/source-43.txt → test-20-results.xml} +144 -144
- package/test-iam-18-results.xml +50 -50
- package/.scannerwork/scanner-report/changesets-4.pb +0 -1
- package/.scannerwork/scanner-report/changesets-5.pb +0 -1
- package/.scannerwork/scanner-report/changesets-50.pb +0 -1
- package/.scannerwork/scanner-report/changesets-51.pb +0 -1
- package/.scannerwork/scanner-report/changesets-53.pb +0 -1
- package/.scannerwork/scanner-report/changesets-54.pb +0 -1
- package/.scannerwork/scanner-report/changesets-6.pb +0 -1
- package/.scannerwork/scanner-report/component-42.pb +0 -1
- package/.scannerwork/scanner-report/component-43.pb +0 -1
- package/.scannerwork/scanner-report/component-5.pb +0 -1
- package/.scannerwork/scanner-report/component-51.pb +0 -1
- package/.scannerwork/scanner-report/component-53.pb +0 -1
- package/.scannerwork/scanner-report/component-54.pb +0 -1
- package/.scannerwork/scanner-report/component-6.pb +0 -1
- package/.scannerwork/scanner-report/coverages-4.pb +0 -0
- package/.scannerwork/scanner-report/coverages-5.pb +0 -0
- package/.scannerwork/scanner-report/coverages-51.pb +0 -0
- package/.scannerwork/scanner-report/coverages-53.pb +0 -0
- package/.scannerwork/scanner-report/coverages-54.pb +0 -0
- package/.scannerwork/scanner-report/coverages-6.pb +0 -0
- package/.scannerwork/scanner-report/duplications-32.pb +0 -3
- package/.scannerwork/scanner-report/duplications-5.pb +0 -3
- package/.scannerwork/scanner-report/duplications-51.pb +0 -2
- package/.scannerwork/scanner-report/duplications-54.pb +0 -2
- package/.scannerwork/scanner-report/issues-29.pb +0 -3
- package/.scannerwork/scanner-report/measures-43.pb +0 -0
- package/.scannerwork/scanner-report/measures-5.pb +0 -0
- package/.scannerwork/scanner-report/measures-51.pb +0 -0
- package/.scannerwork/scanner-report/measures-53.pb +0 -0
- package/.scannerwork/scanner-report/measures-54.pb +0 -0
- package/.scannerwork/scanner-report/measures-6.pb +0 -0
- package/.scannerwork/scanner-report/source-42.txt +0 -509
- package/.scannerwork/scanner-report/source-5.txt +0 -131
- package/.scannerwork/scanner-report/source-51.txt +0 -92
- package/.scannerwork/scanner-report/source-53.txt +0 -129
- package/.scannerwork/scanner-report/source-54.txt +0 -75
- package/.scannerwork/scanner-report/source-6.txt +0 -100
- package/.scannerwork/scanner-report/symbols-4.pb +0 -1254
- package/.scannerwork/scanner-report/symbols-5.pb +0 -97
- package/.scannerwork/scanner-report/symbols-51.pb +0 -44
- package/.scannerwork/scanner-report/symbols-53.pb +0 -33
- package/.scannerwork/scanner-report/symbols-54.pb +0 -42
- package/.scannerwork/scanner-report/symbols-6.pb +0 -69
- package/.scannerwork/scanner-report/syntax-highlightings-42.pb +0 -3748
- package/.scannerwork/scanner-report/syntax-highlightings-5.pb +0 -182
- package/.scannerwork/scanner-report/syntax-highlightings-51.pb +0 -90
- package/.scannerwork/scanner-report/syntax-highlightings-53.pb +0 -129
- package/.scannerwork/scanner-report/syntax-highlightings-54.pb +0 -78
- package/.scannerwork/scanner-report/syntax-highlightings-6.pb +0 -105
- package/test-14-results.xml +0 -509
- /package/.scannerwork/scanner-report/{coverages-50.pb → coverages-68.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-4.pb → duplications-26.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-50.pb → duplications-36.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-53.pb → duplications-45.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-6.pb → duplications-64.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-23.pb → issues-21.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-34.pb → issues-25.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-42.pb → measures-69.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-50.pb → symbols-68.pb} +0 -0
|
@@ -12,136 +12,282 @@
|
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
|
|
15
|
-
/* global describe it beforeEach */
|
|
15
|
+
/* global describe it before after beforeEach */
|
|
16
16
|
'use strict';
|
|
17
17
|
|
|
18
18
|
const assert = require('assert');
|
|
19
19
|
const fs = require('fs');
|
|
20
|
+
const u = require('./citestutils.js');
|
|
21
|
+
const mockServerPort = +process.env.COUCHBACKUP_MOCK_SERVER_PORT || 7777;
|
|
22
|
+
const url = `http://localhost:${mockServerPort}`;
|
|
20
23
|
const nock = require('nock');
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
const httpProxy = require('http-proxy');
|
|
25
|
+
const Readable = require('stream').Readable;
|
|
26
|
+
|
|
27
|
+
// Create an infinite stream to read.
|
|
28
|
+
// It just keeps sending a backup line, useful for testing cases of
|
|
29
|
+
// termination while a stream has content remaining (the animaldb backup
|
|
30
|
+
// is too small for that).
|
|
31
|
+
class InfiniteBackupStream extends Readable {
|
|
32
|
+
constructor(opt) {
|
|
33
|
+
super(opt);
|
|
34
|
+
this.contents = Buffer.from('[{"_id":"giraffe","_rev":"3-7665c3e66315ff40616cceef62886bd8","min_weight":830,"min_length":5,"max_weight":1600,"max_length":6,"wiki_page":"http://en.wikipedia.org/wiki/Giraffe","class":"mammal","diet":"herbivore","_revisions":{"start":3,"ids":["7665c3e66315ff40616cceef62886bd8","aaaf10d5a68cdf22d95a5482a0e95549","967a00dff5e02add41819138abb3284d"]}}]\n', 'utf8');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
_read() {
|
|
38
|
+
let proceed;
|
|
39
|
+
do {
|
|
40
|
+
proceed = this.push(this.contents);
|
|
41
|
+
} while (proceed);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function assertNock(done) {
|
|
46
|
+
try {
|
|
47
|
+
assert.ok(nock.isDone());
|
|
48
|
+
done();
|
|
49
|
+
} catch (err) {
|
|
50
|
+
console.error('pending mocks: %j', nock.pendingMocks());
|
|
51
|
+
done(err);
|
|
52
|
+
}
|
|
34
53
|
}
|
|
35
54
|
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
const db = request.client(dbUrl, { parallelism: 1 });
|
|
55
|
+
function backupHttpError(opts, errorName, errorCode, done) {
|
|
56
|
+
const p = u.p(opts, { expectedBackupError: { name: errorName, code: errorCode } });
|
|
39
57
|
|
|
40
|
-
|
|
41
|
-
|
|
58
|
+
// Create a file and attempt a backup to it
|
|
59
|
+
const output = fs.createWriteStream('/dev/null');
|
|
60
|
+
output.on('open', function() {
|
|
61
|
+
u.testBackup(p, 'fakenockdb', output, function(err) {
|
|
62
|
+
if (err) {
|
|
63
|
+
done(err);
|
|
64
|
+
} else {
|
|
65
|
+
assertNock(done);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
42
68
|
});
|
|
69
|
+
}
|
|
43
70
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
71
|
+
function restoreHttpError(opts, errorName, errorCode, done) {
|
|
72
|
+
const q = u.p(opts, { expectedRestoreError: { name: errorName, code: errorCode } });
|
|
73
|
+
u.testRestoreFromFile(q, './test/fixtures/animaldb_expected.json', 'fakenockdb', function(err) {
|
|
74
|
+
if (err) {
|
|
75
|
+
done(err);
|
|
76
|
+
} else {
|
|
77
|
+
assertNock(done);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
48
81
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
82
|
+
[{ useApi: true }, { useApi: false }].forEach(function(params) {
|
|
83
|
+
describe(u.scenario('#unit Fatal errors', params), function() {
|
|
84
|
+
let processEnvCopy;
|
|
85
|
+
let proxy;
|
|
86
|
+
|
|
87
|
+
before('Set process data for test', function() {
|
|
88
|
+
// Copy env and argv so we can reset them after the tests
|
|
89
|
+
processEnvCopy = JSON.parse(JSON.stringify(process.env));
|
|
90
|
+
|
|
91
|
+
// Set up a proxy to point to our nock server because the nock override
|
|
92
|
+
// isn't visible to the spawned CLI process
|
|
93
|
+
if (!params.useApi) {
|
|
94
|
+
proxy = httpProxy.createProxyServer({ target: url }).listen(mockServerPort + 1000, 'localhost');
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// setup environment variables
|
|
98
|
+
process.env.COUCH_URL = (params.useApi) ? url : `http://localhost:${mockServerPort + 1000}`;
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
after('Reset process data', function(done) {
|
|
102
|
+
process.env = processEnvCopy;
|
|
103
|
+
if (!params.useApi) {
|
|
104
|
+
proxy.close(done);
|
|
105
|
+
} else {
|
|
57
106
|
done();
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
beforeEach('Reset nocks', function() {
|
|
111
|
+
nock.cleanAll();
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
describe('for backup', function() {
|
|
115
|
+
it('should terminate when DB does not exist', function(done) {
|
|
116
|
+
// Simulate existence check
|
|
117
|
+
nock(url).head('/fakenockdb').reply(404, { error: 'not_found', reason: 'missing' });
|
|
118
|
+
backupHttpError(params, 'DatabaseNotFound', 10, done);
|
|
58
119
|
});
|
|
59
|
-
});
|
|
60
120
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
.pipe(writer(db, 500, 1, noopEmitter))
|
|
68
|
-
.on('error', function(err) {
|
|
69
|
-
assert.strictEqual(err.name, 'Unauthorized');
|
|
70
|
-
assert.strictEqual(err.message, 'Access is denied due to invalid credentials.');
|
|
71
|
-
assert.ok(nock.isDone());
|
|
72
|
-
done();
|
|
121
|
+
it('should terminate on BulkGetError', function(done) {
|
|
122
|
+
// Simulate existence check
|
|
123
|
+
const n = nock(url).head('/fakenockdb').reply(200);
|
|
124
|
+
// Simulate _bulk_get not available
|
|
125
|
+
n.post('/fakenockdb/_bulk_get').reply(404, { error: 'not_found', reason: 'missing' });
|
|
126
|
+
backupHttpError(params, 'BulkGetError', 50, done);
|
|
73
127
|
});
|
|
74
|
-
});
|
|
75
128
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
.post('/_bulk_docs')
|
|
81
|
-
.reply(500, { error: 'Internal Server Error' }) // transient error
|
|
82
|
-
.post('/_bulk_docs')
|
|
83
|
-
.reply(200, { ok: true }); // third time lucky success
|
|
84
|
-
|
|
85
|
-
testLinestream()
|
|
86
|
-
.pipe(writer(db, 500, 1, noopEmitter))
|
|
87
|
-
.on('error', function(err) {
|
|
88
|
-
done(err);
|
|
89
|
-
})
|
|
90
|
-
.on('finished', function(data) {
|
|
91
|
-
assert.strictEqual(data.total, 15);
|
|
92
|
-
assert.ok(nock.isDone());
|
|
93
|
-
done();
|
|
129
|
+
it('should terminate on Unauthorized existence check', function(done) {
|
|
130
|
+
// Simulate a 401
|
|
131
|
+
nock(url).head('/fakenockdb').reply(401, { error: 'unauthorized', reason: '_reader access is required for this request' });
|
|
132
|
+
backupHttpError(params, 'Unauthorized', 11, done);
|
|
94
133
|
});
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
.reply(429, { error: 'Too Many Requests' }) // transient error
|
|
101
|
-
.post('/_bulk_docs')
|
|
102
|
-
.reply(500, { error: 'Internal Server Error' }) // transient error
|
|
103
|
-
.post('/_bulk_docs')
|
|
104
|
-
.reply(503, { error: 'Service Unavailable' }); // Final transient error
|
|
105
|
-
|
|
106
|
-
testLinestream()
|
|
107
|
-
.pipe(writer(db, 500, 1, noopEmitter))
|
|
108
|
-
.on('error', function(err) {
|
|
109
|
-
assert.strictEqual(err.name, 'HTTPFatalError');
|
|
110
|
-
assert.strictEqual(err.message, `503 : post ${dbUrl}/_bulk_docs - Error: Service Unavailable`);
|
|
111
|
-
assert.ok(nock.isDone());
|
|
112
|
-
done();
|
|
134
|
+
|
|
135
|
+
it('should terminate on Forbidden no _reader', function(done) {
|
|
136
|
+
// Simulate a 403
|
|
137
|
+
nock(url).head('/fakenockdb').reply(403, { error: 'forbidden', reason: '_reader access is required for this request' });
|
|
138
|
+
backupHttpError(params, 'Forbidden', 12, done);
|
|
113
139
|
});
|
|
114
|
-
}).timeout(longTestTimeout);
|
|
115
140
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
141
|
+
it('should terminate on _bulk_get HTTPFatalError', function(done) {
|
|
142
|
+
// Provide a mock complete changes log to allow a resume to skip ahead
|
|
143
|
+
const p = u.p(params, { opts: { resume: true, log: './test/fixtures/test.log' } });
|
|
144
|
+
// Allow the existence and _bulk_get checks to pass
|
|
145
|
+
const n = nock(url).head('/fakenockdb').reply(200);
|
|
146
|
+
n.post('/fakenockdb/_bulk_get').reply(200, '{"results": []}');
|
|
147
|
+
// Simulate a fatal HTTP error when trying to fetch docs
|
|
148
|
+
// Note: 2 outstanding batches, so 2 responses, 1 mock is optional because we can't guarantee timing
|
|
149
|
+
n.post('/fakenockdb/_bulk_get').query(true).reply(400, { error: 'bad_request', reason: 'testing bad response' });
|
|
150
|
+
n.post('/fakenockdb/_bulk_get').query(true).optionally().reply(400, { error: 'bad_request', reason: 'testing bad response' });
|
|
151
|
+
backupHttpError(p, 'HTTPFatalError', 40, done);
|
|
152
|
+
});
|
|
120
153
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
done
|
|
125
|
-
})
|
|
126
|
-
.on('finished', function(data) {
|
|
127
|
-
assert.strictEqual(data.total, 11);
|
|
128
|
-
assert.ok(nock.isDone());
|
|
129
|
-
done();
|
|
154
|
+
it('should terminate on NoLogFileName', function(done) {
|
|
155
|
+
// Don't supply a log file name with resume
|
|
156
|
+
const p = u.p(params, { opts: { resume: true } });
|
|
157
|
+
backupHttpError(p, 'NoLogFileName', 20, done);
|
|
130
158
|
});
|
|
131
|
-
});
|
|
132
159
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
160
|
+
it('should terminate on LogDoesNotExist', function(done) {
|
|
161
|
+
// Use a non-existent log file
|
|
162
|
+
const p = u.p(params, { opts: { resume: true, log: './test/fixtures/doesnotexist.log' } });
|
|
163
|
+
backupHttpError(p, 'LogDoesNotExist', 21, done);
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
it('should terminate on IncompleteChangesInLogFile', function(done) {
|
|
167
|
+
// Use an incomplete changes log file
|
|
168
|
+
const p = u.p(params, { opts: { resume: true, log: './test/fixtures/incomplete_changes.log' } });
|
|
169
|
+
// Allow the existence and _bulk_get checks to pass
|
|
170
|
+
const n = nock(url).head('/fakenockdb').reply(200);
|
|
171
|
+
n.post('/fakenockdb/_bulk_get').reply(200, '{"results": []}');
|
|
172
|
+
// Should fail when it reads the incomplete changes
|
|
173
|
+
backupHttpError(p, 'IncompleteChangesInLogFile', 22, done);
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
it('should terminate on _changes HTTPFatalError', function(done) {
|
|
177
|
+
// Allow the existence and _bulk_get checks to pass
|
|
178
|
+
const n = nock(url).head('/fakenockdb').reply(200);
|
|
179
|
+
n.post('/fakenockdb/_bulk_get').reply(200, '{"results": []}');
|
|
180
|
+
// Simulate a fatal HTTP error when trying to fetch docs (note 2 outstanding batches)
|
|
181
|
+
n.post('/fakenockdb/_changes').query(true).reply(400, { error: 'bad_request', reason: 'testing bad response' });
|
|
182
|
+
backupHttpError(params, 'HTTPFatalError', 40, done);
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
it('should terminate on SpoolChangesError', function(done) {
|
|
186
|
+
// Allow the existence and _bulk_get checks to pass
|
|
187
|
+
const n = nock(url).head('/fakenockdb').reply(200);
|
|
188
|
+
n.post('/fakenockdb/_bulk_get').reply(200, '{"results": []}');
|
|
189
|
+
// Simulate a changes without a last_seq
|
|
190
|
+
n.post('/fakenockdb/_changes').query(true).reply(200,
|
|
191
|
+
{
|
|
192
|
+
results: [{
|
|
193
|
+
seq: '2-g1AAAAEbeJzLYWBgYMlgTmFQSElKzi9KdUhJstTLTS3KLElMT9VLzskvTUnMK9HLSy3JAapkSmRIsv___39WBnMiUy5QgN3MzDIxOdEMWb85dv0gSxThigyN8diS5AAkk-pBFiUyoOkzxKMvjwVIMjQAKaDW_Zh6TQnqPQDRC7I3CwDPDV1k',
|
|
194
|
+
id: 'badger',
|
|
195
|
+
changes: [{ rev: '4-51aa94e4b0ef37271082033bba52b850' }]
|
|
196
|
+
}]
|
|
197
|
+
});
|
|
198
|
+
backupHttpError(params, 'SpoolChangesError', 30, done);
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
describe('for restore', function() {
|
|
203
|
+
it('should terminate on Unauthorized db existence check', function(done) {
|
|
204
|
+
// Simulate a 401
|
|
205
|
+
nock(url).get('/fakenockdb').reply(401, { error: 'unauthorized', reason: '_reader access is required for this request' });
|
|
206
|
+
restoreHttpError(params, 'Unauthorized', 11, done);
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
it('should terminate on Forbidden no _writer', function(done) {
|
|
210
|
+
// Simulate the DB exists (i.e. you can read it)
|
|
211
|
+
const n = nock(url).get('/fakenockdb').reply(200, { doc_count: 0, doc_del_count: 0 });
|
|
212
|
+
// Simulate a 403 trying to write
|
|
213
|
+
n.post('/fakenockdb/_bulk_docs').reply(403, { error: 'forbidden', reason: '_writer access is required for this request' });
|
|
214
|
+
restoreHttpError(params, 'Forbidden', 12, done);
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
it('should terminate on RestoreDatabaseNotFound', function(done) {
|
|
218
|
+
// Simulate the DB does not exist
|
|
219
|
+
nock(url).get('/fakenockdb').reply(404, { error: 'not_found', reason: 'Database does not exist.' });
|
|
220
|
+
restoreHttpError(params, 'DatabaseNotFound', 10, done);
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
it('should terminate on notEmptyDBErr when database is not empty', function(done) {
|
|
224
|
+
// Simulate the DB that does exist and not empty
|
|
225
|
+
nock(url).get('/fakenockdb').reply(200, { doc_count: 10, doc_del_count: 0 });
|
|
226
|
+
restoreHttpError(params, 'DatabaseNotEmpty', 13, done);
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
it('should terminate on notEmptyDBErr when database is not new', function(done) {
|
|
230
|
+
// Simulate the DB that does exist and not new
|
|
231
|
+
nock(url).get('/fakenockdb').reply(200, { doc_count: 0, doc_del_count: 10 });
|
|
232
|
+
restoreHttpError(params, 'DatabaseNotEmpty', 13, done);
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
it('should terminate on _bulk_docs HTTPFatalError', function(done) {
|
|
236
|
+
// Simulate the DB exists
|
|
237
|
+
const n = nock(url).get('/fakenockdb').reply(200, { doc_count: 0, doc_del_count: 0 });
|
|
238
|
+
// Use a parallelism of one and mock one response
|
|
239
|
+
const p = u.p(params, { opts: { parallelism: 1 } });
|
|
240
|
+
// Simulate a 400 trying to write
|
|
241
|
+
n.post('/fakenockdb/_bulk_docs').reply(400, { error: 'bad_request', reason: 'testing bad response' });
|
|
242
|
+
restoreHttpError(p, 'HTTPFatalError', 40, done);
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
it('should terminate on _bulk_docs HTTPFatalError from system database', function(done) {
|
|
246
|
+
// Simulate that target database exists and is _not_ empty.
|
|
247
|
+
// This should pass validator as we exclude system databases from the check.
|
|
248
|
+
const n = nock(url).get('/_replicator').reply(200, { doc_count: 1, doc_del_count: 0 });
|
|
249
|
+
// Simulate a 400 trying to write
|
|
250
|
+
n.post('/_replicator/_bulk_docs').reply(400, { error: 'bad_request', reason: 'testing bad response' });
|
|
251
|
+
// Use a parallelism of one and mock one response
|
|
252
|
+
const q = u.p(params, { opts: { parallelism: 1 }, expectedRestoreError: { name: 'HTTPFatalError', code: 40 } });
|
|
253
|
+
u.testRestore(q, new InfiniteBackupStream(), '_replicator', function(err) {
|
|
254
|
+
if (err) {
|
|
255
|
+
done(err);
|
|
256
|
+
} else {
|
|
257
|
+
assertNock(done);
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
it('should terminate on _bulk_docs HTTPFatalError large stream', function(done) {
|
|
263
|
+
// Simulate the DB exists
|
|
264
|
+
const n = nock(url).get('/fakenockdb').reply(200, { doc_count: 0, doc_del_count: 0 });
|
|
265
|
+
// Simulate a 400 trying to write
|
|
266
|
+
// Provide a body function to handle the stream, but allow any body
|
|
267
|
+
n.post('/fakenockdb/_bulk_docs', function(body) { return true; }).reply(400, { error: 'bad_request', reason: 'testing bad response' });
|
|
268
|
+
// Use only parallelism 1 so we don't have to mock up loads of responses
|
|
269
|
+
const q = u.p(params, { opts: { parallelism: 1 }, expectedRestoreError: { name: 'HTTPFatalError', code: 40 } });
|
|
270
|
+
u.testRestore(q, new InfiniteBackupStream(), 'fakenockdb', function(err) {
|
|
271
|
+
if (err) {
|
|
272
|
+
done(err);
|
|
273
|
+
} else {
|
|
274
|
+
assertNock(done);
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
it('should terminate on multiple _bulk_docs HTTPFatalError', function(done) {
|
|
280
|
+
// Simulate the DB exists
|
|
281
|
+
const n = nock(url).get('/fakenockdb').reply(200, { doc_count: 0, doc_del_count: 0 });
|
|
282
|
+
// Simulate a 400 trying to write docs, 5 times because of default parallelism
|
|
283
|
+
// Provide a body function to handle the stream, but allow any body
|
|
284
|
+
// Four of the mocks are optional because of parallelism 5 we can't guarantee that the exit will happen
|
|
285
|
+
// after all 5 requests, but we must get at least one of them
|
|
286
|
+
n.post('/fakenockdb/_bulk_docs', function(body) { return true; }).reply(400, { error: 'bad_request', reason: 'testing bad response' });
|
|
287
|
+
n.post('/fakenockdb/_bulk_docs', function(body) { return true; }).times(4).optionally().reply(400, { error: 'bad_request', reason: 'testing bad response' });
|
|
288
|
+
const q = u.p(params, { opts: { bufferSize: 1 }, expectedRestoreError: { name: 'HTTPFatalError', code: 40 } });
|
|
289
|
+
restoreHttpError(q, 'HTTPFatalError', 40, done);
|
|
145
290
|
});
|
|
291
|
+
});
|
|
146
292
|
});
|
|
147
293
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright © 2017
|
|
1
|
+
// Copyright © 2017 IBM Corp. All rights reserved.
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -12,134 +12,24 @@
|
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
|
|
15
|
-
/* global describe it
|
|
15
|
+
/* global describe it */
|
|
16
16
|
'use strict';
|
|
17
17
|
|
|
18
18
|
const assert = require('assert');
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// string of include_docs because of a quirk of nano that when using the fetch
|
|
35
|
-
// method always adds the include_docs query string.
|
|
36
|
-
describe('#unit Perform backup using shallow backup', function() {
|
|
37
|
-
const dbUrl = 'http://localhost:5984/animaldb';
|
|
38
|
-
// Query string keys are stringified by Nano
|
|
39
|
-
const badgerKey = 'badger\0';
|
|
40
|
-
const kookaburraKey = 'kookaburra\0';
|
|
41
|
-
const snipeKey = 'snipe\0';
|
|
42
|
-
|
|
43
|
-
beforeEach('Reset nocks', function() {
|
|
44
|
-
nock.cleanAll();
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('should perform a shallow backup', function(done) {
|
|
48
|
-
const couch = nock(dbUrl)
|
|
49
|
-
// batch 1
|
|
50
|
-
.post('/_all_docs', { limit: 3, include_docs: true })
|
|
51
|
-
.reply(200, JSON.parse(fs.readFileSync('./test/fixtures/animaldb_all_docs_1.json', 'utf8')))
|
|
52
|
-
// batch 2
|
|
53
|
-
.post('/_all_docs', { limit: 3, start_key: badgerKey, include_docs: true })
|
|
54
|
-
.reply(200, JSON.parse(fs.readFileSync('./test/fixtures/animaldb_all_docs_2.json', 'utf8')))
|
|
55
|
-
// batch 3
|
|
56
|
-
.post('/_all_docs', { limit: 3, start_key: kookaburraKey, include_docs: true })
|
|
57
|
-
.reply(200, JSON.parse(fs.readFileSync('./test/fixtures/animaldb_all_docs_3.json', 'utf8')))
|
|
58
|
-
// batch 4
|
|
59
|
-
.post('/_all_docs', { limit: 3, start_key: snipeKey, include_docs: true })
|
|
60
|
-
.reply(200, JSON.parse(fs.readFileSync('./test/fixtures/animaldb_all_docs_4.json', 'utf8')));
|
|
61
|
-
|
|
62
|
-
shallowBackup(dbUrl, { bufferSize: 3, parallelism: 1 })
|
|
63
|
-
.on('error', function(err) {
|
|
64
|
-
assert.fail(err);
|
|
65
|
-
})
|
|
66
|
-
.on('received', function(data) {
|
|
67
|
-
if (data.batch === 3) {
|
|
68
|
-
assert.strictEqual(data.length, 2); // smaller last batch
|
|
69
|
-
} else {
|
|
70
|
-
assert.strictEqual(data.length, 3);
|
|
71
|
-
}
|
|
72
|
-
})
|
|
73
|
-
.on('finished', function(data) {
|
|
74
|
-
assert.strictEqual(data.total, 11);
|
|
75
|
-
assert.ok(couch.isDone());
|
|
76
|
-
done();
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
it('should perform a shallow backup with transient error', function(done) {
|
|
81
|
-
const couch = nock(dbUrl)
|
|
82
|
-
// batch 1
|
|
83
|
-
.post('/_all_docs', { limit: 3, include_docs: true })
|
|
84
|
-
.reply(200, JSON.parse(fs.readFileSync('./test/fixtures/animaldb_all_docs_1.json', 'utf8')))
|
|
85
|
-
// batch 2
|
|
86
|
-
.post('/_all_docs', { limit: 3, start_key: badgerKey, include_docs: true })
|
|
87
|
-
.reply(200, JSON.parse(fs.readFileSync('./test/fixtures/animaldb_all_docs_2.json', 'utf8')))
|
|
88
|
-
// batch 3 - transient error
|
|
89
|
-
.post('/_all_docs', { limit: 3, start_key: kookaburraKey, include_docs: true })
|
|
90
|
-
.reply(500, { error: 'Internal Server Error' })
|
|
91
|
-
// batch 3 - retry
|
|
92
|
-
.post('/_all_docs', { limit: 3, start_key: kookaburraKey, include_docs: true })
|
|
93
|
-
.reply(200, JSON.parse(fs.readFileSync('./test/fixtures/animaldb_all_docs_3.json', 'utf8')))
|
|
94
|
-
// batch 4
|
|
95
|
-
.post('/_all_docs', { limit: 3, start_key: snipeKey, include_docs: true })
|
|
96
|
-
.reply(200, JSON.parse(fs.readFileSync('./test/fixtures/animaldb_all_docs_4.json', 'utf8')));
|
|
97
|
-
|
|
98
|
-
shallowBackup(dbUrl, { bufferSize: 3, parallelism: 1 })
|
|
99
|
-
.on('error', function(err) {
|
|
100
|
-
assert.strictEqual(err.name, 'HTTPError');
|
|
101
|
-
})
|
|
102
|
-
.on('received', function(data) {
|
|
103
|
-
if (data.batch === 3) {
|
|
104
|
-
assert.strictEqual(data.length, 2); // smaller last batch
|
|
105
|
-
} else {
|
|
106
|
-
assert.strictEqual(data.length, 3);
|
|
107
|
-
}
|
|
108
|
-
})
|
|
109
|
-
.on('finished', function(data) {
|
|
110
|
-
assert.strictEqual(data.total, 11);
|
|
111
|
-
assert.ok(couch.isDone());
|
|
112
|
-
done();
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
it('should fail to perform a shallow backup on fatal error', function(done) {
|
|
117
|
-
const couch = nock(dbUrl)
|
|
118
|
-
// batch 1
|
|
119
|
-
.post('/_all_docs', { limit: 3, include_docs: true })
|
|
120
|
-
.reply(200, JSON.parse(fs.readFileSync('./test/fixtures/animaldb_all_docs_1.json', 'utf8')))
|
|
121
|
-
// batch 2
|
|
122
|
-
.post('/_all_docs', { limit: 3, start_key: badgerKey, include_docs: true })
|
|
123
|
-
.reply(200, JSON.parse(fs.readFileSync('./test/fixtures/animaldb_all_docs_2.json', 'utf8')))
|
|
124
|
-
// batch 3 - fatal error
|
|
125
|
-
.post('/_all_docs', { limit: 3, start_key: kookaburraKey, include_docs: true })
|
|
126
|
-
.reply(401, { error: 'Unauthorized' });
|
|
127
|
-
|
|
128
|
-
let errCount = 0;
|
|
129
|
-
|
|
130
|
-
shallowBackup(dbUrl, { bufferSize: 3, parallelism: 1 })
|
|
131
|
-
.on('error', function(err) {
|
|
132
|
-
errCount++;
|
|
133
|
-
assert.strictEqual(err.name, 'Unauthorized');
|
|
134
|
-
})
|
|
135
|
-
.on('received', function(data) {
|
|
136
|
-
assert.strictEqual(data.length, 3);
|
|
137
|
-
})
|
|
138
|
-
.on('finished', function(data) {
|
|
139
|
-
assert.strictEqual(data.total, 6);
|
|
140
|
-
assert.ok(couch.isDone());
|
|
141
|
-
assert.strictEqual(errCount, 1);
|
|
142
|
-
done();
|
|
143
|
-
});
|
|
19
|
+
const logfilegetbatches = require('../includes/logfilegetbatches.js');
|
|
20
|
+
|
|
21
|
+
describe('#unit Fetching batches from a log file', function() {
|
|
22
|
+
it('should fetch multiple batches correctly', function(done) {
|
|
23
|
+
logfilegetbatches('./test/fixtures/test.log', [1, 4], function(err, data) {
|
|
24
|
+
assert.ok(!err);
|
|
25
|
+
assert.ok(data);
|
|
26
|
+
assert.strictEqual(typeof data, 'object');
|
|
27
|
+
assert.strictEqual(Object.keys(data).length, 2);
|
|
28
|
+
assert.deepStrictEqual(data['1'].docs, [{ id: '6' }, { id: '7' }, { id: '8' }, { id: '9' }, { id: '10' }]);
|
|
29
|
+
assert.strictEqual(data['1'].batch, 1);
|
|
30
|
+
assert.deepStrictEqual(data['4'].docs, [{ id: '21' }, { id: '22' }]);
|
|
31
|
+
assert.strictEqual(data['4'].batch, 4);
|
|
32
|
+
done();
|
|
33
|
+
});
|
|
144
34
|
});
|
|
145
35
|
});
|
|
@@ -15,105 +15,15 @@
|
|
|
15
15
|
/* global describe it */
|
|
16
16
|
'use strict';
|
|
17
17
|
|
|
18
|
-
const assert = require('assert');
|
|
19
|
-
const fs = require('fs');
|
|
20
18
|
const u = require('./citestutils.js');
|
|
21
19
|
|
|
22
20
|
[{ useApi: true }, { useApi: false }].forEach(function(params) {
|
|
23
|
-
describe(u.scenario('
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const logFile = `./${this.fileName}` + '.log';
|
|
30
|
-
// Use abort parameter to terminate the backup a given number of ms after
|
|
31
|
-
// the first data write to the output file.
|
|
32
|
-
const p = u.p(params, { opts: { log: logFile } });
|
|
33
|
-
u.testBackupToFile(p, 'animaldb', actualBackup, function(err) {
|
|
34
|
-
if (err) {
|
|
35
|
-
done(err);
|
|
36
|
-
} else {
|
|
37
|
-
// Assert the log file exists
|
|
38
|
-
try {
|
|
39
|
-
assert.ok(fs.existsSync(logFile), 'The log file should exist.');
|
|
40
|
-
done();
|
|
41
|
-
} catch (err) {
|
|
42
|
-
done(err);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it('should restore corrupted animaldb to a database correctly', function(done) {
|
|
49
|
-
// Allow up to 60 s to restore and compare (again it should be faster)!
|
|
50
|
-
u.setTimeout(this, 60);
|
|
51
|
-
const input = fs.createReadStream('./test/fixtures/animaldb_corrupted.json');
|
|
52
|
-
const dbName = this.dbName;
|
|
53
|
-
input.on('open', function() {
|
|
54
|
-
u.testRestore(params, input, dbName, function(err) {
|
|
55
|
-
if (err) {
|
|
56
|
-
done(err);
|
|
57
|
-
} else {
|
|
58
|
-
u.dbCompare('animaldb', dbName, done);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
});
|
|
21
|
+
describe(u.scenario('#slowest End to end backup and restore', params), function() {
|
|
22
|
+
// 10 GB is about the largest the CI can handle before getting very upset
|
|
23
|
+
// about how long things are taking
|
|
24
|
+
it('should backup and restore largedb10g', function(done) {
|
|
25
|
+
u.setTimeout(this, 350 * 60);
|
|
26
|
+
u.testDirectBackupAndRestore(params, 'largedb10g', this.dbName, done);
|
|
62
27
|
});
|
|
63
|
-
|
|
64
|
-
it('should restore resumed animaldb with blank line to a database correctly', function(done) {
|
|
65
|
-
// Allow up to 60 s to restore and compare (again it should be faster)!
|
|
66
|
-
u.setTimeout(this, 60);
|
|
67
|
-
const input = fs.createReadStream('./test/fixtures/animaldb_resumed_blank.json');
|
|
68
|
-
const dbName = this.dbName;
|
|
69
|
-
input.on('open', function() {
|
|
70
|
-
u.testRestore(params, input, dbName, function(err) {
|
|
71
|
-
if (err) {
|
|
72
|
-
done(err);
|
|
73
|
-
} else {
|
|
74
|
-
u.dbCompare('animaldb', dbName, done);
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
describe('Resume tests', function() {
|
|
83
|
-
// Currently cannot abort API backups, when we do this test should be run for
|
|
84
|
-
// both API and CLI
|
|
85
|
-
it('should correctly backup and restore backup10m', function(done) {
|
|
86
|
-
// Allow up to 90 s for this test
|
|
87
|
-
u.setTimeout(this, 90);
|
|
88
|
-
|
|
89
|
-
const actualBackup = `./${this.fileName}`;
|
|
90
|
-
const logFile = `./${this.fileName}` + '.log';
|
|
91
|
-
// Use abort parameter to terminate the backup a given number of ms after
|
|
92
|
-
// the first data write to the output file.
|
|
93
|
-
const p = u.p(params, { abort: true }, { opts: { log: logFile } });
|
|
94
|
-
const restoreDb = this.dbName;
|
|
95
|
-
// Set the database doc count as fewer than this should be written during
|
|
96
|
-
// resumed backup.
|
|
97
|
-
p.exclusiveMaxExpected = 5096;
|
|
98
|
-
|
|
99
|
-
u.testBackupAbortResumeRestore(p, 'backup10m', actualBackup, restoreDb, done);
|
|
100
|
-
});
|
|
101
|
-
// Note --output is only valid for CLI usage, this test should only run for CLI
|
|
102
|
-
const params = { useApi: false };
|
|
103
|
-
it('should correctly backup and restore backup10m using --output', function(done) {
|
|
104
|
-
// Allow up to 90 s for this test
|
|
105
|
-
u.setTimeout(this, 90);
|
|
106
|
-
|
|
107
|
-
const actualBackup = `./${this.fileName}`;
|
|
108
|
-
const logFile = `./${this.fileName}` + '.log';
|
|
109
|
-
// Use abort parameter to terminate the backup a given number of ms after
|
|
110
|
-
// the first data write to the output file.
|
|
111
|
-
const p = u.p(params, { abort: true }, { opts: { output: actualBackup, log: logFile } });
|
|
112
|
-
const restoreDb = this.dbName;
|
|
113
|
-
// Set the database doc count as fewer than this should be written during
|
|
114
|
-
// resumed backup.
|
|
115
|
-
p.exclusiveMaxExpected = 5096;
|
|
116
|
-
|
|
117
|
-
u.testBackupAbortResumeRestore(p, 'backup10m', actualBackup, restoreDb, done);
|
|
118
28
|
});
|
|
119
29
|
});
|