shopware / k6-shopware

E2E Performance Testing with Grafana K6
https://developer.shopware.com/docs/guides/hosting/performance/k6.html
15 stars 5 forks source link

bun execution error #7

Closed Theosakamg closed 2 months ago

Theosakamg commented 2 months ago

after cloning project and set .env file.


k6-shopware (main)$ bun run fetch-fixtures.ts
47 | 
48 |   const taxIds = await adminApiClient.invoke(
49 |     "tax post /search-ids/tax",
50 |   );
51 | 
52 |   const records = data.data.map((record) => {
                                 ^
TypeError: data.data.map is not a function. (In 'data.data.map((record) => {
    return {
      id: record.id,
      name: record.name,
      accessKey: record.accessKey,
      url: record.domains[0].url,
      countryIds: record.countries.map((e) => e.id),
      salutationIds: salutationIds.data,
      taxIds: taxIds.data,
      api: {
        baseURL: `${process.env.SHOP_URL}/api`,
        credentials: {
          grant_type: "password",
          client_id: "administration",
          scopes: "write",
          username: process.env.SHOP_ADMIN_USERNAME,
          password: process.env.SHOP_ADMIN_PASSWORD
        }
      }
    };
  })', 'data.data.map' is undefined)
      at k6-shopware/fetch-fixtures.ts:52:29

Bun v1.1.26 (Linux x64)
`
shyim commented 2 months ago

I think it cannot connect to the shopware installation, maybe check the env again

Theosakamg commented 2 months ago

Fixed by commit 3a3fc0e TY.