Skip to content

Commit

Permalink
chore: fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Goldziher committed Oct 20, 2023
1 parent cb35efd commit aab01f3
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 31 deletions.
1 change: 1 addition & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ test_patterns = [
"**/mocks/**",
"**/test/**",
"**/tests/**",
"**/testutils/**",
"**/vitest.*",
"vitest.*",
]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- 'gradle/**'
- 'sdks/android/**'
env:
DEEPSOURCE_DSN: ${{secrets:DEEPSOURCE_DSN}}
DEEPSOURCE_DSN: ${{secrets.DEEPSOURCE_DSN}}
jobs:
test:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
GCP_SERVICE_ACCOUNT_NAME: firebase-adminsdk-frgvx
GCP_WORKLOAD_IDENTITY_POOL: dev-pool
TEST_SLEEP_TIMEOUT: 1s
DEEPSOURCE_DSN: ${{secrets:DEEPSOURCE_DSN}}
DEEPSOURCE_DSN: ${{secrets.DEEPSOURCE_DSN}}
jobs:
test:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-ts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
- 'vitest.*'
env:
NODE_OPTIONS: '--max_old_space_size=4096'
DEEPSOURCE_DSN: ${{secrets:DEEPSOURCE_DSN}}
DEEPSOURCE_DSN: ${{secrets.DEEPSOURCE_DSN}}
jobs:
test:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/api/projects-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ export async function handleCreateProject({
data: ProjectCreateBody;
}): Promise<Project> {
return await fetcher<Project>({
url: `projects`,
url: 'projects',
method: HttpMethod.Post,
data,
});
}

export async function handleRetrieveProjects(): Promise<Project[]> {
return await fetcher<Project[]>({
url: `projects`,
url: 'projects',
method: HttpMethod.Get,
});
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/projects/[projectId]/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function Dashboard({
}, []);

if (!project) {
return;
return null;
}

return (
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/projects/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function Projects() {
const retrievedProjects = await handleRetrieveProjects();
if (retrievedProjects.length === 0) {
router.replace(Navigation.CreateProject);
return;
return null;
}
const [{ id: projectId }] = retrievedProjects;
setProjects(retrievedProjects);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/sign-in/firebase-login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function FirebaseLogin() {
if (auth.currentUser) {
setUser(auth.currentUser);
router.replace(Navigation.Projects);
return;
return null;
}

const firebaseUI = await import('firebaseui');
Expand Down
4 changes: 2 additions & 2 deletions frontend/tests/api/projects-api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('Projects', () => {

expect(data).toEqual(project);
expect(mockFetch).toHaveBeenCalledWith(
new URL(`http://www.example.com/v1/projects`),
new URL('http://www.example.com/v1/projects'),
{
headers: {
'Authorization': 'Bearer test_token',
Expand All @@ -56,7 +56,7 @@ describe('Projects', () => {

expect(data).toEqual(projects);
expect(mockFetch).toHaveBeenCalledWith(
new URL(`http://www.example.com/v1/projects`),
new URL('http://www.example.com/v1/projects'),
{
headers: {
'Authorization': 'Bearer test_token',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package ai.basemind.client

/**
* Abstract base exception for all BaseMind exceptions.
* Base exception for all BaseMind exceptions.
*/
abstract class BaseMindException(message: String, cause: Throwable? = null) : Exception(message, cause)
class BaseMindException(message: String, cause: Throwable? = null) : Exception(message, cause)

/**
* Thrown when the API key is an empty string.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,15 @@ import ai.basemind.grpc.APIGatewayServiceGrpcKt
import ai.basemind.grpc.PromptRequest
import ai.basemind.grpc.PromptResponse
import ai.basemind.grpc.StreamingPromptResponse
import io.grpc.Context
import io.grpc.Contexts
import io.grpc.ManagedChannel
import io.grpc.Metadata
import io.grpc.ServerCall
import io.grpc.ServerCallHandler
import io.grpc.ServerInterceptor
import io.grpc.ServerInterceptors
import io.grpc.StatusException
import io.grpc.*
import io.grpc.inprocess.InProcessChannelBuilder
import io.grpc.inprocess.InProcessServerBuilder
import io.grpc.testing.GrpcCleanupRule
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.asFlow
import kotlinx.coroutines.test.runTest
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.Assertions.assertDoesNotThrow
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertFalse
import org.junit.jupiter.api.Assertions.assertNotEquals
import org.junit.jupiter.api.Assertions.assertThrows
import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
Expand Down Expand Up @@ -82,14 +69,14 @@ class MockAPIGatewayServer : APIGatewayServiceGrpcKt.APIGatewayServiceCoroutineI

override suspend fun requestPrompt(request: PromptRequest): PromptResponse {
if (exc != null) {
throw exc!!
throw exc!! // skipcq: KT-E1010
}
return PromptResponse.newBuilder().setContent("test prompt").build()
}

override fun requestStreamingPrompt(request: PromptRequest): Flow<StreamingPromptResponse> {
if (exc != null) {
throw exc!!
throw exc!! // skipcq: KT-E1010
}
return arrayOf("1", "2", "3").map {
StreamingPromptResponse.newBuilder().setContent(it).build()
Expand Down
2 changes: 1 addition & 1 deletion shared/go/grpcutils/grpcutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func CreateGRPCServer(opts Options, serverOpts ...grpc.ServerOption) *grpc.Serve
)
}

server := grpc.NewServer(serverOpts...)
server := grpc.NewServer(serverOpts...) // skipcq: GO-S0902

for _, registrar := range opts.ServiceRegistrars {
registrar(server)
Expand Down
2 changes: 1 addition & 1 deletion shared/go/testutils/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func CreateTestGRPCServer[T any](

go func() {
if err := server.Serve(listen); err != nil {
log.Fatalf("error serving test gRPC server: %v", err)
log.Fatalf("error serving test gRPC server: %v", err) // skipcq: RVV-A0003
}
}()

Expand Down

0 comments on commit aab01f3

Please sign in to comment.