Skip to content
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

Fix integration tests #7827

Merged
merged 5 commits into from
Jan 31, 2022
Merged

Fix integration tests #7827

merged 5 commits into from
Jan 31, 2022

Conversation

sagor999
Copy link
Contributor

@sagor999 sagor999 commented Jan 25, 2022

Description

Fixes integrations tests. Made sure it runs manually via go or docker.
Added optional parameters to test additional tests (for example one that requires enterprise license or gitlab integration).

Related Issue(s)

Fixes #7675

How to test

Spin up new cluster via workspace-preview and follow steps in README.md file for manual testing via running go test directly or via docker container that werft builds.

Release Notes

Fix integration tests

Documentation

@codecov
Copy link

codecov bot commented Jan 26, 2022

Codecov Report

Merging #7827 (ec61d39) into main (2fb5775) will decrease coverage by 2.22%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #7827      +/-   ##
==========================================
- Coverage   12.42%   10.20%   -2.23%     
==========================================
  Files          42       18      -24     
  Lines        4248     1009    -3239     
==========================================
- Hits          528      103     -425     
+ Misses       3679      905    -2774     
+ Partials       41        1      -40     
Flag Coverage Δ
components-blobserve-app ?
components-blobserve-lib ?
components-gitpod-cli-app 10.20% <ø> (ø)
components-local-app-app-darwin-amd64 ?
components-local-app-app-darwin-arm64 ?
components-local-app-app-linux-amd64 ?
components-local-app-app-linux-arm64 ?
components-local-app-app-windows-386 ?
components-local-app-app-windows-amd64 ?
components-local-app-app-windows-arm64 ?
components-registry-facade-app ?
components-registry-facade-lib ?
installer-raw-app ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
installer/pkg/components/ws-manager/role.go
components/registry-facade/pkg/registry/metrics.go
components/blobserve/pkg/blobserve/blobserve.go
...omponents/registry-facade/pkg/registry/manifest.go
installer/pkg/common/storage.go
components/local-app/pkg/auth/auth.go
...components/ws-manager/unpriviledged-rolebinding.go
installer/pkg/common/objects.go
...onents/registry-facade/pkg/registry/layersource.go
installer/pkg/components/ws-manager/tlssecret.go
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9f70a0c...ec61d39. Read the comment docs.

@sagor999 sagor999 force-pushed the kyleb/installer-integration branch from c373e3b to f481e40 Compare January 26, 2022 01:42
@sagor999 sagor999 changed the title Draft: Fix integration tests Fix integration tests Jan 26, 2022
@sagor999 sagor999 force-pushed the kyleb/installer-integration branch from f481e40 to b7ec552 Compare January 26, 2022 01:52
@sagor999 sagor999 marked this pull request as ready for review January 26, 2022 01:56
@sagor999 sagor999 requested a review from a team January 26, 2022 01:56
Copy link
Contributor

@utam0k utam0k left a comment

Choose a reason for hiding this comment

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

Awesome! I left a few comments.

test/entrypoint.sh Show resolved Hide resolved
test/README.md Show resolved Hide resolved
test/pkg/integration/setup.go Outdated Show resolved Hide resolved
@sagor999 sagor999 force-pushed the kyleb/installer-integration branch from b7ec552 to 30a9c96 Compare January 26, 2022 19:03
@sagor999 sagor999 requested a review from aledbf January 26, 2022 19:28
@utam0k
Copy link
Contributor

utam0k commented Jan 26, 2022

/approve

@kylos101
Copy link
Contributor

/hold I am actively reviewing.

Copy link
Contributor

@kylos101 kylos101 left a comment

Choose a reason for hiding this comment

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

Just a few questions, nice work, @sagor999 !

test/README.md Show resolved Hide resolved
test/README.md Outdated Show resolved Hide resolved
3. To test gitlab integration, add `-gitlab=true`
4. All other tests.

To run the tests:
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you able to run the tests against a preview environment namespace? Like for this branch, as an example?

