Update stuff so we can pass build hopefully
This commit is contained in:
@@ -50,7 +50,7 @@ jobs:
|
||||
CI_ENV_FILE="$env_file" ./scripts/build-next-app staging
|
||||
- name: Tag and push image
|
||||
run: |
|
||||
docker tag spoon:latest git.gbrown.org/gib/spoon:${{ gitea.sha }}
|
||||
docker tag spoon:latest git.gbrown.org/gib/spoon:latest
|
||||
docker push git.gbrown.org/gib/spoon:${{ gitea.sha }}
|
||||
docker push git.gbrown.org/gib/spoon:latest
|
||||
docker tag spoon-next:latest git.gbrown.org/gib/spoon-next:${{ gitea.sha }}
|
||||
docker tag spoon-next:latest git.gbrown.org/gib/spoon-next:latest
|
||||
docker push git.gbrown.org/gib/spoon-next:${{ gitea.sha }}
|
||||
docker push git.gbrown.org/gib/spoon-next:latest
|
||||
|
||||
+2
-2
@@ -17,8 +17,8 @@ services:
|
||||
NEXT_PUBLIC_SENTRY_URL: ${NEXT_PUBLIC_SENTRY_URL}
|
||||
NEXT_PUBLIC_SENTRY_ORG: ${NEXT_PUBLIC_SENTRY_ORG}
|
||||
NEXT_PUBLIC_SENTRY_PROJECT_NAME: ${NEXT_PUBLIC_SENTRY_PROJECT_NAME}
|
||||
image: spoon:latest
|
||||
#image: git.gbrown.org/gib/spoon:latest
|
||||
image: spoon-next:latest
|
||||
#image: git.gbrown.org/gib/spoon-next:latest
|
||||
container_name: ${NEXT_CONTAINER_NAME}
|
||||
environment:
|
||||
- NODE_ENV=${NODE_ENV}
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
import { convexTest } from 'convex-test';
|
||||
import { makeFunctionReference } from 'convex/server';
|
||||
import { describe, expect, test } from 'vitest';
|
||||
|
||||
import { api } from '../../convex/_generated/api';
|
||||
import schema from '../../convex/schema';
|
||||
|
||||
const createManualSpoon = makeFunctionReference<'mutation'>(
|
||||
'spoons:createManual',
|
||||
);
|
||||
const listMySpoons = makeFunctionReference<'query'>('spoons:listMine');
|
||||
const getSpoon = makeFunctionReference<'query'>('spoons:get');
|
||||
const createAgentRequest = makeFunctionReference<'mutation'>(
|
||||
'agentRequests:create',
|
||||
);
|
||||
const modules = import.meta.glob('../../convex/**/*.*s');
|
||||
|
||||
const createUser = async (t: ReturnType<typeof convexTest>, email: string) =>
|
||||
@@ -41,9 +49,9 @@ describe('convex-test harness', () => {
|
||||
|
||||
test('requires authentication to create a Spoon', async () => {
|
||||
const t = convexTest(schema, modules);
|
||||
await expect(
|
||||
t.mutation(api.spoons.createManual, spoonInput),
|
||||
).rejects.toThrow('Not authenticated.');
|
||||
await expect(t.mutation(createManualSpoon, spoonInput)).rejects.toThrow(
|
||||
'Not authenticated.',
|
||||
);
|
||||
});
|
||||
|
||||
test('creates and lists Spoons for the current user', async () => {
|
||||
@@ -51,8 +59,8 @@ describe('convex-test harness', () => {
|
||||
const userId = await createUser(t, 'one@example.com');
|
||||
const session = authed(t, userId);
|
||||
|
||||
const spoonId = await session.mutation(api.spoons.createManual, spoonInput);
|
||||
const spoons = await session.query(api.spoons.listMine, {});
|
||||
const spoonId = await session.mutation(createManualSpoon, spoonInput);
|
||||
const spoons = await session.query(listMySpoons, {});
|
||||
|
||||
expect(spoons).toHaveLength(1);
|
||||
expect(spoons[0]?._id).toBe(spoonId);
|
||||
@@ -64,12 +72,12 @@ describe('convex-test harness', () => {
|
||||
const ownerId = await createUser(t, 'owner@example.com');
|
||||
const otherId = await createUser(t, 'other@example.com');
|
||||
const spoonId = await authed(t, ownerId).mutation(
|
||||
api.spoons.createManual,
|
||||
createManualSpoon,
|
||||
spoonInput,
|
||||
);
|
||||
|
||||
await expect(
|
||||
authed(t, otherId).query(api.spoons.get, { spoonId }),
|
||||
authed(t, otherId).query(getSpoon, { spoonId }),
|
||||
).rejects.toThrow('Spoon not found.');
|
||||
});
|
||||
|
||||
@@ -78,12 +86,12 @@ describe('convex-test harness', () => {
|
||||
const ownerId = await createUser(t, 'owner@example.com');
|
||||
const otherId = await createUser(t, 'other@example.com');
|
||||
const spoonId = await authed(t, ownerId).mutation(
|
||||
api.spoons.createManual,
|
||||
createManualSpoon,
|
||||
spoonInput,
|
||||
);
|
||||
|
||||
await expect(
|
||||
authed(t, otherId).mutation(api.agentRequests.create, {
|
||||
authed(t, otherId).mutation(createAgentRequest, {
|
||||
spoonId,
|
||||
prompt: 'Add a settings page',
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user