Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invite devroom managers, even without scheduled talks #235

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Conference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,7 @@ export class Conference {
people.push(...t.speakers);
}
}
people.push(...audit.extraPeople);
return people;
}

Expand Down
62 changes: 62 additions & 0 deletions src/__tests__/backends/json/JsonScheduleBackend.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { test, expect, afterEach, beforeEach, describe } from "@jest/globals";
import { Server, createServer } from "node:http";
import { AddressInfo } from "node:net";
import path from "node:path";
import * as fs from "fs";
import { IConfig, JsonScheduleFormat } from "../../../config";
import { JsonScheduleBackend } from "../../../backends/json/JsonScheduleBackend";

function getFixture(fixtureFile: string) {
return fs.readFileSync(path.join(__dirname, fixtureFile), "utf8");
}

function jsonScheduleServer() {
return new Promise<Server>((resolve) => {
const server = createServer((req, res) => {
if (req.url === "/schedule.json") {
res.writeHead(200);
const json = getFixture("original_democon.json");
res.end(json);
} else if (req.url === "/fosdem/p/matrix") {
res.writeHead(200);
const json = getFixture("fosdem_democon.json");
res.end(json);
} else {
console.log(req.url);
res.writeHead(404);
res.end("Not found");
}
}).listen(undefined, "127.0.0.1", undefined, () => {
resolve(server);
});
});
}

