Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests #43

Closed
p-a-s-c-a-l opened this issue Aug 21, 2019 · 10 comments
Closed

Add tests #43

p-a-s-c-a-l opened this issue Aug 21, 2019 · 10 comments
Assignees
Labels
BB: Map Component Map Component Building Block enhancement New feature or request

Comments

@p-a-s-c-a-l
Copy link
Member

Add some tests!

@p-a-s-c-a-l p-a-s-c-a-l added the enhancement New feature or request label Aug 21, 2019
@p-a-s-c-a-l p-a-s-c-a-l added this to the D1.4 CLARITY CSIS v2 milestone Aug 21, 2019
@p-a-s-c-a-l p-a-s-c-a-l self-assigned this Aug 21, 2019
@p-a-s-c-a-l p-a-s-c-a-l added this to Backlog: High Priority in T1.3 Climate Services Co-creation via automation Aug 21, 2019
p-a-s-c-a-l added a commit that referenced this issue Aug 21, 2019
p-a-s-c-a-l added a commit that referenced this issue Aug 21, 2019
p-a-s-c-a-l added a commit that referenced this issue Sep 6, 2019
p-a-s-c-a-l added a commit that referenced this issue Sep 6, 2019
@p-a-s-c-a-l p-a-s-c-a-l added the BB: Map Component Map Component Building Block label Sep 6, 2019
@p-a-s-c-a-l p-a-s-c-a-l moved this from Backlog: High Priority to Backlog: Low Priority in T1.3 Climate Services Co-creation Oct 7, 2019
@p-a-s-c-a-l
Copy link
Member Author

done

T1.3 Climate Services Co-creation automation moved this from Backlog: Low Priority to Done Oct 11, 2019
@p-a-s-c-a-l p-a-s-c-a-l added this to To do in T4.4 Scenario Transferability via automation Oct 28, 2019
@p-a-s-c-a-l p-a-s-c-a-l moved this from To do to Done in T4.4 Scenario Transferability Nov 6, 2019
p-a-s-c-a-l added a commit that referenced this issue Nov 11, 2019
@p-a-s-c-a-l
Copy link
Member Author

console.error node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/virtual-console.js:29
  Error: Cross origin http://localhost forbidden
      at dispatchError (C:\git_work\CLARITY\map-component\node_modules\jest-environment-jsdom\node_modules\jsdom\lib\jsdom\living\xhr-utils.js:65:19)
      at Object.validCORSHeaders (C:\git_work\CLARITY\map-component\node_modules\jest-environment-jsdom\node_modules\jsdom\lib\jsdom\living\xhr-utils.js:77:5)
      at receiveResponse (C:\git_work\CLARITY\map-component\node_modules\jest-environment-jsdom\node_modules\jsdom\lib\jsdom\living\xmlhttprequest.js:847:21)
      at Request.client.on.res (C:\git_work\CLARITY\map-component\node_modules\jest-environment-jsdom\node_modules\jsdom\lib\jsdom\living\xmlhttprequest.js:679:38)
      at Request.emit (events.js:198:13)
      at Request.onRequestResponse (C:\git_work\CLARITY\map-component\node_modules\request\request.js:1066:10)
      at ClientRequest.emit (events.js:198:13)
      at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:556:21)
      at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)
      at Socket.socketOnData (_http_client.js:442:20) undefined
console.log ../csis-helpers-js/dist/index.js:171
  18 resources left after filtering 32 resources by tag type taxonomy_term--eu_gl and tag name Hazard Characterization - Local Effects
console.log ../csis-helpers-js/dist/index.js:171
  10 resources left after filtering 32 resources by tag type taxonomy_term--eu_gl and tag name Hazard Characterization
console.warn ../csis-helpers-js/dist/index.js:264
  no references found in resource 'Adaptation Options' (9c62e7d3-33c8-41a6-825f-9da36d6d7bda)
console.log ../csis-helpers-js/dist/index.js:270
  30 resources left after filtering 32 resources by reference type @mapview:ogc:wms
console.log ../csis-helpers-js/dist/index.js:171
  10 resources left after filtering 32 resources by tag type taxonomy_term--eu_gl and tag name Hazard Characterization
console.log ../csis-helpers-js/dist/index.js:270
  10 resources left after filtering 10 resources by reference type @mapview:ogc:wms
console.log ../csis-helpers-js/dist/index.js:171
  10 resources left after filtering 32 resources by tag type taxonomy_term--eu_gl and tag name Hazard Characterization
console.log ../csis-helpers-js/dist/index.js:270
  10 resources left after filtering 10 resources by reference type @mapview:ogc:wms

