Skip to content

Commit

Permalink
remove addon enable process before e2e test
Browse files Browse the repository at this point in the history
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
  • Loading branch information
chivalryq committed Apr 3, 2023
1 parent 05be55a commit b9626a7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/server-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ jobs:
make e2e-setup-core
make start-addon-mock-server
make load-image
make enable-addon
make enable-addon-no-replicas
- name: Run server e2e test
run: |
Expand All @@ -174,6 +174,10 @@ jobs:
docker run --rm -v `pwd`/e2e-plugins:/plugins oamdev/velaux:latest cp -r -a /app/velaux/plugins/app-demo /plugins/app-demo
make e2e-server-test
- name: Test addon enable
run: |
make enable-addon
- name: Upload coverage report
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
with:
Expand All @@ -199,4 +203,4 @@ jobs:
file: ./Dockerfile
platforms: linux/arm64
push: false
tags: oamdev/velaux:latest
tags: oamdev/velaux:latest
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,11 @@ start-addon-mock-server:
load-image:
k3d image import oamdev/velaux:latest || { echo >&2 "kind not installed or error loading image: $(VELA_CORE_TEST_IMAGE)"; exit 1; }

# Only try to install the addon.
enable-addon-no-replicas:
vela addon enable ./addon replicas=0

enable-addon:
vela addon enable ./addon
vela addon enable ./addon replicas=0

.PHONY: e2e-server-test
e2e-server-test:
Expand Down Expand Up @@ -132,4 +133,4 @@ check-diff: reviewable
@$(OK) branch is clean

run-server:
go run ./cmd/server/main.go
go run ./cmd/server/main.go
4 changes: 2 additions & 2 deletions e2e-test/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const (
baseDomain = "http://127.0.0.1:8001"
baseURL = "http://127.0.0.1:8001/api/v1"
testNSprefix = "api-test-"
fakeAdminName = "fake-admin"
fakeAdminName = "admin"
)

func TestE2eApiserverTest(t *testing.T) {
Expand Down Expand Up @@ -87,7 +87,7 @@ var _ = BeforeSuite(func() {
Expect(err).ShouldNot(HaveOccurred())
}()
By("wait for api server to start")
defaultAdminPassword := "adminPass123"
defaultAdminPassword := "VelaUX12345"
Eventually(
func() error {
password := os.Getenv("VELA_UX_PASSWORD")
Expand Down
4 changes: 0 additions & 4 deletions pkg/server/infrastructure/datastore/kubeapi/kubeapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ func (m *kubeapi) generateConfigMap(entity datastore.Entity) *corev1.ConfigMap {

// Add add data model
func (m *kubeapi) Add(ctx context.Context, entity datastore.Entity) error {
// TODO: REMOVE THIS
if entity.PrimaryKey() == "admin" && entity.TableName() == "vela_user" {
panic("admin user should not be created")
}
if entity.PrimaryKey() == "" {
return datastore.ErrPrimaryEmpty
}
Expand Down

0 comments on commit b9626a7

Please sign in to comment.