Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests on Windows hosts #45

Closed
Gamecock opened this issue Aug 8, 2022 · 5 comments
Closed

Unit tests on Windows hosts #45

Gamecock opened this issue Aug 8, 2022 · 5 comments

Comments

@Gamecock
Copy link
Contributor

Gamecock commented Aug 8, 2022

I had a number of issues with unit test on windows hosts.
Key ones were the space in c:\Program Files" and MINGW path conversion
docker/cli#2204 (comment)

one weird issue in adding data to minio is the container name was showing up as:

"${test_compose_project}"-minio-1 vs _minio_1
I can include on #7 or as a separate pr.

I have resolved all except for non-ascii characters. Any hints?

Testing object: HEAD b/ブツブツ.txt
Response code didn't match expectation. Request [HEAD http://localhost:8989/b/ブツブツ.txt] Expected [200] Actual [404]
curl command: /mingw64/bin/curl -s -o /dev/null -w '%{http_code}' --head 'http://localhost:8989/b/ブツブツ.txt'
Error running tests - outputting container logs
ngt-minio-1 |
ngt-minio-1 | You are running an older version of MinIO released 1 year ago
ngt-minio-1 | Update: Run mc admin update
ngt-minio-1 |
ngt-minio-1 |
ngt-minio-1 | Attempting encryption of all config, IAM users and policies on MinIO backend
ngt-minio-1 | Endpoint: http://172.18.0.2:9000 http://127.0.0.1:9000
ngt-minio-1 |
ngt-minio-1 | Object API (Amazon S3 compatible):
ngt-minio-1 | Go: https://docs.min.io/docs/golang-client-quickstart-guide
ngt-minio-1 | Java: https://docs.min.io/docs/java-client-quickstart-guide
ngt-minio-1 | Python: https://docs.min.io/docs/python-client-quickstart-guide
ngt-minio-1 | JavaScript: https://docs.min.io/docs/javascript-client-quickstart-guide
ngt-minio-1 | .NET: https://docs.min.io/docs/dotnet-client-quickstart-guide
ngt-nginx-s3-gateway-1 | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
ngt-minio-client-1 | bucket-1.minio [REQUEST s3.HeadObject] [2022-08-08T15:46:22.968] [Client IP: 172.18.0.4]
ngt-minio-client-1 | bucket-1.minio HEAD /a.txt
ngt-minio-client-1 | bucket-1.minio Proto: HTTP/1.1
ngt-minio-client-1 | bucket-1.minio Host: bucket-1.minio
ngt-minio-client-1 | bucket-1.minio Authorization: AWS AKIAIOSFODNN7EXAMPLE:fTI5YYzR6CQ5KAsKutGxnP+hBgE=
ngt-minio-client-1 | bucket-1.minio Content-Length: 0
ngt-minio-client-1 | bucket-1.minio Date: Mon, 08 Aug 2022 15:46:22 GMT
ngt-minio-client-1 | bucket-1.minio
ngt-nginx-s3-gateway-1 | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
ngt-nginx-s3-gateway-1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/00-check-for-required-env.sh
ngt-nginx-s3-gateway-1 | S3 Backend Environment
ngt-nginx-s3-gateway-1 | Access Key ID: AKIAIOSFODNN7EXAMPLE
ngt-nginx-s3-gateway-1 | Origin: http://bucket-1.minio:9000
ngt-nginx-s3-gateway-1 | Region: us-east-1
ngt-nginx-s3-gateway-1 | Addressing Style: virtual
ngt-nginx-s3-gateway-1 | AWS Signatures Version: v2
ngt-nginx-s3-gateway-1 | DNS Resolvers: 127.0.0.11
ngt-nginx-s3-gateway-1 | Directory Listing Enabled: 0
ngt-nginx-s3-gateway-1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
ngt-nginx-s3-gateway-1 | 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
ngt-nginx-s3-gateway-1 | 10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
ngt-nginx-s3-gateway-1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
ngt-nginx-s3-gateway-1 | 20-envsubst-on-templates.sh: Running envsubst on /etc/nginx/templates/default.conf.template to /etc/nginx/conf.d/default.conf
ngt-minio-client-1 | bucket-1.minio [RESPONSE] [2022-08-08T15:46:22.969] [ Duration 940µs ↑ 39 B ↓ 334 B ]
ngt-minio-client-1 | bucket-1.minio 200 OK
ngt-minio-client-1 | bucket-1.minio X-Amz-Bucket-Region: us-east-1
ngt-minio-client-1 | bucket-1.minio X-Amz-Request-Id: 1709692DC564B13D
ngt-minio-client-1 | bucket-1.minio Accept-Ranges: bytes
ngt-minio-client-1 | bucket-1.minio Content-Security-Policy: block-all-mixed-content
ngt-minio-client-1 | bucket-1.minio ETag: "00000000000000000000000000000000-1"
ngt-minio-client-1 | bucket-1.minio Last-Modified: Wed, 27 Jul 2022 20:17:26 GMT
ngt-minio-client-1 | bucket-1.minio Server: MinIO
ngt-minio-client-1 | bucket-1.minio Vary: Origin
ngt-minio-client-1 | bucket-1.minio X-Xss-Protection: 1; mode=block
ngt-minio-client-1 | bucket-1.minio Content-Length: 24
ngt-minio-client-1 | bucket-1.minio Content-Type: text/plain
ngt-minio-client-1 | bucket-1.minio
ngt-minio-client-1 | bucket-1.minio
ngt-minio-client-1 | bucket-1.minio [REQUEST s3.HeadObject] [2022-08-08T15:46:23.106] [Client IP: 172.18.0.4]
ngt-minio-client-1 | bucket-1.minio HEAD /b/c/d.txt
ngt-minio-client-1 | bucket-1.minio Proto: HTTP/1.1
ngt-minio-client-1 | bucket-1.minio Host: bucket-1.minio
ngt-minio-client-1 | bucket-1.minio Authorization: AWS AKIAIOSFODNN7EXAMPLE:kdC8I23LkTNy+vL7a60K6JaOufs=
ngt-minio-client-1 | bucket-1.minio Content-Length: 0
ngt-minio-client-1 | bucket-1.minio Date: Mon, 08 Aug 2022 15:46:23 GMT
ngt-minio-client-1 | bucket-1.minio
ngt-minio-client-1 | bucket-1.minio [RESPONSE] [2022-08-08T15:46:23.107] [ Duration 422µs ↑ 39 B ↓ 334 B ]
ngt-minio-client-1 | bucket-1.minio 200 OK
ngt-minio-client-1 | bucket-1.minio Content-Length: 97
ngt-minio-client-1 | bucket-1.minio Content-Type: text/plain
ngt-minio-client-1 | bucket-1.minio ETag: "00000000000000000000000000000000-1"
ngt-minio-client-1 | bucket-1.minio Server: MinIO
ngt-minio-client-1 | bucket-1.minio Vary: Origin
ngt-minio-client-1 | bucket-1.minio X-Xss-Protection: 1; mode=block
ngt-minio-client-1 | bucket-1.minio Accept-Ranges: bytes
ngt-minio-client-1 | bucket-1.minio Content-Security-Policy: block-all-mixed-content
ngt-minio-client-1 | bucket-1.minio Last-Modified: Wed, 27 Jul 2022 20:17:26 GMT
ngt-minio-client-1 | bucket-1.minio X-Amz-Bucket-Region: us-east-1
ngt-minio-client-1 | bucket-1.minio X-Amz-Request-Id: 1709692DCD9AA4FA
ngt-minio-client-1 | bucket-1.minio
ngt-minio-client-1 | bucket-1.minio
ngt-nginx-s3-gateway-1 | 20-envsubst-on-templates.sh: Running envsubst on /etc/nginx/templates/gateway/v4_js_vars.conf.template to /etc/nginx/conf.d/gateway/v4_js_vars.conf
ngt-nginx-s3-gateway-1 | 20-envsubst-on-templates.sh: Running envsubst on /etc/nginx/templates/gateway/v2_headers.conf.template to /etc/nginx/conf.d/gateway/v2_headers.conf
ngt-nginx-s3-gateway-1 | 20-envsubst-on-templates.sh: Running envsubst on /etc/nginx/templates/gateway/v2_js_vars.conf.template to /etc/nginx/conf.d/gateway/v2_js_vars.conf
ngt-nginx-s3-gateway-1 | 20-envsubst-on-templates.sh: Running envsubst on /etc/nginx/templates/gateway/v4_headers.conf.template to /etc/nginx/conf.d/gateway/v4_headers.conf
ngt-nginx-s3-gateway-1 | 20-envsubst-on-templates.sh: Running envsubst on /etc/nginx/templates/upstreams.conf.template to /etc/nginx/conf.d/upstreams.conf
ngt-nginx-s3-gateway-1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
ngt-nginx-s3-gateway-1 | /docker-entrypoint.sh: Configuration complete; ready for start up
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:22 [notice] 1#1: using the "epoll" event method
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:22 [notice] 1#1: nginx/1.23.1
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:22 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6)
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:22 [notice] 1#1: OS: Linux 5.10.16.3-microsoft-standard-WSL2
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:22 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:22 [notice] 1#1: start worker processes
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:22 [notice] 1#1: start worker process 59
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:22 [notice] 1#1: start cache manager process 60
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:22 [notice] 1#1: start cache loader process 61
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:22 [info] 59#59: *1 client closed connection while waiting for request, client: 172.18.0.1, server: 0.0.0.0:80
ngt-nginx-s3-gateway-1 | 172.18.0.1 - - [08/Aug/2022:15:46:22 +0000] "HEAD / HTTP/1.1" 404 0 "-" "curl/7.84.0" "-"
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:22 [info] 59#59: *2 client 172.18.0.1 closed keepalive connection
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:22 [info] 59#59: *3 js: S3 Request URI: HEAD /a.txt
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:22 [info] 59#59: *3 js: AWS v2 Auth Signing String: [HEAD
ngt-nginx-s3-gateway-1 |
ngt-nginx-s3-gateway-1 |
ngt-nginx-s3-gateway-1 | Mon, 08 Aug 2022 15:46:22 GMT
ngt-minio-client-1 | bucket-1.minio [REQUEST s3.HeadObject] [2022-08-08T15:46:23.175] [Client IP: 172.18.0.4]
ngt-minio-client-1 | bucket-1.minio HEAD /b/e.txt
ngt-minio-client-1 | bucket-1.minio Proto: HTTP/1.1
ngt-minio-client-1 | bucket-1.minio Host: bucket-1.minio
ngt-minio-client-1 | bucket-1.minio Date: Mon, 08 Aug 2022 15:46:23 GMT
ngt-minio-client-1 | bucket-1.minio Authorization: AWS AKIAIOSFODNN7EXAMPLE:LPRC71ZP0c1Hq6zK/16ATxV8MxQ=
ngt-minio-client-1 | bucket-1.minio Content-Length: 0
ngt-minio-client-1 | bucket-1.minio
ngt-minio-client-1 | bucket-1.minio [RESPONSE] [2022-08-08T15:46:23.175] [ Duration 910µs ↑ 39 B ↓ 334 B ]
ngt-minio-client-1 | bucket-1.minio 200 OK
ngt-minio-client-1 | bucket-1.minio Accept-Ranges: bytes
ngt-minio-client-1 | bucket-1.minio Content-Type: text/plain
ngt-minio-client-1 | bucket-1.minio ETag: "00000000000000000000000000000000-1"
ngt-minio-client-1 | bucket-1.minio Last-Modified: Wed, 27 Jul 2022 20:17:26 GMT
ngt-minio-client-1 | bucket-1.minio X-Amz-Bucket-Region: us-east-1
ngt-minio-client-1 | bucket-1.minio Content-Length: 43
ngt-minio-client-1 | bucket-1.minio Content-Security-Policy: block-all-mixed-content
ngt-nginx-s3-gateway-1 | /bucket-1/a.txt]
ngt-nginx-s3-gateway-1 | 172.18.0.1 - - [08/Aug/2022:15:46:22 +0000] "HEAD /a.txt HTTP/1.1" 200 0 "-" "curl/7.84.0" "-"
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:22 [info] 59#59: *3 client 172.18.0.1 closed keepalive connection
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:23 [info] 59#59: *5 js: S3 Request URI: HEAD /a.txt
ngt-nginx-s3-gateway-1 | 172.18.0.1 - - [08/Aug/2022:15:46:23 +0000] "HEAD /a.txt?some=param&that=should&be=stripped HTTP/1.1" 200 0 "-" "curl/7.84.0" "-"
ngt-minio-client-1 | bucket-1.minio Server: MinIO
ngt-minio-client-1 | bucket-1.minio Vary: Origin
ngt-minio-client-1 | bucket-1.minio X-Amz-Request-Id: 1709692DD1ACE851
ngt-minio-client-1 | bucket-1.minio X-Xss-Protection: 1; mode=block
ngt-minio-client-1 | bucket-1.minio
ngt-minio-client-1 | bucket-1.minio
ngt-minio-client-1 | bucket-1.minio [REQUEST s3.HeadObject] [2022-08-08T15:46:23.366] [Client IP: 172.18.0.4]
ngt-minio-client-1 | bucket-1.minio HEAD /b/
ngt-minio-client-1 | bucket-1.minio Proto: HTTP/1.1
ngt-minio-client-1 | bucket-1.minio Host: bucket-1.minio
ngt-minio-client-1 | bucket-1.minio Authorization: AWS AKIAIOSFODNN7EXAMPLE:6BTWvC4+NQhPLzcqg44sm80ODkE=
ngt-minio-client-1 | bucket-1.minio Content-Length: 0
ngt-minio-client-1 | bucket-1.minio Date: Mon, 08 Aug 2022 15:46:23 GMT
ngt-minio-client-1 | bucket-1.minio
ngt-minio-client-1 | bucket-1.minio [RESPONSE] [2022-08-08T15:46:23.366] [ Duration 265µs ↑ 39 B ↓ 227 B ]
ngt-minio-client-1 | bucket-1.minio 403 Forbidden
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:23 [info] 59#59: *5 client 172.18.0.1 closed keepalive connection
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:23 [info] 59#59: *6 js: S3 Request URI: HEAD /b/c/d.txt
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:23 [info] 59#59: *6 js: AWS v2 Auth Signing String: [HEAD
ngt-nginx-s3-gateway-1 |
ngt-nginx-s3-gateway-1 |
ngt-nginx-s3-gateway-1 | Mon, 08 Aug 2022 15:46:23 GMT
ngt-nginx-s3-gateway-1 | /bucket-1/b/c/d.txt]
ngt-nginx-s3-gateway-1 | 172.18.0.1 - - [08/Aug/2022:15:46:23 +0000] "HEAD /b/c/d.txt HTTP/1.1" 200 0 "-" "curl/7.84.0" "-"
ngt-minio-client-1 | bucket-1.minio Content-Length: 0
ngt-minio-client-1 | bucket-1.minio Content-Security-Policy: block-all-mixed-content
ngt-minio-client-1 | bucket-1.minio Server: MinIO
ngt-minio-client-1 | bucket-1.minio Vary: Origin
ngt-minio-client-1 | bucket-1.minio X-Amz-Bucket-Region: us-east-1
ngt-minio-client-1 | bucket-1.minio X-Amz-Request-Id: 1709692DDD1868B7
ngt-minio-client-1 | bucket-1.minio X-Xss-Protection: 1; mode=block
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:23 [info] 59#59: *6 client 172.18.0.1 closed keepalive connection
ngt-minio-client-1 | bucket-1.minio Accept-Ranges: bytes
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:23 [info] 59#59: *8 js: S3 Request URI: HEAD /b/e.txt
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:23 [info] 59#59: *8 js: AWS v2 Auth Signing String: [HEAD
ngt-nginx-s3-gateway-1 |
ngt-nginx-s3-gateway-1 |
ngt-nginx-s3-gateway-1 | Mon, 08 Aug 2022 15:46:23 GMT
ngt-nginx-s3-gateway-1 | /bucket-1/b/e.txt]
ngt-nginx-s3-gateway-1 | 172.18.0.1 - - [08/Aug/2022:15:46:23 +0000] "HEAD /b/e.txt HTTP/1.1" 200 0 "-" "curl/7.84.0" "-"
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:23 [info] 59#59: *8 client 172.18.0.1 closed keepalive connection
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:23 [info] 59#59: *10 js: S3 Request URI: HEAD /b/e.txt
ngt-nginx-s3-gateway-1 | 172.18.0.1 - - [08/Aug/2022:15:46:23 +0000] "HEAD /b/e.txt HTTP/1.1" 200 0 "-" "curl/7.84.0" "-"
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:23 [info] 59#59: *10 client 172.18.0.1 closed keepalive connection
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:23 [info] 59#59: *11 js: S3 Request URI: HEAD /b//e.txt
ngt-nginx-s3-gateway-1 | 172.18.0.1 - - [08/Aug/2022:15:46:23 +0000] "HEAD /b//e.txt HTTP/1.1" 200 0 "-" "curl/7.84.0" "-"
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:23 [info] 59#59: *11 client 172.18.0.1 closed keepalive connection
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:23 [info] 59#59: *12 js: S3 Request URI: HEAD /b/
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:23 [info] 59#59: *12 js: AWS v2 Auth Signing String: [HEAD
ngt-nginx-s3-gateway-1 |
ngt-nginx-s3-gateway-1 |
ngt-nginx-s3-gateway-1 | Mon, 08 Aug 2022 15:46:23 GMT
ngt-nginx-s3-gateway-1 | /bucket-1/]
ngt-nginx-s3-gateway-1 | 172.18.0.1 - - [08/Aug/2022:15:46:23 +0000] "HEAD /b/????.txt HTTP/1.1" 404 0 "-" "curl/7.84.0" "-"
ngt-nginx-s3-gateway-1 | 2022/08/08 15:46:23 [info] 59#59: *12 client 172.18.0.1 closed keepalive connection
ngt-minio-client-1 | bucket-1.minio
ngt-minio-client-1 | bucket-1.minio
▶ Cleaning up Docker compose environment

