Skip to content

Commit b8dbe5c

Browse files
committed
ci: add concurrent test suites
Signed-off-by: peefy <[email protected]>
1 parent 52d0f10 commit b8dbe5c

File tree

8 files changed

+86
-26
lines changed

8 files changed

+86
-26
lines changed

.github/workflows/example-e2e-tests.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
shell: bash -ieo pipefail {0}
2323
run: PATH=$PATH:$HOME/go/bin ./examples/test.sh
2424

25+
- name: run concurrent e2e
26+
run: PATH=$PATH:$HOME/go/bin ./scripts/concurrent_test.sh
27+
2528
macos:
2629
strategy:
2730
matrix:
@@ -43,6 +46,9 @@ jobs:
4346
shell: bash -ieo pipefail {0}
4447
run: PATH=$PATH:$HOME/go/bin ./examples/test.sh
4548

49+
- name: run concurrent e2e
50+
run: PATH=$PATH:$HOME/go/bin ./scripts/concurrent_test.sh
51+
4652
windows:
4753
runs-on: windows-latest
4854
steps:

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ RUN apt-get update
1414
RUN apt-get install gcc git -y
1515
# The reason for doing this below is to prevent the
1616
# container from not having write permissions.
17-
ENV KCL_GO_DISABLE_INSTALL_ARTIFACT=true
1817
ENV KCL_PKG_PATH=/tmp
1918
ENV KCL_CACHE_PATH=/tmp
20-
19+
# In the image, we can generate a runtime in advance to
20+
# avoid writing files in the image
21+
ENV KCL_GO_DISABLE_INSTALL_ARTIFACT=true
22+
ENV KCL_GO_DISABLE_ARTIFACT_IN_PATH=false
2123
# Install the tini
2224
ENV TINI_VERSION v0.19.0
2325
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ export PATH=$KCL_CLI_INSTALLATION_PATH:$PATH
8585
docker run -it kcllang/kcl
8686
```
8787

88+
### Docker for arm64
89+
90+
```shell
91+
docker run -it kcllang/kcl-arm64
92+
```
93+
8894
### Build from Source Code
8995

9096
```shell

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.8.9
1+
0.9.0-alpha.1

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ require (
77
github.com/onsi/ginkgo/v2 v2.17.3
88
github.com/onsi/gomega v1.33.1
99
github.com/spf13/cobra v1.8.0
10-
kcl-lang.io/kcl-go v0.8.7
10+
kcl-lang.io/kcl-go v0.9.0-alpha.1
1111
kcl-lang.io/kcl-openapi v0.6.1
1212
kcl-lang.io/kcl-playground v0.5.1
13-
kcl-lang.io/kpm v0.8.6
13+
kcl-lang.io/kpm v0.8.7-0.20240511160903-faa726d7169b
1414
)
1515

