Skip to content

Commit

Permalink
checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
dionjwa committed Oct 27, 2024
1 parent 27e8027 commit 8a28544
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"files.exclude": {
"**/.cache": true,
"**/.certs": true,
"**/deploy2": true,
"**/deploy": true,
"**/dist": true,
"**/node_modules": true,
"**/static/metapage": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default function MetaframePage(props: PageProps<VersionProps>) {
<Head>
<meta charset="UTF-8" />
<title>Metapage test {testname} @ version: {displayVersion}</title>
<script src="https://unpkg.com/compare-versions/lib/umd/index.js"></script>
</Head>
<main>
<p>Metapage test {testname} @ version: {displayVersion}</p>
Expand Down
8 changes: 7 additions & 1 deletion app/worker/src/static/metapage-test-compatibility.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Download the specific metaPAGE library version
// to make it easier to test all versions against all
const { compareVersions } = window.compareVersions
const url = new URL(window.location.href);
console.log(`url: ${url}`);
const urlPathElements = url.pathname.split("/").filter((e) =>
Expand Down Expand Up @@ -487,8 +488,13 @@ VERSIONS_METAFRAME.forEach((versionMetaframe, index) => {

// set the Metapage class into the window object for easier manipulation later
globalThis.Metapage = Metapage;
let metapageInstance;
if (version === "latest" || compareVersions(version, "1.0.0") >= 0) {
metapageInstance = await Metapage.from(metaPageDefinition);
} else {
metapageInstance = Metapage.from(metaPageDefinition);
}

const metapageInstance = Metapage.from(metaPageDefinition);
globalThis.metapageInstance = metapageInstance;

if (debug) {
Expand Down
11 changes: 7 additions & 4 deletions app/worker/test/src/run-tests-in-astral.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
*
*/

import { launch } from "jsr:@astral/astral";import { exists } from "https://deno.land/std/fs/mod.ts";
import { parse } from "https://deno.land/std/flags/mod.ts";
import { delay } from "https://deno.land/std/async/delay.ts";
import { compareVersions } from 'compare-versions';
import { delay } from 'https://deno.land/std/async/delay.ts';
import { parse } from 'https://deno.land/std/flags/mod.ts';
import { launch } from 'jsr:@astral/astral';

const flags = parse(Deno.args);

Expand Down Expand Up @@ -161,7 +162,9 @@ const getMetapageTestUrl = (version: string) => {

const getMetapageVersions = async () :Promise<string[]> => {
const resp = await fetch(`${serverOrigin}/versions/metapages/metapage`);
const versions = await resp.json();
let versions = await resp.json();
// remove versions we know don't pass
versions = versions.filter((v: string) => compareVersions(v, "0.16.2") > 0);
return versions;
};

Expand Down

0 comments on commit 8a28544

Please sign in to comment.