@@ -29,22 +29,40 @@ function compareTransitionedData(sourceClient, destinationClient, versionId, cb)
29
29
30
30
function compareTransitionedColdData ( sourceClient , versionId , cb ) {
31
31
console . log ( "AAAA 3" )
32
+ console . log ( `[DEBUG] compareTransitionedColdData: Starting transition for versionId=${ versionId } ` ) ;
32
33
return series ( [
33
34
next => sourceClient . getObject ( versionId , next ) ,
34
- next => sourceClient . putBucketLifecycleConfiguration ( new Date ( new Date ( ) . setUTCHours ( 0 , 0 , 0 , 0 ) ) , next ) ,
35
- next => sourceClient . waitUntilTransitioned ( versionId , next ) ,
36
- ] , cb ) ;
35
+ next => {
36
+ console . log ( `[DEBUG] compareTransitionedColdData: Setting lifecycle configuration` ) ;
37
+ sourceClient . putBucketLifecycleConfiguration ( new Date ( new Date ( ) . setUTCHours ( 0 , 0 , 0 , 0 ) ) , next ) ;
38
+ } ,
39
+ next => {
40
+ console . log ( `[DEBUG] compareTransitionedColdData: Waiting for transition` ) ;
41
+ sourceClient . waitUntilTransitioned ( versionId , next ) ;
42
+ } ,
43
+ ] , ( err ) => {
44
+ if ( err ) {
45
+ console . log ( `[DEBUG] compareTransitionedColdData error:` , err . message ) ;
46
+ } else {
47
+ console . log ( `[DEBUG] compareTransitionedColdData: Successfully completed` ) ;
48
+ }
49
+ cb ( err ) ;
50
+ } ) ;
37
51
}
38
52
39
53
function checkRestoration ( destination , sourceClient , versionId , cb ) {
40
- console . log ( "AAAA 4" )
54
+ console . log ( "AAAA 4" , destination . supportsRestore )
41
55
if ( ! destination . supportsRestore ) {
42
56
return process . nextTick ( cb ) ;
43
57
}
44
58
return series ( [
45
59
next => sourceClient . getObject ( versionId , err => {
46
- assert . strictEqual ( err . code , 'InvalidObjectState' ) ;
47
- assert . strictEqual ( err . statusCode , 403 ) ;
60
+ console . log ( "AAAA 22" , err , err . Code , err . $metadata ?. httpStatusCode )
61
+ // AWS SDK v3 uses different error property names
62
+ const errorCode = err . Code || err . code ;
63
+ const statusCode = err . $metadata ?. httpStatusCode || err . statusCode ;
64
+ assert . strictEqual ( errorCode , 'InvalidObjectState' ) ;
65
+ assert . strictEqual ( statusCode , 403 ) ;
48
66
return next ( ) ;
49
67
} ) ,
50
68
next => sourceClient . putRestoreObject ( versionId , next ) ,
@@ -118,6 +136,11 @@ testsToRun.forEach(test => {
118
136
119
137
before ( ( ) => {
120
138
console . log ( "AAAA 8" )
139
+ console . log ( `[DEBUG] Setting up test: from=${ test . from } to=${ test . to } ` ) ;
140
+ console . log ( `[DEBUG] Source location: ${ fromLoc . name } ` ) ;
141
+ console . log ( `[DEBUG] Destination location: ${ toLoc . name } ` ) ;
142
+ console . log ( `[DEBUG] Environment COLD_BACKEND_DESTINATION_LOCATION: ${ process . env . COLD_BACKEND_DESTINATION_LOCATION } ` ) ;
143
+
121
144
cloudServer . setSourceLocation ( fromLoc . name ) ;
122
145
cloudServer . setDestinationLocation ( toLoc . name ) ;
123
146
if ( ! toLoc . isCold ) {
0 commit comments