@Gamecock
Copy link
Contributor Author

Gamecock commented Aug 8, 2022

Further investigation by adding -v to curl indicates the ${url} is not getting expanded properly.

▲ Testing object: HEAD b/ブツブツ.txt

  • Trying 127.0.0.1:8989...
  • Connected to localhost (127.0.0.1) port 8989 (#0)

HEAD /b/????.txt HTTP/1.1
Host: localhost:8989
User-Agent: curl/7.84.0
Accept: /

  • Mark bundle as not supporting multiuse
    < HTTP/1.1 404 Not Found
    < Server: nginx
    < Date: Mon, 08 Aug 2022 16:14:03 GMT
    < Content-Type: text/html
    < Content-Length: 146
    < Connection: keep-alive
    <
  • Connection #0 to host localhost left intact
    Response code didn't match expectation. Request [HEAD http://localhost:8989/b/ブツブツ.txt] Expected [200] Actual [404]
    curl command: /mingw64/bin/curl -s -o /dev/null -w '%{http_code}' --head 'http://localhost:8989/b/ブツブツ.txt'
    Error running tests - outputting container logs

@dekobon
Copy link
Collaborator

dekobon commented Aug 8, 2022

Is there a way you can share the CLI environment that you are using on Windows to test? Is this Powershell, cmd.exe? Are you using git for windows or cygwin? I'm not terribly surprised that the unicode url conversion stuff is not working properly. I never anticipated anyone running it outside of Linux.

@Gamecock
Copy link
Contributor Author

Gamecock commented Aug 8, 2022 via email

@dekobon
Copy link
Collaborator

dekobon commented Aug 8, 2022

You will want to set the COMPOSE_COMPATIBILITY environment variable to get compose to name containers in the old way. I set it to COMPOSE_COMPATIBILITY=true

@Gamecock
Copy link
Contributor Author

Gamecock commented Aug 10, 2022

I resolved all the issues except the unicode uris in pr #47.
I asked the world for help on that issue:
https://stackoverflow.com/questions/73311636/how-to-pass-unicode-characters-to-curl-in-windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants