You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/11/26 15:59:16 UTC

[GitHub] [apisix] bisakhmondal opened a new pull request #5625: docs: exec code block for shell commands in Test Nginx

bisakhmondal opened a new pull request #5625:
URL: https://github.com/apache/apisix/pull/5625


   ### What this PR does / why we need it:
   <!--- Why is this change required? What problem does it solve? -->
   <!--- If it fixes an open issue, please link to the issue here. -->
   
   ### Pre-submission checklist:
   
   <!--
   Please follow the requirements:
   1. Use Draft if the PR is not ready to be reviewed
   2. Test is required for the feat/fix PR, unless you have a good reason
   3. Doc is required for the feat PR
   4. Use a new commit to resolve review instead of `push -f`
   5. Use "request review" to notify the reviewer once you have resolved the review
   -->
   
   * [ ] Did you explain what problem does this PR solve? Or what new features have been added?
   * [ ] Have you added corresponding test cases?
   * [x] Have you modified the corresponding document?
   * [x] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix/tree/master#community) first**
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on a change in pull request #5625: docs: exec code block for shell commands in Test Nginx

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #5625:
URL: https://github.com/apache/apisix/pull/5625#discussion_r757836595



##########
File path: docs/en/latest/internal/testing-framework.md
##########
@@ -286,3 +286,24 @@ ONLY:
 --- response_body
 {"action":"get","count":0,"node":{"dir":true,"key":"/apisix/upstreams","nodes":{}}}
 ```
+
+### Executing Shell Commands
+
+It is possible to execute shell commands while writing tests in Test Nginx for apisix modules. We exeposes this feature via `exec` code block. The `stdout` of the executed process can be captured via `response_body` code block and `stderr` (if any) can be captured by filtering error.log through `grep_error_log`. Here is an example:

Review comment:
       ```suggestion
   It is possible to execute shell commands while writing tests in test-nginx for APISIX. We expose this feature via `exec` code block. The `stdout` of the executed process can be captured via `response_body` code block and `stderr` (if any) can be captured by filtering error.log through `grep_error_log`. Here is an example:
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] bisakhmondal edited a comment on pull request #5625: docs: exec code block for shell commands in Test Nginx

Posted by GitBox <gi...@apache.org>.
bisakhmondal edited a comment on pull request #5625:
URL: https://github.com/apache/apisix/pull/5625#issuecomment-980494687


   > Have we used this feature in APISIX?
   
   Hi @membphis! Yes currently all grpc tests with grpcurl are using this. 
   PR https://github.com/apache/apisix/pull/5460/files
   files: 1. https://github.com/apache/apisix/blob/master/t/node/grpc-proxy-unary.t
   2. https://github.com/apache/apisix/blob/master/t/node/grpc-proxy-stream.t
   3. https://github.com/apache/apisix/blob/master/t/node/grpc-proxy-mtls.t


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] membphis commented on pull request #5625: docs: exec code block for shell commands in Test Nginx

Posted by GitBox <gi...@apache.org>.
membphis commented on pull request #5625:
URL: https://github.com/apache/apisix/pull/5625#issuecomment-980522891


   cool job!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] bisakhmondal commented on pull request #5625: docs: exec code block for shell commands in Test Nginx

Posted by GitBox <gi...@apache.org>.
bisakhmondal commented on pull request #5625:
URL: https://github.com/apache/apisix/pull/5625#issuecomment-980494687


   > Have we used this feature in APISIX?
   
   Hi @membphis! Yes current all grpc tests using grpcurl are using this. 
   PR https://github.com/apache/apisix/pull/5460/files
   files: 1. https://github.com/apache/apisix/blob/master/t/node/grpc-proxy-unary.t
   2. https://github.com/apache/apisix/blob/master/t/node/grpc-proxy-stream.t
   3. https://github.com/apache/apisix/blob/master/t/node/grpc-proxy-mtls.t


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander merged pull request #5625: docs: exec code block for shell commands in Test Nginx

Posted by GitBox <gi...@apache.org>.
spacewander merged pull request #5625:
URL: https://github.com/apache/apisix/pull/5625


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] membphis commented on pull request #5625: docs: exec code block for shell commands in Test Nginx

Posted by GitBox <gi...@apache.org>.
membphis commented on pull request #5625:
URL: https://github.com/apache/apisix/pull/5625#issuecomment-980491529


   Have we used this feature in APISIX?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org