mirror of
https://github.com/fumiama/terasu-cloudflared.git
synced 2026-06-05 00:50:24 +08:00
TUN-9800: Migrate cloudflared-ci pipelines to Gitlab CI
## Summary This commit migrates the cloduflared ci pipelines, that built, tested and component tested the linux binaries to gitlab ci. The only thing that is remaining to move from teamcity to gitlab are now the release pipelines that run on master. Relates to TUN-9800
This commit is contained in:
@@ -9,7 +9,7 @@ import pytest
|
||||
|
||||
import test_logging
|
||||
from conftest import CfdModes
|
||||
from util import select_platform, start_cloudflared, wait_tunnel_ready, write_config
|
||||
from util import select_platform, skip_on_ci, start_cloudflared, wait_tunnel_ready, write_config
|
||||
|
||||
|
||||
def default_config_dir():
|
||||
@@ -82,6 +82,7 @@ class TestServiceMode:
|
||||
os.remove(default_config_file())
|
||||
self.launchctl_cmd("list", success=False)
|
||||
|
||||
@skip_on_ci("we can't run sudo command on CI")
|
||||
@select_platform("Linux")
|
||||
@pytest.mark.skipif(os.path.exists("/etc/cloudflared/config.yml"),
|
||||
reason=f"There is already a config file in default path")
|
||||
@@ -98,6 +99,7 @@ class TestServiceMode:
|
||||
|
||||
self.sysv_service_scenario(config, tmp_path, assert_log_file)
|
||||
|
||||
@skip_on_ci("we can't run sudo command on CI")
|
||||
@select_platform("Linux")
|
||||
@pytest.mark.skipif(os.path.exists("/etc/cloudflared/config.yml"),
|
||||
reason=f"There is already a config file in default path")
|
||||
@@ -116,6 +118,7 @@ class TestServiceMode:
|
||||
|
||||
self.sysv_service_scenario(config, tmp_path, assert_rotating_log)
|
||||
|
||||
@skip_on_ci("we can't run sudo command on CI")
|
||||
@select_platform("Linux")
|
||||
@pytest.mark.skipif(os.path.exists("/etc/cloudflared/config.yml"),
|
||||
reason=f"There is already a config file in default path")
|
||||
|
||||
@@ -10,7 +10,6 @@ import pytest
|
||||
|
||||
import requests
|
||||
import yaml
|
||||
import json
|
||||
from retrying import retry
|
||||
|
||||
from constants import METRICS_PORT, MAX_RETRIES, BACKOFF_SECS
|
||||
@@ -35,6 +34,12 @@ def fips_enabled():
|
||||
nofips = pytest.mark.skipif(
|
||||
fips_enabled(), reason=f"Only runs without FIPS (COMPONENT_TESTS_FIPS=0)")
|
||||
|
||||
def skip_on_ci(reason):
|
||||
env_ci = os.getenv("CI")
|
||||
running_in_ci = env_ci is not None and env_ci != "0"
|
||||
return pytest.mark.skipif(
|
||||
running_in_ci, reason=f"This test can't run on CI due to: {reason}")
|
||||
|
||||
def write_config(directory, config):
|
||||
config_path = directory / "config.yml"
|
||||
with open(config_path, 'w') as outfile:
|
||||
|
||||
Reference in New Issue
Block a user