Skip to content

Commit

Permalink
Test schema timestamps (ClickHouse#101)
Browse files Browse the repository at this point in the history
* Add timestampt to test schemas

* Fix lint
  • Loading branch information
genzgd authored Oct 6, 2022
1 parent bd7be61 commit 4a47f3e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: "test_cloud"
on: # yamllint disable-line rule:truthy
push:
branches:
- '*cloud*'
- '_cloud*'

jobs:
cloud_tests:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test_matrix.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
name: "text_matrix"
name: "test_matrix"

on: # yamllint disable-line rule:truthy
pull_request:
branches: master
branches: main
push:
branches-ignore:
- '*_test'
- '*_dev'
- '*cloud*'
- '*_cloud'
paths-ignore:
- 'README.md'
- 'CHANGELOG.md'
Expand Down
16 changes: 14 additions & 2 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import os
import random
import sys
import time
import timeit
from pathlib import Path
from subprocess import PIPE, Popen
from time import sleep

import pytest
import requests
Expand Down Expand Up @@ -110,6 +111,17 @@ def dbt_profile_target(test_config):
}


@pytest.fixture(scope="class")
def prefix():
return f"dbt_clickhouse_{random.randint(1000, 9999)}"


@pytest.fixture(scope="class")
def unique_schema(request, prefix) -> str:
test_file = request.module.__name__.split(".")[-1]
return f"{prefix}_{test_file}_{int(time.time() * 1000)}"


def run_cmd(cmd):
with Popen(cmd, stdout=PIPE, stderr=PIPE) as popen:
stdout, stderr = popen.communicate()
Expand All @@ -129,7 +141,7 @@ def wait_until_responsive(check, timeout, pause, clock=timeit.default_timer):
ref = clock()
now = ref
while (now - ref) < timeout:
sleep(pause)
time.sleep(pause)
if check():
return
now = clock()
Expand Down

0 comments on commit 4a47f3e

Please sign in to comment.