Skip to content

Commit

Permalink
Add frontend tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mawandm committed Apr 4, 2024
1 parent 2f38b5d commit a659e06
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 69 deletions.
24 changes: 0 additions & 24 deletions .github/workflows/frontend.yml

This file was deleted.

34 changes: 15 additions & 19 deletions .github/workflows/api.yml → .github/workflows/test_api.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
name: Build/Test API
name: Test API

on:
push:
# paths:
# - "nesis/api/core/**"
# - "nesis/api/tests/**"
# - "nesis/api/core/requirements*"
# pull_request:
# paths:
# - "nesis/api/core/**"
# - "nesis/api/tests/**"
# - "nesis/api/core/requirements*"
paths:
- "nesis/api/core/**"
- "nesis/api/tests/**"
- "nesis/api/core/requirements*"
pull_request:
paths:
- "nesis/api/core/**"
- "nesis/api/tests/**"
- "nesis/api/core/requirements*"

jobs:
format:
linter:
name: Black formatter
runs-on: ubuntu-latest
name: Check API code format
steps:
- name: Check out source
uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: rickstaa/action-black@v1
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
black_args: "nesis/api/ --check"
test:
runs-on: ubuntu-latest
name: Test API
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/test_frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test RAG Engine

on:
push:
# paths:
# - "nesis/frontend/core/**"
# - "nesis/frontend/tests/**"
# - "nesis/frontend/core/requirements*"
# pull_request:
# paths:
# - "nesis/frontend/core/**"
# - "nesis/frontend/tests/**"
# - "nesis/frontend/core/requirements*"

jobs:
lint:
runs-on: ubuntu-latest
name: Lint Frontend
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install frontend dependencies
run: npm install --legacy-peer-deps --prefix client --only dev
- name: Install server dependencies
run: npm install --legacy-peer-deps
- run: npm run format:check
name: Check formatting
- name: Test API
run: npm run test:api
- name: Test frontend
run: npm run test:client
35 changes: 16 additions & 19 deletions .github/workflows/rag.yml → .github/workflows/test_rag.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
name: Build/Test Rag Engine
name: Test Rag Engine

on:
push:
# paths:
# - "nesis/rag/core/**"
# - "nesis/rag/tests/**"
# - "nesis/rag/core/requirements*"
# pull_request:
# paths:
# - "nesis/rag/core/**"
# - "nesis/rag/tests/**"
# - "nesis/rag/core/requirements*"
paths:
- "nesis/rag/core/**"
- "nesis/rag/tests/**"
- "nesis/rag/core/requirements*"
pull_request:
paths:
- "nesis/rag/core/**"
- "nesis/rag/tests/**"
- "nesis/rag/core/requirements*"

jobs:
format:
linter:
name: Black formatter
runs-on: ubuntu-latest
name: Check API code format
steps:
- name: Check out source
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: rickstaa/action-black@v1
with:
python-version: "3.11"
black_args: "nesis/api/ --check"

test:
runs-on: ubuntu-latest
name: Test RAG API
Expand Down
4 changes: 2 additions & 2 deletions nesis/api/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Ametnes OptimAI
Ametnes business insights AI solution
# Nesis API
Nesis API module
1. Allows you to chat with data
2. Chats with documents and enhances document knowledge retrival
3. Offers business insights
Expand Down
11 changes: 6 additions & 5 deletions nesis/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ametnes-nosis",
"version": "1.0.0",
"description": "Ametnes OptimAI",
"name": "nosis",
"version": "0.0.1",
"description": "Nesis",
"main": "main.js",
"scripts": {
"test:api": "mocha --recursive --timeout 5000 --reporter spec \"server/api/**/*spec.js\"",
Expand All @@ -11,13 +11,14 @@
"start:server": "node server/main.js",
"start:server:local": "set PROFILE=DEV && node server/main.js",
"start:client": "cd client && npm run start",
"format": "node_modules/.bin/prettier --write ."
"format": "node_modules/.bin/prettier --write .",
"format:check": "node_modules/.bin/prettier --check ."
},
"repository": {
"type": "git",
"url": "git+ssh://git@https://github.com/ametnes/nosis.git"
},
"author": "Ametnes Limited",
"author": "Nesis Contributors",
"license": "ISC",
"homepage": "https://https://github.com/ametnes/nosis#readme",
"bugs": {
Expand Down

0 comments on commit a659e06

Please sign in to comment.