describe("JsonScheduleBackend", () => {
let serv;
beforeEach(async () => {
serv = await jsonScheduleServer();
});
afterEach(async () => {
serv.close();
});

test("can parse a FOSDEM JSON format", async () => {
const globalConfig = { conference: { name: "DemoCon" } } as IConfig;
const backend = await JsonScheduleBackend.new(
"/dev/null",
{
backend: "json",
scheduleFormat: JsonScheduleFormat.FOSDEM,
scheduleDefinition: `http://127.0.0.1:${
(serv.address() as AddressInfo).port
}/fosdem/p/matrix`,
},
globalConfig
);
expect(backend.conference.title).toBe("DemoCon");
expect(backend.auditoriums).toMatchSnapshot("auditoriums");
expect(backend.talks).toMatchSnapshot("talks");
expect(backend.interestRooms.size).toBe(0);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`JsonScheduleBackend can parse a FOSDEM JSON format: auditoriums 1`] = `
Map {
"5" => {
"extraPeople": [
{
"email": "conal@example.org",
"id": "1",
"matrix_id": "@conal:example.org",
"name": "Conal Coordinator",
"role": "coordinator",
},
],
"id": "5",
"isPhysical": true,
"kind": "auditorium",
"name": "Open CAD/CAM devroom",
"slug": "open_cad_cam",
"talks": Map {
"3" => {
"auditoriumId": "5",
"dateTs": 1706745600000,
"endTime": 1706778000000,
"id": "3",
"livestream_endTime": 1706778000000,
"prerecorded": false,
"qa_startTime": 0,
"speakers": [
{
"email": "ioferrell@localhost",
"id": "4",
"matrix_id": "",
"name": "Iarlaith O'Ferrell",
"role": "speaker",
},
{
"email": "niamh@localhost",
"id": "5",
"matrix_id": "",
"name": "Niamh O'Donnellan",
"role": "speaker",
},
{
"email": "conal@example.org",
"id": "1",
"matrix_id": "@conal:example.org",
"name": "Conal Cördinator",
"role": "coordinator",
},
],
"startTime": 1706778000000,
"subtitle": "",
"title": "Panacea3D: The Final Word in Open Source 3D Solid Modelling",
},
},
},
"6" => {
"extraPeople": [
{
"email": "chloe@example.org",
"id": "246",
"matrix_id": "@chloe:example.org",
"name": "Chloé Coordinator",
"role": "coordinator",
},
],
"id": "6",
"isPhysical": true,
"kind": "auditorium",
"name": "Self-Hosted Software devroom",
"slug": "selfhosting",
"talks": Map {
"14" => {
"auditoriumId": "6",
"dateTs": 1706745600000,
"endTime": 1706779800000,
"id": "14",
"livestream_endTime": 1706779800000,
"prerecorded": false,
"qa_startTime": 0,
"speakers": [
{
"email": "tysnr@localhost",
"id": "42",
"matrix_id": "",
"name": "Yasunori Takeda",
"role": "speaker",
},
{
"email": "chloe@example.org",
"id": "246",
"matrix_id": "@chloe:example.org",
"name": "Chloé Coordinator",
"role": "coordinator",
},
],
"startTime": 1706779800000,
"subtitle": "",
"title": "A new architecture for Local-First Computing without boundaries",
},
"19" => {
"auditoriumId": "6",
"dateTs": 1706745600000,
"endTime": 1706783400000,
"id": "19",
"livestream_endTime": 1706783400000,
"prerecorded": false,
"qa_startTime": 0,
"speakers": [
{
"email": "vivaldo@localhost",
"id": "94",
"matrix_id": "@vivaldo:example.org",
"name": "Vivaldo Corradetti",
"role": "speaker",
},
{
"email": "chloe@example.org",
"id": "246",
"matrix_id": "@chloe:example.org",
"name": "Chloé Coordinator",
"role": "coordinator",
},
],
"startTime": 1706783400000,
"subtitle": "",
"title": "Devising a Blended Federation Topology that reaches Cosmique Perfection",
},
},
},
"7" => {
"extraPeople": [
{
"email": "bert@example.org",
"id": "0",
"matrix_id": "@bert:example.org",
"name": "Bert Boss",
"role": "coordinator",
},
],
"id": "7",
"isPhysical": true,
"kind": "auditorium",
"name": "Keynotes (TALKS NOT ANNOUNCED YET)",
"slug": "key_notes",
"talks": Map {},
},
}
`;

exports[`JsonScheduleBackend can parse a FOSDEM JSON format: talks 1`] = `
Map {
"3" => {
"auditoriumId": "5",
"dateTs": 1706745600000,
"endTime": 1706778000000,
"id": "3",
"livestream_endTime": 1706778000000,
"prerecorded": false,
"qa_startTime": 0,
"speakers": [
{
"email": "ioferrell@localhost",
"id": "4",
"matrix_id": "",
"name": "Iarlaith O'Ferrell",
"role": "speaker",
},
{
"email": "niamh@localhost",
"id": "5",
"matrix_id": "",
"name": "Niamh O'Donnellan",
"role": "speaker",
},
{
"email": "conal@example.org",
"id": "1",
"matrix_id": "@conal:example.org",
"name": "Conal Cördinator",
"role": "coordinator",
},
],
"startTime": 1706778000000,
"subtitle": "",
"title": "Panacea3D: The Final Word in Open Source 3D Solid Modelling",
},
"14" => {
"auditoriumId": "6",
"dateTs": 1706745600000,
"endTime": 1706779800000,
"id": "14",
"livestream_endTime": 1706779800000,
"prerecorded": false,
"qa_startTime": 0,
"speakers": [
{
"email": "tysnr@localhost",
"id": "42",
"matrix_id": "",
"name": "Yasunori Takeda",
"role": "speaker",
},
{
"email": "chloe@example.org",
"id": "246",
"matrix_id": "@chloe:example.org",
"name": "Chloé Coordinator",
"role": "coordinator",
},
],
"startTime": 1706779800000,
"subtitle": "",
"title": "A new architecture for Local-First Computing without boundaries",
},
"19" => {
"auditoriumId": "6",
"dateTs": 1706745600000,
"endTime": 1706783400000,
"id": "19",
"livestream_endTime": 1706783400000,
"prerecorded": false,
"qa_startTime": 0,
"speakers": [
{
"email": "vivaldo@localhost",
"id": "94",
"matrix_id": "@vivaldo:example.org",
"name": "Vivaldo Corradetti",
"role": "speaker",
},
{
"email": "chloe@example.org",
"id": "246",
"matrix_id": "@chloe:example.org",
"name": "Chloé Coordinator",
"role": "coordinator",
},
],
"startTime": 1706783400000,
"subtitle": "",
"title": "Devising a Blended Federation Topology that reaches Cosmique Perfection",
},
}
`;
Loading
Loading