Skip to content

Commit

Permalink
Speed up e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jmduke committed Sep 9, 2024
1 parent e576a03 commit c9fb412
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
4 changes: 3 additions & 1 deletion app/domain/[domain]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ export default async function Page({
};
}) {
const data = await fetch(params.domain);
await reify(params.domain, data);
if (!process.env.DISABLE_DATABASE) {
await reify(params.domain, data);
}

return (
<div className="">
Expand Down
10 changes: 7 additions & 3 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ export const metadata = {
};

export default async function Home() {
const data = await db
.selectFrom("detected_technologies")
.select(db.fn.countAll<number>().as("count"))
const data = process.env.DISABLE_DATABASE
? [{
count: 0
}]
: await db
.selectFrom("detected_technologies")
.select(db.fn.countAll<number>().as("count"))
.execute();

return (
Expand Down
8 changes: 5 additions & 3 deletions app/technology/[identifier]/and/[subidentifier]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ export default async function TechnologyAndPage({
return { data: data.slice(0, PAGE_SIZE), hasMore, total };
});

const technologyCounts = await db
.selectFrom("detected_technologies")
.where(
const technologyCounts = process.env.DISABLE_DATABASE
? []
: await db
.selectFrom("detected_technologies")
.where(
"domain",
"in",
db
Expand Down

0 comments on commit c9fb412

Please sign in to comment.