Skip to content

Commit

Permalink
Update DockerComposeV0 L0 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanduplenskikh committed May 27, 2024
1 parent e48898f commit e6f16bc
Show file tree
Hide file tree
Showing 19 changed files with 1,330 additions and 1,111 deletions.
679 changes: 341 additions & 338 deletions Tasks/DockerComposeV0/Tests/L0.ts

Large diffs are not rendered by default.

56 changes: 47 additions & 9 deletions Tasks/DockerComposeV0/Tests/L0Linux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,26 @@ let a: any = <any>{
"code": 0,
"stdout": "sucessfully built the service images"
},
"docker compose --compatibility -f /tmp/tempdir/100/docker-compose.yml build" :{
"code": 0,
"stdout": "sucessfully built the service images"
},
"docker-compose-userdefined -f /tmp/tempdir/100/docker-compose.yml build" :{
"code": 0,
"stdout": "sucessfully built the service images"
},
"docker-compose -f /tmp/tempdir/100/docker-compose.yml config" :{
"code": 0,
"stdout": "services:\n redis:\n image: redis:alpine\n web:\n build:\n context: /tmp/tempdir/100\n ports:\n - 5000:5000/tcp\n volumes:\n - /tmp/tempdir/100:/code:rw\nversion: '2.0'"
},
"docker compose --compatibility -f /tmp/tempdir/100/docker-compose.yml config" :{
"code": 0,
"stdout": "services:\n redis:\n image: redis:alpine\n web:\n build:\n context: /tmp/tempdir/100\n ports:\n - 5000:5000/tcp\n volumes:\n - /tmp/tempdir/100:/code:rw\nversion: '2.0'"
},
"docker-compose-userdefined -f /tmp/tempdir/100/docker-compose.yml config" :{
"code": 0,
"stdout": "services:\n redis:\n image: redis:alpine\n web:\n build:\n context: /tmp/tempdir/100\n ports:\n - 5000:5000/tcp\n volumes:\n - /tmp/tempdir/100:/code:rw\nversion: '2.0'"
},
"docker push 100_web": {
"code": 0,
"stdout": "sucessfully pushed 100_web"
Expand All @@ -64,39 +80,61 @@ let a: any = <any>{
"code": 0,
"stdout": "sucessfully ran services"
},
"docker-compose -f /tmp/tempdir/100/docker-compose.yml -f /tmp/tempdir/100/.docker-compose.12345.yml config":{
"docker compose --compatibility -f /tmp/tempdir/100/docker-compose.yml up": {
"code": 0,
"stdout": "services:\n redis:\n image: redis:alpine\n web:\n build:\n context: /tmp/tempdir/100\n image: ajgtestacr1.azurecr.io/100_web\n ports:\n - 5000:5000/tcp\n volumes:\n - /tmp/tempdir/100:/code:rw\nversion: '2.0'"
"stdout": "sucessfully ran services"
},
"docker push ajgtestacr1.azurecr.io/100_web":{
"code": 0,
"stdout": "successfully pushed with qualified image"
},
"docker-compose -f /tmp/tempdir/100/docker-compose.yml -f /tmp/tempdir/100/docker-compose.override.yml config":{
"docker-compose -f /tmp/tempdir/100/docker-compose.yml -f /tmp/tempdir/100/docker-compose.override.yml up -d":{
"code": 0,
"stdout": "services:\n redis:\n image: redis:alpine\n web:\n build:\n context: /tmp/tempdir/100\n image: ajgtestacr1.azurecr.io/100_web\n ports:\n - 5000:5000/tcp\n volumes:\n - /tmp/tempdir/100:/code:rw\nversion: '2.0'"
"stdout": "successfully ran up command"
},
"docker-compose -f /tmp/tempdir/100/docker-compose.yml -f /tmp/tempdir/100/docker-compose.override.yml up -d":{
"docker compose --compatibility -f /tmp/tempdir/100/docker-compose.yml -f /tmp/tempdir/100/docker-compose.override.yml up -d":{
"code": 0,
"stdout": "successfully ran up command"
},
"docker-compose -f /tmp/tempdir/100/docker-compose.yml up -d":{
"code": 0,
"stdout": "successfully ran up command"
},
"docker compose --compatibility -f /tmp/tempdir/100/docker-compose.yml up -d":{
"code": 0,
"stdout": "successfully ran up command"
},
"docker-compose -f /tmp/tempdir/100/docker-compose.yml build --pull --parallel" :{
"code": 0,
"stdout": "sucessfully built the service images"
},
"docker-compose-userdefined -f /tmp/tempdir/100/docker-compose.yml build" :{
"docker compose --compatibility -f /tmp/tempdir/100/docker-compose.yml build --pull --parallel" :{
"code": 0,
"stdout": "sucessfully built the service images"
}, "docker-compose-userdefined -f /tmp/tempdir/100/docker-compose.yml config" :{
},
"docker-compose -f /tmp/tempdir/100/docker-compose.yml pull service1 service2" :{
"code": 0,
"stdout": "services:\n redis:\n image: redis:alpine\n web:\n build:\n context: /tmp/tempdir/100\n ports:\n - 5000:5000/tcp\n volumes:\n - /tmp/tempdir/100:/code:rw\nversion: '2.0'"
}, "docker-compose -f /tmp/tempdir/100/docker-compose.yml pull service1 service2" :{
"stdout": "successfully pulled the passed service images"
},
"docker compose --compatibility -f /tmp/tempdir/100/docker-compose.yml pull service1 service2" :{
"code": 0,
"stdout": "successfully pulled the passed service images"
},
"docker-compose -f /tmp/tempdir/100/docker-compose.yml -f /tmp/tempdir/100/.docker-compose.12345.yml config":{
"code": 0,
"stdout": "services:\n redis:\n image: redis:alpine\n web:\n build:\n context: /tmp/tempdir/100\n image: ajgtestacr1.azurecr.io/100_web\n ports:\n - 5000:5000/tcp\n volumes:\n - /tmp/tempdir/100:/code:rw\nversion: '2.0'"
},
"docker compose --compatibility -f /tmp/tempdir/100/docker-compose.yml -f /tmp/tempdir/100/.docker-compose.12345.yml config":{
"code": 0,
"stdout": "services:\n redis:\n image: redis:alpine\n web:\n build:\n context: /tmp/tempdir/100\n image: ajgtestacr1.azurecr.io/100_web\n ports:\n - 5000:5000/tcp\n volumes:\n - /tmp/tempdir/100:/code:rw\nversion: '2.0'"
},
"docker-compose -f /tmp/tempdir/100/docker-compose.yml -f /tmp/tempdir/100/docker-compose.override.yml config":{
"code": 0,
"stdout": "services:\n redis:\n image: redis:alpine\n web:\n build:\n context: /tmp/tempdir/100\n image: ajgtestacr1.azurecr.io/100_web\n ports:\n - 5000:5000/tcp\n volumes:\n - /tmp/tempdir/100:/code:rw\nversion: '2.0'"
},
"docker compose --compatibility -f /tmp/tempdir/100/docker-compose.yml -f /tmp/tempdir/100/docker-compose.override.yml config":{
"code": 0,
"stdout": "services:\n redis:\n image: redis:alpine\n web:\n build:\n context: /tmp/tempdir/100\n image: ajgtestacr1.azurecr.io/100_web\n ports:\n - 5000:5000/tcp\n volumes:\n - /tmp/tempdir/100:/code:rw\nversion: '2.0'"
}
},
"exist": {
Expand Down
66 changes: 49 additions & 17 deletions Tasks/DockerComposeV0/Tests/L0Windows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ process.env["SYSTEM_DEFAULTWORKINGDIRECTORY"] = DefaultWorkingDirectory;
process.env["SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"] = "https://abc.visualstudio.com/";
process.env["SYSTEM_SERVERTYPE"] = "hosted";
process.env['AGENT_TEMPDIRECTORY'] = '.';
process.env["ENDPOINT_AUTH_dockerhubendpoint"] = "{\"parameters\":{\"username\":\"test\", \"password\":\"regpassword\", \"email\":\"test@microsoft.com\",\"registry\":\"https://index.docker.io/v1/\"},\"scheme\":\"UsernamePassword\"}";
process.env["ENDPOINT_AUTH_dockerhubendpoint"] = "{\"parameters\": {\"username\":\"test\", \"password\":\"regpassword\", \"email\":\"test@microsoft.com\",\"registry\":\"https://index.docker.io/v1/\"},\"scheme\":\"UsernamePassword\"}";
process.env["ENDPOINT_AUTH_SCHEME_AzureRMSpn"] = "ServicePrincipal";
process.env["ENDPOINT_AUTH_PARAMETER_AzureRMSpn_SERVICEPRINCIPALID"] = "spId";
process.env["ENDPOINT_AUTH_PARAMETER_AzureRMSpn_SERVICEPRINCIPALKEY"] = "spKey";
Expand All @@ -48,11 +48,27 @@ let a: any = <any>{
"docker-compose": true
},
"exec": {
"docker-compose -f F:\\dir2\\docker-compose.yml build" :{
"docker-compose -f F:\\dir2\\docker-compose.yml build" : {
"code": 0,
"stdout": "sucessfully built the service images"
},
"docker-compose -f F:\\dir2\\docker-compose.yml config" :{
"docker compose --compatibility -f F:\\dir2\\docker-compose.yml build" : {
"code": 0,
"stdout": "sucessfully built the service images"
},
"docker-compose-userdefined -f F:\\dir2\\docker-compose.yml build" : {
"code": 0,
"stdout": "sucessfully built the service images"
},
"docker-compose -f F:\\dir2\\docker-compose.yml config" : {
"code": 0,
"stdout": "services:\n redis:\n image: redis:alpine\n web:\n build:\n context: C:\\docketest\n ports:\n - 5000:5000/tcp\n volumes:\n - C:\\docketest:/code:rw\nversion: '2.0'"
},
"docker compose --compatibility -f F:\\dir2\\docker-compose.yml config" : {
"code": 0,
"stdout": "services:\n redis:\n image: redis:alpine\n web:\n build:\n context: C:\\docketest\n ports:\n - 5000:5000/tcp\n volumes:\n - C:\\docketest:/code:rw\nversion: '2.0'"
},
"docker-compose-userdefined -f F:\\dir2\\docker-compose.yml config" : {
"code": 0,
"stdout": "services:\n redis:\n image: redis:alpine\n web:\n build:\n context: C:\\docketest\n ports:\n - 5000:5000/tcp\n volumes:\n - C:\\docketest:/code:rw\nversion: '2.0'"
},
Expand All @@ -64,39 +80,55 @@ let a: any = <any>{
"code": 0,
"stdout": "sucessfully ran services"
},
"docker-compose -f F:\\dir2\\docker-compose.yml -f F:\\dir2\\.docker-compose.12345.yml config":{
"docker-compose -f F:\\dir2\\docker-compose.yml build --pull --parallel" : {
"code": 0,
"stdout": "services:\n redis:\n image: redis:alpine\n web:\n build:\n context: F:\\dir2\n image: ajgtestacr1.azurecr.io/dir2_web\n ports:\n - 5000:5000/tcp\n volumes:\n - F:\\dir2:/code:rw\nversion: '2.0'"
"stdout": "sucessfully built the service images"
},
"docker push ajgtestacr1.azurecr.io/dir2_web":{
"docker compose --compatibility -f F:\\dir2\\docker-compose.yml build --pull --parallel" : {
"code": 0,
"stdout": "successfully pushed with qualified image"
"stdout": "sucessfully built the service images"
},
"docker-compose -f F:\\dir2\\docker-compose.yml -f F:\\dir2\\.docker-compose.12345.yml config": {
"code": 0,
"stdout": "services:\n redis:\n image: redis:alpine\n web:\n build:\n context: F:\\dir2\n image: ajgtestacr1.azurecr.io/dir2_web\n ports:\n - 5000:5000/tcp\n volumes:\n - F:\\dir2:/code:rw\nversion: '2.0'"
},
"docker-compose -f F:\\dir2\\docker-compose.yml -f F:\\dir2\\docker-compose.override.yml config":{
"docker compose --compatibility -f F:\\dir2\\docker-compose.yml -f F:\\dir2\\.docker-compose.12345.yml config": {
"code": 0,
"stdout": "services:\n redis:\n image: redis:alpine\n web:\n build:\n context: F:\\dir2\n image: ajgtestacr1.azurecr.io/dir2_web\n ports:\n - 5000:5000/tcp\n volumes:\n - F:\\dir2:/code:rw\nversion: '2.0'"
},
"docker-compose -f F:\\dir2\\docker-compose.yml -f F:\\dir2\\docker-compose.override.yml up -d":{
"docker push ajgtestacr1.azurecr.io/dir2_web": {
"code": 0,
"stdout": "successfully pushed with qualified image"
},
"docker-compose -f F:\\dir2\\docker-compose.yml -f F:\\dir2\\docker-compose.override.yml up -d": {
"code": 0,
"stdout": "successfully ran up command"
},
"docker-compose -f F:\\dir2\\docker-compose.yml up -d":{
"docker compose --compatibility -f F:\\dir2\\docker-compose.yml -f F:\\dir2\\docker-compose.override.yml up -d": {
"code": 0,
"stdout": "successfully ran up command"
},
"docker-compose -f F:\\dir2\\docker-compose.yml build --pull --parallel" :{
"docker-compose -f F:\\dir2\\docker-compose.yml -f F:\\dir2\\docker-compose.override.yml config": {
"code": 0,
"stdout": "sucessfully built the service images"
"stdout": "services:\n redis:\n image: redis:alpine\n web:\n build:\n context: F:\\dir2\n image: ajgtestacr1.azurecr.io/dir2_web\n ports:\n - 5000:5000/tcp\n volumes:\n - F:\\dir2:/code:rw\nversion: '2.0'"
},
"docker-compose-userdefined -f F:\\dir2\\docker-compose.yml config" :{
"docker compose --compatibility -f F:\\dir2\\docker-compose.yml -f F:\\dir2\\docker-compose.override.yml config": {
"code": 0,
"stdout": "services:\n redis:\n image: redis:alpine\n web:\n build:\n context: C:\\docketest\n ports:\n - 5000:5000/tcp\n volumes:\n - C:\\docketest:/code:rw\nversion: '2.0'"
"stdout": "services:\n redis:\n image: redis:alpine\n web:\n build:\n context: F:\\dir2\n image: ajgtestacr1.azurecr.io/dir2_web\n ports:\n - 5000:5000/tcp\n volumes:\n - F:\\dir2:/code:rw\nversion: '2.0'"
},
"docker-compose-userdefined -f F:\\dir2\\docker-compose.yml build" :{
"docker-compose -f F:\\dir2\\docker-compose.yml up -d": {
"code": 0,
"stdout": "sucessfully built the service images"
"stdout": "successfully ran up command"
},
"docker compose --compatibility -f F:\\dir2\\docker-compose.yml up -d": {
"code": 0,
"stdout": "successfully ran up command"
},
"docker-compose -f F:\\dir2\\docker-compose.yml pull service1 service2" : {
"code": 0,
"stdout": "successfully pulled the passed service images"
},
"docker-compose -f F:\\dir2\\docker-compose.yml pull service1 service2" :{
"docker compose --compatibility -f F:\\dir2\\docker-compose.yml pull service1 service2" : {
"code": 0,
"stdout": "successfully pulled the passed service images"
}
Expand Down
2 changes: 1 addition & 1 deletion Tasks/DockerComposeV0/dockercomposeconnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default class DockerComposeConnection extends ContainerConnection {
public createComposeCommand(): tr.ToolRunner {
var command = tl.tool(this.dockerComposePath);

if (this.useDockerComposeV2) {
if (this.useDockerComposeV2 && !tl.getInput('dockerComposePath')) {
command.arg("compose");
command.arg("--compatibility");
}
Expand Down
2 changes: 1 addition & 1 deletion Tasks/DockerComposeV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 239,
"Minor": 240,
"Patch": 0
},
"demands": [],
Expand Down
2 changes: 1 addition & 1 deletion Tasks/DockerComposeV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 239,
"Minor": 240,
"Patch": 0
},
"demands": [],
Expand Down
4 changes: 2 additions & 2 deletions _generated/DockerComposeV0.versionmap.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Default|0.239.0
Node20_229_2|0.239.1
Default|0.240.0
Node20_229_2|0.240.1
Loading

0 comments on commit e6f16bc

Please sign in to comment.