fix(core): Stabilize CI/workflows and runtime: update CI images/metadata, improve streaming requests and image handling, and fix tests & package metadata
This commit is contained in:
		| @@ -41,7 +41,10 @@ tap.test('should create a network', async () => { | ||||
| }); | ||||
|  | ||||
| tap.test('should remove a network', async () => { | ||||
|   const webgateway = await docker.DockerNetwork.getNetworkByName(testDockerHost, 'webgateway'); | ||||
|   const webgateway = await docker.DockerNetwork.getNetworkByName( | ||||
|     testDockerHost, | ||||
|     'webgateway', | ||||
|   ); | ||||
|   await webgateway.remove(); | ||||
| }); | ||||
|  | ||||
| @@ -78,7 +81,10 @@ tap.test('should create a secret', async () => { | ||||
| }); | ||||
|  | ||||
| tap.test('should remove a secret by name', async () => { | ||||
|   const mySecret = await docker.DockerSecret.getSecretByName(testDockerHost, 'testSecret'); | ||||
|   const mySecret = await docker.DockerSecret.getSecretByName( | ||||
|     testDockerHost, | ||||
|     'testSecret', | ||||
|   ); | ||||
|   await mySecret.remove(); | ||||
| }); | ||||
|  | ||||
| @@ -102,11 +108,14 @@ tap.test('should create a service', async () => { | ||||
|     labels: {}, | ||||
|     contentArg: '{"hi": "wow"}', | ||||
|   }); | ||||
|   const testImage = await docker.DockerImage.createFromRegistry(testDockerHost, { | ||||
|     creationObject: { | ||||
|       imageUrl: 'code.foss.global/host.today/ht-docker-node:latest', | ||||
|     } | ||||
|   }); | ||||
|   const testImage = await docker.DockerImage.createFromRegistry( | ||||
|     testDockerHost, | ||||
|     { | ||||
|       creationObject: { | ||||
|         imageUrl: 'code.foss.global/host.today/ht-docker-node:latest', | ||||
|       }, | ||||
|     }, | ||||
|   ); | ||||
|   const testService = await docker.DockerService.createService(testDockerHost, { | ||||
|     image: testImage, | ||||
|     labels: {}, | ||||
| @@ -124,13 +133,16 @@ tap.test('should create a service', async () => { | ||||
|  | ||||
| tap.test('should export images', async (toolsArg) => { | ||||
|   const done = toolsArg.defer(); | ||||
|   const testImage = await docker.DockerImage.createFromRegistry(testDockerHost, { | ||||
|     creationObject: { | ||||
|       imageUrl: 'code.foss.global/host.today/ht-docker-node:latest', | ||||
|     } | ||||
|   }); | ||||
|   const testImage = await docker.DockerImage.createFromRegistry( | ||||
|     testDockerHost, | ||||
|     { | ||||
|       creationObject: { | ||||
|         imageUrl: 'code.foss.global/host.today/ht-docker-node:latest', | ||||
|       }, | ||||
|     }, | ||||
|   ); | ||||
|   const fsWriteStream = plugins.smartfile.fsStream.createWriteStream( | ||||
|     plugins.path.join(paths.nogitDir, 'testimage.tar') | ||||
|     plugins.path.join(paths.nogitDir, 'testimage.tar'), | ||||
|   ); | ||||
|   const exportStream = await testImage.exportToTarStream(); | ||||
|   exportStream.pipe(fsWriteStream).on('finish', () => { | ||||
| @@ -141,14 +153,17 @@ tap.test('should export images', async (toolsArg) => { | ||||
|  | ||||
| tap.test('should import images', async () => { | ||||
|   const fsReadStream = plugins.smartfile.fsStream.createReadStream( | ||||
|     plugins.path.join(paths.nogitDir, 'testimage.tar') | ||||
|     plugins.path.join(paths.nogitDir, 'testimage.tar'), | ||||
|   ); | ||||
|   const importedImage = await docker.DockerImage.createFromTarStream( | ||||
|     testDockerHost, | ||||
|     { | ||||
|       tarStream: fsReadStream, | ||||
|       creationObject: { | ||||
|         imageUrl: 'code.foss.global/host.today/ht-docker-node:latest', | ||||
|       }, | ||||
|     }, | ||||
|   ); | ||||
|   const importedImage = await docker.DockerImage.createFromTarStream(testDockerHost, { | ||||
|     tarStream: fsReadStream, | ||||
|     creationObject: { | ||||
|       imageUrl: 'code.foss.global/host.today/ht-docker-node:latest', | ||||
|     } | ||||
|   }); | ||||
|   expect(importedImage).toBeInstanceOf(docker.DockerImage); | ||||
| }); | ||||
|  | ||||
| @@ -163,11 +178,16 @@ tap.test('should expose a working DockerImageStore', async () => { | ||||
|   await testDockerHost.addS3Storage(s3Descriptor); | ||||
|  | ||||
|   // | ||||
|   await testDockerHost.imageStore.storeImage('hello2', plugins.smartfile.fsStream.createReadStream(plugins.path.join(paths.nogitDir, 'testimage.tar'))); | ||||
| }) | ||||
|   await testDockerHost.imageStore.storeImage( | ||||
|     'hello2', | ||||
|     plugins.smartfile.fsStream.createReadStream( | ||||
|       plugins.path.join(paths.nogitDir, 'testimage.tar'), | ||||
|     ), | ||||
|   ); | ||||
| }); | ||||
|  | ||||
| tap.test('cleanup', async () => { | ||||
|   await testDockerHost.stop(); | ||||
| }) | ||||
| }); | ||||
|  | ||||
| export default tap.start(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user