Fixing tests.
This commit is contained in:
parent
91de139c73
commit
29656b5e97
8 changed files with 69 additions and 46 deletions
4
api_tests/src/comment.spec.ts
vendored
4
api_tests/src/comment.spec.ts
vendored
|
@ -235,7 +235,7 @@ test('Reply to a comment', async () => {
|
|||
|
||||
test('Mention beta', async () => {
|
||||
// Create a mention on alpha
|
||||
let mentionContent = 'A test mention of @lemmy_beta@lemmy-beta:8550';
|
||||
let mentionContent = 'A test mention of @lemmy_beta@lemmy-beta:8551';
|
||||
let commentRes = await createComment(alpha, postRes.post.id);
|
||||
await delay();
|
||||
let mentionRes = await createComment(
|
||||
|
@ -275,7 +275,7 @@ test('A and G subscribe to B (center) A posts, G mentions B, it gets announced t
|
|||
let gammaPost = search.posts[0];
|
||||
|
||||
let commentContent =
|
||||
'A jest test federated comment announce, lets mention @lemmy_beta@lemmy-beta:8550';
|
||||
'A jest test federated comment announce, lets mention @lemmy_beta@lemmy-beta:8551';
|
||||
let commentRes = await createComment(
|
||||
gamma,
|
||||
gammaPost.id,
|
||||
|
|
2
api_tests/src/community.spec.ts
vendored
2
api_tests/src/community.spec.ts
vendored
|
@ -26,7 +26,7 @@ test('Create community', async () => {
|
|||
await delay();
|
||||
|
||||
// Cache the community on beta, make sure it has the other fields
|
||||
let searchShort = `!${prevName}@lemmy-alpha:8540`;
|
||||
let searchShort = `!${prevName}@lemmy-alpha:8541`;
|
||||
let search = await searchForCommunity(beta, searchShort);
|
||||
let communityOnBeta = search.communities[0];
|
||||
expect(communityOnBeta.name).toBe(communityRes.community.name);
|
||||
|
|
1
api_tests/src/follow.spec.ts
vendored
1
api_tests/src/follow.spec.ts
vendored
|
@ -1,3 +1,4 @@
|
|||
jest.setTimeout(120000);
|
||||
import {
|
||||
alpha,
|
||||
setupLogins,
|
||||
|
|
12
api_tests/src/shared.ts
vendored
12
api_tests/src/shared.ts
vendored
|
@ -50,23 +50,23 @@ export interface API {
|
|||
}
|
||||
|
||||
export let alpha: API = {
|
||||
client: new LemmyHttp('http://localhost:8540/api/v1'),
|
||||
client: new LemmyHttp('http://localhost:8541/api/v1'),
|
||||
};
|
||||
|
||||
export let beta: API = {
|
||||
client: new LemmyHttp('http://localhost:8550/api/v1'),
|
||||
client: new LemmyHttp('http://localhost:8551/api/v1'),
|
||||
};
|
||||
|
||||
export let gamma: API = {
|
||||
client: new LemmyHttp('http://localhost:8560/api/v1'),
|
||||
client: new LemmyHttp('http://localhost:8561/api/v1'),
|
||||
};
|
||||
|
||||
export let delta: API = {
|
||||
client: new LemmyHttp('http://localhost:8570/api/v1'),
|
||||
client: new LemmyHttp('http://localhost:8571/api/v1'),
|
||||
};
|
||||
|
||||
export let epsilon: API = {
|
||||
client: new LemmyHttp('http://localhost:8580/api/v1'),
|
||||
client: new LemmyHttp('http://localhost:8581/api/v1'),
|
||||
};
|
||||
|
||||
export async function setupLogins() {
|
||||
|
@ -236,7 +236,7 @@ export async function searchForBetaCommunity(
|
|||
// Make sure lemmy-beta/c/main is cached on lemmy_alpha
|
||||
// Use short-hand search url
|
||||
let form: SearchForm = {
|
||||
q: '!main@lemmy-beta:8550',
|
||||
q: '!main@lemmy-beta:8551',
|
||||
type_: SearchType.Communities,
|
||||
sort: SortType.TopAll,
|
||||
};
|
||||
|
|
2
api_tests/src/user.spec.ts
vendored
2
api_tests/src/user.spec.ts
vendored
|
@ -18,7 +18,7 @@ test('Create user', async () => {
|
|||
|
||||
let site = await getSite(alpha, auth);
|
||||
expect(site.my_user).toBeDefined();
|
||||
apShortname = `@${site.my_user.name}@lemmy-alpha:8540`;
|
||||
apShortname = `@${site.my_user.name}@lemmy-alpha:8541`;
|
||||
});
|
||||
|
||||
test('Save user settings, check changed bio from beta', async () => {
|
||||
|
|
20
docker/federation/docker-compose.yml
vendored
20
docker/federation/docker-compose.yml
vendored
|
@ -15,11 +15,11 @@ services:
|
|||
depends_on:
|
||||
- pictrs
|
||||
- iframely
|
||||
- lemmy-alpha-ui
|
||||
- lemmy-beta-ui
|
||||
- lemmy-gamma-ui
|
||||
- lemmy-delta-ui
|
||||
- lemmy-epsilon-ui
|
||||
- lemmy-alpha
|
||||
- lemmy-beta
|
||||
- lemmy-gamma
|
||||
- lemmy-delta
|
||||
- lemmy-epsilon
|
||||
|
||||
pictrs:
|
||||
restart: always
|
||||
|
@ -56,6 +56,8 @@ services:
|
|||
- RUST_LOG=debug
|
||||
depends_on:
|
||||
- postgres_alpha
|
||||
ports:
|
||||
- "8541:8541"
|
||||
postgres_alpha:
|
||||
image: postgres:12-alpine
|
||||
environment:
|
||||
|
@ -93,6 +95,8 @@ services:
|
|||
- RUST_LOG=debug
|
||||
depends_on:
|
||||
- postgres_beta
|
||||
ports:
|
||||
- "8551:8551"
|
||||
postgres_beta:
|
||||
image: postgres:12-alpine
|
||||
environment:
|
||||
|
@ -130,6 +134,8 @@ services:
|
|||
- RUST_LOG=debug
|
||||
depends_on:
|
||||
- postgres_gamma
|
||||
ports:
|
||||
- "8561:8561"
|
||||
postgres_gamma:
|
||||
image: postgres:12-alpine
|
||||
environment:
|
||||
|
@ -168,6 +174,8 @@ services:
|
|||
- RUST_LOG=debug
|
||||
depends_on:
|
||||
- postgres_delta
|
||||
ports:
|
||||
- "8571:8571"
|
||||
postgres_delta:
|
||||
image: postgres:12-alpine
|
||||
environment:
|
||||
|
@ -206,6 +214,8 @@ services:
|
|||
- RUST_LOG=debug
|
||||
depends_on:
|
||||
- postgres_epsilon
|
||||
ports:
|
||||
- "8581:8581"
|
||||
postgres_epsilon:
|
||||
image: postgres:12-alpine
|
||||
environment:
|
||||
|
|
62
docker/federation/nginx.conf
vendored
62
docker/federation/nginx.conf
vendored
|
@ -11,8 +11,14 @@ http {
|
|||
# Upload limit for pictshare
|
||||
client_max_body_size 50M;
|
||||
|
||||
location /api/v1 {
|
||||
proxy_pass http://lemmy-alpha:8541/api/v1;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
location / {
|
||||
proxy_pass http://lemmy-alpha-ui:1234/;
|
||||
proxy_pass http://lemmy-alpha-ui:1234;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
@ -20,12 +26,6 @@ http {
|
|||
# Cuts off the trailing slash on URLs to make them valid
|
||||
rewrite ^(.+)/+$ $1 permanent;
|
||||
}
|
||||
location /api/v1/ws {
|
||||
proxy_pass http://lemmy-alpha:8541;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
location /iframely/ {
|
||||
proxy_pass http://iframely:80/;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
@ -42,6 +42,12 @@ http {
|
|||
# Upload limit for pictshare
|
||||
client_max_body_size 50M;
|
||||
|
||||
location /api/v1 {
|
||||
proxy_pass http://lemmy-beta:8551/api/v1;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
location / {
|
||||
proxy_pass http://lemmy-beta-ui:1234;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
@ -51,12 +57,6 @@ http {
|
|||
# Cuts off the trailing slash on URLs to make them valid
|
||||
rewrite ^(.+)/+$ $1 permanent;
|
||||
}
|
||||
location /api/v1/ws {
|
||||
proxy_pass http://lemmy-beta:8551;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
location /iframely/ {
|
||||
proxy_pass http://iframely:80/;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
@ -73,6 +73,12 @@ http {
|
|||
# Upload limit for pictshare
|
||||
client_max_body_size 50M;
|
||||
|
||||
location /api/v1 {
|
||||
proxy_pass http://lemmy-gamma:8561/api/v1;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
location / {
|
||||
proxy_pass http://lemmy-gamma-ui:1234;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
@ -82,12 +88,6 @@ http {
|
|||
# Cuts off the trailing slash on URLs to make them valid
|
||||
rewrite ^(.+)/+$ $1 permanent;
|
||||
}
|
||||
location /api/v1/ws {
|
||||
proxy_pass http://lemmy-gamma:8561;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
location /iframely/ {
|
||||
proxy_pass http://iframely:80/;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
@ -104,6 +104,12 @@ http {
|
|||
# Upload limit for pictshare
|
||||
client_max_body_size 50M;
|
||||
|
||||
location /api/v1 {
|
||||
proxy_pass http://lemmy-delta:8571/api/v1;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
location / {
|
||||
proxy_pass http://lemmy-delta-ui:1234;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
@ -113,12 +119,6 @@ http {
|
|||
# Cuts off the trailing slash on URLs to make them valid
|
||||
rewrite ^(.+)/+$ $1 permanent;
|
||||
}
|
||||
location /api/v1/ws {
|
||||
proxy_pass http://lemmy-delta:8571;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
location /iframely/ {
|
||||
proxy_pass http://iframely:80/;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
@ -135,6 +135,12 @@ http {
|
|||
# Upload limit for pictshare
|
||||
client_max_body_size 50M;
|
||||
|
||||
location /api/v1 {
|
||||
proxy_pass http://lemmy-epsilon:8581/api/v1;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
location / {
|
||||
proxy_pass http://lemmy-epsilon-ui:1234;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
@ -144,12 +150,6 @@ http {
|
|||
# Cuts off the trailing slash on URLs to make them valid
|
||||
rewrite ^(.+)/+$ $1 permanent;
|
||||
}
|
||||
location /api/v1/ws {
|
||||
proxy_pass http://lemmy-epsilon:8581;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
location /iframely/ {
|
||||
proxy_pass http://iframely:80/;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
|
|
@ -94,6 +94,18 @@ impl ToApub for Community {
|
|||
group.set_content(d);
|
||||
}
|
||||
|
||||
if let Some(icon) = &self.icon {
|
||||
let mut image = Image::new();
|
||||
image.set_url(icon.to_owned());
|
||||
group.set_icon(image.into_any_base()?);
|
||||
}
|
||||
|
||||
if let Some(banner_url) = &self.banner {
|
||||
let mut image = Image::new();
|
||||
image.set_url(banner_url.to_owned());
|
||||
group.set_image(image.into_any_base()?);
|
||||
}
|
||||
|
||||
let mut ap_actor = ApActor::new(self.get_inbox_url()?, group);
|
||||
ap_actor
|
||||
.set_preferred_username(self.title.to_owned())
|
||||
|
|
Loading…
Reference in a new issue