forked from neuml/txtai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (29 loc) · 922 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Project utility scripts
.PHONY: test
# Setup environment
export SRC_DIR := ./src/python
export TEST_DIR := ./test/python
export PYTHONPATH := ${SRC_DIR}:${TEST_DIR}:${PYTHONPATH}
export PATH := ${TEST_DIR}:${PATH}
export PYTHONWARNINGS := ignore
# Disable tokenizer parallelism for tests
export TOKENIZERS_PARALLELISM := false
# Default python executable if not provided
PYTHON ?= python
# Check for wget
WGET := $(shell wget --version 2> /dev/null)
ifndef WGET
$(error "Required binary `wget` not found, please install wget OS package")
endif
# Download test data
data:
mkdir -p /tmp/txtai
wget -N https://github.com/neuml/txtai/releases/download/v3.5.0/tests.tar.gz -P /tmp
tar -xvzf /tmp/tests.tar.gz -C /tmp
# Unit tests
test:
${PYTHON} -m unittest discover -v -s ${TEST_DIR}
# Run tests while calculating code coverage
coverage:
coverage run -m unittest discover -v -s ${TEST_DIR}
coverage combine