Skip to content

Commit

Permalink
Merge pull request #414 from code4romania/feature/bugs-and-features
Browse files Browse the repository at this point in the history
Various fixes and features
  • Loading branch information
idormenco authored Oct 12, 2023
2 parents 2de4693 + ccb36f4 commit c5df5d6
Show file tree
Hide file tree
Showing 25 changed files with 33,845 additions and 33,166 deletions.
8 changes: 4 additions & 4 deletions bombardier/1-polling-stations-details-flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ const pollingStations = new SharedArray('polling-stations', function () {
const data = papaparse.parse(open('./polling-stations.csv'), { header: true }).data;

return [data.reduce((result, item) => {
const { code, number } = item;
const { communityCode, number } = item;

// Check if the code already exists in the result object
if (!result[code]) {
result[code] = [];
if (!result[communityCode]) {
result[communityCode] = [];
}

// Add the number to the list associated with the code
result[code].push(number);
result[communityCode].push(number);

return result;
}, {})];
Expand Down
6 changes: 3 additions & 3 deletions bombardier/2-forms-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ const users = new SharedArray('users', function () {
export const options = {
// Key configurations for avg load test in this section
stages: [
{ duration: '5m', target: 100 }, // traffic ramp-up from 1 to 100 users over 5 minutes.
{ duration: '5m', target: 100 }, // stay at 100 users for 30 minutes
{ duration: '5m', target: 0 }, // ramp-down to 0 users
{ duration: '30s', target: 10 }, // traffic ramp-up from 1 to 100 users over 5 minutes.
{ duration: '2m', target: 10 }, // stay at 100 users for 30 minutes
{ duration: '30s', target: 0 }, // ramp-down to 0 users
],
};

Expand Down
15 changes: 7 additions & 8 deletions bombardier/3-answers-flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ const pollingStations = new SharedArray('polling-stations', function () {
const data = papaparse.parse(open('./polling-stations.csv'), { header: true }).data;

return [data.reduce((result, item) => {
const { code, number } = item;
const { communityCode, number } = item;

// Check if the code already exists in the result object
if (!result[code]) {
result[code] = [];
if (!result[communityCode]) {
result[communityCode] = [];
}

// Add the number to the list associated with the code
result[code].push(number);
result[communityCode].push(number);

return result;
}, {})];
Expand All @@ -44,13 +44,12 @@ const pollingStations = new SharedArray('polling-stations', function () {
export const options = {
// Key configurations for avg load test in this section
stages: [
{ duration: '5m', target: 100 }, // traffic ramp-up from 1 to 100 users over 5 minutes.
{ duration: '5m', target: 100 }, // stay at 100 users for 30 minutes
{ duration: '5m', target: 0 }, // ramp-down to 0 users
{ duration: '30s', target: 10 }, // traffic ramp-up from 1 to 100 users over 5 minutes.
{ duration: '2m', target: 10 }, // stay at 100 users for 30 minutes
{ duration: '30s', target: 0 }, // ramp-down to 0 users
],
};


// Retrieve authentication token for subsequent API requests
const login = () => {
const user = randomItem(users);
Expand Down
2 changes: 1 addition & 1 deletion bombardier/4-notes-flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,5 @@ export default () => {
const authToken = login();

const pollingStation = pollingStations[scenario.iterationInTest % pollingStations.length];
addNote(authToken, pollingStation.code, pollingStation.number);
addNote(authToken, pollingStation.communityCode, pollingStation.number);
};
Loading

0 comments on commit c5df5d6

Please sign in to comment.