$ date
Thu Mar 4 12:16:44 UTC 2021
$ git clone file:///srv/git/mediawiki-services-citoid.git repo --depth=1 -b master
Cloning into 'repo'...
$ git config user.name libraryupgrader
$ git config user.email tools.libraryupgrader@tools.wmflabs.org
$ git submodule update --init
$ grr init
Installed commit-msg hook.
$ git show-ref refs/heads/master
e82cd739af638d11822ad939e85238bf79c5ff3d refs/heads/master
Attempting to npm audit fix
$ npm audit fix --only=dev
> core-js@3.8.3 postinstall /src/repo/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
[96mThank you for using core-js ([94m https://github.com/zloirock/core-js [96m) for polyfilling JavaScript standard library![0m
[96mThe project needs your help! Please consider supporting of core-js on Open Collective or Patreon: [0m
[96m>[94m https://opencollective.com/core-js [0m
[96m>[94m https://www.patreon.com/zloirock [0m
[96mAlso, the author of core-js ([94m https://github.com/zloirock [96m) is looking for a good job -)[0m
added 257 packages from 597 contributors in 10.462s
20 packages are looking for funding
run `npm fund` for details
fixed 0 of 5 vulnerabilities in 604 scanned packages
1 package update for 1 vulnerability involved breaking changes
(use `npm audit fix --force` to install breaking changes; or refer to `npm audit` for steps to fix these manually)
Verifying that tests still pass
$ npm ci
npm WARN prepare removing existing node_modules/ before installation
> dtrace-provider@0.8.8 install /src/repo/node_modules/dtrace-provider
> node-gyp rebuild || node suppress-error.js
make: Entering directory '/src/repo/node_modules/dtrace-provider/build'
TOUCH Release/obj.target/DTraceProviderStub.stamp
make: Leaving directory '/src/repo/node_modules/dtrace-provider/build'
> unix-dgram@2.0.4 install /src/repo/node_modules/unix-dgram
> node-gyp rebuild
make: Entering directory '/src/repo/node_modules/unix-dgram/build'
CXX(target) Release/obj.target/unix_dgram/src/unix_dgram.o
In file included from ../../nan/nan.h:56,
from ../src/unix_dgram.cc:5:
/cache/node-gyp/10.21.0/include/node/node.h:573:43: warning: cast between incompatible function types from ‘void (*)(v8::Local<v8::Object>)’ to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
(node::addon_register_func) (regfunc), \
^
/cache/node-gyp/10.21.0/include/node/node.h:607:3: note: in expansion of macro ‘NODE_MODULE_X’
NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
^~~~~~~~~~~~~
../src/unix_dgram.cc:404:1: note: in expansion of macro ‘NODE_MODULE’
NODE_MODULE(unix_dgram, Initialize)
^~~~~~~~~~~
In file included from /cache/node-gyp/10.21.0/include/node/node.h:63,
from ../../nan/nan.h:56,
from ../src/unix_dgram.cc:5:
/cache/node-gyp/10.21.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’:
/cache/node-gyp/10.21.0/include/node/node_object_wrap.h:84:78: required from here
/cache/node-gyp/10.21.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
reinterpret_cast<Callback>(callback), type);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/cache/node-gyp/10.21.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
../../nan/nan_object_wrap.h:65:61: required from here
/cache/node-gyp/10.21.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
SOLINK_MODULE(target) Release/obj.target/unix_dgram.node
COPY Release/unix_dgram.node
make: Leaving directory '/src/repo/node_modules/unix-dgram/build'
> heapdump@0.3.15 install /src/repo/node_modules/heapdump
> node-gyp rebuild
make: Entering directory '/src/repo/node_modules/heapdump/build'
CXX(target) Release/obj.target/addon/src/heapdump.o
In file included from ../src/heapdump.cc:15:
/cache/node-gyp/10.21.0/include/node/node.h:573:43: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
(node::addon_register_func) (regfunc), \
^
/cache/node-gyp/10.21.0/include/node/node.h:607:3: note: in expansion of macro ‘NODE_MODULE_X’
NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
^~~~~~~~~~~~~
../src/heapdump.cc:136:1: note: in expansion of macro ‘NODE_MODULE’
NODE_MODULE(addon, Initialize)
^~~~~~~~~~~
In file included from /cache/node-gyp/10.21.0/include/node/node.h:63,
from ../src/heapdump.cc:15:
/cache/node-gyp/10.21.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’:
/cache/node-gyp/10.21.0/include/node/node_object_wrap.h:84:78: required from here
/cache/node-gyp/10.21.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
reinterpret_cast<Callback>(callback), type);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/cache/node-gyp/10.21.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
../../nan/nan_object_wrap.h:65:61: required from here
/cache/node-gyp/10.21.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
SOLINK_MODULE(target) Release/obj.target/addon.node
COPY Release/addon.node
make: Leaving directory '/src/repo/node_modules/heapdump/build'
> gc-stats@1.4.0 install /src/repo/node_modules/gc-stats
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using request for node-pre-gyp https download
[gc-stats] Success: "/src/repo/node_modules/gc-stats/build/gcstats/v1.4.0/Release/node-v64-linux-x64/gcstats.node" is installed via remote
> core-js@3.8.3 postinstall /src/repo/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
added 535 packages in 21.511s
$ npm test
> citoid@1.0.0 test /src/repo
> npm run lint && mocha ./test/features/unit/*
> citoid@1.0.0 lint /src/repo
> eslint --max-warnings 0 --ext .js --cache --report-unused-disable-directives .
type schema data functions
zotero methods
✓ returns false if no base types exist
✓ gets base types - no creators
✓ gets base types - with creators
creator types methods
✓ gets creator type ids
✓ returns empty list if no create type ids exist
✓ gets primary creator id from type
✓ gets creator name from id
✓ gets primary creator id from name
✓ determines if creatorType valid for type- true
✓ determines if creatorType valid for type- false
item fields methods
✓ determines if id is valid for type- false
✓ determines if id is valid for type- true
✓ determines if creator field is valid for type- true
✓ determines if creator field is valid for type- false
✓ get field id from type and base
✓ get base id from type and field
✓ get item type fields
✓ gets field name from id
✓ gets id from field name
lib/Exporter.js functions:
validation functions:
fixURL:
✓ discards url with no host
✓ adds protocol to url when missing
addIDSToCitation:
✓ cleans script and html out of title
stripCitation:
✓ cleans script and html out of title
fixDate:
✓ Contains copyright symbol
✓ Is in brackets for some unfathomable reason
✓ Contains copyright symbol & whitespace
✓ Contains c symbol
✓ sets year only date to year only date
✓ converts American style date to ISO
✓ Unable to parse so leaves as written; season
✓ Chooses worldcat publication year
✓ Multilingual date - Spanish - leaves as written
✓ Multilingual date - Russian - leaves as written
✓ Normal date
✓ Normal date with ordinal indicator
✓ Correctly sets normal date with ordinal number
✓ Date on the fence: ISO with - notation
✓ Date on the fence; ISO with + notation
✓ Date on the fence; toString output
✓ Date on the fence; ISO with Z notation
✓ Year first date
✓ Partial ISO date no preceeding 0
✓ Full ISO date no preceeding 0
✓ Full ISO date no preceeding 0 month or day
✓ Partial ISO date proceeding 0
fixDOI:
✓ Correctly gets DOI from full citation
✓ Correctly removes DOI that is not a DOI
✓ Correctly gets DOI when only DOI is present
fixISBN:
✓ Correctly hyphenates single ISBN-10
✓ Correctly handles ISBN-13s that have spaces in them
✓ Correctly extracts two ISBN-10s
✓ Correctly extracts ISBN-13
✓ Correctly extracts ISBN-10 and ISBN-13
✓ Correctly handles and normalizes hyphenated ISBN
✓ Correctly handles ISBNs with and without hyphens
✓ Correctly handles ISBN-13s that have spaces in them
✓ Correctly handles out comma separated ISBNs
fixISSN:
✓ Correctly ignores invalid ISSN
✓ Correctly adds valid ISSN
✓ Correctly adds valid ISSN with X
✓ Correctly adds valid ISSN with x
✓ Correctly ignores invalid ISSN without hyphen
✓ Correctly ignores invalid ISSN
fixPages:
✓ converts hyphen minus to en dash
replaceCreators:
✓ Correctly adds name with firstName and lastName present
✓ Correctly adds names with only lastName or firstName present
✓ Adds names with name field
✓ Doesn't add names with incorrect field name
export formats:
wikibase:
different search term types
✓ url from search, doi from result
✓ doi from search, no url
✓ qid, no url
✓ pmid, no url
✓ pmcid, no url
different item types
✓ itemType webpage
✓ itemType book
✓ itemType journalArticle
lib/externalAPIs/CrossRefService.js functions:
polite config
✓ Gets metadata for doi (743ms)
✓ Doesn't get metadata for invalid doi (307ms)
anonymous config
✓ Gets metadata for doi (363ms)
✓ Doesn't get metadata for invalid doi (319ms)
open search function
✓ Gets metadata for open search (3975ms)
lib/Scraper.js functions:
matchIDs function:
✓ gets doi from bePress string
✓ gets doi from bePress Array
✓ gets doi from highwirePress string
✓ gets doi from highwirePress Array
✓ gets doi from dublinCore string
✓ gets doi from dublinCore Array
✓ Returns empty metadata from empty object
✓ Multiple metadata types
parsing
✓ should scrape meta tag charset content
Tests for Translator.js :
translate function on html:
✓ translates bePress metadata from movie file (71ms)
✓ translates bePress metadata from article file (79ms)
✓ translates bePress metadata from song file
✓ translates highwirePress metadata from movie file (40ms)
✓ translates highwirePress metadata from article file (83ms)
✓ translates highwirePress metadata from song file
✓ translates coins metadata from movie file
✓ translates coins metadata from article file
✓ translates coins metadata from song file
✓ translates dublinCore metadata from movie file (54ms)
✓ translates dublinCore metadata from article file (60ms)
✓ translates dublinCore metadata from song file
✓ translates general metadata from movie file
✓ translates general metadata from article file
✓ translates general metadata from song file
✓ translates openGraph metadata from movie file
✓ translates openGraph metadata from article file (40ms)
✓ translates openGraph metadata from song file
translate function on json:
✓ sets right info from journal-article crossRef metadata
✓ sets right info from book-section crossRef metadata
✓ tests every itemType for crossRef translator on every sample crossRef file (100ms)
addItemType function:
✓ sets videoRecording itemType
✓ sets article itemType
✓ sets audioRecording itemType from openGraph
✓ sets itemType webpage if no relevant metadata available
check specific results:
✓ sets right info from webpage for general metadata
✓ sets right info from webpage for bepress metadata
coins metadata
✓ Correctly adds pages from spage and epage
✓ Correctly fixes en dash in pages fields
✓ Correctly adds date
exports.other.addCreators function
✓ Doesn't add empty creators field
✓ Doesn't add creators field if missing itemType
- Doesn't add duplicate author names
- Doesn't add duplicate author names with nbsp present
✓ Correctly adds name with missing firstname
✓ Correctly adds name with missing lastname
✓ Correctly uses auinit1 and auinitm
✓ Correctly uses auinit1 and auinitm
✓ Correctly adds corporation names
✓ Does split names in au field
dublinCore translator unit
✓ Creator translate function adds lists of strings
dateParts function
✓ Translates full date
✓ Translates year and day
✓ Translates year only
✓ Fails with object
✓ Fails with list not nested
✓ Works with strings date
✓ Does not work with unexpected input
dublinCore translator unit
✓ Creator translate function adds lists of strings
✓ Correctly adds an author string with one word
✓ Correctly adds an author string with two words
✓ Correctly adds an author string with three words
general translator unit
✓ Author function adds lists of strings
✓ Correctly adds an author string with one word
✓ Correctly adds an author string with two words
✓ Correctly adds an author string with three words
✓ Does something redonk with Harry Potter author field from worldcat
worldcat marcXML translator unit
✓ Correctly adds an author string with one word
✓ Correctly adds an author string with two words
✓ Correctly adds an author string with three words
✓ Correctly adds an author string with date
✓ Format Last name, first name
openSearch translator unit tests:
✓ title
✓ oclc
translator utilities:
makeTranslator function:
✓ strips leading and trailing whitespace
✓ correctly adds date with fixDate validate function
✓ correctly uses fixLang validate function
makePagesTranslator function:
✓ Uses spage and epage
✓ Uses optional pages arg and converts - to en dash
makeListTranslator function:
✓ Correctly adds one isbn
✓ Correctly uses isbn validate function
✓ Correctly uses issn validate function
✓ Correctly adds two issn and one eissn
✓ Correctly adds two isbn
makeCreatorsTranslator function:
✓ Name as written
✓ Format Last name, first name
✓ Adds two different contributor types
165 passing (7s)
2 pending
$ git add .
$ git commit -F /tmp/tmpbwearwcv
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
.