-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactored data pump including tools * make possible to change configs from cmd set port so it can be easily changed via cmd updates for dev-5 import less verbose progressbar proper no term startup * control anonym email by global var * less verbose for acceptable outcomes * less verbose, ignoring known inconsistencies * ignoring known errors, issues and specific cases * improve info * less verbose do not log specific cases fixed add_checksums call by not parsing (empty) response content * unify log before/after messages and add count check * fix log * improge logs * better docs * Generate JSON from DB into /input/data folder not /input/data-json because in repo_import.py it expects *.jsons in the /input/data folder. * Add result of importing logs into files because in the `postgres.log` are only errors of the first attempt and the user do not know that the dumps was successfully imported. * Add NOTE that all scripts must have `LF` line separator because it cannot find the `init.dspacedb5.sh` file. * show db table count * Fix importing of groups - one collection could have more group relations. * For the workflowitem was used wrong endpoint. * Generate JSON from DB into /input/data folder not /input/data-json because in repo_import.py it expects *.jsons in the /input/data folder. * Add result of importing logs into files because in the `postgres.log` are only errors of the first attempt and the user do not know that the dumps was successfully imported. * Add NOTE that all scripts must have `LF` line separator because it cannot find the `init.dspacedb5.sh` file. * Fix importing of groups - one collection could have more group relations. * For the workflowitem was used wrong endpoint. * add @Property not get * removed () * enforce line ending for specific types update docs reinit sql dumps rather then create (statement order references tables before creating them) * revert fixes * implementation of db diffs * add local sch_id to schema dict * Send bitstream mime type instead of id because IDs are different in CLARIN-DSpace5 and CLARIN-DSpace7 * key in dict as str, missing wf, incorrect handles * Do not create list where it shouldn't be created because it throws an error during importing resource policies. * add diff_all more fixes, less logging if known cases make consistency validation even more stricter do not make assumptions about the response content fix .html added to the end of the url ignoring known metadatavalue changes ignore file listing date.issued/approx.date normalized in v5/v7 comparison improved versions comparison * If statement compares str not int - add item_id into migrated_versions as string value. * norm text * refactor_jm_resource_policies (#121) * Do not import resourcepolicy for deleted item/bundle. * Update condition -> do not call private attrs. * refactor_jm_resourcepolicies_condition (#123) * Updated condition * Prettify condition * Log resource policy type * refactor_jm_user_metadata * refactor_jm_conflicts (#125) * Find out newer versions of the item * One Item history is imported * Item previous version are in the right sequence * Versions of the item which are replaced in another repository is fetched in specific list. * Importing of Item versions is working * Importing of Item versions is working * Uncommented item import and added handle prefix to const * Updated checksum * The sequences are updated * clearly separate TESTs part of Readme * Updated comments * Removed empty row. * Removed another empty row. --------- Co-authored-by: MajoBerger <[email protected]> --------- Co-authored-by: jm <jm@maz> Co-authored-by: milanmajchrak <[email protected]> Co-authored-by: Paurikova2 <[email protected]> Co-authored-by: milanmajchrak <[email protected]> Co-authored-by: MajoBerger <[email protected]>
- Loading branch information
1 parent
90c300a
commit 07a3ae6
Showing
109 changed files
with
5,316 additions
and
3,255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
*.sh eol=lf | ||
*.py eol=lf | ||
*.md eol=lf | ||
apt-requirements.txt eol=lf | ||
*.bat eol=crlf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,28 @@ | ||
name: Test dspace on dev-5 | ||
name: build-and-test | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
# * is a special character in YAML so you have to quote this string | ||
- cron: '0 0 * * *' | ||
push: | ||
branches: [ "main" ] | ||
|
||
|
||
jobs: | ||
test: | ||
runs-on: dspace-bbt | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: install requirements | ||
run: pip install -r requirements.txt | ||
|
||
- name: test | ||
run: python3 -m unittest -v 2> output.txt | ||
|
||
- name: report result | ||
run: echo $? > result.txt | ||
- name: smoketest | ||
run: | | ||
cd ./src | ||
python repo_import.py --help | ||
# multi line commands for future reference | ||
- name: Run a multi-line script | ||
- name: test | ||
run: | | ||
echo first line | ||
echo second line | ||
cd ./tests | ||
python -m unittest discover ./ -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,3 +139,7 @@ clarin-dspace-dump-8.8.23 | |
# data folders | ||
data/ | ||
temp-files/ | ||
|
||
__logs | ||
input | ||
*.bak |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# How to write new tests | ||
Check test.example package. Everything necessary should be there. | ||
|
||
Test data are in `test/data` folder. | ||
If your test data contains special characters like čřšáý and so on, it is recommended | ||
to make `.stripped` variation of the file. | ||
E.g. `my_format.json` and `my_format.stripped.json` for loading data | ||
and `my_format.test.xml` and `my_format.test.stripped.xml` for testing. | ||
|
||
If not on dev-5 (e.g. when run on localhost), `.stripped` version of files will be loaded. | ||
The reason for this is, that when dspace runs on windows, it has trouble with special characters. | ||
|
||
|
||
## Settings | ||
See const.py for constants used at testing. | ||
|
||
To set up logs, navigate to support.logs.py and modify method set_up_logging. | ||
|
||
## Run | ||
|
||
In order to run tests, use command | ||
`python -m unittest` | ||
|
||
Recommended variation is | ||
`python -m unittest -v 2> output.txt` | ||
which leaves result in output.txt | ||
|
||
Before running for the first time, requirements must be installed with following command | ||
`pip install -r requirements.txt` | ||
|
||
It is possible to run in Pycharm with configuration like so: | ||
|
||
![image](https://user-images.githubusercontent.com/88670521/186934112-d0f828fd-a809-4ed8-bbfd-4457b734d8fd.png) | ||
|
||
|
||
# How to re-initialize dspace 7 database | ||
|
||
Recreate your local CLARIN-DSpace7.* database **NOTE: all data will be deleted** | ||
|
||
- Install again the database following the official tutorial steps: https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace#InstallingDSpace-PostgreSQL11.x,12.xor13.x(withpgcryptoinstalled) | ||
- Or try to run these commands in the <PSQL_PATH>/bin: | ||
> - `createdb --username=postgres --owner=dspace --encoding=UNICODE dspace` // create database | ||
> - `psql --username=postgres dspace -c "CREATE EXTENSION pgcrypto;"` // Add pgcrypto extension | ||
> > If it throws warning that `-c` parameter was ignored, just write a `CREATE EXTENSION pgcrypto;` command in the database cmd. | ||
> > CREATE EXTENSION pgcrypto; | ||
![image](https://user-images.githubusercontent.com/90026355/228528044-f6ad178c-f525-4b15-b6cc-03d8d94c8ccc.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Oops, something went wrong.