Skip to content

Commit 1baa718

Browse files
committed
Node 18 with github actions resolves localhost to ::1 that docker does not listen on
1 parent cb9f4ca commit 1baa718

File tree

12 files changed

+30
-31
lines changed

12 files changed

+30
-31
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ jobs:
3434
node-version: 18
3535
- name: Run terminusdb server
3636
run: |
37-
docker run --detach --net=host terminusdb/terminusdb-server:dev && sleep 10
37+
docker run --detach --publish 127.0.0.1:6363:6363 terminusdb/terminusdb-server:dev && sleep 10
3838
docker ps
3939
netstat -an |grep 6363
40-
echo "127.0.0.1 localhost" >> /etc/hosts
4140
- name: Install, build and test
4241
run: |
4342
npm ci

integration_tests/create_database.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import { DbDetails, DocParamsGet } from '../dist/typescript/lib/typedef';
77
import schemaJson from './persons_schema'
88
//console.log(typeof schemaJson)
99

10-
let client : WOQLClient //= new WOQLClient('http://localhost:6363');
10+
let client : WOQLClient //= new WOQLClient('http://127.0.0.1:6363');
1111

1212
beforeAll(() => {
13-
client = new WOQLClient("http://localhost:6363",{ user: 'admin', organization: 'admin', key: process.env.TDB_ADMIN_PASS ?? 'root' })
13+
client = new WOQLClient("http://127.0.0.1:6363",{ user: 'admin', organization: 'admin', key: process.env.TDB_ADMIN_PASS ?? 'root' })
1414
});
1515

1616
const db01 = 'db__test';

integration_tests/woql_arithmetic.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import { WOQLClient, WOQL } from '../index.js';
44
import { DbDetails } from '../dist/typescript/lib/typedef.js';
55
import { Vars } from '../lib/woql.js';
66

7-
let client: WOQLClient //= new WOQLClient('http://localhost:6363');
7+
let client: WOQLClient //= new WOQLClient('http://127.0.0.1:6363');
88
const db01 = 'db__test_woql_arithmetic';
99

1010
beforeAll(() => {
11-
client = new WOQLClient("http://localhost:6363", { user: 'admin', organization: 'admin', key: process.env.TDB_ADMIN_PASS ?? 'root' })
11+
client = new WOQLClient("http://127.0.0.1:6363", { user: 'admin', organization: 'admin', key: process.env.TDB_ADMIN_PASS ?? 'root' })
1212
client.db(db01);
1313
});
1414

integration_tests/woql_client.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import schemaJson from './persons_schema'
66
import { mock_employees_limit_1 } from './data/employees_limit1';
77
import fs from 'fs';
88

9-
let client: WOQLClient //= new WOQLClient('http://localhost:6363');
9+
let client: WOQLClient //= new WOQLClient('http://127.0.0.1:6363');
1010

1111
beforeAll(() => {
12-
client = new WOQLClient("http://localhost:6363", { user: 'admin', organization: 'admin', key: process.env.TDB_ADMIN_PASS ?? 'root' })
12+
client = new WOQLClient("http://127.0.0.1:6363", { user: 'admin', organization: 'admin', key: process.env.TDB_ADMIN_PASS ?? 'root' })
1313
});
1414

1515
const db01 = 'db__test_woql';

integration_tests/woql_regression.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let client: WOQLClient
77
const db01 = 'db__test_woql_regression';
88

