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 Solid CRUD tests in Travis #278

Merged
merged 5 commits into from
Nov 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ coverage
**/*.js
**/*.d.ts
**/*.js.map

# ignore temporary test files
test/tmp
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
.idea

node_modules
coverage

*.js
*.js.map
*.d.ts
components

.eslintcache

!.eslintrc.js
!test/eslintrc.js

!jest.config.js

components
coverage

test/tmp
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@ script:
jobs:
allow_failures:
- node_js: "node"
- node_js: "14.0"
fast_finish: true
include:
- stage: test
name: Coveralls
node_js: "14"
script:
- npm run jest -- --coverage --coverageReporters=text-lcov | npx coveralls
- stage: test
name: "System tests (pending)"
node_js: "14.0"
script:
- npm run test:system
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
"transform": {
"^.+\\.ts$": "ts-jest"
},
"testRegex": "/test/.*\\.test\\.ts$",
"testRegex": "/test/(unit|integration)/.*\\.test\\.ts$",
"moduleFileExtensions": [
"ts",
"js"
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"test": "npm run jest",
"test:deploy": "test/deploy/validate-package.sh",
"test:integration": "jest --coverageThreshold '{}' test/integration",
"test:system": "test/system/run-solid-test-suite.sh",
"test:unit": "jest test/unit",
"validate": "componentsjs-compile-config urn:solid-server:default -c config/config-default.json -f > /dev/null",
"version": "manual-git-changelog onversion",
Expand Down
25 changes: 25 additions & 0 deletions test/system/run-solid-test-suite.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

# Start server
npm start &
PID=$!

# Initialize tests
pushd test/tmp
git clone https://github.com/solid/solid-crud-tests
cd solid-crud-tests
git checkout v0.3.0
npm ci

# Run tests
export SERVER_ROOT=http://localhost:3000
export ALICE_WEBID_DOC=$SERVER_ROOT/profile.ttl
export ALICE_WEBID=$ALICE_WEBID#me
curl -X PUT $ALICE_WEBID_DOC -d '<#me> <http://www.w3.org/ns/pim/space#storage> </>.'
npm run jest
RESULT=$?

# Clean up
kill $PID
popd
exit $RESULT
Empty file added test/tmp/.gitkeep
Empty file.
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"test/**/*.ts"
],
"exclude": [
"node_modules"
"node_modules",
"test/tmp"
]
}