Skip to content

Commit

Permalink
fixed chromium, updated some deps (#78)
Browse files Browse the repository at this point in the history
* fixed chromium, updated some deps

* Update test.yml

* Update test.yml

* Update test.yml

---------

Co-authored-by: Val <valerii.tikhonov@airteam.ai>
  • Loading branch information
comtihon and AirteamRobot committed May 10, 2023
1 parent 3db056f commit bdadc88
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 9 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,10 @@ jobs:
-v /tmp/data:/data \
-v /tmp/config:/root/.minio \
minio/minio server /data
- name: Install msodbcsql17
- name: Install unixodbc
run: |
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list -o /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install msodbcsql17 unixodbc-dev
sudo ACCEPT_EULA=Y apt-get install unixodbc-dev
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
Expand Down
4 changes: 0 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ RUN apk --no-cache add openjdk11 nodejs npm \
&& bash -c 'source "/root/.sdkman/bin/sdkman-init.sh" && sdk install kotlin'

## browsers
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \
&& wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.34-r0/glibc-2.34-r0.apk \
&& wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.34-r0/glibc-bin-2.34-r0.apk
RUN apk add glibc-2.34-r0.apk glibc-bin-2.34-r0.apk
RUN apk add firefox-esr chromium chromium-chromedriver

## selenium drivers (firefox, opera)
Expand Down
2 changes: 1 addition & 1 deletion catcher_modules/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
APPNAME = 'catcher-modules'
APPAUTHOR = 'Valerii Tikhonov, Ekaterina Belova'
APPVSN = '6.0.2'
APPVSN = '6.0.3'
72 changes: 72 additions & 0 deletions test/postgres_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,75 @@ def test_populate_sql(self):
self.assertTrue(runner.run_tests())
response = self.get_values('foo')
self.assertEqual([(1, 'test1@test.org'), (2, 'test2@test.org')], response)

def test_uuid(self):
# write uuid
self.populate_file('resources/schema.sql', '''
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE if not exists foo (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
email TEXT
);
{%- for user in users %}
insert into foo values ('{{random("uuid4")}}', '{{user.email}}');
{%- endfor -%}
''')
self.populate_file('main.yaml', '''---
variables:
users:
- email: test1@test.org
- email: test2@test.org
steps:
- postgres:
request:
conf: 'test:test@localhost:5433/test'
sql: schema.sql
''')
runner = Runner(self.test_dir, join(self.test_dir, 'main.yaml'), None)
self.assertTrue(runner.run_tests())
connection = self.connection
cursor = connection.cursor()
# Execute the SQL query to fetch id and email from the foo table
try:
cursor.execute("SELECT id, email FROM foo where email='test1@test.org'")

row = cursor.fetchone()
self.assertIsNotNone(row)
uuid = row[0]
finally:
cursor.close()
connection.close()

# read uuid
userid = '{{ user.id }}'
documentid = '{{ document.id }}'
useremail = '{{ user.email }}'
documentemail = '{{ document.email }}'
output = '{{ OUTPUT }}'
self.populate_file('main2.yaml', f'''---
variables:
user:
id: {uuid}
email: test1@test.org
steps:
- postgres:
request:
conf: 'test:test@localhost:5433/test'
sql: "select * from foo where id='{userid}'"
register:
document: '{output}'
- check:
equals:
the: '{userid}'
is: '{documentid}'
- check:
equals:
the: '{uuid}'
is: '{documentid}'
- check:
equals:
the: '{useremail}'
is: '{documentemail}'
''')
runner = Runner(self.test_dir, join(self.test_dir, 'main2.yaml'), None, output_format='other')
self.assertTrue(runner.run_tests())

0 comments on commit bdadc88

Please sign in to comment.