Compare commits

...

3 Commits

Author SHA1 Message Date
28ec1bb0d6 Switch to line reporter and preset Chromium path
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2026-01-19 15:19:10 -08:00
9781695929 Add initial draft of flake.nix
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2026-01-19 15:18:53 -08:00
69783ca88a Just commit the list of pages
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2026-01-19 15:17:26 -08:00
6 changed files with 168 additions and 9 deletions

77
e2e/pages.ts Normal file
View File

@@ -0,0 +1,77 @@
export const pages = [
"http://localhost:8081/about",
"http://localhost:8081/blog/00_aoc_coq/index.html",
"http://localhost:8081/blog/00_compiler_intro/index.html",
"http://localhost:8081/blog/00_cs325_languages_hw1/index.html",
"http://localhost:8081/blog/00_spa_agda_intro/index.html",
"http://localhost:8081/blog/01_aoc_coq/index.html",
"http://localhost:8081/blog/01_compiler_tokenizing/index.html",
"http://localhost:8081/blog/01_cs325_languages_hw2/index.html",
"http://localhost:8081/blog/01_learning_emulation/index.html",
"http://localhost:8081/blog/01_spa_agda_lattices/index.html",
"http://localhost:8081/blog/02_compiler_parsing/index.html",
"http://localhost:8081/blog/02_cs325_languages_hw3/index.html",
"http://localhost:8081/blog/02_learning_emulation/index.html",
"http://localhost:8081/blog/02_spa_agda_combining_lattices/index.html",
"http://localhost:8081/blog/03_compiler_typechecking/index.html",
"http://localhost:8081/blog/03_learning_emulation/index.html",
"http://localhost:8081/blog/03_spa_agda_fixed_height/index.html",
"http://localhost:8081/blog/04_compiler_improvements/index.html",
"http://localhost:8081/blog/04_spa_agda_fixedpoint/index.html",
"http://localhost:8081/blog/05_compiler_execution/index.html",
"http://localhost:8081/blog/05_spa_agda_semantics/index.html",
"http://localhost:8081/blog/06_compiler_compilation/index.html",
"http://localhost:8081/blog/06_spa_agda_cfg/index.html",
"http://localhost:8081/blog/07_compiler_runtime/index.html",
"http://localhost:8081/blog/07_spa_agda_semantics_and_cfg/index.html",
"http://localhost:8081/blog/08_compiler_llvm/index.html",
"http://localhost:8081/blog/08_spa_agda_forward/index.html",
"http://localhost:8081/blog/09_compiler_garbage_collection/index.html",
"http://localhost:8081/blog/09_spa_agda_verified_forward/index.html",
"http://localhost:8081/blog/10_compiler_polymorphism/index.html",
"http://localhost:8081/blog/11_compiler_polymorphic_data_types/index.html",
"http://localhost:8081/blog/12_compiler_let_in_lambda/index.html",
"http://localhost:8081/blog/13_compiler_cleanup/index.html",
"http://localhost:8081/blog/agda_expr_pattern/index.html",
"http://localhost:8081/blog/agda_hugo/index.html",
"http://localhost:8081/blog/agda_is_pattern/index.html",
"http://localhost:8081/blog/backend_math_rendering/index.html",
"http://localhost:8081/blog/bergamot/index.html",
"http://localhost:8081/blog/better_explanations/index.html",
/* "http://localhost:8081/blog/blog_microfeatures/index.html", has a gif, animation breaks it */
"http://localhost:8081/blog/blog_with_nix/index.html",
"http://localhost:8081/blog/boolean_values/index.html",
"http://localhost:8081/blog/chapel_runtime_types/index.html",
"http://localhost:8081/blog/chapel_x_macros/index.html",
"http://localhost:8081/blog/codelines/index.html",
"http://localhost:8081/blog/coq_dawn/index.html",
"http://localhost:8081/blog/coq_dawn_eval/index.html",
"http://localhost:8081/blog/coq_palindrome/index.html",
"http://localhost:8081/blog/crystal_nix/index.html",
"http://localhost:8081/blog/crystal_nix_revisited/index.html",
"http://localhost:8081/blog/crystal_on_arm/index.html",
"http://localhost:8081/blog/dell_is_horrible/index.html",
"http://localhost:8081/blog/dyno_alloy/index.html",
"http://localhost:8081/blog/haskell_catamorphisms/index.html",
"http://localhost:8081/blog/haskell_language_server/index.html",
"http://localhost:8081/blog/haskell_language_server_again/index.html",
"http://localhost:8081/blog/haskell_lazy_evaluation/index.html",
"http://localhost:8081/blog/hugo_functions/index.html",
/* "http://localhost:8081/blog/index.html", new posts break this test */
/* "http://localhost:8081/blog/introducing_highlight/index.html", the embed is flaky */
"http://localhost:8081/blog/jos_local/index.html",
"http://localhost:8081/blog/lambda_calculus_integers/index.html",
"http://localhost:8081/blog/math_rendering_is_wrong/index.html",
/* "http://localhost:8081/blog/modulo_patterns/index.html", has a gif, animation breaks it */
"http://localhost:8081/blog/new_look/index.html",
"http://localhost:8081/blog/search_polynomials/index.html",
"http://localhost:8081/blog/sidenotes/index.html",
"http://localhost:8081/blog/stack_recursion/index.html",
"http://localhost:8081/blog/starbound/index.html",
"http://localhost:8081/blog/static_site/index.html",
"http://localhost:8081/blog/typesafe_imperative_lang/index.html",
"http://localhost:8081/blog/typesafe_interpreter/index.html",
"http://localhost:8081/blog/typesafe_interpreter_revisited/index.html",
"http://localhost:8081/blog/typesafe_interpreter_tuples/index.html",
"http://localhost:8081/blog/typescript_typesafe_events/index.html",
]

