Skip to content

Commit

Permalink
Detect dead slack invite links (#91)
Browse files Browse the repository at this point in the history
Signed-off-by: harupy <[email protected]>
  • Loading branch information
harupy authored Jul 31, 2024
1 parent b5d3dcb commit 06bfca8
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 2 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: E2E

on:
pull_request:
schedule:
# Run this job daily to detect dead slack invite links
- cron: "0 0 * * *"

jobs:
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- working-directory: website
run: yarn
- working-directory: website
run: yarn e2e-setup
- working-directory: website
run: yarn build
- working-directory: website
run: yarn e2e-test
3 changes: 3 additions & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# playwright
/test-results/
1 change: 1 addition & 0 deletions website/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const config: Config = {
{
redirects: [
{
// See https://slack.com/help/articles/201330256-Invite-new-members-to-your-workspace for how to create a new invite link
from: "/slack",
to: "https://join.slack.com/t/mlflow-users/shared_invite/zt-2nyy6x19s-iBUGKEBExnXXv0zQD28uWg",
},
Expand Down
5 changes: 4 additions & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"compile": "ts-node scripts/compile.ts && prettier --write src/posts.ts",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc"
"typecheck": "tsc",
"e2e-setup": "playwright install chromium",
"e2e-test": "playwright test"
},
"dependencies": {
"@docusaurus/core": "3.0.1",
Expand All @@ -31,6 +33,7 @@
"@docusaurus/module-type-aliases": "3.0.1",
"@docusaurus/tsconfig": "3.0.1",
"@docusaurus/types": "3.0.1",
"@playwright/test": "^1.45.3",
"@types/js-yaml": "^4.0.9",
"@types/node": "^20.10.5",
"js-yaml": "^4.1.0",
Expand Down
24 changes: 24 additions & 0 deletions website/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import type { PlaywrightTestConfig } from "@playwright/test";
import { devices } from "@playwright/test";

const config: PlaywrightTestConfig = {
testDir: "./tests",
use: {
baseURL: "http://localhost:3000",
},
projects: [
{
name: "chromium",
use: devices["Desktop Chrome"],
},
],
webServer: {
// Several docusaurus plugins are disabled in development.
// Use production build to enable them.
command: "yarn build && yarn serve",
port: 3000,
timeout: 30 * 1000, // 30 seconds
},
};

export default config;
14 changes: 14 additions & 0 deletions website/tests/slack.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { test, expect } from "@playwright/test";

test.describe("Slack", () => {
test.beforeEach(async ({ page }) => {
await page.goto("./");
});

test("Slack invite link is active", async ({ page }) => {
await page.goto("/slack");
const title = (await page.title()).toLocaleLowerCase();
expect(title).toContain("mlflow");
expect(title).toContain("join");
});
});
36 changes: 35 additions & 1 deletion website/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1506,7 +1506,7 @@
"@docusaurus/theme-search-algolia" "3.0.1"
"@docusaurus/types" "3.0.1"

"@docusaurus/[email protected]", "react-loadable@npm:@docusaurus/[email protected]":
"@docusaurus/[email protected]":
version "5.5.2"
resolved "https://registry.yarnpkg.com/@docusaurus/react-loadable/-/react-loadable-5.5.2.tgz#81aae0db81ecafbdaee3651f12804580868fa6ce"
integrity sha512-A3dYjdBGuy0IGT+wyLIGIKLRE+sAk1iNk0f1HjNDysO7u8lhL4N3VEm+FAubmJbAztn94F7MxBTPmnixbiyFdQ==
Expand Down Expand Up @@ -1797,6 +1797,13 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@playwright/test@^1.45.3":
version "1.45.3"
resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.45.3.tgz#22e9c38b3081d6674b28c6e22f784087776c72e5"
integrity sha512-UKF4XsBfy+u3MFWEH44hva1Q8Da28G6RFtR2+5saw+jgAFQV5yYnB1fu68Mz7fO+5GJF3wgwAIs0UelU8TxFrA==
dependencies:
playwright "1.45.3"

"@pnpm/config.env-replace@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz#ab29da53df41e8948a00f2433f085f54de8b3a4c"
Expand Down Expand Up @@ -4220,6 +4227,11 @@ fs.realpath@^1.0.0:
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==

[email protected]:
version "2.3.2"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==

fsevents@~2.3.2:
version "2.3.3"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
Expand Down Expand Up @@ -6479,6 +6491,20 @@ pkg-up@^3.1.0:
dependencies:
find-up "^3.0.0"

[email protected]:
version "1.45.3"
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.45.3.tgz#e77bc4c78a621b96c3e629027534ee1d25faac93"
integrity sha512-+ym0jNbcjikaOwwSZycFbwkWgfruWvYlJfThKYAlImbxUgdWFO2oW70ojPm4OpE4t6TAo2FY/smM+hpVTtkhDA==

[email protected]:
version "1.45.3"
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.45.3.tgz#75143f73093a6e1467f7097083d2f0846fb8dd2f"
integrity sha512-QhVaS+lpluxCaioejDZ95l4Y4jSFCsBvl2UZkpeXlzxmqS+aABr5c82YmfMHrL6x27nvrvykJAFpkzT2eWdJww==
dependencies:
playwright-core "1.45.3"
optionalDependencies:
fsevents "2.3.2"

postcss-calc@^8.2.3:
version "8.2.4"
resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-8.2.4.tgz#77b9c29bfcbe8a07ff6693dc87050828889739a5"
Expand Down Expand Up @@ -7003,6 +7029,14 @@ react-loadable-ssr-addon-v5-slorber@^1.0.1:
dependencies:
"@babel/runtime" "^7.10.3"

"react-loadable@npm:@docusaurus/[email protected]":
version "5.5.2"
resolved "https://registry.yarnpkg.com/@docusaurus/react-loadable/-/react-loadable-5.5.2.tgz#81aae0db81ecafbdaee3651f12804580868fa6ce"
integrity sha512-A3dYjdBGuy0IGT+wyLIGIKLRE+sAk1iNk0f1HjNDysO7u8lhL4N3VEm+FAubmJbAztn94F7MxBTPmnixbiyFdQ==
dependencies:
"@types/react" "*"
prop-types "^15.6.2"

react-router-config@^5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/react-router-config/-/react-router-config-5.1.1.tgz#0f4263d1a80c6b2dc7b9c1902c9526478194a988"
Expand Down

0 comments on commit 06bfca8

Please sign in to comment.