handleSummary() and AWS CodeBuild

Hello All,

Running tests
locally: load tests run, the handleSummary function gets called afterwards.
AWS CodeBuild: load tests run, the handleSummary function doesn’t get called.

Why is the function not being called in AWS?

import http from 'k6/http';
import { sleep } from 'k6';
import { htmlReport } from 'https://raw.githubusercontent.com/benc-uk/k6-reporter/main/dist/bundle.js';
import { helper } from '../../utils/helper.js';

export default function () {
    http.get('https://test.k6.io');
    sleep(1);
}

export async function handleSummary(data) {
    return {
        [helper.setFileName()]: htmlReport(data),
    };
}

Hi @sqa

Welcome to the community forum :wave:

I understand you are following How to Perform Load Testing with k6 using AWS CodeBuild Platform. Are CloudWatch logs enabled? Is the function not called or is there an error at some point? Do you see the default summary as in the blog above if you don’t define the custom html report?

Can you share the helper.js? We could test this locally and check why it would not work in AWS CodeBuild.

Cheers!

Hi @eyeveeb, I should of updated this thread on Friday! The issue was the k6 Docker image I was using locally vs what was being used in the CodeBuild project.

1 Like