Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 35 additions & 15 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10" ]
os: [ ubuntu-latest, macOS-latest ]
python-version: ["3.8", "3.9", "3.10"]
os: [ubuntu-latest, macOS-latest]
exclude:
- os: macOS-latest
python-version: "3.9"
Expand All @@ -31,7 +31,7 @@ jobs:
with:
go-version: 1.18.0
- name: Install mysql on macOS
if: startsWith(matrix.os, 'macOS')
if: startsWith(matrix.os, 'macOS')
run: |
brew install mysql
PATH=$PATH:/usr/local/mysql/bin
Expand All @@ -57,12 +57,12 @@ jobs:
- name: Install apache-arrow on ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install -y -V ca-certificates lsb-release wget
wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
sudo apt install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
sudo apt update
sudo apt install -y -V libarrow-dev
sudo apt update
sudo apt install -y -V ca-certificates lsb-release wget
wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
sudo apt install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
sudo apt update
sudo apt install -y -V libarrow-dev
- name: Install apache-arrow on macos
if: matrix.os == 'macOS-latest'
run: brew install apache-arrow
Expand Down Expand Up @@ -100,11 +100,31 @@ jobs:
go-version: 1.18.0
- name: Install apache-arrow on ubuntu
run: |
sudo apt update
sudo apt install -y -V ca-certificates lsb-release wget
wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
sudo apt install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
sudo apt update
sudo apt install -y -V libarrow-dev
sudo apt update
sudo apt install -y -V ca-certificates lsb-release wget
wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
sudo apt install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
sudo apt update
sudo apt install -y -V libarrow-dev
- name: Test
run: make test-go

unit-test-ui:
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "17.x"
registry-url: "https://registry.npmjs.org"
- name: Install yarn dependencies
working-directory: ./ui
run: yarn install
- name: Build yarn rollup
working-directory: ./ui
run: yarn build:lib
- name: Run yarn tests
working-directory: ./ui
run: yarn test --watchAll=false
10 changes: 5 additions & 5 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@
"use-query-params": "^1.2.3"
},
"scripts": {
"start": "npm run generate-protos && react-scripts start",
"build": "npm run generate-protos && react-scripts build",
"build:lib": "npm run generate-protos && rimraf ./dist && tsc && rollup -c",
"build:lib-dev": "npm run generate-protos && rimraf ./dist && tsc && rollup -c && yalc publish -f",
"test": "npm run generate-protos && react-scripts test",
"start": "yarn run generate-protos && react-scripts start",
"build": "yarn run generate-protos && react-scripts build",
"build:lib": "yarn run generate-protos && rimraf ./dist && tsc && rollup -c",
"build:lib-dev": "yarn run generate-protos && rimraf ./dist && tsc && rollup -c && yalc publish -f",
"test": "yarn run generate-protos && react-scripts test",
"eject": "react-scripts eject",
"generate-protos": "pbjs --no-encode -o src/protos.js -w commonjs -t static-module `find ../protos/feast/ -iname *.proto` && pbts -n protos -o src/protos.d.ts src/protos.js"
},
Expand Down
15 changes: 10 additions & 5 deletions ui/src/FeastUISansProviders.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ import {
creditHistoryRegistry,
} from "./mocks/handlers";

import registry from "../public/registry.json";
import { feast } from "./protos";

import fs from 'fs';

const registry = feast.core.Registry.decode(fs.readFileSync("./public/registry.db"));

// declare which API requests to mock
const server = setupServer(
Expand Down Expand Up @@ -50,7 +54,7 @@ test("full app rendering", async () => {
// Explore Panel Should Appear
expect(screen.getByText(/Explore this Project/i)).toBeInTheDocument();

const projectNameRegExp = new RegExp(registry.project, "i");
const projectNameRegExp = new RegExp(registry.projectMetadata[0].project!, "i");

// It should load the default project, which is credit_scoring_aws
await waitFor(() => {
Expand Down Expand Up @@ -95,9 +99,10 @@ test("routes are reachable", async () => {
}
});


const featureViewName = registry.featureViews[0].spec.name;
const featureName = registry.featureViews[0].spec.features[0].name;
const featureView: feast.core.IFeatureView = registry.featureViews[0];
const featureViewName = featureView.spec?.name!;
const feature: feast.core.IFeatureSpecV2 = featureView.spec?.features![0]!;
const featureName = feature.name!;

test("features are reachable", async () => {
render(<FeastUISansProviders />);
Expand Down
11 changes: 7 additions & 4 deletions ui/src/mocks/handlers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { rest } from "msw";
import registry from "../../public/registry.json";

import fs from 'fs';

const registry = fs.readFileSync("./public/registry.db");

const projectsListWithDefaultProject = rest.get(
"/projects-list.json",
Expand All @@ -14,16 +17,16 @@ const projectsListWithDefaultProject = rest.get(
description:
"Project for credit scoring team and associated models.",
id: "credit_score_project",
registryPath: "/registry.json",
registryPath: "/registry.db",
},
],
})
);
}
);

const creditHistoryRegistry = rest.get("/registry.json", (req, res, ctx) => {
return res(ctx.status(200), ctx.json(registry));
const creditHistoryRegistry = rest.get("/registry.db", (req, res, ctx) => {
return res(ctx.status(200), ctx.body(registry));
});

export { projectsListWithDefaultProject, creditHistoryRegistry };