1616
require (
@@ -178,7 +178,7 @@ require (
178178
golang.org/x/tools v0.20.0 // indirect
179179
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
180180
google.golang.org/grpc v1.63.2 // indirect
181-
google.golang.org/protobuf v1.34.0 // indirect
181+
google.golang.org/protobuf v1.34.1 // indirect
182182
gopkg.in/inf.v0 v0.9.1 // indirect
183183
gopkg.in/warnings.v0 v0.1.2 // indirect
184184
gopkg.in/yaml.v2 v2.4.0 // indirect
@@ -191,7 +191,7 @@ require (
191191
k8s.io/klog/v2 v2.100.1 // indirect
192192
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
193193
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
194-
kcl-lang.io/lib v0.8.7 // indirect
194+
kcl-lang.io/lib v0.9.0-alpha.1.0.20240513115021-7408627a80ec // indirect
195195
oras.land/oras-go v1.2.3 // indirect
196196
oras.land/oras-go/v2 v2.3.0 // indirect
197197
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect

go.sum

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,8 +1658,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ
16581658
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
16591659
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
16601660
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
1661-
google.golang.org/protobuf v1.34.0 h1:Qo/qEd2RZPCf2nKuorzksSknv0d3ERwp1vFG38gSmH4=
1662-
google.golang.org/protobuf v1.34.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
1661+
google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
1662+
google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
16631663
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
16641664
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
16651665
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
@@ -1735,16 +1735,16 @@ k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
17351735
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
17361736
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk=
17371737
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
1738-
kcl-lang.io/kcl-go v0.8.7 h1:KekBSkoZYWupMjsC0yX3bCQzEvFTI9HTpKREvWrvu/8=
1739-
kcl-lang.io/kcl-go v0.8.7/go.mod h1:PjOAZXoCdmx+rz/zybRNLQWvybnU4z4gbKDW7IwUDH4=
1738+
kcl-lang.io/kcl-go v0.9.0-alpha.1 h1:X4phg09tX0GR7QBXwykPeo4HzzQanMV2ToeJm+mj7Xw=
1739+
kcl-lang.io/kcl-go v0.9.0-alpha.1/go.mod h1:X4aDVk46f8meaP/IUQiFz3gKvO/SB02IJAWbL66IHfo=
17401740
kcl-lang.io/kcl-openapi v0.6.1 h1:iPH0EvPgDGZS5Lk00/Su5Av6AQP5IBG8f7gAUyevkHE=
17411741
kcl-lang.io/kcl-openapi v0.6.1/go.mod h1:Ai9mFztCVKkRSFabczO/r5hCNdqaNtAc2ZIRxTeV0Mk=
17421742
kcl-lang.io/kcl-playground v0.5.1 h1:MKQQUHgt4+2QyU2NVwa73oksOaBJGDi4keGoggA0MiU=
17431743
kcl-lang.io/kcl-playground v0.5.1/go.mod h1:IFmnlw7m011ccX8OidMUfnnN2u/TWdtQGxyABRTbmow=
1744-
kcl-lang.io/kpm v0.8.6 h1:uGaZjfkyG2ot9xVqdbE7ZsHcUfi6qYDa3UZUM77hhR8=
1745-
kcl-lang.io/kpm v0.8.6/go.mod h1:buvccvOf1JdN9WiPG1bOYHUnzapWNBLfURJf8W/VswU=
1746-
kcl-lang.io/lib v0.8.7 h1:qN7FOrwd8l4IiuPUDEEIKJqavGAq+rTMR1GCn0OrydE=
1747-
kcl-lang.io/lib v0.8.7/go.mod h1:ubsalGXxJaa5II/EsHmsI/tL2EluYHIcW+BwzQPt+uY=
1744+
kcl-lang.io/kpm v0.8.7-0.20240511160903-faa726d7169b h1:Bduk9oA+5UnbksE486EDbp6oq1VScqF1S8/PKiypG94=
1745+
kcl-lang.io/kpm v0.8.7-0.20240511160903-faa726d7169b/go.mod h1:buvccvOf1JdN9WiPG1bOYHUnzapWNBLfURJf8W/VswU=
1746+
kcl-lang.io/lib v0.9.0-alpha.1.0.20240513115021-7408627a80ec h1:93Wwpa9OIT2HlYX6DDhOYP9Azv4SlPtLeyWuTIY1kO0=
1747+
kcl-lang.io/lib v0.9.0-alpha.1.0.20240513115021-7408627a80ec/go.mod h1:ubsalGXxJaa5II/EsHmsI/tL2EluYHIcW+BwzQPt+uY=
17481748
oras.land/oras-go v1.2.3 h1:v8PJl+gEAntI1pJ/LCrDgsuk+1PKVavVEPsYIHFE5uY=
17491749
oras.land/oras-go v1.2.3/go.mod h1:M/uaPdYklze0Vf3AakfarnpoEckvw0ESbRdN8Z1vdJg=
17501750
oras.land/oras-go/v2 v2.3.0 h1:lqX1aXdN+DAmDTKjiDyvq85cIaI4RkIKp/PghWlAGIU=

pkg/version/version.go

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ func getVersion(version string) string {
3232
}
3333

3434
const (
35-
VersionTypeLatest = Version_0_8_9
35+
VersionTypeLatest = Version_0_9_0_alpha_1
3636

37+
Version_0_9_0_alpha_1 VersionType = "0.9.0-alpha.1"
3738
Version_0_8_9 VersionType = "0.8.9"
3839
Version_0_8_8 VersionType = "0.8.8"
3940
Version_0_8_7 VersionType = "0.8.7"
@@ -44,21 +45,11 @@ const (
4445
Version_0_8_2 VersionType = "0.8.2"
4546
Version_0_8_1 VersionType = "0.8.1"
4647
Version_0_8_0 VersionType = "0.8.0"
47-
Version_0_8_0_beta_1 VersionType = "0.8.0-beta.1"
48-
Version_0_8_0_alpha_1 VersionType = "0.8.0-alpha.1"
4948
Version_0_7_5 VersionType = "0.7.5"
5049
Version_0_7_4 VersionType = "0.7.4"
5150
Version_0_7_3 VersionType = "0.7.3"
5251
Version_0_7_2 VersionType = "0.7.2"
5352
Version_0_7_1 VersionType = "0.7.1"
5453
Version_0_7_0 VersionType = "0.7.0"
55-
Version_0_7_0_beta_2 VersionType = "0.7.0-beta.2"
56-
Version_0_7_0_beta_1 VersionType = "0.7.0-beta.1"
57-
Version_0_7_0_alpha_2 VersionType = "0.7.0-alpha.2"
58-
Version_0_7_0_alpha_1 VersionType = "0.7.0-alpha.1"
5954
Version_0_6_0 VersionType = "0.6.0"
60-
Version_0_6_0_alpha_1 VersionType = "0.6.0-alpha.1"
61-
Version_0_6_0_alpha_2 VersionType = "0.6.0-alpha.2"
62-
Version_0_6_0_alpha_3 VersionType = "0.6.0-alpha.3"
63-
Version_0_6_0_alpha_4 VersionType = "0.6.0-alpha.4"
6455
)

scripts/concurrent_test.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/bash
2+
3+
concurrent_test() {
4+
local repo_url=$1
5+
local concurrency=$2
6+
7+
local -a statuses
8+
for i in $(seq 1 "$concurrency"); do
9+
statuses[i]=0
10+
done
11+
12+
run_test() {
13+
local id=$1
14+
echo "Starting test for $repo_url (ID: $id)"
15+
if time kcl run "$repo_url"; then
16+
echo "Completed test successfully for $repo_url (ID: $id)"
17+
statuses[id]=0
18+
else
19+
echo "Test failed for $repo_url (ID: $id)"
20+
statuses[id]=$?
21+
fi
22+
}
23+
24+
for i in $(seq 1 "$concurrency"); do
25+
run_test "$i" &
26+
done
27+
28+
wait
29+
30+
local has_errors=0
31+
for status in "${statuses[@]}"; do
32+
if [ "$status" -ne 0 ]; then
33+
has_errors=1
34+
break
35+
fi
36+
done
37+
38+
return $has_errors
39+
}
40+
41+
TEST_REPOS=(
42+
"oci://ghcr.io/kcl-lang/podinfo"
43+
"https://github.com/kcl-lang/flask-demo-kcl-manifests"
44+
"./examples/server"
45+
)
46+
CONCURRENCY_LEVEL=4
47+
48+
for repo in "${TEST_REPOS[@]}"; do
49+
if ! concurrent_test "$repo" "$CONCURRENCY_LEVEL"; then
50+
echo "Error during concurrent test for $repo"
51+
exit 1
52+
fi
53+
done
54+
55+
echo "All concurrent tests completed successfully."

0 commit comments

Comments
 (0)