Skip to content

Commit

Permalink
chore: WDQS_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
rti committed Feb 7, 2025
1 parent b58eae9 commit eb63fc6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ In order to test your own instances of the services, make sure to change the fol
WIKIBASE_URL=http://wikibase
WIKIBASE_CLIENT_URL=http://wikibase-client
QUICKSTATEMENTS_URL=http://quickstatements
WDQS_FRONTEND_URL=http://wdqs-frontend
WDQS_URL=http://wdqs:9999
WDQS_URL=http://query
MW_ADMIN_NAME=
MW_ADMIN_PASS=
MW_SCRIPT_PATH=/w
Expand Down
6 changes: 3 additions & 3 deletions test/helpers/pages/queryservice-ui/queryservice-ui.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ class QueryServiceUIPage extends SubmittablePage {
}

/**
* `${testEnv.vars.WDQS_FRONTEND_URL}/#${prefixes, query}`
* `${testEnv.vars.WDQS_URL}/#${prefixes, query}`
*
* @param {string} query
* @param {string[]} prefixes - Optional
* @return {void}
*/
public async open( query: string, prefixes: string[] = [] ): Promise<void> {
await browser.url( testEnv.vars.WDQS_FRONTEND_URL );
await browser.url( testEnv.vars.WDQS_URL );
if ( prefixes ) {
query = [ ...prefixes, query ].join( '\n' );
}
browser.url( `${ testEnv.vars.WDQS_FRONTEND_URL }/#${ encodeURI( query ) }` );
browser.url( `${ testEnv.vars.WDQS_URL }/#${ encodeURI( query ) }` );
}

public async resultIncludes( prop: string, value?: string ): Promise<boolean> {
Expand Down
8 changes: 4 additions & 4 deletions test/specs/repo/queryservice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import { wikibasePropertyString } from '../../helpers/wikibase-property-types.js
describe( 'QueryService', function () {
it( 'Should be able to get sparql endpoint', async function () {
const result = await browser.makeRequest(
`${ testEnv.vars.WDQS_FRONTEND_URL }/sparql`
`${ testEnv.vars.WDQS_URL }/sparql`
);
expect( result.status ).toEqual( 200 );
} );

it( 'Should not be able to post to sparql endpoint', async function () {
const result = await browser.makeRequest(
`${ testEnv.vars.WDQS_FRONTEND_URL }/sparql`,
`${ testEnv.vars.WDQS_URL }/sparql`,
{ validateStatus: false },
{}
);
Expand All @@ -25,15 +25,15 @@ describe( 'QueryService', function () {

it( 'Should not be possible to reach blazegraph ldf api that is not enabled', async function () {
const result = await browser.makeRequest(
`${ testEnv.vars.WDQS_FRONTEND_URL }/ldf`,
`${ testEnv.vars.WDQS_URL }/ldf`,
{ validateStatus: false }
);
expect( result.status ).toEqual( 404 );
} );

it( 'Should not be possible to reach blazegraph ldf assets thats not enabled', async function () {
const result = await browser.makeRequest(
`${ testEnv.vars.WDQS_FRONTEND_URL }/assets`,
`${ testEnv.vars.WDQS_URL }/assets`,
{ validateStatus: false }
);
expect( result.status ).toEqual( 404 );
Expand Down
3 changes: 1 addition & 2 deletions test/test-services.env
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ MW_ADMIN_PASS=change-this-password
# URLs used by tests to access services from within the
# docker network through traefik proxy
WIKIBASE_URL=http://wikibase.example
WDQS_FRONTEND_URL=http://query.example
WDQS_URL=http://query.example
QUICKSTATEMENTS_URL=http://quickstatements.example

# URLs used by tests to access services from within the docker network directly
WIKIBASE_CLIENT_URL=http://wikibase-client
WDQS_URL=http://wdqs:9999

# CONFIG
# wikibase / wikibase-client / wikibase-jobrunner
Expand Down

0 comments on commit eb63fc6

Please sign in to comment.