Skip to content

Commit 98056ca

Browse files
committed
chore(tests): another fresh run, with static names for randomIds
1 parent f40b902 commit 98056ca

File tree

186 files changed

+1907
-1863
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+1907
-1863
lines changed

tests/docker/api-key.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b070c15fba28558129d97fee20bb47d89464553d80d36e46a3b256101fa67d1d
1+
eb2a2de8f93102c896aff8a55eec4672bdbd2be123f02c4900ad6d0f6483703b

tests/docker/cookie.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# https://curl.se/docs/http-cookies.html
33
# This file was generated by libcurl! Edit at your own risk.
44

5-
#HttpOnly_localhost FALSE / FALSE 0 _forum_session DEyN8IuCi%2B70ZDZiPidhaADhaGa3ms0BIfXy78F48zGMu82ofzgSuBo%2F48ne6bTiq8Qsmyi5Tk7RIOIu%2BMiN%2BFgWJlkxGswPrkmzsSzL%2BU3CENWfGmqyac1%2FMe4JdkYlTRcOrOqHCurUyXeyNTmUB312PKF4T8TVQIQDtShR1ZbMjuAmQeky5LAD%2BewCUO5DNs9Mm1X8pZzMuHBorh35jq8MirQ299T5MRXBAfRUvHuSIbhcbO4Aw%2F%2BtIksNcV%2Bdbi8cc1PT%2BXO3zwjLZQdkbYiIdlMPV7OVCDgGXQVAvD2rYpFAI3XvhPmX1dnXwDoseJvjdG9xf8stqX8pinz%2BFkeTcTKcaWJ3dOFMC%2FYDmuFa0pfdb2KfSh%2BiFOCqaw%3D%3D--qpn7HuwUrFWSo2vW--tUMXZQXEZVqU0pxMnfpdiQ%3D%3D
6-
#HttpOnly_localhost FALSE / FALSE 1765285323 _t zDcaae70lEuwFUX9TBewAkGzSsfaoRBsA8MBh2yMTtD%2FRtpwV6pup%2FG7bPpJsCtAjOc22FX5gfWCI8DyhWIUtvRx%2Bi7yB0sCRMorSRuvqQ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2Bu384fMEecVenKg7Eedc0YwnT7L0L3PKBZsoWF4LE1E6zB%2FrM0r7Q--NPoZnqW8vDk6pGQ6--MzPJIOpUZLsSiO9sa2W92g%3D%3D

tests/docker/env.admin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
ADMIN_EMAIL=root@localhost.localdomain
22
ADMIN_USERNAME=admin
3-
ADMIN_PASSWORD=c/vKIi9PZzytf5jWSLj76b0911OQGgN1
3+
ADMIN_PASSWORD=VIvBRJYju9PTI65PCPLwjcxjuhUhf890

tests/docker/server.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"url": "http://localhost",
3-
"apiKey": "b070c15fba28558129d97fee20bb47d89464553d80d36e46a3b256101fa67d1d"
3+
"apiKey": "eb2a2de8f93102c896aff8a55eec4672bdbd2be123f02c4900ad6d0f6483703b"
44
}

tests/e2e/categories.test.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,39 @@ import {
33
discourse,
44
expect,
55
randomName,
6+
setNextCacheId,
67
test,
78
useCache,
89
} from "./_common.ts";
910