45
flake.nix Normal file
View File

@@ -0,0 +1,45 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
flake-utils.url = "github:numtide/flake-utils";
blog.url = "git+https://dev.danilafe.com/Nix-Configs/blog-static-flake.git";
blog.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, flake-utils, blog, }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit system; };
builtBlog = blog.defaultPackage.${system};
in {
devShell = pkgs.mkShell {
packages = [
pkgs.nodejs
pkgs.yarn
pkgs.chromium
builtBlog
];
nativeBuildInputs = [ pkgs.yarnConfigHook ];
# Must be named this for pkgs.yarnConfigHook
yarnOfflineCache = pkgs.fetchYarnDeps {
yarnLock = ./yarn.lock;
hash = "sha256-jUa1XkxJ2dS6nTyH/gRrTkEedSUgcl7k6wd3OiCkj6A=";
};
# Configure to use system Chromium
PLAYWRIGHT_CHROMIUM_PATH = "${pkgs.chromium}/bin/chromium";
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = "1";
# Expose the built blog package, which we'll be testing
builtBlog = builtBlog;
# Optional but often needed in Nix sandboxes:
# XDG_CACHE_HOME = "$TMPDIR/xdg-cache";
# XDG_CONFIG_HOME = "$TMPDIR/xdg-config";
# XDG_DATA_HOME = "$TMPDIR/xdg-data";
};
}
);
}

View File

@@ -1,8 +0,0 @@
function cleanurls { for result in $(find . -name "result-*"); do; (cd $result; python3 ../chatgpt-fix-root-URLs.py); done; }
function htmls { find -s result-$1/blog -name "*.html" | sed "s|^result-$1/|http://localhost:8081/|" | awk 'BEGIN { print "export const pages = [" } { printf(" \"%s\",\n", $0); } END { print "]" }'; }
function commonhtmls { comm -12 <(htmls $1) <(htmls $2); }
function compare {
commonhtmls $1 $2 > e2e/pages.ts;
# (cd result-$1 && python -m http.server 8081 & SERVER_PID=$! && trap "kill $SERVER_PID" EXIT && sleep 1 && cd .. && npx playwright test);
(cd result-$2 && python -m http.server 8081 & SERVER_PID=$! && trap "kill $SERVER_PID" EXIT && sleep 1 && cd .. && npx playwright test);
}

View File

@@ -22,7 +22,7 @@ export default defineConfig({
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : 1,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
reporter: 'line',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
@@ -33,6 +33,10 @@ export default defineConfig({
animations: 'disabled',
colorScheme: 'light',
launchOptions: {
executablePath: process.env.PLAYWRIGHT_CHROMIUM_PATH
},
},
expect: {

41
yarn.lock Normal file
View File

@@ -0,0 +1,41 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@playwright/test@^1.51.1":
version "1.57.0"
resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.57.0.tgz#a14720ffa9ed7ef7edbc1f60784fc6134acbb003"
integrity sha512-6TyEnHgd6SArQO8UO2OMTxshln3QMWBtPGrOCgs3wVEmQmwyuNtB10IZMfmYDE0riwNR1cu4q+pPcxMVtaG3TA==
dependencies:
playwright "1.57.0"
"@types/node@^22.14.0":
version "22.19.7"
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.19.7.tgz#434094ee1731ae76c16083008590a5835a8c39c1"
integrity sha512-MciR4AKGHWl7xwxkBa6xUGxQJ4VBOmPTF7sL+iGzuahOFaO0jHCsuEfS80pan1ef4gWId1oWOweIhrDEYLuaOw==
dependencies:
undici-types "~6.21.0"
fsevents@2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
playwright-core@1.57.0:
version "1.57.0"
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.57.0.tgz#3dcc9a865af256fa9f0af0d67fc8dd54eecaebf5"
integrity sha512-agTcKlMw/mjBWOnD6kFZttAAGHgi/Nw0CZ2o6JqWSbMlI219lAFLZZCyqByTsvVAJq5XA5H8cA6PrvBRpBWEuQ==
playwright@1.57.0, playwright@^1.51.1:
version "1.57.0"
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.57.0.tgz#74d1dacff5048dc40bf4676940b1901e18ad0f46"
integrity sha512-ilYQj1s8sr2ppEJ2YVadYBN0Mb3mdo9J0wQ+UuDhzYqURwSoW4n1Xs5vs7ORwgDGmyEh33tRMeS8KhdkMoLXQw==
dependencies:
playwright-core "1.57.0"
optionalDependencies:
fsevents "2.3.2"
undici-types@~6.21.0:
version "6.21.0"
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.21.0.tgz#691d00af3909be93a7faa13be61b3a5b50ef12cb"
integrity sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==