Repository: ClickHouse/ClickHouse
File: ci/jobs/fast_test.py (Python)

Code before:
        results.append(
            Result.from_commands_run(
                name="Build ClickHouse",
                command=f"command time -v cmake --build {build_dir_normalized} --"
                " clickhouse-bundle clickhouse-stripped lexer_test",
            )
        )
        Shell.check(f"{build_dir}/rust/chcache/chcache stats")
        Shell.check("sccache --show-stats")
        res = results[-1].is_ok()

    if res and JobStages.BUILD in stages:
        commands = [
            "sccache --show-stats",
            "clickhouse-client --version",
        ]
        results.append(
            Result.from_commands_run(
                name="Check and Compress binary",
                command=commands,
                workdir=build_dir_normalized,
            )
        )
        res = results[-1].is_ok()

    if Info().is_local_run:
        resolved_clickhouse_bin_path = clickhouse_bin_path.resolve()
        Shell.check(
            f"ln -sf {resolved_clickhouse_bin_path} {resolved_clickhouse_bin_path.parent}/clickhouse-server",
            strict=True,
        )
        Shell.check(
            f"ln -sf {resolved_clickhouse_bin_path} {resolved_clickhouse_bin_path.parent}/clickhouse-client",
            strict=True,
        )
        Shell.check(f"chmod +x {resolved_clickhouse_bin_path}", strict=True)

    if res and JobStages.CONFIG in stages:
        commands = [
            f"cp ./programs/server/config.xml ./programs/server/users.xml {temp_dir}/etc/clickhouse-server/",
            f"./tests/config/install.sh /etc/clickhouse-server /etc/clickhouse-client --fast-test",
            # f"cp -a {current_directory}/programs/server/config.d/log_to_console.xml {temp_dir}/etc/clickhouse-server/config.d/",
            f"rm -f {temp_dir}/etc/clickhouse-server/config.d/secure_ports.xml",
            update_path_ch_config,
        ]
        results.append(
            Result.from_commands_run(
                name="Install ClickHouse Config",
                command=commands,
            )
        )

Review comment (suggestion):
We should add here a check for `res` as well, because otherwise we'll attempt to create unconditionally the symbolic links
```suggestion
    if res and Info().is_local_run:
```

Code after:
                -DBUILD_STRIPPED_BINARY=1 \
                -DENABLE_JEMALLOC=1 -DENABLE_LIBURING=1 -DENABLE_YAML_CPP=1 -DENABLE_RUST=1 \
                -B {build_dir_normalized}",
                workdir=repo_path_normalized,
            )
        )
        res = results[-1].is_ok()

    if res and JobStages.BUILD in stages:
        Shell.check("sccache --show-stats")
        results.append(
            Result.from_commands_run(
                name="Build ClickHouse",
                command=f"command time -v cmake --build {build_dir_normalized} --"
                " clickhouse-bundle clickhouse-stripped lexer_test",
            )
        )
        Shell.check(f"{build_dir}/rust/chcache/chcache stats")
        Shell.check("sccache --show-stats")
        res = results[-1].is_ok()

    if res and JobStages.BUILD in stages:
        commands = [
            "sccache --show-stats",
            "clickhouse-client --version",
        ]
        results.append(
            Result.from_commands_run(
                name="Check and Compress binary",
                command=commands,
                workdir=build_dir_normalized,
            )
        )
        res = results[-1].is_ok()

    if res and JobStages.CONFIG in stages:
        commands = [
            f"cp ./programs/server/config.xml ./programs/server/users.xml {temp_dir}/etc/clickhouse-server/",
            f"./tests/config/install.sh /etc/clickhouse-server /etc/clickhouse-client --fast-test",
            # f"cp -a {current_directory}/programs/server/config.d/log_to_console.xml {temp_dir}/etc/clickhouse-server/config.d/",
            f"rm -f {temp_dir}/etc/clickhouse-server/config.d/secure_ports.xml",
            update_path_ch_config,
        ]
        results.append(
            Result.from_commands_run(
                name="Install ClickHouse Config",
                command=commands,
            )
        )
        res = results[-1].is_ok()