Commit 91687222 authored by Carina Antunes's avatar Carina Antunes
Browse files

tests: automate testing

parent 2b8dabf7
......@@ -9,19 +9,19 @@ ENV=dev
FLASK_SKIP_DOTENV=1
INVENIO_ACCOUNTS_SESSION_REDIS_URL=redis://redis:6379/1
INVENIO_ADMIN_ACCESS_GROUPS=b
INVENIO_ADMIN_ACCESS_GROUPS=CernSearch-Administrators@cern.ch
INVENIO_ADMIN_USER=test@example.com
INVENIO_ADMIN_VIEW_ACCESS_GROUPS=a
INVENIO_ADMIN_VIEW_ACCESS_GROUPS=CernSearch-Administrators@cern.ch
INVENIO_APP_ALLOWED_HOSTS=['localhost', 'nginx']
INVENIO_CACHE_REDIS_HOST=redis
INVENIO_CACHE_REDIS_URL=redis://redis:6379/0
INVENIO_CERN_APP_CREDENTIALS={'consumer_key':'bah'}
INVENIO_CERN_APP_CREDENTIALS_CONSUMER_KEY=xxx
INVENIO_COLLECT_STORAGE=flask_collect.storage.file
INVENIO_INDEXER_DEFAULT_DOC_TYPE=test-doc_v0.0.2
INVENIO_INDEXER_DEFAULT_INDEX=cernsearch-test-test-doc_v0.0.2
INVENIO_LOGGING_CONSOLE='False'
INVENIO_LOGGING_CONSOLE_LEVEL=WARNING
INVENIO_INDEXER_DEFAULT_DOC_TYPE=doc_v0.0.2
INVENIO_INDEXER_DEFAULT_INDEX=cernsearch-test-doc_v0.0.2
INVENIO_LOGGING_CONSOLE='True'
INVENIO_LOGGING_CONSOLE_LEVEL=DEBUG
INVENIO_RATELIMIT_STORAGE_URL='redis://redis:6379/3'
INVENIO_SEARCH_ELASTIC_HOSTS=elasticsearch
INVENIO_SEARCH_INDEX_PREFIX=cernsearch-
......
......@@ -33,3 +33,6 @@ env/
# Gitlab CI Runner
builds/
# Test files
.api_token
......@@ -9,19 +9,19 @@ ENV=dev
FLASK_SKIP_DOTENV=1
INVENIO_ACCOUNTS_SESSION_REDIS_URL=redis://localhost:6379/1
INVENIO_ADMIN_ACCESS_GROUPS=b
INVENIO_ADMIN_ACCESS_GROUPS=CernSearch-Administrators@cern.ch
INVENIO_ADMIN_USER=test@example.com
INVENIO_ADMIN_VIEW_ACCESS_GROUPS=a
INVENIO_ADMIN_VIEW_ACCESS_GROUPS=CernSearch-Administrators@cern.ch
INVENIO_APP_ALLOWED_HOSTS=['localhost']
INVENIO_CACHE_REDIS_HOST=localhost
INVENIO_CACHE_REDIS_URL=redis://localhost:6379/0
INVENIO_CERN_APP_CREDENTIALS={'consumer_key':'bah'}
INVENIO_CERN_APP_CREDENTIALS_CONSUMER_KEY=xxx
INVENIO_COLLECT_STORAGE=flask_collect.storage.file
INVENIO_INDEXER_DEFAULT_DOC_TYPE=test-doc_v0.0.1
INVENIO_INDEXER_DEFAULT_INDEX=cernsearch-test-test-doc_v0.0.1
INVENIO_LOGGING_CONSOLE='False'
INVENIO_LOGGING_CONSOLE_LEVEL=WARNING
INVENIO_INDEXER_DEFAULT_DOC_TYPE=doc_v0.0.1
INVENIO_INDEXER_DEFAULT_INDEX=cernsearch-test-doc_v0.0.1
INVENIO_LOGGING_CONSOLE='True'
INVENIO_LOGGING_CONSOLE_LEVEL=DEBUG
INVENIO_RATELIMIT_STORAGE_URL='redis://localhost:6379/3'
INVENIO_SEARCH_ELASTIC_HOSTS=localhost
INVENIO_SEARCH_INDEX_PREFIX=cernsearch-
......
......@@ -16,6 +16,7 @@
SERVICE_NAME := cern-search-api
DOCKER_FILE := docker-compose.full.yml
API_TOKEN := .api_token
build-env:
docker-compose -f $(DOCKER_FILE) up -d --build --remove-orphans
......@@ -59,8 +60,8 @@ generate-certificates:
.PHONY: generate-certificates
test:
@echo todo
# python pytest
docker-compose -f $(DOCKER_FILE) exec $(SERVICE_NAME) /bin/bash -c \
"API_TOKEN=$$(<$(API_TOKEN)) pytest tests -vv;"
.PHONY: test
lint:
......@@ -93,6 +94,10 @@ PYTHON_VERSION_FILE := .python-version
PYTHON_VERSION := $(shell cat $(PYTHON_VERSION_FILE) | xargs)
PIPENV_DOCKER_FILE := docker-compose.yml
local-env-logs:
docker-compose -f $(PIPENV_DOCKER_FILE) logs -f
.PHONY: local-env-logs
check-requirements-local:
PYTHON_VERSION=$(PYTHON_VERSION) sh scripts/pipenv/requirements.sh
.PHONY: check-requirements-local
......
......@@ -4,11 +4,10 @@ url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
pytest = ">=3.8.1"
pytest-mock = ">=1.6.0"
flake8 = ">=3.7.8"
flake8-docstrings = ">=1.5.0"
isort = "==4.3.21"
pytest-invenio = ">=1.2.0"
[packages]
invenio-access = ">=1.0.0,<1.1.0"
......
{
"_meta": {
"hash": {
"sha256": "5aa9419591b659fd9a0488970c7fc1cc3972fdb20025ce9f8d592e630074b8b3"
"sha256": "2e590f8905c885e65be5db88f2f190ef992359b4eda66d25a6bb791a842e9c52"
},
"pipfile-spec": 6,
"requires": {
......@@ -18,9 +18,9 @@
"default": {
"alembic": {
"hashes": [
"sha256:e6c6a4243e89c8d3e2342a1562b2388f3b524c9cac2fccc4d2c461a1320cc1c1"
"sha256:9f907d7e8b286a1cfb22db9084f9ce4fde7ad7956bb496dc7c952e10ac90e36a"
],
"version": "==1.3.0"
"version": "==1.2.1"
},
"amqp": {
"hashes": [
......@@ -31,10 +31,10 @@
},
"arrow": {
"hashes": [
"sha256:01a16d8a93eddf86a29237f32ae36b29c27f047e79312eb4df5d55fd5a2b3183",
"sha256:e1a318a4c0b787833ae46302c02488b6eeef413c6a13324b3261ad320f21ec1e"
"sha256:10257c5daba1a88db34afa284823382f4963feca7733b9107956bed041aff24f",
"sha256:c2325911fcd79972cf493cfd957072f9644af8ad25456201ae1ede3316576eb4"
],
"version": "==0.15.4"
"version": "==0.15.2"
},
"attrs": {
"hashes": [
......@@ -100,40 +100,40 @@
},
"cffi": {
"hashes": [
"sha256:0b49274afc941c626b605fb59b59c3485c17dc776dc3cc7cc14aca74cc19cc42",
"sha256:0e3ea92942cb1168e38c05c1d56b0527ce31f1a370f6117f1d490b8dcd6b3a04",
"sha256:135f69aecbf4517d5b3d6429207b2dff49c876be724ac0c8bf8e1ea99df3d7e5",
"sha256:19db0cdd6e516f13329cba4903368bff9bb5a9331d3410b1b448daaadc495e54",
"sha256:2781e9ad0e9d47173c0093321bb5435a9dfae0ed6a762aabafa13108f5f7b2ba",
"sha256:291f7c42e21d72144bb1c1b2e825ec60f46d0a7468f5346841860454c7aa8f57",
"sha256:2c5e309ec482556397cb21ede0350c5e82f0eb2621de04b2633588d118da4396",
"sha256:2e9c80a8c3344a92cb04661115898a9129c074f7ab82011ef4b612f645939f12",
"sha256:32a262e2b90ffcfdd97c7a5e24a6012a43c61f1f5a57789ad80af1d26c6acd97",
"sha256:3c9fff570f13480b201e9ab69453108f6d98244a7f495e91b6c654a47486ba43",
"sha256:415bdc7ca8c1c634a6d7163d43fb0ea885a07e9618a64bda407e04b04333b7db",
"sha256:4424e42199e86b21fc4db83bd76909a6fc2a2aefb352cb5414833c030f6ed71b",
"sha256:4a43c91840bda5f55249413037b7a9b79c90b1184ed504883b72c4df70778579",
"sha256:599a1e8ff057ac530c9ad1778293c665cb81a791421f46922d80a86473c13346",
"sha256:5c4fae4e9cdd18c82ba3a134be256e98dc0596af1e7285a3d2602c97dcfa5159",
"sha256:5ecfa867dea6fabe2a58f03ac9186ea64da1386af2159196da51c4904e11d652",
"sha256:62f2578358d3a92e4ab2d830cd1c2049c9c0d0e6d3c58322993cc341bdeac22e",
"sha256:6471a82d5abea994e38d2c2abc77164b4f7fbaaf80261cb98394d5793f11b12a",
"sha256:6d4f18483d040e18546108eb13b1dfa1000a089bcf8529e30346116ea6240506",
"sha256:71a608532ab3bd26223c8d841dde43f3516aa5d2bf37b50ac410bb5e99053e8f",
"sha256:74a1d8c85fb6ff0b30fbfa8ad0ac23cd601a138f7509dc617ebc65ef305bb98d",
"sha256:7b93a885bb13073afb0aa73ad82059a4c41f4b7d8eb8368980448b52d4c7dc2c",
"sha256:7d4751da932caaec419d514eaa4215eaf14b612cff66398dd51129ac22680b20",
"sha256:7f627141a26b551bdebbc4855c1157feeef18241b4b8366ed22a5c7d672ef858",
"sha256:8169cf44dd8f9071b2b9248c35fc35e8677451c52f795daa2bb4643f32a540bc",
"sha256:aa00d66c0fab27373ae44ae26a66a9e43ff2a678bf63a9c7c1a9a4d61172827a",
"sha256:ccb032fda0873254380aa2bfad2582aedc2959186cce61e3a17abc1a55ff89c3",
"sha256:d754f39e0d1603b5b24a7f8484b22d2904fa551fe865fd0d4c3332f078d20d4e",
"sha256:d75c461e20e29afc0aee7172a0950157c704ff0dd51613506bd7d82b718e7410",
"sha256:dcd65317dd15bc0451f3e01c80da2216a31916bdcffd6221ca1202d96584aa25",
"sha256:e570d3ab32e2c2861c4ebe6ffcad6a8abf9347432a37608fe1fbd157b3f0036b",
"sha256:fd43a88e045cf992ed09fa724b5315b790525f2676883a6ea64e3263bae6549d"
],
"version": "==1.13.2"
"sha256:00d890313797d9fe4420506613384b43099ad7d2b905c0752dbcc3a6f14d80fa",
"sha256:0cf9e550ac6c5e57b713437e2f4ac2d7fd0cd10336525a27224f5fc1ec2ee59a",
"sha256:0ea23c9c0cdd6778146a50d867d6405693ac3b80a68829966c98dd5e1bbae400",
"sha256:193697c2918ecdb3865acf6557cddf5076bb39f1f654975e087b67efdff83365",
"sha256:1ae14b542bf3b35e5229439c35653d2ef7d8316c1fffb980f9b7647e544baa98",
"sha256:1e389e069450609c6ffa37f21f40cce36f9be7643bbe5051ab1de99d5a779526",
"sha256:263242b6ace7f9cd4ea401428d2d45066b49a700852334fd55311bde36dcda14",
"sha256:33142ae9807665fa6511cfa9857132b2c3ee6ddffb012b3f0933fc11e1e830d5",
"sha256:364f8404034ae1b232335d8c7f7b57deac566f148f7222cef78cf8ae28ef764e",
"sha256:47368f69fe6529f8f49a5d146ddee713fc9057e31d61e8b6dc86a6a5e38cecc1",
"sha256:4895640844f17bec32943995dc8c96989226974dfeb9dd121cc45d36e0d0c434",
"sha256:558b3afef987cf4b17abd849e7bedf64ee12b28175d564d05b628a0f9355599b",
"sha256:5ba86e1d80d458b338bda676fd9f9d68cb4e7a03819632969cf6d46b01a26730",
"sha256:63424daa6955e6b4c70dc2755897f5be1d719eabe71b2625948b222775ed5c43",
"sha256:6381a7d8b1ebd0bc27c3bc85bc1bfadbb6e6f756b4d4db0aa1425c3719ba26b4",
"sha256:6381ab708158c4e1639da1f2a7679a9bbe3e5a776fc6d1fd808076f0e3145331",
"sha256:6fd58366747debfa5e6163ada468a90788411f10c92597d3b0a912d07e580c36",
"sha256:728ec653964655d65408949b07f9b2219df78badd601d6c49e28d604efe40599",
"sha256:7cfcfda59ef1f95b9f729c56fe8a4041899f96b72685d36ef16a3440a0f85da8",
"sha256:819f8d5197c2684524637f940445c06e003c4a541f9983fd30d6deaa2a5487d8",
"sha256:825ecffd9574557590e3225560a8a9d751f6ffe4a49e3c40918c9969b93395fa",
"sha256:8a2bcae2258d00fcfc96a9bde4a6177bc4274fe033f79311c5dd3d3148c26518",
"sha256:9009e917d8f5ef780c2626e29b6bc126f4cb2a4d43ca67aa2b40f2a5d6385e78",
"sha256:9c77564a51d4d914ed5af096cd9843d90c45b784b511723bd46a8a9d09cf16fc",
"sha256:a19089fa74ed19c4fe96502a291cfdb89223a9705b1d73b3005df4256976142e",
"sha256:a40ed527bffa2b7ebe07acc5a3f782da072e262ca994b4f2085100b5a444bbb2",
"sha256:b8f09f21544b9899defb09afbdaeb200e6a87a2b8e604892940044cf94444644",
"sha256:bb75ba21d5716abc41af16eac1145ab2e471deedde1f22c6f99bd9f995504df0",
"sha256:e22a00c0c81ffcecaf07c2bfb3672fa372c50e2bd1024ffee0da191c1b27fc71",
"sha256:e55b5a746fb77f10c83e8af081979351722f6ea48facea79d470b3731c7b2891",
"sha256:ec2fa3ee81707a5232bf2dfbd6623fdb278e070d596effc7e2d788f2ada71a05",
"sha256:fd82eb4694be712fcae03c717ca2e0fc720657ac226b80bbb597e971fc6928c2"
],
"version": "==1.13.1"
},
"chardet": {
"hashes": [
......@@ -366,9 +366,9 @@
},
"future": {
"hashes": [
"sha256:b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d"
"sha256:858e38522e8fd0d3ce8f0c1feaf0603358e366d5403209674c7b617fa0c24093"
],
"version": "==0.18.2"
"version": "==0.18.1"
},
"html5lib": {
"hashes": [
......@@ -946,10 +946,10 @@
},
"python-dateutil": {
"hashes": [
"sha256:73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c",
"sha256:75bb3f31ea686f1197762692a9ee6a7550b59fc6ca3a1f4b5d7e32fb98e2da2a"
"sha256:7e6584c74aeed623791615e26efd690f29817a27c73085b78e4bad02493df2fb",
"sha256:c89805f6f4d64db21ed966fda138f8a5ed7a4fdbc1a8ee329ce1b74e3c74da9e"
],
"version": "==2.8.1"
"version": "==2.8.0"
},
"python-editor": {
"hashes": [
......@@ -1048,9 +1048,9 @@
"encrypted"
],
"hashes": [
"sha256:01f0f0ebed696386bc7bf9231cd6894087baba374dd60f40eb1b07512d6b1a5e"
"sha256:6689b29d7951c5c7c4d79fa6b8c95f9ff9ec708b07aa53f82060599bd14dcc88"
],
"version": "==0.35.0"
"version": "==0.34.2"
},
"traitlets": {
"hashes": [
......@@ -1192,6 +1192,50 @@
],
"version": "==19.3.0"
},
"click": {
"hashes": [
"sha256:2335065e6395b9e67ca716de5f7526736bfa6ceead690adf616d925bdc622b13",
"sha256:5b94b49521f6456670fdb30cd82a4eca9412788a93fa6dd6df72c94d5a8ff2d7"
],
"version": "==7.0"
},
"coverage": {
"hashes": [
"sha256:08907593569fe59baca0bf152c43f3863201efb6113ecb38ce7e97ce339805a6",
"sha256:0be0f1ed45fc0c185cfd4ecc19a1d6532d72f86a2bac9de7e24541febad72650",
"sha256:141f08ed3c4b1847015e2cd62ec06d35e67a3ac185c26f7635f4406b90afa9c5",
"sha256:19e4df788a0581238e9390c85a7a09af39c7b539b29f25c89209e6c3e371270d",
"sha256:23cc09ed395b03424d1ae30dcc292615c1372bfba7141eb85e11e50efaa6b351",
"sha256:245388cda02af78276b479f299bbf3783ef0a6a6273037d7c60dc73b8d8d7755",
"sha256:331cb5115673a20fb131dadd22f5bcaf7677ef758741312bee4937d71a14b2ef",
"sha256:386e2e4090f0bc5df274e720105c342263423e77ee8826002dcffe0c9533dbca",
"sha256:3a794ce50daee01c74a494919d5ebdc23d58873747fa0e288318728533a3e1ca",
"sha256:60851187677b24c6085248f0a0b9b98d49cba7ecc7ec60ba6b9d2e5574ac1ee9",
"sha256:63a9a5fc43b58735f65ed63d2cf43508f462dc49857da70b8980ad78d41d52fc",
"sha256:6b62544bb68106e3f00b21c8930e83e584fdca005d4fffd29bb39fb3ffa03cb5",
"sha256:6ba744056423ef8d450cf627289166da65903885272055fb4b5e113137cfa14f",
"sha256:7494b0b0274c5072bddbfd5b4a6c6f18fbbe1ab1d22a41e99cd2d00c8f96ecfe",
"sha256:826f32b9547c8091679ff292a82aca9c7b9650f9fda3e2ca6bf2ac905b7ce888",
"sha256:93715dffbcd0678057f947f496484e906bf9509f5c1c38fc9ba3922893cda5f5",
"sha256:9a334d6c83dfeadae576b4d633a71620d40d1c379129d587faa42ee3e2a85cce",
"sha256:af7ed8a8aa6957aac47b4268631fa1df984643f07ef00acd374e456364b373f5",
"sha256:bf0a7aed7f5521c7ca67febd57db473af4762b9622254291fbcbb8cd0ba5e33e",
"sha256:bf1ef9eb901113a9805287e090452c05547578eaab1b62e4ad456fcc049a9b7e",
"sha256:c0afd27bc0e307a1ffc04ca5ec010a290e49e3afbe841c5cafc5c5a80ecd81c9",
"sha256:dd579709a87092c6dbee09d1b7cfa81831040705ffa12a1b248935274aee0437",
"sha256:df6712284b2e44a065097846488f66840445eb987eb81b3cc6e4149e7b6982e1",
"sha256:e07d9f1a23e9e93ab5c62902833bf3e4b1f65502927379148b6622686223125c",
"sha256:e2ede7c1d45e65e209d6093b762e98e8318ddeff95317d07a27a2140b80cfd24",
"sha256:e4ef9c164eb55123c62411f5936b5c2e521b12356037b6e1c2617cef45523d47",
"sha256:eca2b7343524e7ba246cab8ff00cab47a2d6d54ada3b02772e908a45675722e2",
"sha256:eee64c616adeff7db37cc37da4180a3a5b6177f5c46b187894e633f088fb5b28",
"sha256:ef824cad1f980d27f26166f86856efe11eff9912c4fed97d3804820d43fa550c",
"sha256:efc89291bd5a08855829a3c522df16d856455297cf35ae827a37edac45f466a7",
"sha256:fa964bae817babece5aa2e8c1af841bebb6d0b9add8e637548809d040443fee0",
"sha256:ff37757e068ae606659c28c3bd0d923f9d29a85de79bf25b2b34b148473b5025"
],
"version": "==4.5.4"
},
"entrypoints": {
"hashes": [
"sha256:589f874b313739ad35be6e0cd7efde2a4e9b6fea91edcc34e58ecbb8dbe56d19",
......@@ -1215,6 +1259,14 @@
"index": "pypi",
"version": "==1.5.0"
},
"flask": {
"hashes": [
"sha256:13f9f196f330c7c2c5d7a5cf91af894110ca0215ac051b5844701f2bfd934d52",
"sha256:45eb5a6fd193d6cf7e0cf5d8a5b31f83d5faae0293695626f539a823e93b13f6"
],
"index": "pypi",
"version": "==1.1.1"
},
"importlib-metadata": {
"hashes": [
"sha256:aa18d7378b00b40847790e7c27e11673d7fed219354109d0e7b9e5b25dc3ad26",
......@@ -1231,6 +1283,53 @@
"index": "pypi",
"version": "==4.3.21"
},
"itsdangerous": {
"hashes": [
"sha256:321b033d07f2a4136d3ec762eac9f16a10ccd60f53c0c91af90217ace7ba1f19",
"sha256:b12271b2047cb23eeb98c8b5622e2e5c5e9abd9784a153e9d8ef9cb4dd09d749"
],
"version": "==1.1.0"
},
"jinja2": {
"hashes": [
"sha256:74320bb91f31270f9551d46522e33af46a80c3d619f4a4bf42b3164d30b5911f",
"sha256:9fe95f19286cfefaa917656583d020be14e7859c6b0252588391e47db34527de"
],
"version": "==2.10.3"
},
"markupsafe": {
"hashes": [
"sha256:00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473",
"sha256:09027a7803a62ca78792ad89403b1b7a73a01c8cb65909cd876f7fcebd79b161",
"sha256:09c4b7f37d6c648cb13f9230d847adf22f8171b1ccc4d5682398e77f40309235",
"sha256:1027c282dad077d0bae18be6794e6b6b8c91d58ed8a8d89a89d59693b9131db5",
"sha256:24982cc2533820871eba85ba648cd53d8623687ff11cbb805be4ff7b4c971aff",
"sha256:29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b",
"sha256:43a55c2930bbc139570ac2452adf3d70cdbb3cfe5912c71cdce1c2c6bbd9c5d1",
"sha256:46c99d2de99945ec5cb54f23c8cd5689f6d7177305ebff350a58ce5f8de1669e",
"sha256:500d4957e52ddc3351cabf489e79c91c17f6e0899158447047588650b5e69183",
"sha256:535f6fc4d397c1563d08b88e485c3496cf5784e927af890fb3c3aac7f933ec66",
"sha256:62fe6c95e3ec8a7fad637b7f3d372c15ec1caa01ab47926cfdf7a75b40e0eac1",
"sha256:6dd73240d2af64df90aa7c4e7481e23825ea70af4b4922f8ede5b9e35f78a3b1",
"sha256:717ba8fe3ae9cc0006d7c451f0bb265ee07739daf76355d06366154ee68d221e",
"sha256:79855e1c5b8da654cf486b830bd42c06e8780cea587384cf6545b7d9ac013a0b",
"sha256:7c1699dfe0cf8ff607dbdcc1e9b9af1755371f92a68f706051cc8c37d447c905",
"sha256:88e5fcfb52ee7b911e8bb6d6aa2fd21fbecc674eadd44118a9cc3863f938e735",
"sha256:8defac2f2ccd6805ebf65f5eeb132adcf2ab57aa11fdf4c0dd5169a004710e7d",
"sha256:98c7086708b163d425c67c7a91bad6e466bb99d797aa64f965e9d25c12111a5e",
"sha256:9add70b36c5666a2ed02b43b335fe19002ee5235efd4b8a89bfcf9005bebac0d",
"sha256:9bf40443012702a1d2070043cb6291650a0841ece432556f784f004937f0f32c",
"sha256:ade5e387d2ad0d7ebf59146cc00c8044acbd863725f887353a10df825fc8ae21",
"sha256:b00c1de48212e4cc9603895652c5c410df699856a2853135b3967591e4beebc2",
"sha256:b1282f8c00509d99fef04d8ba936b156d419be841854fe901d8ae224c59f0be5",
"sha256:b2051432115498d3562c084a49bba65d97cf251f5a331c64a12ee7e04dacc51b",
"sha256:ba59edeaa2fc6114428f1637ffff42da1e311e29382d81b339c1817d37ec93c6",
"sha256:c8716a48d94b06bb3b2524c2b77e055fb313aeb4ea620c8dd03a105574ba704f",
"sha256:cd5df75523866410809ca100dc9681e301e3c27567cf498077e8551b6d20e42f",
"sha256:e249096428b3ae81b08327a63a485ad0878de3fb939049038579ac0ef61e17e7"
],
"version": "==1.1.1"
},
"mccabe": {
"hashes": [
"sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42",
......@@ -1299,16 +1398,36 @@
"sha256:27abc3fef618a01bebb1f0d6d303d2816a99aa87a5968ebc32fe971be91eb1e6",
"sha256:58cee9e09242937e136dbb3dab466116ba20d6b7828c7620f23947f37eb4dae4"
],
"index": "pypi",
"version": "==5.2.2"
},
"pytest-mock": {
"pytest-cov": {
"hashes": [
"sha256:b3514caac35fe3f05555923eabd9546abce11571cc2ddf7d8615959d04f2c89e",
"sha256:ea502c3891599c26243a3a847ccf0b1d20556678c528f86c98e3cd6d40c5cf11"
"sha256:cc6742d8bac45070217169f5f72ceee1e0e55b0221f54bcf24845972d3a47f2b",
"sha256:cdbdef4f870408ebdbfeb44e63e07eb18bb4619fae852f6e760645fa36172626"
],
"version": "==2.8.1"
},
"pytest-flask": {
"hashes": [
"sha256:283730b469604ecb94caac28df99a40b7c785b828dd8d3323596718b51dfaeb2",
"sha256:d874781b622210d8c5d8061cdb091cb059fcb12203125110bd8e6f9256ccbf49"
],
"version": "==0.15.0"
},
"pytest-invenio": {
"hashes": [
"sha256:7d6593eb374f1697d8de0194543dd66e4591905ab87aae5a8a8970dce091fc44",
"sha256:86d06c518752f586d7c508510dd9e938ecb764cc2310a680c12dd2e6dc25f412"
],
"index": "pypi",
"version": "==1.11.2"
"version": "==1.2.0"
},
"selenium": {
"hashes": [
"sha256:2d7131d7bc5a5b99a2d9b04aaf2612c411b03b8ca1b1ee8d3de5845a9be2cb3c",
"sha256:deaf32b60ad91a4611b98d8002757f29e6f2c2d5fcaf202e1c9ad06d6772300d"
],
"version": "==3.141.0"
},
"six": {
"hashes": [
......@@ -1324,6 +1443,13 @@
],
"version": "==2.0.0"
},
"urllib3": {
"hashes": [
"sha256:2393a695cd12afedd0dcb26fe5d50d0cf248e5a66f75dbd89a3d4eb333a61af4",
"sha256:a637e5fae88995b256e3409dc4d52c2e2e0ba32c42a6365fee8bbd2238de3cfb"
],
"version": "==1.24.3"
},
"wcwidth": {
"hashes": [
"sha256:3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e",
......@@ -1331,6 +1457,13 @@
],
"version": "==0.1.7"
},
"werkzeug": {
"hashes": [
"sha256:7280924747b5733b246fe23972186c6b348f9ae29724135a6dfc1e53cea433e7",
"sha256:e5f4a1f98b52b18a93da705a7458e55afb26f32bff83ff5d19189f92462d65c4"
],
"version": "==0.16.0"
},
"zipp": {
"hashes": [
"sha256:3718b1cbcd963c7d4c5511a8240812904164b7f381b647143a89d3b98f9bcd8e",
......
......@@ -193,3 +193,6 @@ SECURITY_CONFIRMABLE = False
SECURITY_REGISTERABLE = False # Avoid user registration outside of CERN SSO
SECURITY_RECOVERABLE = False # Avoid user password recovery
SESSION_COOKIE_SECURE = True
# LOGGING_LEVEL
LOGGING_CONSOLE_LEVEL = os.getenv('INVENIO_LOGGING_CONSOLE_LEVEL', 'DEBUG')
......@@ -7,9 +7,11 @@
# CERN Search is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
from cern_search_rest_api.config import LOGGING_CONSOLE_LEVEL
from cern_search_rest_api.modules.cernsearch.indexer import csas_indexer_receiver
from cern_search_rest_api.modules.cernsearch.views import build_blueprint
from invenio_indexer.signals import before_record_index
from invenio_logging.console import InvenioLoggingConsole
class CERNSearch(object):
......@@ -28,6 +30,10 @@ class CERNSearch(object):
before_record_index.connect(csas_indexer_receiver, sender=app)
app.extensions["cern-search"] = self
#InvenioLoggingConsole(app)
app.logger.setLevel(LOGGING_CONSOLE_LEVEL)
app.logger.debug('Starting up...')
def init_config(self, app):
"""Initialize configuration."""
# Set up API endpoints for records.
......
......@@ -42,6 +42,8 @@ services:
redis:
image: redis:5.0.6
ports:
- 6379:6379
networks:
- default
......
......@@ -8,5 +8,6 @@
# under the terms of the MIT License; see LICENSE file for more details.
invenio users create test@example.com --password test1234 --active
export API_TOKEN=$(invenio tokens create -n test -u test@example.com)
echo "API TOKEN: $API_TOKEN"
invenio roles create CernSearch-Administrators@cern.ch
invenio roles add test@example.com CernSearch-Administrators@cern.ch
invenio tokens create -n test -u test@example.com > .api_token
......@@ -4,4 +4,7 @@
# Copyright (C) 2018-2019 CERN.
#
# CERN Search is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
\ No newline at end of file
# under the terms of the MIT License; see LICENSE file for more details.
[aliases]
test = pytest
\ No newline at end of file
......@@ -15,6 +15,17 @@ from setuptools import find_packages, setup
readme = open('README.md').read()
history = open('CHANGES.md').read()
setup_requires = [
'pytest-runner>=3.0.0,<5',
]
tests_require = [
'pytest-runner>=3.0.0,<5',
]
install_requires = [
'pytest',
]
# Get the version string. Cannot be done with import!
g = {}
......@@ -72,4 +83,7 @@ setup(
'Programming Language :: Python :: 2.7',
'Development Status :: 1 - Pre-Alpha',
],
setup_requires=setup_requires,
tests_require=tests_require,
install_requires=install_requires,
)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment