Skip to content

Commit

Permalink
try ci
Browse files Browse the repository at this point in the history
  • Loading branch information
prakashsvmx committed May 22, 2023
1 parent e95cc7a commit cf13534
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 29 deletions.
1 change: 0 additions & 1 deletion src/CredentialProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,3 @@ export class CredentialProvider {
// deprecated default export, please use named exports.
// keep for backward compatibility.
// eslint-disable-next-line import/no-default-export
export default CredentialProvider
12 changes: 2 additions & 10 deletions src/minio.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { TextEncoder } from 'web-encoding'
import Xml from 'xml'
import xml2js from 'xml2js'

import { AssumeRoleProvider } from './AssumeRoleProvider.ts'
import * as errors from './errors.ts'
import { extensions } from './extensions.js'
import { CopyDestinationOptions, CopySourceOptions, DEFAULT_REGION } from './helpers.ts'
Expand Down Expand Up @@ -70,17 +69,10 @@ import { postPresignSignatureV4, presignSignatureV4, signV4 } from './signing.ts
import * as transformers from './transformers.js'
import { parseSelectObjectContentResponse } from './xml-parsers.js'

export * from './AssumeRoleProvider.ts'
export * from './helpers.ts'
export * from './notification.js'
export {
AssumeRoleProvider,
CopyConditions,
CopyDestinationOptions,
CopySourceOptions,
DEFAULT_REGION,
getVersionId,
PostPolicy,
}
export { CopyConditions, CopyDestinationOptions, CopySourceOptions, DEFAULT_REGION, getVersionId, PostPolicy }

export class Client extends TypedClient {
// Set application specific information.
Expand Down
40 changes: 22 additions & 18 deletions tests/functional/functional-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,23 @@ import * as url from 'node:url'
import async from 'async'
import chai from 'chai'
import _ from 'lodash'
import {
// eslint-disable-next-line import/named
AssumeRoleProvider,
Client,
// eslint-disable-next-line import/named
CopyConditions,
// eslint-disable-next-line import/named
CopyDestinationOptions,
// eslint-disable-next-line import/named
CopySourceOptions,
// eslint-disable-next-line import/named
DEFAULT_REGION,
} from 'minio'
import { step } from 'mocha-steps'
import splitFile from 'split-file'
import superagent from 'superagent'
import * as uuid from 'uuid'

let minio
try {
minio = require('../../dist/main/minio.js')
} catch (err) {
minio = require('minio')
}

const { AssumeRoleProvider, CopyDestinationOptions, CopySourceOptions, DEFAULT_REGION } = minio
/** Functional Tests need to be run externally e.g in https://github.com/minio/mint **/

const assert = chai.assert
Expand Down Expand Up @@ -94,10 +98,10 @@ describe('functional tests', function () {
// a directory with files to read from, i.e. /mint/data.
var dataDir = process.env['MINT_DATA_DIR']

var client = new minio.Client(clientConfigParams)
var client = new Client(clientConfigParams)
var usEastConfig = clientConfigParams
usEastConfig.region = server_region
var clientUsEastRegion = new minio.Client(usEastConfig)
var clientUsEastRegion = new Client(usEastConfig)

var traceStream
// FUNCTIONAL_TEST_TRACE env variable contains the path to which trace
Expand Down Expand Up @@ -723,7 +727,7 @@ describe('functional tests', function () {
step(
`copyObject(bucketName, objectName, srcObject, conditions, cb)_bucketName:${bucketName}, objectName:${_100kbObjectNameCopy}, srcObject:/${bucketName}/${_100kbObjectName}, conditions:ExceptIncorrectEtag_`,
(done) => {
var conds = new minio.CopyConditions()
var conds = new CopyConditions()
conds.setMatchETagExcept('TestEtag')
client.copyObject(bucketName, _100kbObjectNameCopy, '/' + bucketName + '/' + _100kbObjectName, conds, (e) => {
if (e) {
Expand All @@ -737,7 +741,7 @@ describe('functional tests', function () {
step(
`copyObject(bucketName, objectName, srcObject, conditions, cb)_bucketName:${bucketName}, objectName:${_100kbObjectNameCopy}, srcObject:/${bucketName}/${_100kbObjectName}, conditions:ExceptCorrectEtag_`,
(done) => {
var conds = new minio.CopyConditions()
var conds = new CopyConditions()
conds.setMatchETagExcept(etag)
client
.copyObject(bucketName, _100kbObjectNameCopy, '/' + bucketName + '/' + _100kbObjectName, conds)
Expand All @@ -751,7 +755,7 @@ describe('functional tests', function () {
step(
`copyObject(bucketName, objectName, srcObject, conditions, cb)_bucketName:${bucketName}, objectName:${_100kbObjectNameCopy}, srcObject:/${bucketName}/${_100kbObjectName}, conditions:MatchCorrectEtag_`,
(done) => {
var conds = new minio.CopyConditions()
var conds = new CopyConditions()
conds.setMatchETag(etag)
client.copyObject(bucketName, _100kbObjectNameCopy, '/' + bucketName + '/' + _100kbObjectName, conds, (e) => {
if (e) {
Expand All @@ -765,7 +769,7 @@ describe('functional tests', function () {
step(
`copyObject(bucketName, objectName, srcObject, conditions, cb)_bucketName:${bucketName}, objectName:${_100kbObjectNameCopy}, srcObject:/${bucketName}/${_100kbObjectName}, conditions:MatchIncorrectEtag_`,
(done) => {
var conds = new minio.CopyConditions()
var conds = new CopyConditions()
conds.setMatchETag('TestETag')
client
.copyObject(bucketName, _100kbObjectNameCopy, '/' + bucketName + '/' + _100kbObjectName, conds)
Expand All @@ -779,7 +783,7 @@ describe('functional tests', function () {
step(
`copyObject(bucketName, objectName, srcObject, conditions, cb)_bucketName:${bucketName}, objectName:${_100kbObjectNameCopy}, srcObject:/${bucketName}/${_100kbObjectName}, conditions:Unmodified since ${modifiedDate}`,
(done) => {
var conds = new minio.CopyConditions()
var conds = new CopyConditions()
conds.setUnmodified(new Date(modifiedDate))
client.copyObject(bucketName, _100kbObjectNameCopy, '/' + bucketName + '/' + _100kbObjectName, conds, (e) => {
if (e) {
Expand All @@ -793,7 +797,7 @@ describe('functional tests', function () {
step(
`copyObject(bucketName, objectName, srcObject, conditions, cb)_bucketName:${bucketName}, objectName:${_100kbObjectNameCopy}, srcObject:/${bucketName}/${_100kbObjectName}, conditions:Unmodified since 2010-03-26T12:00:00Z_`,
(done) => {
var conds = new minio.CopyConditions()
var conds = new CopyConditions()
conds.setUnmodified(new Date('2010-03-26T12:00:00Z'))
client
.copyObject(bucketName, _100kbObjectNameCopy, '/' + bucketName + '/' + _100kbObjectName, conds)
Expand Down Expand Up @@ -3789,7 +3793,7 @@ describe('functional tests', function () {

const aRoleConf = Object.assign({}, clientConfigParams, { credentialsProvider: assumeRoleProvider })

const assumeRoleClient = new minio.Client(aRoleConf)
const assumeRoleClient = new Client(aRoleConf)
assumeRoleClient.region = server_region

describe('Put an Object', function () {
Expand Down

0 comments on commit cf13534

Please sign in to comment.