99
beforeAll(async () => {
10-
client = new WOQLClient("http://localhost:6363", { user: 'admin', organization: 'admin', key: process.env.TDB_ADMIN_PASS ?? 'root' })
10+
client = new WOQLClient("http://127.0.0.1:6363", { user: 'admin', organization: 'admin', key: process.env.TDB_ADMIN_PASS ?? 'root' })
1111
client.db(db01);
1212
const dbObj: DbDetails = { label: db01, comment: 'add db', schema: true }
1313
await client.createDatabase(db01, dbObj);

lib/accessControl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const typedef = require('./typedef');
3838
* eTFORUd.......")
3939
*
4040
* //connect with the base authentication this type of connection is only for the local installation
41-
* const accessContol = new AccessControl("http://localhost:6363",
41+
* const accessContol = new AccessControl("http://127.0.0.1:6363",
4242
* {organization:"my_team_name", user:"admin"
4343
* key:"mykey"})
4444
* accessControl.getOrgUsers().then(result=>{

test/accessControl.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const { expect } = require('chai');
22
const AccessControl = require('../lib/accessControl');
33

44
describe('AccessControl tests', () => {
5-
const startServerUrl = 'http://localhost:6363/';
5+
const startServerUrl = 'http://127.0.0.1:6363/';
66
const organization = 'admin';
77
const user = 'admin';
88
const key ='mykey'

test/connectionConfing.spec.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ const { expect } = require('chai');
22
const ConnectionConfig = require('../lib/connectionConfig');
33

44
describe('connectionConfig tests', () => {
5-
const startServerUrl = 'http://localhost:6363/';
5+
const startServerUrl = 'http://127.0.0.1:6363/';
66
const startDBid = 'testDB';
77
const organization = 'admin';
88
const params = {
99
db: startDBid, organization, user: organization, key: 'myKey',
1010
};
1111
const connectionConfig = new ConnectionConfig(startServerUrl, params);
1212

13-
const dbURL = 'http://localhost:6363/api/db/admin/testDB';
13+
const dbURL = 'http://127.0.0.1:6363/api/db/admin/testDB';
1414

1515
it('check get server URL', () => {
1616
expect(connectionConfig.serverURL()).to.equal(startServerUrl);
@@ -22,7 +22,7 @@ describe('connectionConfig tests', () => {
2222

2323
it('check set branch', () => {
2424
connectionConfig.setBranch('myBranch');
25-
const queryURLBranch = 'http://localhost:6363/api/woql/admin/testDB/local/branch/myBranch';
25+
const queryURLBranch = `${startServerUrl}api/woql/admin/testDB/local/branch/myBranch`;
2626
/*
2727
* the dbURL dosen't change
2828
*/
@@ -33,7 +33,7 @@ describe('connectionConfig tests', () => {
3333
it('check set refId', () => {
3434
connectionConfig.setRef('gfhfjkflfgorpyuiioo');
3535

36-
const queryURL = 'http://localhost:6363/api/woql/admin/testDB/local/commit/gfhfjkflfgorpyuiioo';
36+
const queryURL = `${startServerUrl}api/woql/admin/testDB/local/commit/gfhfjkflfgorpyuiioo`;
3737

3838
expect(connectionConfig.queryURL()).to.equal(queryURL);
3939
});
@@ -42,17 +42,17 @@ describe('connectionConfig tests', () => {
4242
* get the schema in owl turtle encoding
4343
*/
4444
it('check set class tripleUrl', () => {
45-
const classTripleURL = 'http://localhost:6363/api/triples/admin/testDB/local/commit/gfhfjkflfgorpyuiioo/schema/main';
45+
const classTripleURL = `${startServerUrl}api/triples/admin/testDB/local/commit/gfhfjkflfgorpyuiioo/schema/main`;
4646

4747
// console.log(JSON.stringify(connectionConfig.triplesURL(), null, 4));
4848

4949
expect(connectionConfig.triplesURL('schema')).to.equal(classTripleURL);
5050
});
5151

5252
it('check remove the refCommit', () => {
53-
const queryUrlBranch01 = 'http://localhost:6363/api/woql/admin/testDB/local/branch/myBranch';
54-
// const queryFrameBranch01 = 'http://localhost:6363/api/frame/admin/testDB/local/branch/myBranch'
55-
const queryTriplesBranch01 = 'http://localhost:6363/api/triples/admin/testDB/local/branch/myBranch/schema/main';
53+
const queryUrlBranch01 = `${startServerUrl}api/woql/admin/testDB/local/branch/myBranch`;
54+
// const queryFrameBranch01 = `${startServerUrl}api/frame/admin/testDB/local/branch/myBranch`
55+
const queryTriplesBranch01 = `${startServerUrl}api/triples/admin/testDB/local/branch/myBranch/schema/main`;
5656
/*
5757
*remove the ref commit it come to the
5858
*/
@@ -65,17 +65,17 @@ describe('connectionConfig tests', () => {
6565
});
6666

6767
it('check set branch', () => {
68-
const optimizeUrl = 'http://localhost:6363/api/optimize/admin/testDB/local/branch/%23%23branch01';
68+
const optimizeUrl = `${startServerUrl}api/optimize/admin/testDB/local/branch/%23%23branch01`;
6969
/*
7070
* the dbURL dosen't change
7171
*/
7272
expect(connectionConfig.optimizeBranchUrl('##branch01')).to.equal(optimizeUrl);
7373
});
7474

7575
it('check remove the branch', () => {
76-
const queryUrlBranch01 = 'http://localhost:6363/api/woql/admin/testDB/local/branch/main';
77-
// const queryFrameBranch01 = 'http://localhost:6363/api/frame/admin/testDB/local/branch/main'
78-
const queryTriplesBranch01 = 'http://localhost:6363/api/triples/admin/testDB/local/branch/main/instance/main';
76+
const queryUrlBranch01 = `${startServerUrl}api/woql/admin/testDB/local/branch/main`;
77+
// const queryFrameBranch01 = `${startServerUrl}api/frame/admin/testDB/local/branch/main`
78+
const queryTriplesBranch01 = `${startServerUrl}api/triples/admin/testDB/local/branch/main/instance/main`;
7979
/*
8080
*remove the ref commit it come to the
8181
*/
@@ -269,7 +269,7 @@ describe('connectionConfig tests', () => {
269269
it('check baseUrlEncode', function() {
270270
const db = "%6277&ˆˆˆ@ˆˆWˆTWTET#Y@&&GHHSHHS"
271271
connectionConfig.setDB(db)
272-
const dbBase = 'http://localhost:6363/api/woql/123/%256277%26%CB%86%CB%86%CB%86@%CB%86%CB%86W%CB%86TWTET%23Y@%26%26GHHSHHS'
272+
const dbBase = `${startServerUrl}api/woql/123/%256277%26%CB%86%CB%86%CB%86@%CB%86%CB%86W%CB%86TWTET%23Y@%26%26GHHSHHS`;
273273
expect(connectionConfig.dbBase('woql')).to.equal(dbBase)
274274
expect(connectionConfig.db()).to.equal(db)
275275

@@ -296,7 +296,7 @@ describe('connectionConfig tests', () => {
296296

297297
//serverUrlEncoding
298298

299-
//const startServerUrl = 'http://localhost:6363/'
299+
//const startServerUrl = 'http://127.0.0.1:6363/'
300300
//const startDBid = 'testDB'
301301
//const organization = 'admin'
302302

test/createDatabase.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('create new db tests', () => {
1515
.stub(axiosInstance, 'post')
1616
.returns(Promise.resolve({ status: 200, data: { 'system:status': 'system:success' } }));
1717

18-
expect(global.client.connectionConfig.serverURL()).to.equal('http://localhost:6363/');
18+
expect(global.client.connectionConfig.serverURL()).to.equal('http://127.0.0.1:6363/');
1919
global.client
2020
.createDatabase(dbid, doc, organizationid)
2121
.then((response) => {

test/getSchema.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ const { expect } = require('chai');
22
const turtleSchemaR = require('./extraFile/getSchemaTurtleResponse');
33
const axiosInstance = require('../lib/axiosInstance');
44

5-
// http://localhost:6363/triples/terminus/schema/main
6-
// http://localhost:6363/triples/admin/testDB/local/commit/gfhfjkflfgorpyuiioo
5+
// http://127.0.0.1:6363/triples/terminus/schema/main
6+
// http://127.0.0.1:6363/triples/admin/testDB/local/commit/gfhfjkflfgorpyuiioo
77

88
describe('get a terminusDB schema', () => {
99
const dbID = 'second_database';
@@ -14,7 +14,7 @@ describe('get a terminusDB schema', () => {
1414
expect(global.client.connectionConfig.server).to.equal(global.url);
1515

1616
// console.log(JSON.stringify(global.client.connectionConfig.triplesURL('schema'), null, 4));
17-
const schemaURL = 'http://localhost:6363/api/triples/organization01/second_database/local/branch/main/schema/main';
17+
const schemaURL = 'http://127.0.0.1:6363/api/triples/organization01/second_database/local/branch/main/schema/main';
1818

1919
expect(global.client.connectionConfig.triplesURL('schema')).to.equal(schemaURL);
2020
});

0 commit comments

Comments
 (0)