-
Notifications
You must be signed in to change notification settings - Fork 96
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
Run cypress #1479
Run cypress #1479
Changes from all commits
5023f64
2fef3a6
8929429
02df68d
65945cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,84 +3,103 @@ name: CI | |
on: [push, pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
build-test: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
timeout-minutes: 10 | ||
continue-on-error: ${{ matrix.experimental }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php_version: ["8.0", "8.1"] | ||
experimental: [false] | ||
include: | ||
- php_version: "8.2" | ||
experimental: true | ||
# build-test: | ||
# runs-on: ubuntu-latest | ||
# permissions: | ||
# packages: write | ||
# timeout-minutes: 10 | ||
# continue-on-error: ${{ matrix.experimental }} | ||
# strategy: | ||
# fail-fast: false | ||
# matrix: | ||
# php_version: ["8.0", "8.1"] | ||
# experimental: [false] | ||
# include: | ||
# - php_version: "8.2" | ||
# experimental: true | ||
# | ||
# steps: | ||
# - name: Check out repository code | ||
# uses: actions/checkout@v3 | ||
# with: | ||
# fetch-depth: 0 | ||
# | ||
# - name: Cache Fuseki installation | ||
# uses: actions/cache@v3 | ||
# with: | ||
# path: tests/apache-jena-fuseki-* | ||
# key: fuseki-${{ hashFiles('tests/init_fuseki.sh') }} | ||
# | ||
# - name: Start up Fuseki | ||
# run: cd tests; sh ./init_fuseki.sh | ||
# | ||
# - name: Cache Composer dependencies | ||
# uses: actions/cache@v3 | ||
# with: | ||
# path: | | ||
# /tmp/composer-cache | ||
# vendor | ||
# components | ||
# key: ${{ runner.os }}-php${{ matrix.php_version}}-skosmos3-${{ hashFiles('**/composer.json') }} | ||
# restore-keys: | | ||
# ${{ runner.os }}-php${{ matrix.php_version}}-skosmos3- | ||
# | ||
# - name: Install Composer dependencies | ||
# uses: php-actions/composer@v6 | ||
# with: | ||
# php_version: ${{ matrix.php_version }} | ||
# php_extensions: gettext intl xsl pcov | ||
# | ||
# - name: Install Node | ||
# uses: actions/setup-node@v3 | ||
# with: | ||
# node-version: 16.x | ||
# | ||
# - name: Install JavaScript dependencies | ||
# run: npm install | ||
# | ||
# - name: Check PHP code style | ||
# run: ./vendor/bin/php-cs-fixer fix src --diff --dry-run | ||
# | ||
# - name: Check JavaScript code style | ||
# run: cd resource/js; npx standard *.js | ||
# | ||
# - name: Run PHPUnit tests | ||
# uses: php-actions/phpunit@v3 | ||
# env: | ||
# LANGUAGE: fr | ||
# with: | ||
# version: 9.5 | ||
# php_version: ${{ matrix.php_version }} | ||
# php_extensions: gettext intl xsl pcov | ||
# memory_limit: 512M | ||
# configuration: phpunit.xml | ||
# | ||
# - name: Publish code coverage to Code Climate | ||
# uses: paambaati/[email protected] | ||
# env: | ||
# CC_TEST_REPORTER_ID: fb98170a5c7ea9cc2bbab19ff26268335e6a11a4f8267ca935e5e8ff4624886c | ||
# with: | ||
# prefix: /app | ||
# | ||
# - name: Publish code coverage to Codecov | ||
# uses: codecov/codecov-action@v3 | ||
|
||
cypress-run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Cache Fuseki installation | ||
uses: actions/cache@v3 | ||
with: | ||
path: tests/apache-jena-fuseki-* | ||
key: fuseki-${{ hashFiles('tests/init_fuseki.sh') }} | ||
|
||
- name: Start up Fuseki | ||
run: cd tests; sh ./init_fuseki.sh | ||
|
||
- name: Cache Composer dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
/tmp/composer-cache | ||
vendor | ||
components | ||
key: ${{ runner.os }}-php${{ matrix.php_version}}-skosmos3-${{ hashFiles('**/composer.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-php${{ matrix.php_version}}-skosmos3- | ||
|
||
- name: Install Composer dependencies | ||
uses: php-actions/composer@v6 | ||
with: | ||
php_version: ${{ matrix.php_version }} | ||
php_extensions: gettext intl xsl pcov | ||
|
||
- name: Install Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
|
||
- name: Install JavaScript dependencies | ||
run: npm install | ||
|
||
- name: Check PHP code style | ||
run: ./vendor/bin/php-cs-fixer fix src --diff --dry-run | ||
|
||
- name: Check JavaScript code style | ||
run: cd resource/js; npx standard *.js | ||
|
||
- name: Run PHPUnit tests | ||
uses: php-actions/phpunit@v3 | ||
env: | ||
LANGUAGE: fr | ||
with: | ||
version: 9.5 | ||
php_version: ${{ matrix.php_version }} | ||
php_extensions: gettext intl xsl pcov | ||
memory_limit: 512M | ||
configuration: phpunit.xml | ||
|
||
- name: Publish code coverage to Code Climate | ||
uses: paambaati/[email protected] | ||
env: | ||
CC_TEST_REPORTER_ID: fb98170a5c7ea9cc2bbab19ff26268335e6a11a4f8267ca935e5e8ff4624886c | ||
with: | ||
prefix: /app | ||
|
||
- name: Publish code coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
cache: yarn | ||
- name: Install | ||
run: yarn install | ||
- name: Start Skosmos | ||
run: cd dockerfiles && docker compose up -d | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here before we run the tests, we can have a step that loads datasets, if necessary. Startup of Skosmos is taking ~2.5 minutes on GH Actions with Docker Compose. So the overall execution for Cypress is quite good for now. |
||
- name: Test | ||
run: yarn run test:e2e |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ const { defineConfig } = require("cypress"); | |
|
||
module.exports = defineConfig({ | ||
e2e: { | ||
baseUrl: 'http://localhost/Skosmos', | ||
baseUrl: 'http://localhost:9090/', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can pass that via command line too. If most devs will use their own localhost/Skosmos instead of docker or 9090, that might make more sense. Changed here as that was the simplest to get the Cypress tests executed. |
||
setupNodeEvents(on, config) { | ||
// implement node event listeners here | ||
}, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ignore these dockerfiles modified here. I just cherry-picked from #1477 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,73 @@ | ||
@prefix : <http://base/#> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix tdb2: <http://jena.apache.org/2016/tdb#> . | ||
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix fuseki: <http://jena.apache.org/fuseki#> . | ||
@prefix tdb2: <http://jena.apache.org/2016/tdb#> . | ||
@prefix text: <http://jena.apache.org/text#> . | ||
@prefix skos: <http://www.w3.org/2004/02/skos/core#> . | ||
@prefix fuseki: <http://jena.apache.org/fuseki#> . | ||
|
||
ja:DatasetTxnMem rdfs:subClassOf ja:RDFDataset . | ||
ja:MemoryDataset rdfs:subClassOf ja:RDFDataset . | ||
ja:RDFDatasetOne rdfs:subClassOf ja:RDFDataset . | ||
ja:RDFDatasetSink rdfs:subClassOf ja:RDFDataset . | ||
ja:RDFDatasetZero rdfs:subClassOf ja:RDFDataset . | ||
|
||
tdb2:DatasetTDB rdfs:subClassOf ja:RDFDataset . | ||
tdb2:DatasetTDB2 rdfs:subClassOf ja:RDFDataset . | ||
|
||
tdb2:GraphTDB rdfs:subClassOf ja:Model . | ||
tdb2:GraphTDB2 rdfs:subClassOf ja:Model . | ||
|
||
<http://jena.hpl.hp.com/2008/tdb#DatasetTDB> | ||
rdfs:subClassOf ja:RDFDataset . | ||
|
||
<http://jena.hpl.hp.com/2008/tdb#GraphTDB> | ||
rdfs:subClassOf ja:Model . | ||
|
||
text:TextDataset | ||
rdfs:subClassOf ja:RDFDataset . | ||
[] rdf:type fuseki:Server ; | ||
fuseki:services ( | ||
:skosmos_service | ||
) | ||
. | ||
|
||
:service_tdb_all a fuseki:Service ; | ||
rdfs:label "TDB2+text skosmos" ; | ||
fuseki:dataset :text_dataset ; | ||
fuseki:name "skosmos" ; | ||
fuseki:serviceQuery "query" , "" , "sparql" ; | ||
fuseki:serviceReadGraphStore "get" ; | ||
fuseki:serviceReadQuads "" ; | ||
:skosmos_service rdf:type fuseki:Service ; | ||
rdfs:label "TDB2+text skosmos" ; | ||
fuseki:name "skosmos" ; | ||
fuseki:serviceQuery "query" , "" , "sparql" ; | ||
fuseki:serviceReadGraphStore "get" ; | ||
fuseki:serviceReadQuads "" ; | ||
fuseki:serviceReadWriteGraphStore "data" ; | ||
fuseki:serviceReadWriteQuads "" ; | ||
fuseki:serviceUpdate "" , "update" ; | ||
fuseki:serviceUpload "upload" . | ||
fuseki:serviceReadWriteQuads "" ; | ||
fuseki:serviceUpdate "" , "update" ; | ||
fuseki:serviceUpload "upload" ; | ||
fuseki:dataset :text_dataset | ||
. | ||
|
||
:text_dataset a text:TextDataset ; | ||
text:dataset :tdb_dataset_readwrite ; | ||
text:index :index_lucene . | ||
:text_dataset rdf:type text:TextDataset ; | ||
text:dataset :tdb_dataset_readwrite ; | ||
text:index <#indexLucene> | ||
. | ||
|
||
:tdb_dataset_readwrite | ||
a tdb2:DatasetTDB2 ; | ||
# tdb2:unionDefaultGraph true ; | ||
tdb2:location "/fuseki/databases/skosmos" . | ||
:tdb_dataset_readwrite rdf:type tdb2:DatasetTDB2 ; | ||
tdb2:location "/fuseki/databases/skosmos" ; | ||
# tdb2:unionDefaultGraph true ; | ||
. | ||
|
||
:index_lucene a text:TextIndexLucene ; | ||
text:directory <file:/fuseki/databases/skosmos/text> ; | ||
text:entityMap :entity_map ; | ||
text:storeValues true . | ||
<#indexLucene> rdf:type text:TextIndexLucene ; | ||
text:directory <file:/fuseki/databases/skosmos/text> ; | ||
text:entityMap <#entMap> ; | ||
text:storeValues true | ||
. | ||
|
||
# Text index configuration for Skosmos | ||
:entity_map a text:EntityMap ; | ||
text:entityField "uri" ; | ||
text:graphField "graph" ; | ||
<#entMap> rdf:type text:EntityMap ; | ||
text:defaultField "pref" ; | ||
text:entityField "uri" ; | ||
text:uidField "uid" ; | ||
text:langField "lang" ; | ||
text:graphField "graph" ; | ||
text:map ( | ||
# skos:prefLabel | ||
[ text:field "pref" ; | ||
text:predicate skos:prefLabel ; | ||
text:analyzer [ a text:LowerCaseKeywordAnalyzer ] | ||
text:analyzer [ rdf:type text:LowerCaseKeywordAnalyzer ] | ||
] | ||
# skos:altLabel | ||
[ text:field "alt" ; | ||
text:predicate skos:altLabel ; | ||
text:analyzer [ a text:LowerCaseKeywordAnalyzer ] | ||
text:analyzer [ rdf:type text:LowerCaseKeywordAnalyzer ] | ||
] | ||
# skos:hiddenLabel | ||
[ text:field "hidden" ; | ||
text:predicate skos:hiddenLabel ; | ||
text:analyzer [ a text:LowerCaseKeywordAnalyzer ] | ||
text:analyzer [ rdf:type text:LowerCaseKeywordAnalyzer ] | ||
] | ||
# skos:notation | ||
[ text:field "notation" ; | ||
text:predicate skos:notation ; | ||
text:analyzer [ a text:LowerCaseKeywordAnalyzer ] | ||
text:analyzer [ rdf:type text:LowerCaseKeywordAnalyzer ] | ||
] | ||
) . | ||
) | ||
. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disabling just to run CI a bit faster. Will add it back later.