Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(profile-ui): r2-b1 keep discovery tests in image context

Josuéb60d7097f4c8
diff --git a/.github/workflows/ci-public.yml b/.github/workflows/ci-public.yml
index 9f1b8da45..2250d3e80 100644
--- a/.github/workflows/ci-public.yml
+++ b/.github/workflows/ci-public.yml
@@ -122,6 +122,10 @@ jobs:
working-directory: ${{ matrix.service }}
run: npm run build
+ - name: Build Profile UI image builder stage
+ if: matrix.service == 'profile-ui'
+ run: timeout 900s docker build --target builder -f profile-ui/Dockerfile .
+
- name: Install Playwright Chromium
if: matrix.service == 'desktop-app'
working-directory: desktop-app
diff --git a/profile-ui/app/components/__tests__/ProfilePortalHome.test.tsx b/profile-ui/app/components/__tests__/ProfilePortalHome.test.tsx
index b7eafe7cd..c6feeaa31 100644
--- a/profile-ui/app/components/__tests__/ProfilePortalHome.test.tsx
+++ b/profile-ui/app/components/__tests__/ProfilePortalHome.test.tsx
@@ -1,29 +1,17 @@
import React from 'react'
-import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import '@testing-library/jest-dom/vitest'
import { cleanup, render, screen } from '@testing-library/react'
import { buildDesktopEnvironmentLink } from '@lib/desktopAppLinks'
import type { DesktopEnvironmentResponse } from '@/app/types/api'
-import { buildDesktopEnvironmentResponse } from '../../../../external-rest-api/src/routes/desktopEnvironmentResponse.js'
+import desktopEnvironmentFixture from '@/test/fixtures/desktop-environment-response.json'
import Page from '../../page'
const api = vi.hoisted(() => ({
getDesktopEnvironment: vi.fn(),
}))
-const originalDesktopEnvironmentConfig = {
- appName: process.env.EXTERNAL_REST_API_DESKTOP_APP_NAME,
- externalRestApiBaseUrl: process.env.EXTERNAL_REST_API_PUBLIC_BASE_URL,
- rpcProxyBaseUrl: process.env.EXTERNAL_REST_API_DESKTOP_RPC_PROXY_BASE_URL,
-}
-
-function getDesktopEnvironmentFromProducer(): DesktopEnvironmentResponse {
- return buildDesktopEnvironmentResponse({
- desktopAppName: process.env.EXTERNAL_REST_API_DESKTOP_APP_NAME ?? '',
- publicBaseUrl: process.env.EXTERNAL_REST_API_PUBLIC_BASE_URL ?? '',
- desktopRpcProxyBaseUrl: process.env.EXTERNAL_REST_API_DESKTOP_RPC_PROXY_BASE_URL ?? '',
- })
-}
+const desktopEnvironment: DesktopEnvironmentResponse = desktopEnvironmentFixture
vi.mock('@lib/api', () => ({
getDesktopEnvironment: api.getDesktopEnvironment,
@@ -55,35 +43,9 @@ vi.mock('next/link', () => ({
),
}))
-beforeAll(() => {
- process.env.EXTERNAL_REST_API_PUBLIC_BASE_URL = 'https://api.example.com'
- process.env.EXTERNAL_REST_API_DESKTOP_RPC_PROXY_BASE_URL = 'https://rpc.example.com/'
- process.env.EXTERNAL_REST_API_DESKTOP_APP_NAME = 'Example Tenant'
-})
-
-afterAll(() => {
- if (originalDesktopEnvironmentConfig.externalRestApiBaseUrl === undefined) {
- delete process.env.EXTERNAL_REST_API_PUBLIC_BASE_URL
- } else {
- process.env.EXTERNAL_REST_API_PUBLIC_BASE_URL =
- originalDesktopEnvironmentConfig.externalRestApiBaseUrl
- }
- if (originalDesktopEnvironmentConfig.rpcProxyBaseUrl === undefined) {
- delete process.env.EXTERNAL_REST_API_DESKTOP_RPC_PROXY_BASE_URL
- } else {
- process.env.EXTERNAL_REST_API_DESKTOP_RPC_PROXY_BASE_URL =
- originalDesktopEnvironmentConfig.rpcProxyBaseUrl
- }
- if (originalDesktopEnvironmentConfig.appName === undefined) {
- delete process.env.EXTERNAL_REST_API_DESKTOP_APP_NAME
- } else {
- process.env.EXTERNAL_REST_API_DESKTOP_APP_NAME = originalDesktopEnvironmentConfig.appName
- }
-})
-
beforeEach(() => {
api.getDesktopEnvironment.mockReset()
- api.getDesktopEnvironment.mockImplementation(getDesktopEnvironmentFromProducer)
+ api.getDesktopEnvironment.mockImplementation(() => desktopEnvironment)
})
afterEach(cleanup)
@@ -123,7 +85,7 @@ describe('Profile Portal home desktop setup link', () => {
})
it('labels the environment setup handoff accurately', async () => {
- const environment = getDesktopEnvironmentFromProducer()
+ const environment = desktopEnvironment
api.getDesktopEnvironment.mockResolvedValue(environment)
render(<Page />)
@@ -139,7 +101,7 @@ describe('Profile Portal home desktop setup link', () => {
})
it('builds the setup link from the production discovery response', () => {
- const environment = getDesktopEnvironmentFromProducer()
+ const environment = desktopEnvironment
const href = buildDesktopEnvironmentLink(environment)
expect(href).not.toBeNull()
diff --git a/profile-ui/package-lock.json b/profile-ui/package-lock.json
index e86988ea2..8198e32ac 100644
--- a/profile-ui/package-lock.json
+++ b/profile-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-profile-ui",
- "version": "0.1.152",
+ "version": "0.1.153",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-profile-ui",
- "version": "0.1.152",
+ "version": "0.1.153",
"dependencies": {
"@clerum/desktop-app-links": "file:../packages/desktop-app-links",
"@clerum/frontend-components": "file:../packages/frontend-components",
diff --git a/profile-ui/package.json b/profile-ui/package.json
index 1754fdbef..b08228120 100644
--- a/profile-ui/package.json
+++ b/profile-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-profile-ui",
- "version": "0.1.152",
+ "version": "0.1.153",
"private": true,
"scripts": {
"dev": "next dev",
diff --git a/profile-ui/test/fixtures/desktop-environment-response.json b/profile-ui/test/fixtures/desktop-environment-response.json
new file mode 100644
index 000000000..4bd362582
--- /dev/null
+++ b/profile-ui/test/fixtures/desktop-environment-response.json
@@ -0,0 +1,5 @@
+{
+ "appName": "Example Tenant",
+ "externalRestApiBaseUrl": "https://api.example.com",
+ "rpcProxyBaseUrl": "https://rpc.example.com"
+}