Skip to content

Commit

Permalink
fix: replace missing Oralce XE image
Browse files Browse the repository at this point in the history
Replacement for Oracle XE image which was taken down
  • Loading branch information
Hage Yaapa committed Sep 3, 2019
1 parent ce8442c commit 98e17ce
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 10 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -464,12 +464,17 @@ npm test
```

### Docker

[ODPI-C](https://oracle.github.io/odpi/doc/installation.html) is a prerequisite, install on your system
before performing the next steps.

If you do not have a local Oracle instance, you can also run the test suite with very minimal requirements.
- Assuming you have [Docker](https://docs.docker.com/engine/installation/) installed, run the following script which would spawn an Oracle instance on your local machine:

```bash
source setup.sh <HOST> <PORT>
```
where `<HOST>`, `<PORT>`, `<USER>`, and `PASSWORD` are optional parameters. The default values are `localhost`, `1521`, `admin`, and `0raclep4ss` respectively. The `DATABASE` setting is always `XE`.
where `<HOST>`, `<PORT>`, `<USER>`, and `PASSWORD` are optional parameters. The default values are `localhost`, `1521`, `system`, and `oracle` respectively. The `DATABASE` setting is always `XE`.
- Run the test:
```bash
npm test
Expand Down
10 changes: 5 additions & 5 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ CYAN='\033[1;36m'
PLAIN='\033[0m'

## variables
ORACLE_CONTAINER="oracle_c"
ORACLE_CONTAINER="oracle-xe"
HOST="localhost"
PORT=1521
DATABASE="XE"
USER="admin"
PASSWORD="0raclep4ss"
USER="system"
PASSWORD="oracle"
if [ "$1" ]; then
HOST=$1
fi
Expand Down Expand Up @@ -46,12 +46,12 @@ printf "\n${CYAN}Clean up complete.${PLAIN}\n"

## pull latest oracle image
printf "\n${RED}>> Pulling latest oracle image${PLAIN} ${GREEN}...${PLAIN}"
docker pull sath89/oracle-xe-11g:latest > /dev/null 2>&1
docker pull webdizz/oracle-xe-11g-sa:latest > /dev/null 2>&1
printf "\n${CYAN}Image successfully built.${PLAIN}\n"

## run the oracle container
printf "\n${RED}>> Starting the oracle container${PLAIN} ${GREEN}...${PLAIN}\n"
docker run --name $ORACLE_CONTAINER -p $PORT:1521 -d sath89/oracle-xe-11g:latest > /dev/null 2>&1
docker run --name $ORACLE_CONTAINER -p $PORT:1521 -d webdizz/oracle-xe-11g-sa:latest > /dev/null 2>&1

##wait for orale database container to be ready
OUTPUT=1
Expand Down
2 changes: 2 additions & 0 deletions test/init/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ let DataSource = juggler.DataSource;

const config = require('rc')('loopback', {test: {oracle: {}}}).test.oracle;
config.maxConn = 64;
config.user = process.env.ORACLE_USER;
config.password = process.env.ORACLE_PASSWORD;

let db;

Expand Down
4 changes: 2 additions & 2 deletions test/oracle.autoupdate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('Oracle connector', function() {
options: {
idInjection: false,
oracle: {
schema: 'TEST',
schema: 'system',
table: 'CUSTOMER_TEST',
},
},
Expand Down Expand Up @@ -55,7 +55,7 @@ describe('Oracle connector', function() {
options: {
idInjection: false,
oracle: {
schema: 'TEST',
schema: 'system',
table: 'CUSTOMER_TEST',
},
},
Expand Down
2 changes: 1 addition & 1 deletion test/oracle.clob.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ before(function(done) {
name: 'ClobTest',
options: {
oracle: {
schema: 'TEST',
schema: 'system',
table: 'CLOB_TEST',
},
},
Expand Down
2 changes: 2 additions & 0 deletions test/oracle.connectionpool.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ let db, config;

before(function() {
config = require('rc')('loopback', {dev: {oracle: {}}}).dev.oracle;
config.user = process.env.ORACLE_USER;
config.password = process.env.ORACLE_PASSWORD;
});

after(function() {
Expand Down
2 changes: 2 additions & 0 deletions test/oracle.discover.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ let db;
describe('discoverModels', function() {
before(function() {
const config = require('rc')('loopback', {dev: {oracle: {}}}).dev.oracle;
config.user = process.env.ORACLE_USER;
config.password = process.env.ORACLE_PASSWORD;
db = new DataSource(require('../'), config);
});

Expand Down
2 changes: 1 addition & 1 deletion test/oracle.mapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('Mapping models', function() {
options: {
idInjection: false,
oracle: {
schema: 'TEST', 'table': 'INVENTORY_TEST',
schema: 'system', 'table': 'INVENTORY_TEST',
},
},
properties: {
Expand Down

0 comments on commit 98e17ce

Please sign in to comment.