1011
describe("categories", () => {
1112
useCache();
1213

14+
/*
15+
* Note: There's no documented deleteCategory API, so we need to give each category
16+
* a unique name to avoid conflicts, and manually specify cacheId.
17+
*/
18+
1319
test("listCategories", async () => {
1420
const result = await discourse.listCategories();
1521
expect(Array.isArray(result.category_list.categories)).toBe(true);
1622
});
1723

1824
test("createCategory", async () => {
1925
const name = randomName();
26+
setNextCacheId("createCategory-createCategory");
2027
const result = await discourse.createCategory({ name });
2128
expect(result).toHaveProperty("category");
2229
});
2330

2431
test("updateCategory", async () => {
25-
const name = randomName();
26-
const result = await discourse.createCategory({ name });
32+
setNextCacheId("updateCategory-createCategory");
33+
const result = await discourse.createCategory({ name: randomName() });
34+
const name = result.category.name;
2735
const id = result.category.id;
2836

2937
const newName = name + "-updated";
38+
setNextCacheId("updateCategory-updateCategory");
3039
const updateResult = await discourse.updateCategory({ id, name: newName });
3140
expect(updateResult.category.name).toBe(newName);
3241
});

tests/e2e/tags.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
discourse,
66
expect,
77
randomName,
8+
setNextCacheId,
89
skipCacheOnce,
910
test,
1011
useCache,
@@ -22,6 +23,7 @@ describe("tags", () => {
2223
// No documented delete API :D
2324
// console.warn("Found leftover test tag group:", tagGroup.name, "but cannot delete it");
2425
// We might have lots of randomName()'d tag groups, so don't spam the console
26+
// It also means we should manually set cache IDs due to the random names.
2527
}
2628
}
2729
}
@@ -36,20 +38,24 @@ describe("tags", () => {
3638

3739
test("createTagGroup & getTagGroup", async () => {
3840
const name = randomName();
41+
setNextCacheId("createTagGroup-createTagGroup");
3942
const result = await discourse.createTagGroup({ name });
4043
expect(result.tag_group).toHaveProperty("id");
4144

45+
setNextCacheId("createTagGroup-getTagGroup");
4246
const tagGroup = await discourse.getTagGroup({
4347
id: result.tag_group.id.toString(),
4448
});
4549
expect(tagGroup.tag_group?.id).toBe(result.tag_group.id);
4650
});
4751

4852
test("updateTagGroup", async () => {
49-
const name = randomName();
50-
const result = await discourse.createTagGroup({ name });
53+
setNextCacheId("updateTagGroup-createTagGroup");
54+
const result = await discourse.createTagGroup({ name: randomName() });
55+
const name = result.tag_group.name;
5156

5257
const updatedName = name + "-updated";
58+
setNextCacheId("updateTagGroup-updateTagGroup");
5359
const updated = await discourse.updateTagGroup({
5460
id: result.tag_group.id.toString(),
5561
name: updatedName,

tests/fixtures/http/createBackup-createBackup.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"with_uploads": false
77
},
88
"headers": {
9-
"api-key": "b070c15fba28558129d97fee20bb47d89464553d80d36e46a3b256101fa67d1d",
9+
"api-key": "eb2a2de8f93102c896aff8a55eec4672bdbd2be123f02c4900ad6d0f6483703b",
1010
"api-username": "system",
1111
"content-type": "application/json"
1212
}
@@ -19,7 +19,7 @@
1919
"cache-control": "no-cache, no-store",
2020
"connection": "keep-alive",
2121
"content-type": "application/json; charset=utf-8",
22-
"date": "Fri, 10 Oct 2025 13:02:24 GMT",
22+
"date": "Fri, 10 Oct 2025 13:43:37 GMT",
2323
"referrer-policy": "strict-origin-when-cross-origin",
2424
"server": "nginx",
2525
"transfer-encoding": "chunked",
@@ -29,8 +29,8 @@
2929
"x-discourse-username": "system",
3030
"x-frame-options": "SAMEORIGIN",
3131
"x-permitted-cross-domain-policies": "none",
32-
"x-request-id": "9644c731-2b61-4cb4-9b0b-72a71a6541ca",
33-
"x-runtime": "0.019264",
32+
"x-request-id": "89ae1fa4-d0e8-49f5-bbf4-beda48379971",
33+
"x-runtime": "0.056677",
3434
"x-xss-protection": "0"
3535
},
3636
"bodyJson": {

tests/fixtures/http/localhost!categories.json[method=POST,headers=ec5bc95,body=527050a].json renamed to tests/fixtures/http/createCategory-createCategory.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"url": "http://localhost/categories.json",
44
"method": "POST",
55
"bodyJson": {
6-
"name": "test-qjgpywa"
6+
"name": "test-ulxandf"
77
},
88
"headers": {
9-
"api-key": "b070c15fba28558129d97fee20bb47d89464553d80d36e46a3b256101fa67d1d",
9+
"api-key": "eb2a2de8f93102c896aff8a55eec4672bdbd2be123f02c4900ad6d0f6483703b",
1010
"api-username": "system",
1111
"content-type": "application/json"
1212
}
@@ -19,7 +19,7 @@
1919
"cache-control": "no-cache, no-store",
2020
"connection": "keep-alive",
2121
"content-type": "application/json; charset=utf-8",
22-
"date": "Fri, 10 Oct 2025 13:02:24 GMT",
22+
"date": "Fri, 10 Oct 2025 13:43:38 GMT",
2323
"referrer-policy": "strict-origin-when-cross-origin",
2424
"server": "nginx",
2525
"transfer-encoding": "chunked",
@@ -29,27 +29,27 @@
2929
"x-discourse-username": "system",
3030
"x-frame-options": "SAMEORIGIN",
3131
"x-permitted-cross-domain-policies": "none",
32-
"x-request-id": "258f0ff4-690e-48f2-88a4-bcd6ad2ade58",
33-
"x-runtime": "0.139812",
32+
"x-request-id": "060c7707-82b3-4178-9054-01f899e6875e",
33+
"x-runtime": "0.123283",
3434
"x-xss-protection": "0"
3535
},
3636
"bodyJson": {
3737
"category": {
3838
"id": 5,
39-
"name": "test-qjgpywa",
39+
"name": "test-ulxandf",
4040
"color": "0088CC",
4141
"text_color": "FFFFFF",
4242
"style_type": "square",
4343
"icon": null,
4444
"emoji": null,
45-
"slug": "test-qjgpywa",
45+
"slug": "test-ulxandf",
4646
"topic_count": 0,
4747
"post_count": 0,
4848
"position": 4,
4949
"description": null,
5050
"description_text": null,
5151
"description_excerpt": null,
52-
"topic_url": "/t/about-the-test-qjgpywa-category/8",
52+
"topic_url": "/t/about-the-test-ulxandf-category/9",
5353
"read_restricted": false,
5454
"permission": null,
5555
"notification_level": 1,

tests/fixtures/http/localhost!tag_groups.json[method=POST,headers=ec5bc95,body=75a77d3].json renamed to tests/fixtures/http/createTagGroup-createTagGroup.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"url": "http://localhost/tag_groups.json",
44
"method": "POST",
55
"bodyJson": {
6-
"name": "test-phzukzn"
6+
"name": "test-rqyyyty"
77
},
88
"headers": {
9-
"api-key": "b070c15fba28558129d97fee20bb47d89464553d80d36e46a3b256101fa67d1d",
9+
"api-key": "eb2a2de8f93102c896aff8a55eec4672bdbd2be123f02c4900ad6d0f6483703b",
1010
"api-username": "system",
1111
"content-type": "application/json"
1212
}
@@ -19,7 +19,7 @@
1919
"cache-control": "no-cache, no-store",
2020
"connection": "keep-alive",
2121
"content-type": "application/json; charset=utf-8",
22-
"date": "Fri, 10 Oct 2025 13:02:24 GMT",
22+
"date": "Fri, 10 Oct 2025 13:43:38 GMT",
2323
"referrer-policy": "strict-origin-when-cross-origin",
2424
"server": "nginx",
2525
"transfer-encoding": "chunked",
@@ -29,14 +29,14 @@
2929
"x-discourse-username": "system",
3030
"x-frame-options": "SAMEORIGIN",
3131
"x-permitted-cross-domain-policies": "none",
32-
"x-request-id": "0275e4c6-c88d-4831-a076-f90f352818a0",
33-
"x-runtime": "0.038421",
32+
"x-request-id": "102bd4c6-8305-4967-85e2-b0014d075fcd",
33+
"x-runtime": "0.026048",
3434
"x-xss-protection": "0"
3535
},
3636
"bodyJson": {
3737
"tag_group": {
3838
"id": 1,
39-
"name": "test-phzukzn",
39+
"name": "test-rqyyyty",
4040
"tag_names": [],
4141
"parent_tag_name": [],
4242
"one_per_topic": false,

tests/fixtures/http/localhost!tag_groups!1.json[headers=c555ed5,body=74234e9].json renamed to tests/fixtures/http/createTagGroup-getTagGroup.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"url": "http://localhost/tag_groups/1.json",
44
"method": "GET",
55
"headers": {
6-
"api-key": "b070c15fba28558129d97fee20bb47d89464553d80d36e46a3b256101fa67d1d",
6+
"api-key": "eb2a2de8f93102c896aff8a55eec4672bdbd2be123f02c4900ad6d0f6483703b",
77
"api-username": "system"
88
}
99
},
@@ -15,7 +15,7 @@
1515
"cache-control": "no-cache, no-store",
1616
"connection": "keep-alive",
1717
"content-type": "application/json; charset=utf-8",
18-
"date": "Fri, 10 Oct 2025 13:02:25 GMT",
18+
"date": "Fri, 10 Oct 2025 13:43:38 GMT",
1919
"referrer-policy": "strict-origin-when-cross-origin",
2020
"server": "nginx",
2121
"transfer-encoding": "chunked",
@@ -25,14 +25,14 @@
2525
"x-discourse-username": "system",
2626
"x-frame-options": "SAMEORIGIN",
2727
"x-permitted-cross-domain-policies": "none",
28-
"x-request-id": "53f200e8-c7cb-4c94-ae6c-9f47d898e77d",
29-
"x-runtime": "0.017515",
28+
"x-request-id": "fb0e297a-79ec-458c-8178-7ad0236bb0eb",
29+
"x-runtime": "0.013959",
3030
"x-xss-protection": "0"
3131
},
3232
"bodyJson": {
3333
"tag_group": {
3434
"id": 1,
35-
"name": "test-phzukzn",
35+
"name": "test-rqyyyty",
3636
"tag_names": [],
3737
"parent_tag_name": [],
3838
"one_per_topic": false,

0 commit comments

Comments
 (0)