Skip to content

Commit

Permalink
ci: rm scheme from es url if not v8
Browse files Browse the repository at this point in the history
  • Loading branch information
tevariou committed Sep 27, 2023
1 parent 5078655 commit e381a3d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,14 @@ jobs:
- name: Run tests with Python ${{ matrix.python-version }} and Django ${{ matrix.django-version }} and elasticsearch-dsl-py ${{ matrix.es-dsl-version }}
run: |
TOX_ENV=$(echo "py${{ matrix.python-version }}-django-${{ matrix.django-version }}-es${{ matrix.es-dsl-version }}" | tr -d .)
python -m tox -e $TOX_ENV -- --elasticsearch --elasticsearch-username --elasticsearch-password
python -m tox -e $TOX_ENV -- --elasticsearch http://127.0.0.1:9200
if: matrix.es-version == '7.13.4'

- name: Run tests with Python ${{ matrix.python-version }} and Django ${{ matrix.django-version }} and elasticsearch-dsl-py ${{ matrix.es-dsl-version }}
run: |
TOX_ENV=$(echo "py${{ matrix.python-version }}-django-${{ matrix.django-version }}-es${{ matrix.es-dsl-version }}" | tr -d .)
python -m tox -e $TOX_ENV -- --elasticsearch https://127.0.0.1:9200 --elasticsearch-username elastic --elasticsearch-password changeme
if: matrix.es-version == '8.2.0'

- name: Publish Coverage Report
uses: codecov/codecov-action@v1
12 changes: 6 additions & 6 deletions runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ def get_settings():
'ELASTICSEARCH_URL',
'https://127.0.0.1:9200'
),
'http_auth': (
}

if os.environ.get('ELASTICSEARCH_USERNAME') or os.environ.get('ELASTICSEARCH_PASSWORD'):
elasticsearch_dsl_default_settings['http_auth'] = (
os.environ.get('ELASTICSEARCH_USERNAME'),
os.environ.get('ELASTICSEARCH_PASSWORD')
)
}

elasticsearch_certs_path = os.environ.get(
'ELASTICSEARCH_CERTS_PATH'
Expand Down Expand Up @@ -80,15 +82,13 @@ def make_parser():
parser.add_argument(
'--elasticsearch-username',
nargs='?',
metavar='elastic',
const='elastic',
default="",
help="Username for Elasticsearch user"
)
parser.add_argument(
'--elasticsearch-password',
nargs='?',
metavar='changeme',
const='changeme',
default="",
help="Password for Elasticsearch user"
)
parser.add_argument(
Expand Down

0 comments on commit e381a3d

Please sign in to comment.