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

Using config variables #23

Open
samisagit opened this issue Nov 18, 2020 · 2 comments
Open

Using config variables #23

samisagit opened this issue Nov 18, 2020 · 2 comments

Comments

@samisagit
Copy link

It appears that, when using the grpc engine, variables are used literally. In this case I would expect {{ email }} to be replaced with [email protected] however my server receives the string of {{ email }}. Is this expected when using the grpc engine? It would be really useful to be able to use variables, especially when combined with tools like faker to create randomish test data.

(Apologies if there are any yaml formatting inconsistencies, GitHub didn't handle pasting too well)

config:                                                                                                                                                                                                     
  target: 0.0.0.0:8080                                                                                                                                                                                      
  phases:                                                                                                                                                                                                   
    - duration: 5                                                                                                                                                                                           
      arrivalRate: 1                                                                                                                                                                                        
  variables:                                                                                                                                                                                                
    email: "[email protected]"                                                                                                                                                                                   
  engines:                                                                                                                                                                                                  
    grpc:                                                                                                                                                                                                   
      channelOpts:                                                                                                                                                                                          
        grpc.client_idle_timeout_ms: 1000                                                                                                                                                                   
      protobufDefinition:                                                                                                                                                                                   
        filepath: ../../services/authentication/pb/authentication.proto                                                                                                                                     
        package: services.authentication.pb                                                                                                                                                                 
        service: Auth                                                                                                                                                                                       
      protoLoaderConfig:                                                                                                                                                                                    
        keepCase: true                                                                                                                                                                                      
        longs: String                                                                                                                                                                                       
        enums: String                                                                                                                                                                                       
        bytes: Buffer                                                                                                                                                                                       
        defaults: false                                                                                                                                                                                     
        arrays: false                                                                                                                                                                                       
        objects: false                                                                                                                                                                                      
        oneofs: true                                                                                                                                                                                        
      metadata:                                                                                                                                                                                             
        "pointlesskey": "stringvalue"                                                                                                                                                                       
                                                                                                                                                                                                              
  scenarios:                                                                                                                                                                                                  
    - name: test Auth running at http://0.0.0.0:8080                                                                                                                                                          
      engine: grpc                                                                                                                                                                                            
      flow:                                                                                                                                                                                                   
        - Register:                                                                                                                                                                                           
            email: "{{ email }}"
@bmurphy421
Copy link
Contributor

I've got the same problem, looks like this can be fixed by changing
const args = ops[rpcName] -> const args = this.helpers.template(ops[rpcName], context)
in the step function @kenju

@kenju
Copy link
Owner

kenju commented Jul 9, 2021

@bmurphy421 @samisagit

Thanks for your report & your contribution at #40!

v0.0.9 is now available. Could you confirm that variables template works as expected? Thank you.

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

3 participants