diff --git a/green_metric_tests/greencheck_test.spec.js b/green_metric_tests/greencheck_test.spec.js index b7f286eb..7b94d894 100644 --- a/green_metric_tests/greencheck_test.spec.js +++ b/green_metric_tests/greencheck_test.spec.js @@ -3,15 +3,15 @@ const expect = require('chai').expect; describe('Greencheck API', () => { it('Has the correct URL property', () => { - request('https://django:8000') + request('https://django:9000') .get('/greencheck/climateaction.tech') .expect(200) .expect('Content-Type', 'application/json') - .expect(function(res) { + .expect(function (res) { if (!res.body.hasOwnProperty('url')) throw new Error("Expected 'url' key!"); }) - .end(function(err, res){ + .end(function (err, res) { if (err) throw err; }) }); -}); \ No newline at end of file +}); diff --git a/usage_scenario.yml b/usage_scenario.yml index dcdae5b1..efaec1eb 100644 --- a/usage_scenario.yml +++ b/usage_scenario.yml @@ -1,6 +1,6 @@ --- name: Greencheck Test -author: James Camilleri +author: James Camilleri , Chris Adams description: Scenario to test the Greencheck endpoint of the Green Web Foundation Greencheck API version: "3.5" @@ -10,20 +10,24 @@ networks: services: mariadb: - image: mariadb:10.3 + image: mariadb:10.11 ports: - 3306:3306 - env: - MYSQL_ROOT_PASSWORD: just-for-github-actions - MYSQL_DATABASE: greencheck + environment: + - MYSQL_ROOT_PASSWORD=deploy + - MYSQL_DATABASE=greencheck + - MYSQL_USER=deploy + - MYSQL_PASSWORD=deploy + # not sure which of these take precedence now + # env: + # MYSQL_ROOT_PASSWORD: just-for-github-actions + # MYSQL_DATABASE: greencheck networks: - greencheck-network rabbitmq: - image: rabbitmq:3.9 - env: - RABBITMQ_USERNAME: "guest" - RABBITMQ_PASSWORD: "guest" + image: rabbitmq:3.11 + restart: always ports: - 5672:5672 options: '--hostname "rmq" --health-cmd "rabbitmqctl status" --health-interval 10s --health-timeout 10s --health-retries 3 --health-start-period 60s' @@ -31,18 +35,19 @@ services: - greencheck-network django: + image: greenweb-app depends_on: - mariadb + - rabbitmq build: context: . - args: - PIPENV_CFG: --dev - command: - - cp -a . . - - python -m pip install --upgrade pipenv wheel - - pipenv install --deploy --dev --verbose + dockerfile: Dockerfile + env_file: + - path: ./.env.docker ports: - - "8000:8000" + - 9000:9000 + expose: + - 9000 restart: on-failure volumes: - .:/app @@ -53,8 +58,9 @@ services: test-container: container_name: test-container - image: node - depends_on: django + image: node + depends_on: + - django setup-commands: - cp ./green_metric_tests/greencheck_test.spec.js . - cp ./green_metric_tests/package.json . @@ -62,17 +68,17 @@ services: networks: - greencheck-network - flow: - - name: Greencheck API Test - container: test-container - commands: - - type: console - command: npm test - note: Starting test - read-notes-stdout: true - - type: console - command: sleep 30 - note: Idling - - type: console - command: npm test - note: Starting test again \ No newline at end of file +flow: + - name: Greencheck API Test + container: test-container + commands: + - type: console + command: npm test + note: Starting test + read-notes-stdout: true + - type: console + command: sleep 30 + note: Idling + - type: console + command: npm test + note: Starting test again