Skip to content

Commit

Permalink
Merge pull request #105 from rtjord/dev
Browse files Browse the repository at this point in the history
Fix frontend
  • Loading branch information
jwai01 authored Dec 9, 2024
2 parents 6829f95 + d5350da commit 156b028
Show file tree
Hide file tree
Showing 24 changed files with 3,190 additions and 3,327 deletions.
115 changes: 57 additions & 58 deletions backend/layers/dependencies/nodejs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion backend/open_api/ece461_fall_2024_openapi_spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ info:
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: https://dev.teamfivepackages.com
description: Development Server
paths:
/packages:
post:
Expand Down Expand Up @@ -128,6 +131,9 @@ paths:
$ref: '#/components/schemas/PackageID'
in: path
required: true
examples:
ExampleID:
value: "{id}" # Dynamic placeholder for Restler
responses:
"200":
content:
Expand Down Expand Up @@ -180,7 +186,6 @@ paths:
operationId: PackageRetrieve
summary: Interact with the package with this ID. (BASELINE)
description: Return this package.
operationId: PackageRecommend
post:
requestBody:
content:
Expand Down Expand Up @@ -353,6 +358,9 @@ paths:
$ref: '#/components/schemas/PackageID'
in: path
required: true
examples:
ExampleID:
value: "{id}" # Dynamic placeholder for Restler
- name: X-Authorization
description: ""
schema:
Expand Down Expand Up @@ -403,6 +411,9 @@ paths:
$ref: '#/components/schemas/PackageID'
in: path
required: true
examples:
ExampleID:
value: "{id}" # Dynamic placeholder for Restler
- name: dependency
schema:
type: boolean
Expand Down
4 changes: 2 additions & 2 deletions backend/src/common/__tests__/zip.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ describe("File Operations and Compression Functions", () => {

describe("cloneAndZipRepository", () => {
it("should clone a repository and zip it", async () => {
const repoUrl = "https://github.com/isomorphic-git/isomorphic-git"; // Use a real repo URL
const repoUrl = "https://github.com/thejoshwolfe/yazl"; // Use a real repo URL
const zipBuffer = await cloneAndZipRepository(repoUrl);

const zip = await JSZip.loadAsync(zipBuffer);
const files = Object.keys(zip.files);

expect(files).toContain("README.md");
});
}, 60000);
});

describe("zipDirectory", () => {
Expand Down
1 change: 1 addition & 0 deletions backend/src/handlers/RegistryReset/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { APIGatewayProxyHandler } from "aws-lambda";
import { S3Client } from "@aws-sdk/client-s3";
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
import { DynamoDBDocumentClient } from "@aws-sdk/lib-dynamodb";

const commonPath = process.env.COMMON_PATH || '/opt/nodejs/common';
const { getEnvVariable } = require(`${commonPath}/utils`);
const { clearDynamoDBTable } = require(`${commonPath}/dynamodb`);
Expand Down
4 changes: 2 additions & 2 deletions backend/src/handlers/__tests__/end_to_end/getCost.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe("E2E Test for Get Cost Endpoint", () => {
let circular2_id: string;
beforeAll(async () => {
// Reset the registry before running the tests
await axios.delete(`${baseUrl}/reset`);
await axios.delete(`${baseUrl}/reset`, { timeout: 60000 });

// Upload yazl to the registry
const requestBody: PackageData = {
Expand Down Expand Up @@ -59,7 +59,7 @@ describe("E2E Test for Get Cost Endpoint", () => {
}, 90000);
afterAll(async () => {
// Reset the registry after running the tests
await axios.delete(`${baseUrl}/reset`);
await axios.delete(`${baseUrl}/reset`, { timeout: 60000 });
}, timeout);

it("should only return total cost if dependency is false", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe("E2E Test for Package By Name Endpoint", () => {
let id: string;
beforeAll(async () => {
// Reset the registry before running the tests
await axios.delete(`${baseUrl}/reset`);
await axios.delete(`${baseUrl}/reset`, { timeout: 60000 });

// Upload a package with Content to the registry
const requestBody: PackageData = {
Expand Down Expand Up @@ -43,7 +43,7 @@ describe("E2E Test for Package By Name Endpoint", () => {
}, 90000);
afterAll(async () => {
// Reset the registry after running the tests
await axios.delete(`${baseUrl}/reset`);
await axios.delete(`${baseUrl}/reset`, { timeout: 60000 });
}, 90000);

it("should return a 200 status for a package that exists", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe("E2E Test for PackageByRegEx Endpoint", () => {
let url_id: string;
beforeAll(async () => {
// Reset the registry before running the tests
await axios.delete(`${baseUrl}/reset`);
await axios.delete(`${baseUrl}/reset`, { timeout: 60000 });

// Upload a package with Content to the registry
const requestBody: PackageData = {
Expand Down Expand Up @@ -41,7 +41,7 @@ describe("E2E Test for PackageByRegEx Endpoint", () => {
}, 90000);
afterAll(async () => {
// Reset the registry after running the tests
await axios.delete(`${baseUrl}/reset`);
await axios.delete(`${baseUrl}/reset`, { timeout: 60000 });
}, 90000);

it("should return a 200 status for a package that exists", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ describe("E2E Test for Package Create Endpoint", () => {

beforeAll(async () => {
// Reset the registry before running the tests
await axios.delete(`${baseUrl}/reset`);
await axios.delete(`${baseUrl}/reset`, { timeout: 60000 });
}, timeout);
afterAll(async () => {
// Reset the registry after running the tests
await axios.delete(`${baseUrl}/reset`);
await axios.delete(`${baseUrl}/reset`, { timeout: 60000 });
}, timeout);
it("should return a 201 status for a package with Content set", async () => {
const requestBody: PackageData = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe("E2E Test for Package Delete Endpoint", () => {
let url_id: string;
beforeAll(async () => {
// Reset the registry before running the tests
await axios.delete(`${baseUrl}/reset`);
await axios.delete(`${baseUrl}/reset`, { timeout: 60000 });

// Upload a package with Content to the registry
const requestBody: PackageData = {
Expand Down Expand Up @@ -39,7 +39,7 @@ describe("E2E Test for Package Delete Endpoint", () => {
}, 90000);
afterAll(async () => {
// Reset the registry after running the tests
await axios.delete(`${baseUrl}/reset`);
await axios.delete(`${baseUrl}/reset`, { timeout: 60000 });
}, timeout);

it("should return a 200 status for a package uploaded via Content", async () => {
Expand Down
4 changes: 2 additions & 2 deletions backend/src/handlers/__tests__/end_to_end/packageRate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe("E2E Test for Package Rate Endpoint", () => {
let url_id: string;
beforeAll(async () => {
// Reset the registry before running the tests
await axios.delete(`${baseUrl}/reset`);
await axios.delete(`${baseUrl}/reset`, { timeout: 60000 });

// Upload a package with Content to the registry
const requestBody: PackageData = {
Expand Down Expand Up @@ -39,7 +39,7 @@ describe("E2E Test for Package Rate Endpoint", () => {
}, 90000);
afterAll(async () => {
// Reset the registry after running the tests
await axios.delete(`${baseUrl}/reset`);
await axios.delete(`${baseUrl}/reset`, { timeout: 60000 });
}, timeout);

it("should return a 200 status for a package with a rating", async () => {
Expand Down
Loading

0 comments on commit 156b028

Please sign in to comment.