Skip to content

[test] Fix workspace integration tests #17222

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

Merged
merged 24 commits into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1bb8ef2
[tests] unique ContextURL for commit only
kylos101 Apr 13, 2023
173a210
[tests] include std output in the error message for commit
kylos101 Apr 13, 2023
4ee8ed9
[tests] Fix TestGitActions by using the test case context
kylos101 Apr 13, 2023
99aa47c
[test] bypass exit code 1 on `git commit` with `--allow-empty`
kylos101 Apr 14, 2023
a3b4937
[test] Fix gcloud auth, do setup before auth
kylos101 Apr 15, 2023
ca75e37
Show all output
kylos101 Apr 19, 2023
7d60c28
[test] avoid using deleted user, identity, and token
kylos101 Apr 23, 2023
c216ff6
[test] add organizationId to CreateWorkspaceOptions
kylos101 Apr 23, 2023
4f66add
[test] orgId is required on createWorkspace
kylos101 Apr 24, 2023
0bd754e
[test] fix git context tests
kylos101 Apr 24, 2023
1257b4c
[test] Use example test as the example
kylos101 Apr 24, 2023
5f59a1a
[test] fix context tests when run as gitpod-integration-test user
kylos101 Apr 24, 2023
05a9bb3
[test] clean-up
kylos101 Apr 24, 2023
242093e
[test] wait for workspaces to stop
kylos101 Apr 24, 2023
9b01eb4
[test] add code owners
kylos101 Apr 24, 2023
fe3c251
[test] limit # of tests that can run in parallel
kylos101 Apr 26, 2023
4be1123
[test] no parallel tests
kylos101 Apr 26, 2023
15aa2c8
[preview] update the VM image to have parity with production
kylos101 Apr 26, 2023
96b3e84
[preview] no PSP in support of VM image update
kylos101 Apr 26, 2023
8af791e
[test] don't wait for workspace stop with git_test.go, we're testing …
kylos101 Apr 26, 2023
d1c504a
[preview] retry installing trust-manager
kylos101 Apr 28, 2023
16b64f5
[test] clarify USER_TOKEN value for preview environments
kylos101 Apr 28, 2023
4655cee
Cleanup
kylos101 May 1, 2023
a10d7d5
[preview] remove commented out yaml related to PodSecurityPolicy
kylos101 May 1, 2023
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
15 changes: 15 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,18 @@
/CHANGELOG.md
/components/ide/jetbrains/backend-plugin/gradle-latest.properties
/components/ide/jetbrains/gateway-plugin/gradle-latest.properties

#
# Add so that teams assert we're not breaking each other's integration tests
/test/pkg/agent @gitpod-io/engineering-workspace
/test/pkg/integration @gitpod-io/engineering-ide @gitpod-io/engineering-workspace
/test/pkg/report @gitpod-io/engineering-workspace
/test/tests/workspace @gitpod-io/engineering-workspace
/test/tests/smoke-test @gitpod-io/engineering-ide @gitpod-io/engineering-workspace
/test/tests/ide @gitpod-io/engineering-ide
/test/tests/components/content-service @gitpod-io/engineering-workspace
/test/tests/components/database @gitpod-io/engineering-webapp
/test/tests/components/image-builder @gitpod-io/engineering-workspace
/test/tests/components/server @gitpod-io/engineering-webapp
/test/tests/components/ws-daemon @gitpod-io/engineering-workspace
/test/tests/components/ws-manager @gitpod-io/engineering-workspace
17 changes: 6 additions & 11 deletions .github/workflows/workspace-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,14 @@ jobs:
steps:
# sometimes auth fails with:
# google-github-actions/setup-gcloud failed with: EACCES: permission denied, mkdir '/__t/gcloud'
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
- id: auth
uses: google-github-actions/auth@v1
continue-on-error: true
with:
token_format: access_token
credentials_json: "${{ secrets.GCP_CREDENTIALS }}"
# so we retry on failure
- id: auth-retry
uses: google-github-actions/auth@v1
if: steps.auth.outcome == 'failure'
with:
token_format: access_token
credentials_json: "${{ secrets.GCP_CREDENTIALS }}"
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
# do this step as early as possible, so that Slack Notify failure has the secret
- name: Get Secrets from GCP
id: "secrets"
Expand Down Expand Up @@ -193,7 +186,7 @@ jobs:
args+=( "-kubeconfig=/home/gitpod/.kube/config" )
args+=( "-namespace=default" )
[[ "$USERNAME" != "" ]] && args+=( "-username=$USERNAME" )
args+=( "-timeout=60m" )
args+=( "-timeout=90m" )

