Skip to content

test PR actions #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: oss_runners
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on: # yamllint disable-line rule:truthy
- reopened
- opened
branches:
- master
- oss_runners
paths-ignore:
- 'docker/docs/**'
- 'docs/**'
Expand Down
6 changes: 5 additions & 1 deletion docker/test/fasttest/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# rebuild in #33610
# docker build -t clickhouse/fasttest .
ARG FROM_TAG=latest
FROM clickhouse/test-util:$FROM_TAG
ARG DOCKER_REPO=docker.io
FROM $DOCKER_REPO/clickhouse/test-util:$FROM_TAG

ENV GITHUB_SERVER_URL=https://github.com
ENV GITHUB_REPOSITORY=ClickHouse/ClickHouse

# ARG for quick switch to a given ubuntu mirror
ARG apt_archive="http://archive.ubuntu.com"
Expand Down
2 changes: 1 addition & 1 deletion docker/test/fasttest/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function start_server
function clone_root
{
git config --global --add safe.directory "$FASTTEST_SOURCE"
git clone --depth 1 https://github.com/ClickHouse/ClickHouse.git -- "$FASTTEST_SOURCE" 2>&1 | ts '%Y-%m-%d %H:%M:%S' | tee "$FASTTEST_OUTPUT/clone_log.txt"
git clone --depth 1 $GITHUB_SERVER_URL/$GITHUB_REPOSITORY -- "$FASTTEST_SOURCE" 2>&1 | ts '%Y-%m-%d %H:%M:%S' | tee "$FASTTEST_OUTPUT/clone_log.txt"

(
cd "$FASTTEST_SOURCE"
Expand Down
15 changes: 12 additions & 3 deletions tests/ci/fast_test_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

from github import Github

from env_helper import CACHES_PATH, TEMP_PATH, GITHUB_SERVER_URL, GITHUB_REPOSITORY
from env_helper import CACHES_PATH, TEMP_PATH, GITHUB_SERVER_URL, GITHUB_REPOSITORY, DOCKER_REPO, DOCKER_USER
from pr_info import FORCE_TESTS_LABEL, PRInfo, SKIP_SIMPLE_CHECK_LABEL
from s3_helper import S3Helper
from get_robot_token import get_best_robot_token
from get_robot_token import get_best_robot_token, get_parameter_from_ssm
from upload_result_helper import upload_results
from docker_pull_helper import get_image_with_version
from commit_status_helper import post_commit_status, get_commit
Expand All @@ -37,6 +37,8 @@ def get_fasttest_cmd(
f"-e FASTTEST_SOURCE=/ClickHouse --cap-add=SYS_PTRACE "
f"-e PULL_REQUEST_NUMBER={pr_number} -e COMMIT_SHA={commit_sha} "
f"-e COPY_CLICKHOUSE_BINARY_TO_OUTPUT=1 "
f"-e GITHUB_SERVER_URL={GITHUB_SERVER_URL} "
f"-e GITHUB_REPOSITORY={GITHUB_REPOSITORY} "
f"--volume={workspace}:/fasttest-workspace --volume={repo_path}:/ClickHouse "
f"--volume={output_path}:/test_output "
f"--volume={ccache_path}:/fasttest-workspace/ccache {image}"
Expand Down Expand Up @@ -90,14 +92,21 @@ def process_results(result_folder):

pr_info = PRInfo()

subprocess.check_output( # pylint: disable=unexpected-keyword-arg
"docker login {} --username '{}' --password-stdin".format(DOCKER_REPO, DOCKER_USER),
input=get_parameter_from_ssm("dockerhub_robot_password"),
encoding="utf-8",
shell=True,
)

gh = Github(get_best_robot_token())

rerun_helper = RerunHelper(gh, pr_info, NAME)
if rerun_helper.is_already_finished_by_status():
logging.info("Check is already finished according to github status, exiting")
sys.exit(0)

docker_image = get_image_with_version(temp_path, "clickhouse/fasttest")
docker_image = get_image_with_version(temp_path, "{}/clickhouse/fasttest".format(DOCKER_REPO))

s3_helper = S3Helper()

Expand Down