Skip to content

Commit

Permalink
Moved env var declarations to job scope so that they are consistent f…
Browse files Browse the repository at this point in the history
…or all steps.

Signed-off-by: Theo Truong <[email protected]>
  • Loading branch information
nhtruong committed Jan 30, 2024
1 parent d1b9f5a commit 1f90740
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
- { opensearch_version: 1.3.3 }
- { opensearch_version: 2.0.0 }
- { opensearch_version: 2.0.1 }
env:
OPENSEARCH_VERSION: ${{ matrix.entry.opensearch_version }}
SECURE_INTEGRATION: ${{ matrix.secured }}

steps:
- uses: actions/checkout@v2
Expand All @@ -44,9 +47,6 @@ jobs:
- name: Runs OpenSearch cluster
id: start_opensearch_cluster
env:
OPENSEARCH_VERSION: ${{ matrix.entry.opensearch_version }}
SECURE_INTEGRATION: ${{ matrix.secured }}
run: |
make cluster.clean cluster.opensearch.build cluster.opensearch.start
Expand All @@ -66,8 +66,6 @@ jobs:
- name: Integration test with security
if: ${{ matrix.secured == 'true'}}
env:
OPENSEARCH_VERSION: ${{ matrix.entry.opensearch_version }}
run: |
npm run test:integration:helpers-secure
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ jobs:
matrix:
node-version: [10.x, 12.x, 14.x, 16.x, 18.x]

env:
OPENSEARCH_VERSION: latest
SECURE_INTEGRATION: false

steps:
- uses: actions/checkout@v2

Expand All @@ -30,9 +34,6 @@ jobs:
sudo sysctl -w vm.max_map_count=262144
- name: Runs OpenSearch cluster
env:
OPENSEARCH_VERSION: latest
SECURE_INTEGRATION: false
run: |
make cluster.clean cluster.opensearch.build cluster.opensearch.start
Expand Down Expand Up @@ -68,6 +69,10 @@ jobs:
matrix:
node-version: [10.x, 12.x, 14.x, 16.x, 18.x]

env:
OPENSEARCH_VERSION: latest
SECURE_INTEGRATION: true

steps:
- uses: actions/checkout@v2

Expand All @@ -79,9 +84,6 @@ jobs:
sudo sysctl -w vm.max_map_count=262144
- name: Runs OpenSearch secure cluster
env:
OPENSEARCH_VERSION: latest
SECURE_INTEGRATION: true
run: |
make cluster.clean cluster.opensearch.build cluster.opensearch.start
Expand All @@ -106,7 +108,5 @@ jobs:
npm install
- name: Integration test with secure cluster
env:
OPENSEARCH_VERSION: latest
run: |
npm run test:integration:helpers-secure
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Updated integration tests to use strong password in OS 2.12 and up ([#707](https://github.com/opensearch-project/opensearch-js/pull/707))
### Deprecated
### Removed
- Removed AutoHeal([#707](https://github.com/opensearch-project/opensearch-js/pull/707))
### Fixed
### Security

Expand Down
3 changes: 3 additions & 0 deletions test/unit/tools.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ const { strongPasswordRequired } = require('../../lib/tools');

test('strongPasswordRequired', (t) => {
t.plan(9);

t.throws(() => strongPasswordRequired());

t.ok(strongPasswordRequired('latest'));
t.ok(strongPasswordRequired('3.0'));
t.ok(strongPasswordRequired('2.12.x'));
t.ok(strongPasswordRequired('2.12.0'));

t.notOk(strongPasswordRequired('2.11'));
t.notOk(strongPasswordRequired('2.11.x'));
t.notOk(strongPasswordRequired('1.13.0'));
Expand Down

0 comments on commit 1f90740

Please sign in to comment.