I know the goal was to get it running against workspace-preview, but it would be interesting to see how it fairs here, too.

Ideally we'd also be able to use these tests against core-dev (a set of namespaces in a single GKE cluster). Pretty soon core-dev will be replaced with Hertzner, where each preview environment (branch) gets a single node K3s cluster.

Copy link
Contributor Author

@sagor999 sagor999 Jan 27, 2022

Choose a reason for hiding this comment

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

Hm. There is something with permissions when trying to run go tests in core-dev. when test calls kubectl it cannot access kubeconfig.

And also you cannot run it via docker container due to permissions:

kubectl apply -f integration.yaml 
serviceaccount/integration-svc created
job.batch/integration-job created
Error from server (Forbidden): error when creating "integration.yaml": roles.rbac.authorization.k8s.io is forbidden: User "pavel@gitpod.io" cannot create resource "roles" in API group "rbac.authorization.k8s.io" in the namespace "staging-kyleb-installer-integration": requires one of ["container.roles.create"] permission(s).
Error from server (Forbidden): error when creating "integration.yaml": rolebindings.rbac.authorization.k8s.io is forbidden: User "pavel@gitpod.io" cannot create resource "rolebindings" in API group "rbac.authorization.k8s.io" in the namespace "staging-kyleb-installer-integration": requires one of ["container.roleBindings.create"] permission(s).

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm sorry I missed your response from a couple days ago! 🙏

I rebased with main and did ec61d39 to get the tests runnable in werft against core-dev. May I ask for you to review?

I just tried kubectl apply and had similar trouble in core-dev, which may be intentional (in hindsight) so that we do not "break" core-dev for other namespaces. In other words, kubectl apply is probably best for us (in hindsight) in single node clusters dedicated to ourselves (workspace preview, harvester, etc.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks good, thank you!

test/pkg/integration/integration.go Show resolved Hide resolved
@kylos101 kylos101 added the team: workspace Issue belongs to the Workspace team label Jan 27, 2022
@sagor999 sagor999 force-pushed the kyleb/installer-integration branch from 30a9c96 to 95b0747 Compare January 27, 2022 23:26
@sagor999 sagor999 requested a review from kylos101 January 27, 2022 23:39
@kylos101 kylos101 force-pushed the kyleb/installer-integration branch 4 times, most recently from 28713df to 661f27a Compare January 29, 2022 23:30
@kylos101 kylos101 force-pushed the kyleb/installer-integration branch from 661f27a to ec61d39 Compare January 30, 2022 00:09
@kylos101
Copy link
Contributor

@sagor999 This run seems fast, like almost too good to be true. 🤔 WDYT? Did you see similar speeds with workspace-preview, after downloading images?

First test: 'Test succeeded at Sun Jan 30 00:16:10 UTC 2022'
Last test: 'Test succeeded at Sun Jan 30 00:18:11 UTC 2022'

@sagor999
Copy link
Contributor Author

This run seems fast, like almost too good to be true. thinking WDYT? Did you see similar speeds with workspace-preview, after downloading images?

@kylos101
yeah, that seems fine. It only ran a few tests, and to run more extensive testing you need to provide -username param, those additional tests usually run longer.

@kylos101
Copy link
Contributor

/unhold

Excellent work @sagor999 ! Super stoked that we can run tests again.

@kylos101
Copy link
Contributor

/LGTM

@roboquat
Copy link
Contributor

LGTM label has been added.

Git tree hash: 003cc00ee0c1d28a42017c05fc921c514cf8f26c

@roboquat
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kylos101, utam0k

Associated issue: #7675

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@roboquat roboquat merged commit a82a23f into main Jan 31, 2022
@roboquat roboquat deleted the kyleb/installer-integration branch January 31, 2022 15:20
@roboquat roboquat added deployed: workspace Workspace team change is running in production deployed Change is completely running in production labels Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved deployed: workspace Workspace team change is running in production deployed Change is completely running in production release-note size/XL team: workspace Issue belongs to the Workspace team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get the integration tests to pass
4 participants