BASE_TESTS_DIR="$GITHUB_WORKSPACE/test/tests"
CONTENT_SERVICE_TESTS="$BASE_TESTS_DIR/components/content-service"
Expand Down Expand Up @@ -225,7 +218,8 @@ jobs:
fi

set +e
go test -p 2 -v ./... "${args[@]}" -run '.*[^.SerialOnly]$' 2>&1 | go-junit-report -subtest-mode=exclude-parents -set-exit-code -out "TEST-${TEST_NAME}-PARALLEL.xml" -iocopy
# running tests in parallel saves time, but is flakey.
go test -p 1 --parallel 1 -v ./... "${args[@]}" -run '.*[^.SerialOnly]$' 2>&1 | go-junit-report -subtest-mode=exclude-parents -set-exit-code -out "TEST-${TEST_NAME}-PARALLEL.xml" -iocopy
RC=${PIPESTATUS[0]}
set -e

Expand All @@ -240,6 +234,7 @@ jobs:
uses: test-summary/action@v2
with:
paths: "test/tests/**/TEST-*.xml"
show: "all"
if: always()
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
Expand Down
256 changes: 0 additions & 256 deletions .werft/vm/manifests/rook-ceph/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,6 @@ rules:
resources: ["volumesnapshots/status"]
verbs: ["update", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: 'psp:rook'
labels:
operator: rook
storage-backend: ceph
app.kubernetes.io/part-of: rook-ceph-operator
rules:
- apiGroups:
- policy
resources:
- podsecuritypolicies
resourceNames:
- 00-rook-privileged
verbs:
- use
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
Expand Down Expand Up @@ -701,156 +683,6 @@ subjects:
name: rook-ceph-system
namespace: rook-ceph # namespace:operator
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: rook-ceph-system-psp
labels:
operator: rook
storage-backend: ceph
app.kubernetes.io/part-of: rook-ceph-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: 'psp:rook'
subjects:
- kind: ServiceAccount
name: rook-ceph-system
namespace: rook-ceph # namespace:operator
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: rook-csi-cephfs-plugin-sa-psp
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: 'psp:rook'
subjects:
- kind: ServiceAccount
name: rook-csi-cephfs-plugin-sa
namespace: rook-ceph # namespace:operator
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: rook-csi-cephfs-provisioner-sa-psp
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: 'psp:rook'
subjects:
- kind: ServiceAccount
name: rook-csi-cephfs-provisioner-sa
namespace: rook-ceph # namespace:operator
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: rook-csi-rbd-plugin-sa-psp
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: 'psp:rook'
subjects:
- kind: ServiceAccount
name: rook-csi-rbd-plugin-sa
namespace: rook-ceph # namespace:operator
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: rook-csi-rbd-provisioner-sa-psp
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: 'psp:rook'
subjects:
- kind: ServiceAccount
name: rook-csi-rbd-provisioner-sa
namespace: rook-ceph # namespace:operator
---
# We expect most Kubernetes teams to follow the Kubernetes docs and have these PSPs.
# * privileged (for kube-system namespace)
# * restricted (for all logged in users)
#
# PSPs are applied based on the first match alphabetically. `rook-ceph-operator` comes after
# `restricted` alphabetically, so we name this `00-rook-privileged`, so it stays somewhere
# close to the top and so `rook-system` gets the intended PSP. This may need to be renamed in
# environments with other `00`-prefixed PSPs.
#
# More on PSP ordering: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#policy-order
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: 00-rook-privileged
annotations:
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'runtime/default'
seccomp.security.alpha.kubernetes.io/defaultProfileName: 'runtime/default'
spec:
privileged: true
allowedCapabilities:
# required by CSI
- SYS_ADMIN
- MKNOD
fsGroup:
rule: RunAsAny
# runAsUser, supplementalGroups - Rook needs to run some pods as root
# Ceph pods could be run as the Ceph user, but that user isn't always known ahead of time
runAsUser:
rule: RunAsAny
supplementalGroups:
rule: RunAsAny
# seLinux - seLinux context is unknown ahead of time; set if this is well-known
seLinux:
rule: RunAsAny
volumes:
# recommended minimum set
- configMap
- downwardAPI
- emptyDir
- persistentVolumeClaim
- secret
- projected
# required for Rook
- hostPath
# allowedHostPaths can be set to Rook's known host volume mount points when they are fully-known
# allowedHostPaths:
# - pathPrefix: "/run/udev" # for OSD prep
# readOnly: false
# - pathPrefix: "/dev" # for OSD prep
# readOnly: false
# - pathPrefix: "/var/lib/rook" # or whatever the dataDirHostPath value is set to
# readOnly: false
# Ceph requires host IPC for setting up encrypted devices
hostIPC: true
# Ceph OSDs need to share the same PID namespace
hostPID: true
# hostNetwork can be set to 'false' if host networking isn't used
hostNetwork: true
hostPorts:
# Ceph messenger protocol v1
- min: 6789
max: 6790 # <- support old default port
# Ceph messenger protocol v2
- min: 3300
max: 3300
# Ceph RADOS ports for OSDs, MDSes
- min: 6800
max: 7300
# # Ceph dashboard port HTTP (not recommended)
# - min: 7000
# max: 7000
# Ceph dashboard port HTTPS
- min: 8443
max: 8443
# Ceph mgr Prometheus Metrics
- min: 9283
max: 9283
# port for CSIAddons
- min: 9070
max: 9070
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
Expand Down Expand Up @@ -1147,38 +979,6 @@ subjects:
name: rook-ceph-cmd-reporter
namespace: rook-ceph # namespace:cluster
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: rook-ceph-cmd-reporter-psp
namespace: rook-ceph # namespace:cluster
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: psp:rook
subjects:
- kind: ServiceAccount
name: rook-ceph-cmd-reporter
namespace: rook-ceph # namespace:cluster
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: rook-ceph-default-psp
namespace: rook-ceph # namespace:cluster
labels:
operator: rook
storage-backend: ceph
app.kubernetes.io/part-of: rook-ceph-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: psp:rook
subjects:
- kind: ServiceAccount
name: default
namespace: rook-ceph # namespace:cluster
---
# Allow the ceph mgr to access resources scoped to the CephCluster namespace necessary for mgr modules
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -1194,20 +994,6 @@ subjects:
name: rook-ceph-mgr
namespace: rook-ceph # namespace:cluster
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: rook-ceph-mgr-psp
namespace: rook-ceph # namespace:cluster
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: psp:rook
subjects:
- kind: ServiceAccount
name: rook-ceph-mgr
namespace: rook-ceph # namespace:cluster
---
# Allow the ceph mgr to access resources in the Rook operator namespace necessary for mgr modules
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand Down Expand Up @@ -1238,20 +1024,6 @@ subjects:
name: rook-ceph-osd
namespace: rook-ceph # namespace:cluster
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: rook-ceph-osd-psp
namespace: rook-ceph # namespace:cluster
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: psp:rook
subjects:
- kind: ServiceAccount
name: rook-ceph-osd
namespace: rook-ceph # namespace:cluster
---
# Allow the osd purge job to run in this namespace
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -1267,20 +1039,6 @@ subjects:
name: rook-ceph-purge-osd
namespace: rook-ceph # namespace:cluster
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: rook-ceph-purge-osd-psp
namespace: rook-ceph # namespace:cluster
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: psp:rook
subjects:
- kind: ServiceAccount
name: rook-ceph-purge-osd
namespace: rook-ceph # namespace:cluster
---
# Allow the rgw pods in this namespace to work with configmaps
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -1296,20 +1054,6 @@ subjects:
name: rook-ceph-rgw
namespace: rook-ceph # namespace:cluster
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: rook-ceph-rgw-psp
namespace: rook-ceph # namespace:cluster
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: psp:rook
subjects:
- kind: ServiceAccount
name: rook-ceph-rgw
namespace: rook-ceph # namespace:cluster
---
# Grant the operator, agent, and discovery agents access to resources in the rook-ceph-system namespace
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
1 change: 1 addition & 0 deletions components/gitpod-protocol/go/gitpod-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -2053,6 +2053,7 @@ type UpdateOwnAuthProviderParams struct {
type CreateWorkspaceOptions struct {
StartWorkspaceOptions
ContextURL string `json:"contextUrl,omitempty"`
OrganizationId string `json:"organizationId,omitempty"`
IgnoreRunningWorkspaceOnSameCommit bool `json:"ignoreRunningWorkspaceOnSameCommit,omitemopty"`
IgnoreRunningPrebuild bool `json:"ignoreRunningPrebuild,omitemopty"`
AllowUsingPreviousPrebuilds bool `json:"allowUsingPreviousPrebuilds,omitemopty"`
Expand Down
2 changes: 1 addition & 1 deletion dev/preview/BUILD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ scripts:
export TF_VAR_preview_name="${TF_VAR_preview_name:-$(previewctl get name)}"
export TF_VAR_vm_cpu="${TF_VAR_vm_cpu:-6}"
export TF_VAR_vm_memory="${TF_VAR_vm_memory:-12Gi}"
export TF_VAR_vm_storage_class="${TF_VAR_vm_storage_class:-longhorn-gitpod-k3s-202209251218-onereplica}"
export TF_VAR_vm_storage_class="${TF_VAR_vm_storage_class:-longhorn-gitpod-k3s-202304191605-onereplica}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

./workflow/preview/deploy-harvester.sh

- name: delete-preview
Expand Down
Loading