Skip to content
Open

Stuff #1307

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,19 @@ jobs:
npx turbo build build-library
env:
NODE_ENV: production
- name: Lint and type-check
# - name: Lint and type-check
# run: |
# npx turbo lint type-check
# - name: Validate Grats generated files are up-to-date
# run: ./scripts/validate-grats.sh
- name: Run db tests manually
run: |
npx turbo lint type-check
- name: Validate Grats generated files are up-to-date
run: ./scripts/validate-grats.sh
cd packages/skin-database
pnpm run test
env:
NODE_ENV: test
- name: Run tests
run: |
touch packages/skin-database/config.js
npx turbo test --no-cache -- --maxWorkers=2
env:
NODE_ENV: test
Expand Down
1 change: 1 addition & 0 deletions packages/skin-database/__mocks__/algolia.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
console.log("RAN ALGOLIA MOCK");
export const client = {
partialUpdateObjects: jest.fn(),
};
2 changes: 2 additions & 0 deletions packages/skin-database/algolia.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { algoliasearch } from "algoliasearch";
import { ALGOLIA_ACCOUNT, ALGOLIA_KEY } from "./config";

console.log("RAN ALGOLIA", ALGOLIA_ACCOUNT, ALGOLIA_KEY);

export const client = algoliasearch(ALGOLIA_ACCOUNT, ALGOLIA_KEY);
3 changes: 3 additions & 0 deletions packages/skin-database/api/__tests__/graphql.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
console.log("RAN GRAPHQL TESTS");
import { knex } from "../../db";
import SkinModel from "../../data/SkinModel";
import * as S3 from "../../s3";
import { processUserUploads } from "../processUserUploads";
import UserContext from "../../data/UserContext";
import { client } from "../../algolia";
console.log("RAN GRAPHQL TESTS ALGOLIA IMPORT");
import { createYogaInstance } from "../../app/graphql/yoga";
import { YogaServerInstance } from "graphql-yoga";
jest.mock("../../s3");
jest.mock("../../algolia");
console.log("RAN GRAPHQL TESTS ALGOLIA MOCK");
jest.mock("../processUserUploads");
jest.mock("../auth");

Expand Down
2 changes: 2 additions & 0 deletions packages/skin-database/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export const INSTAGRAM_ACCOUNT_ID = env("INSTAGRAM_ACCOUNT_ID");
export const SECRET = env("SECRET");
export const NODE_ENV = env("NODE_ENV") || "production";

console.log("RAN CONFIG", ALGOLIA_ACCOUNT);

function env(key: string): string {
const value = process.env[key];
if (!value) {
Expand Down
1 change: 1 addition & 0 deletions packages/skin-database/data/skins.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ALGOLIA_INDEX } from "../config";
console.log("RAN skins.ts", ALGOLIA_INDEX);
import { knex } from "../db";
import path from "path";
import md5Hash from "md5";
Expand Down
1 change: 0 additions & 1 deletion packages/skin-database/discord-bot/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
config.js
node_modules/
4 changes: 4 additions & 0 deletions packages/skin-database/jest-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { TextEncoder, TextDecoder } from "util";
global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder;

// eslint-disable-next-line no-constant-condition

// In the real app, these are set via .env
process.env.LOCAL_FILE_CACHE = "<DUMMY>";
process.env.CLOUDFLARE_PURGE_AUTH_KEY = "<DUMMY_CLOUDFLARE_PURGE_AUTH_KEY>";
Expand Down Expand Up @@ -31,3 +33,5 @@ process.env.INSTAGRAM_ACCESS_TOKEN = "<DUMMY>";
process.env.INSTAGRAM_ACCOUNT_ID = "<DUMMY>";
process.env.MASTODON_ACCESS_TOKEN = "<DUMMY>";
process.env.SECRET = "<DUMMY>";

console.log("RAN JEST SETUP", process.env.ALGOLIA_INDEX);
Loading