Przeglądaj źródła

chore: Update load testing scripts

Michael Bromley 4 lat temu
rodzic
commit
2ac94cc681

+ 1 - 1
packages/dev-server/load-testing/graphql/shop/complete-order.graphql

@@ -10,7 +10,7 @@ mutation SetShippingMethod($id: ID!) {
         }
     }
     addPaymentToOrder(input: {
-        method: "example-payment-provider",
+        method: "standard-payment",
         metadata: {}
     }) {
         ...on Order {

+ 0 - 5
packages/dev-server/load-testing/graphql/shop/deep-query.graphql

@@ -95,7 +95,6 @@
                 code
             }
             price
-            priceIncludesTax
             priceWithTax
             sku
             taxCategory {
@@ -107,10 +106,6 @@
                     id
                     name
                 }
-                customerGroup {
-                    id
-                    name
-                }
                 value
                 zone {
                     id

+ 0 - 1
packages/dev-server/load-testing/graphql/shop/product.graphql

@@ -58,7 +58,6 @@ fragment ProductVariant on ProductVariant {
   name
   price
   currencyCode
-  priceIncludesTax
   priceWithTax
   taxRateApplied {
     id

+ 6 - 2
packages/dev-server/load-testing/graphql/shop/search.graphql

@@ -8,8 +8,12 @@ query {
       productVariantId
       productName
       productVariantName
-      productPreview
-      productVariantPreview
+      productAsset {
+          preview
+      }
+      productVariantAsset {
+          preview
+      }
       price {
         ... on PriceRange {
           min

+ 5 - 5
packages/dev-server/load-testing/graphql/shop/set-shipping-address.graphql

@@ -35,13 +35,13 @@ fragment Cart on Order {
         unitPrice
         unitPriceWithTax
         quantity
-        totalPrice
+        linePriceWithTax
         productVariant {
             id
             name
         }
-        adjustments {
-            amount
+        discounts {
+            amountWithTax
             description
             adjustmentSource
             type
@@ -60,8 +60,8 @@ fragment Cart on Order {
         }
     }
     total
-    adjustments {
-        amount
+    discounts {
+        amountWithTax
         description
         adjustmentSource
         type

+ 4 - 0
packages/dev-server/load-testing/load-test-config.ts

@@ -2,6 +2,7 @@
 import { AssetServerPlugin } from '@vendure/asset-server-plugin';
 import {
     defaultConfig,
+    DefaultJobQueuePlugin,
     DefaultLogger,
     DefaultSearchPlugin,
     dummyPaymentHandler,
@@ -62,6 +63,9 @@ export function getLoadTestConfig(tokenMethod: 'cookie' | 'bearer'): Required<Ve
                 route: 'assets',
             }),
             DefaultSearchPlugin,
+            DefaultJobQueuePlugin.init({
+                pollInterval: 1000,
+            }),
         ],
     });
 }

+ 2 - 5
packages/dev-server/load-testing/run-load-test.ts

@@ -1,6 +1,6 @@
 /* tslint:disable:no-console */
 import { INestApplication } from '@nestjs/common';
-import { bootstrap } from '@vendure/core';
+import { bootstrap, JobQueueService } from '@vendure/core';
 import { spawn } from 'child_process';
 import stringify from 'csv-stringify';
 import fs from 'fs';
@@ -157,8 +157,5 @@ async function getTimeSeriesCsvData(summary: LoadTestSummary): Promise<string> {
 }
 
 function getDateString(): string {
-    return new Date()
-        .toISOString()
-        .split('.')[0]
-        .replace(/[:\.]/g, '_');
+    return new Date().toISOString().split('.')[0].replace(/[:\.]/g, '_');
 }