Skip to content
This repository was archived by the owner on Sep 2, 2024. It is now read-only.
This repository was archived by the owner on Sep 2, 2024. It is now read-only.

Only one server endpoint is being exercised #4

Description

@davisjam

The server exposes count, product, and random endpoints, but the client only exercises count by default. In addition it is difficult to exercise the wide variety of possible endpoints since they accept arbitrary numbers.

Suggestion: Something like this:

config-ssr.json

@@ -14,7 +15,9 @@
     "root_endpoint": "/",
     "no_db": true,
     "get_endpoints": [
-      "count/10000/15"
+      "count/{{RANDOM}}00/{{RANDOM}}",
+      "product/{{RANDOM}}",
+      "random/{{RANDOM}}"
     ],

runspec.py

@@ -607,9 +658,17 @@ def get_data():
 def generate_urls_from_list():
   urls_count = len(get_endpoints_urls)
   for ii in xrange(int(total_urls)):
+    # Which URL to use?
     urls_idx = random.randint(0, urls_count - 1)
+
+    # Resolve templating
+    templateURL = get_endpoints_urls[urls_idx]
+    while '{{RANDOM}}' in templateURL:
+      templateURL = templateURL.replace('{{RANDOM}}', str(random.randint(0, 100)), 1)
+    fullURL = templateURL
+
     urllist.append({
-        'url': get_endpoints_urls[urls_idx],
+        'url': fullURL,
         'method':'GET'})

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions