tests: disable blockrules youtube tests in CI (#698)

due to youtube being blocked, disable test involving youtube embeds when
running in CI for now
This commit is contained in:
Ilya Kreymer 2024-10-04 17:37:13 -07:00 committed by GitHub
parent 356b3f8d10
commit d497a424fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 5 deletions

View file

@ -64,10 +64,10 @@ jobs:
run: sudo pip install wacz run: sudo pip install wacz
- name: run all tests as root - name: run all tests as root
run: sudo DOCKER_HOST_NAME=172.17.0.1 yarn test -validate run: sudo DOCKER_HOST_NAME=172.17.0.1 CI=true yarn test -validate
- name: run saved state + qa compare test as non-root - with volume owned by current user - name: run saved state + qa compare test as non-root - with volume owned by current user
run: | run: |
sudo rm -rf ./test-crawls sudo rm -rf ./test-crawls
mkdir test-crawls mkdir test-crawls
sudo yarn test ./tests/saved-state.test.js ./tests/qa_compare.test.js sudo CI=true yarn test ./tests/saved-state.test.js ./tests/qa_compare.test.js

View file

@ -2,6 +2,9 @@ import child_process from "child_process";
import fs from "fs"; import fs from "fs";
import yaml from "js-yaml"; import yaml from "js-yaml";
const isCI = !!process.env.CI;
const testIf = (condition, ...args) => condition ? test(...args) : test.skip(...args);
function runCrawl(name, config, commandExtra = "") { function runCrawl(name, config, commandExtra = "") {
config.generateCDX = true; config.generateCDX = true;
config.depth = 0; config.depth = 0;
@ -63,7 +66,7 @@ test("test block rule on specific URL", () => {
).toBe(false); ).toBe(false);
}); });
test("test block rule based on iframe text, content included due to match", () => { testIf(!isCI, "test block rule based on iframe text, content included due to match", () => {
const config = { const config = {
url: "https://oembed.link/https://www.youtube.com/watch?v=aT-Up5Y4uRI", url: "https://oembed.link/https://www.youtube.com/watch?v=aT-Up5Y4uRI",
blockRules: [ blockRules: [
@ -116,7 +119,7 @@ test("test block rule based on iframe text, block matched", () => {
expect(checkVideo("block-4")).toBe(false); expect(checkVideo("block-4")).toBe(false);
}); });
test("test rule based on iframe text not matching, plus allowOnly iframe", () => { testIf(!isCI, "test rule based on iframe text not matching, plus allowOnly iframe", () => {
const config = { const config = {
url: "https://oembed.link/https://www.youtube.com/watch?v=aT-Up5Y4uRI", url: "https://oembed.link/https://www.youtube.com/watch?v=aT-Up5Y4uRI",
blockRules: [ blockRules: [
@ -161,7 +164,7 @@ test("test block url in frame url", () => {
).toBe(false); ).toBe(false);
}); });
test("test block rules complex example, block external urls on main frame, but not on youtube", () => { testIf(!isCI, "test block rules complex example, block external urls on main frame, but not on youtube", () => {
const config = { const config = {
seeds: ["https://archiveweb.page/en/troubleshooting/errors/"], seeds: ["https://archiveweb.page/en/troubleshooting/errors/"],
depth: "0", depth: "0",