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

locustfile as configmap -> Could not find any locustfile! Ensure file ends in '.py' #1012

Closed
wehappyfew opened this issue May 13, 2019 · 3 comments

Comments

@wehappyfew
Copy link

Description of issue

I try to run a locust test file as config map. I have created the config map from the .py file.
However, when I deploy the helm chart, the master pod crashes with the above error.

Expected behavior

To find the locustfile that I have provided as config map [as stated in the documentation], and run without problems.

Actual behavior

The master pod crashes with error "Could not find any locustfile! Ensure file ends in '.py'"

Environment settings

  • OS: Linux on Vagrant
  • Python version: 2.7
  • Locust version: 0.8.1

Steps to reproduce (for bug reports)

from rabbitmq import get_client
from locust import HttpLocust, Locust, TaskSet, task, events
import pika
from random import randint,choice
from string import ascii_uppercase

class UserBehavior(TaskSet):

  host="192.168.99.100"
  port=5672
  username="guest"
  password="guest"
  vhost="/"

  # create a random string between 1000 and 10000 chars
  msg=''.join(choice(ascii_uppercase) for i in range(randint(1000,10000)))

  @task
  def hit_rabbit(self):
    min_wait = 2000
    max_wait = 5000

    # # # #
    credentials = pika.PlainCredentials(self.username, self.password)
    parameters  = pika.ConnectionParameters(self.host, self.port, self.vhost, credentials)
    connection  = pika.BlockingConnection(parameters)
    channel     = connection.channel()

    channel.queue_declare(queue='locust_queue')

    channel.basic_publish(exchange='', routing_key='route-key-1', body=self.msg)
    print("[OK] Sent msg")

    connection.close()
    # # # #

    @task
    def stop(self):
      self.interrupt()

class WebsiteUser(HttpLocust):
  # host = target_url
  task_set = UserBehavior
  # min_wait = 5000
  # max_wait = 15000
@cgoldberg
Copy link
Member

To find the locustfile that I have provided as
config map [as stated in the documentation]

I'm not sure what a config map is or which documentation you are referring to... but the Locust docs don't mention any such thing.

@hsellik
Copy link

hsellik commented May 30, 2019

@wehappyfew , are you referring to this documentation?
https://github.com/helm/charts/tree/master/stable/locust

@wehappyfew
Copy link
Author

Hello @hsellik !
Yes exactly.

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