Skip to content
8 changes: 0 additions & 8 deletions ab-testing/abTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export const ABTests: ABTest[] = [
status: 'ON',
expirationDate: new Date('2025-07-30'),
type: 'client',
highImpact: false,
audienceSize: 10 / 100,
groups: ['control', 'variant'],
},
Expand All @@ -41,9 +40,7 @@ export const ABTests: ABTest[] = [
status: 'ON',
expirationDate: new Date('2025-07-30'),
type: 'client',
highImpact: false,
audienceSize: 20 / 100,
audienceOffset: 10,
groups: ['control', 'variant'],
},
// Example server side AB test definition
Expand All @@ -58,7 +55,6 @@ export const ABTests: ABTest[] = [
status: 'ON',
expirationDate: new Date('2025-08-04'),
type: 'server',
highImpact: false,
audienceSize: 100 / 100,
groups: ['control', 'variant'],
audienceSpace: 'B',
Expand All @@ -74,9 +70,7 @@ export const ABTests: ABTest[] = [
status: 'ON',
expirationDate: new Date('2025-08-04'),
type: 'server',
highImpact: false,
audienceSize: 10 / 100,
audienceOffset: 30,
groups: ['control', 'variant'],
},
{
Expand All @@ -90,9 +84,7 @@ export const ABTests: ABTest[] = [
status: 'ON',
expirationDate: new Date('2025-08-04'),
type: 'server',
highImpact: false,
audienceSize: 10 / 100,
audienceOffset: 40,
groups: ['control', 'variant'],
},
];
2 changes: 1 addition & 1 deletion ab-testing/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"tasks": {
"validate": "deno run scripts/validation/index.ts",
"upload": "deno run --allow-read=dist --allow-env=FASTLY_AB_TESTING_API_TOKEN,FASTLY_AB_TESTING_SERVICE_ID,FASTLY_AB_TESTING_SERVICE_NAME,FASTLY_MVTS_DICTIONARY_ID,FASTLY_MVTS_DICTIONARY_NAME,FASTLY_AB_TESTS_DICTIONARY_ID,FASTLY_AB_TESTS_DICTIONARY_NAME --allow-net=api.fastly.com:443 scripts/deploy/index.ts --mvts=dist/mvts.json --ab-tests=dist/ab-tests.json",
"build": "deno run --allow-write scripts/build/index.ts --mvts=dist/mvts.json --ab-tests=dist/ab-tests.json"
"build": "deno run --allow-env=FASTLY_AB_TESTING_API_TOKEN,FASTLY_AB_TESTING_SERVICE_ID,FASTLY_AB_TESTING_SERVICE_NAME,FASTLY_MVTS_DICTIONARY_ID,FASTLY_MVTS_DICTIONARY_NAME,FASTLY_AB_TESTS_DICTIONARY_ID,FASTLY_AB_TESTS_DICTIONARY_NAME --allow-net=api.fastly.com:443 --allow-write scripts/build/index.ts --mvts=dist/mvts.json --ab-tests=dist/ab-tests.json"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build step now needs to read the AB testing state from fastly

},
"imports": {
"@std/assert": "jsr:@std/assert@^1.0.13",
Expand Down
4 changes: 2 additions & 2 deletions ab-testing/scripts/build/build-ab-tests-dict.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { ABTest } from '../../types.ts';
import { stringify } from '../lib.ts';
import { stringifyFastlySubfield } from '../lib/fastly-subfield.ts';

const buildABTestDict = (tests: ABTest[]) =>
tests
.map((test) =>
test.groups.map((group) => ({
item_key: `${test.name}:${group}`,
item_value: stringify({
item_value: stringifyFastlySubfield({
exp: Math.floor(test.expirationDate.getTime() / 1000),
type: test.type,
}),
Expand Down
206 changes: 0 additions & 206 deletions ab-testing/scripts/build/build-mvt-dict.test.ts

This file was deleted.

Loading