-
Notifications
You must be signed in to change notification settings - Fork 12
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
Using mocka for Openresty testing #115
Comments
Sorry for the late answer yes, I will update with a bunch of openresty testing docs. Is that ok? |
Yes please update the docs. Thanks! |
@syedmhashim a pull request is ongoing after is done I will merge to dev and master. There is no need for a new version of mocka it works with previous versions as well. If you have any other questions please don't hesitate to contact me at trifan@adobe.com |
* Develop to master (#117) * new incremental version (#111) * fixing mocka failing some nginx tests * version 1.3.0 * update code * making a centos docker * add loop script * working nginx/openresty * add boiler plate * small refactoring * update some more * fixing issues and adding docker-compose for running * correct mapping * adding example * adding examples * adding examples * finished example * support and example + coverage * update
* new incremental version (#111) * fixing mocka failing some nginx tests * version 1.3.0 * [#115][request] Openresty test examples (#119) * Develop to master (#117) * new incremental version (#111) * fixing mocka failing some nginx tests * version 1.3.0 * update code * making a centos docker * add loop script * working nginx/openresty * add boiler plate * small refactoring * update some more * fixing issues and adding docker-compose for running * correct mapping * adding example * adding examples * adding examples * finished example * support and example + coverage * update
Hi Alexandru! If you can also update the README.md with usage examples with regards to testing ngx, then that would be great! Thanks a load! |
Can you please be more specific about your testing scenario so I can better pinpoint the docs?
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Syed Muhammad Hashim <notifications@github.com>
Sent: Thursday, November 12, 2020 5:19:29 PM
To: adobe/mocka <mocka@noreply.github.com>
Cc: Alexandru Trifan <trifan.alex.criss@gmail.com>; Comment <comment@noreply.github.com>
Subject: Re: [adobe/mocka] Using mocka for Openresty testing (#115)
Hi Alexandru! If you can also update the README.md with usage examples with regards to testing ngx, then that would be great! Thanks a load!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#115 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAQP7EH43SV6NTFNBOPA3PDSPP4IDANCNFSM4KW5Q4RQ>.
|
* new incremental version (#111) * fixing mocka failing some nginx tests * version 1.3.0 * [#115][request] Openresty test examples (#119) * Develop to master (#117) * new incremental version (#111) * fixing mocka failing some nginx tests * version 1.3.0 * update code * making a centos docker * add loop script * working nginx/openresty * add boiler plate * small refactoring * update some more * fixing issues and adding docker-compose for running * correct mapping * adding example * adding examples * adding examples * finished example * support and example + coverage * update * [#121] Global before each (#122) * Develop to master (#117) * new incremental version (#111) * fixing mocka failing some nginx tests * version 1.3.0 * update code * make globalBeforEach and globalAfterEach * global before each after each and mocka 1.3.2
* new incremental version (#111) * fixing mocka failing some nginx tests * version 1.3.0 * [#115][request] Openresty test examples (#119) * Develop to master (#117) * new incremental version (#111) * fixing mocka failing some nginx tests * version 1.3.0 * update code * making a centos docker * add loop script * working nginx/openresty * add boiler plate * small refactoring * update some more * fixing issues and adding docker-compose for running * correct mapping * adding example * adding examples * adding examples * finished example * support and example + coverage * update * make globalBeforEach and globalAfterEach * global before each after each and mocka 1.3.2 * fixes for centos deployment pipeline
* new incremental version (#111) * fixing mocka failing some nginx tests * version 1.3.0 * [#115][request] Openresty test examples (#119) * Develop to master (#117) * new incremental version (#111) * fixing mocka failing some nginx tests * version 1.3.0 * update code * making a centos docker * add loop script * working nginx/openresty * add boiler plate * small refactoring * update some more * fixing issues and adding docker-compose for running * correct mapping * adding example * adding examples * adding examples * finished example * support and example + coverage * update * [#121] Global before each (#122) * Develop to master (#117) * new incremental version (#111) * fixing mocka failing some nginx tests * version 1.3.0 * update code * make globalBeforEach and globalAfterEach * global before each after each and mocka 1.3.2
Hi Alexandru. I'll show you the way I've have done the testing of the lua code that's used within my nginx configuration files. Can you please verify if this is how it should be done. The tests run successfully tho. security.lua (This would be used within the nginx configuration)
The sample usage of above code in nginx.conf
Now for testing this lua code I created ngx/mocked.lua as the default ngx doesn't fulfill my needs:
And in authenticate_test.lua I'm using it like this:
|
the above is correct only if you plan to use ngx just inside the testing code, but if you want to replace the global variable you should not use local ngx you should just say ngx.exit = ... and so on since ngx is a global. You also cannot replace var on the global field because it is actual a c code invocation. It would be better if you would show me the actual testing and tell me more on what you want to verify, you want to verify ngx calls if they are executing or what? |
Hello!
The Readme document states that mocka has nginx embedded methods for individual testing of Openresty. However, I cannot find any support material or examples/references for that. Can you please guide me on how to use it for ngx testing.
Thanks!
The text was updated successfully, but these errors were encountered: