Skip to content

Commit

Permalink
Optimized disk usage in GH Action for integration tests (#2355)
Browse files Browse the repository at this point in the history
* tests: remote unncessary software from GH VM

Previously tests were failing with no space left on device.

Signed-off-by: Matej Vašek <[email protected]>

* fixup: updated generated code

The codegen should have been updated in prior PR but we forget do do it
there.

Signed-off-by: Matej Vašek <[email protected]>

* test: wait for gitlab setting effect

Signed-off-by: Matej Vašek <[email protected]>

---------

Signed-off-by: Matej Vašek <[email protected]>
  • Loading branch information
matejvasek authored Jun 11, 2024
1 parent d8793d4 commit 2e7154c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ jobs:
os: ["ubuntu-latest"]
runs-on: ${{ matrix.os }}
steps:
- name: Remove Unnecessary Software
run: |
sudo rm -rf /usr/share/dotnet || true
sudo rm -rf /usr/local/lib/android || true
sudo rm -rf /opt/ghc || true
- name: Set Environment Variables
run: |
echo "KUBECONFIG=${{ github.workspace }}/hack/bin/kubeconfig.yaml" >> "$GITHUB_ENV"
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/func_build.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func build
--platform string Optionally specify a target platform, for example "linux/amd64" when using the s2i build strategy
-u, --push Attempt to push the function image to the configured registry after being successfully built
-r, --registry string Container registry + registry namespace. (ex 'ghcr.io/myuser'). The full image name is automatically determined using this along with function name. ($FUNC_REGISTRY)
--registry-insecure Disable HTTPS when communicating to the registry ($FUNC_REGISTRY_INSECURE)
--registry-insecure Skip TLS certificate verification when communicating in HTTPS with the registry ($FUNC_REGISTRY_INSECURE)
-v, --verbose Print verbose logs ($FUNC_VERBOSE)
```

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/func_deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func deploy
-u, --push Push the function image to registry before deploying. ($FUNC_PUSH) (default true)
--pvc-size string When triggering a remote deployment, set a custom volume size to allocate for the build operation ($FUNC_PVC_SIZE)
-r, --registry string Container registry + registry namespace. (ex 'ghcr.io/myuser'). The full image name is automatically determined using this along with function name. ($FUNC_REGISTRY)
--registry-insecure Disable HTTPS when communicating to the registry ($FUNC_REGISTRY_INSECURE)
--registry-insecure Skip TLS certificate verification when communicating in HTTPS with the registry ($FUNC_REGISTRY_INSECURE)
-R, --remote Trigger a remote deployment. Default is to deploy and build from the local system ($FUNC_REMOTE)
--service-account string Service account to be used in the deployed function ($FUNC_SERVICE_ACCOUNT)
-v, --verbose Print verbose logs ($FUNC_VERBOSE)
Expand Down
23 changes: 6 additions & 17 deletions pkg/pipelines/tekton/gitlab_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,24 +240,13 @@ func setupGitlabEnv(ctx context.Context, t *testing.T, baseURL, username, passwo
if err != nil {
t.Fatal(err)
}
// For some reason the setting update does not kick in immediately.

ticker := time.NewTicker(time.Second)
out:
for {
select {
case <-ctx.Done():
t.Fatal("cancelled")
case <-ticker.C:
s, _, e := glabCli.Settings.GetSettings()
if e != nil {
t.Fatal(e)
}
if s != nil && s.AllowLocalRequestsFromWebHooksAndServices {
ticker.Stop()
break out
}
}
// For some reason the setting update does not kick in immediately.
select {
case <-time.After(time.Second * 30):
break
case <-ctx.Done():
t.Fatal(ctx.Err())
}

//endregion
Expand Down

0 comments on commit 2e7154c

Please sign in to comment.