@p-a-s-c-a-l p-a-s-c-a-l reopened this Mar 6, 2020
T1.3 Climate Services Co-creation automation moved this from Done to In Progress Mar 6, 2020
T4.4 Scenario Transferability automation moved this from Done to In progress Mar 6, 2020
@p-a-s-c-a-l
Copy link
Member Author

p-a-s-c-a-l commented Mar 6, 2020

Plus the same problem as here: clarity-h2020/simple-table-component#4 (comment)

It's always 'nice' to see your tests failing not because of changes in code or tests specs but in the test environment itself. 😲

@p-a-s-c-a-l
Copy link
Member Author

p-a-s-c-a-l commented Mar 6, 2020

Fix: axios/axios#1754 (comment)

@p-a-s-c-a-l
Copy link
Member Author

p-a-s-c-a-l commented Mar 6, 2020

log.debug() in beforeAll is not printed to console when running the tests in VSCode. See also jestjs/jest#2441

@p-a-s-c-a-l

This comment has been minimized.

@p-a-s-c-a-l

This comment has been minimized.

@p-a-s-c-a-l
Copy link
Member Author

don't expect that this will work on an ip6 capable system if server adress is ::1

http://${server.address().address}:${server.address().port}

hard-code http://localhost:${server.address().port} instead. 👎

p-a-s-c-a-l added a commit that referenced this issue Mar 6, 2020
@p-a-s-c-a-l
Copy link
Member Author

Works locally but not on CI:

FAIL src/tests/CSISRemoteHelpers.test.js (12.224s)
● Console

console.warn src/__tests__/CSISRemoteHelpers.test.js:76
  no headers ENV VAR (.env.test.local) found, skipping remote API tests
console.warn src/__tests__/CSISRemoteHelpers.test.js:113
  no headers.js fixture found, skipping remote API tests
console.log node_modules/csis-helpers-js/dist/index.js:983
  fetching study from CSIS API: https://csis.myclimateservice.eu/jsonapi/group/study/c3609e3e-f80f-482b-9e9f-3a26226a6859?include=field_data_package,field_data_package.field_resources,field_data_package.field_resources.field_resource_tags,field_data_package.field_resources.field_references,field_data_package.field_resources.field_resource_tags.field_var_meaning2
console.error node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/virtual-console.js:29
  Error: Cross origin http://localhost forbidden
      at dispatchError (/var/jenkins_home/workspace/map-component/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/xhr-utils.js:65:19)
      at Object.validCORSHeaders (/var/jenkins_home/workspace/map-component/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/xhr-utils.js:77:5)
      at receiveResponse (/var/jenkins_home/workspace/map-component/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/xmlhttprequest.js:847:21)
      at Request.<anonymous> (/var/jenkins_home/workspace/map-component/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/xmlhttprequest.js:679:38)
      at Request.emit (events.js:321:20)
      at Request.onRequestResponse (/var/jenkins_home/workspace/map-component/node_modules/request/request.js:1066:10)
      at ClientRequest.emit (events.js:321:20)
      at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:610:27)
      at HTTPParser.parserOnHeadersComplete (_http_common.js:116:17)
      at TLSSocket.socketOnData (_http_client.js:479:22) undefined
console.error node_modules/csis-helpers-js/dist/index.js:996
  could not fetch study from https://csis.myclimateservice.eu/jsonapi/group/study/c3609e3e-f80f-482b-9e9f-3a26226a6859?include=field_data_package,field_data_package.field_resources,field_data_package.field_resources.field_resource_tags,field_data_package.field_resources.field_references,field_data_package.field_resources.field_resource_tags.field_var_meaning2 Error: Network Error

p-a-s-c-a-l added a commit that referenced this issue Mar 6, 2020
@p-a-s-c-a-l
Copy link
Member Author

BTW, remote tests shouldn't be executed on CI, because .env.test.local is no present.!
It seems that it.onlydoesn't work any more as expected.

p-a-s-c-a-l added a commit that referenced this issue Mar 6, 2020
p-a-s-c-a-l added a commit that referenced this issue Mar 6, 2020
p-a-s-c-a-l added a commit that referenced this issue Mar 6, 2020
p-a-s-c-a-l added a commit that referenced this issue Mar 6, 2020
p-a-s-c-a-l added a commit that referenced this issue Mar 6, 2020
T1.3 Climate Services Co-creation automation moved this from In Progress to Done Mar 6, 2020
T4.4 Scenario Transferability automation moved this from In progress to Done Mar 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BB: Map Component Map Component Building Block enhancement New feature or request
Projects
No open projects
Development

No branches or pull requests

1 participant