fix config

This commit is contained in:
Elio Bischof 2022-07-09 11:11:25 +02:00
parent 2a8c66b64d
commit 27de173481
No known key found for this signature in database
GPG Key ID: 7B383FDE4DDBF1BD
5 changed files with 21 additions and 20 deletions

View File

@ -17,6 +17,7 @@ import (
func execute(ctx context.Context, cmd *command.Commands, cfg E2EConfig, users []userData) error {
ctx = authz.WithInstanceID(ctx, cfg.InstanceID)
ctx = authz.WithRequestedDomain(ctx, "localhost")
orgOwner := newHuman(users[0])
@ -92,6 +93,10 @@ func execute(ctx context.Context, cmd *command.Commands, cfg E2EConfig, users []
}
if user.role != "" {
if _, err = cmd.AddInstanceMember(ctx, createdHuman.ID, domain.RoleIAMOwner); err != nil {
return err
}
if _, err = cmd.AddOrgMember(ctx, org.ResourceOwner, createdHuman.ID, user.role); err != nil {
return err
}

View File

@ -1,4 +1,5 @@
import { defineConfig } from 'cypress';
import { readFileSync } from 'fs';
export default defineConfig({
reporter: 'mochawesome',
@ -11,13 +12,21 @@ export default defineConfig({
},
chromeWebSecurity: false,
// experimentalSessionSupport: true,
trashAssetsBeforeRuns: false,
defaultCommandTimeout: 10000,
e2e: {
experimentalSessionAndOrigin: true,
setupNodeEvents(on, config) {
// implement node event listeners here
require('cypress-terminal-report/src/installLogsPrinter')(on);
config.defaultCommandTimeout = 10_000
config.env.parsedServiceAccountKey = config.env.serviceAccountKey
if (config.env.serviceAccountKeyPath) {
config.env.parsedServiceAccountKey = JSON.parse(readFileSync(config.env.serviceAccountKeyPath, 'utf-8'))
}
return config
},
},
});

View File

@ -16,6 +16,6 @@ if ! command -v cypress &> /dev/null; then
fi
$NPX cypress $ACTION \
--port ${E2E_CYPRESS_PORT} \
--port "${E2E_CYPRESSPORT}" \
--env org="${ZITADEL_E2E_ORG}",org_owner_password="${ZITADEL_E2E_ORGOWNERPW}",org_owner_viewer_password="${ZITADEL_E2E_ORGOWNERVIEWERPW}",org_project_creator_password="${ZITADEL_E2E_ORGPROJECTCREATORPW}",login_policy_user_password="${ZITADEL_E2E_LOGINPOLICYUSERPW}",password_complexity_user_password="${ZITADEL_E2E_PASSWORDCOMPLEXITYUSERPW}",consoleUrl="${ZITADEL_E2E_CONSOLEURL}",apiUrl="${ZITADEL_E2E_APIURL}",accountsUrl="${ZITADEL_E2E_ACCOUNTSURL}",issuerUrl="${ZITADEL_E2E_ISSUERURL}",serviceAccountKeyPath="${ZITADEL_E2E_MACHINEKEYPATH}",otherZitadelIdpInstance="${ZITADEL_E2E_OTHERZITADELIDPINSTANCE}",zitadelProjectResourceId="${ZITADEL_E2E_ZITADELPROJECTRESOURCEID}" \
"$@"

View File

@ -1,15 +0,0 @@
import { readFileSync } from "fs";
module.exports = (on, config) => {
require('cypress-terminal-report/src/installLogsPrinter')(on);
config.defaultCommandTimeout = 10_000
config.env.parsedServiceAccountKey = config.env.serviceAccountKey
if (config.env.serviceAccountKeyPath) {
config.env.parsedServiceAccountKey = JSON.parse(readFileSync(config.env.serviceAccountKeyPath, 'utf-8'))
}
return config
}

View File

@ -11,5 +11,7 @@ ZITADEL_E2E_APIURL="http://localhost:8080"
ZITADEL_E2E_ACCOUNTSURL="http://localhost:8080"
ZITADEL_E2E_ISSUERURL="http://localhost:8080/oauth/v2"
ZITADEL_E2E_OTHERZITADELIDPINSTANCE=false
ZITADEL_E2E_ZITADELPROJECTRESOURCEID="bignumber-$(echo -n $(./e2e/docker-compose.sh exec --no-TTY db cockroach sql --database zitadel --insecure --execute "select aggregate_id from eventstore.events where event_type = 'project.added' and event_data = '{\"name\": \"ZITADEL\"}';" --format tsv) | cut -d " " -f 2)"
ZITADEL_E2E_INSTANCEID="$(echo -n $(./e2e/docker-compose.sh exec --no-TTY db cockroach sql --database zitadel --insecure --execute "select aggregate_id from eventstore.events where event_type = 'instance.added' and event_data = '{\"name\": \"Localhost\"}';" --format tsv) | cut -d " " -f 2)"
projectRoot=${projectRoot:-"."}
ZITADEL_E2E_ZITADELPROJECTRESOURCEID="bignumber-$(echo -n $(cd ${projectRoot}; ./e2e/docker-compose.sh exec --no-TTY db cockroach sql --database zitadel --insecure --execute "select aggregate_id from eventstore.events where event_type = 'project.added' and event_data = '{\"name\": \"ZITADEL\"}';" --format tsv) | cut -d " " -f 2)"
ZITADEL_E2E_INSTANCEID="$(echo -n $(cd ${projectRoot}; ./e2e/docker-compose.sh exec --no-TTY db cockroach sql --database zitadel --insecure --execute "select aggregate_id from eventstore.events where event_type = 'instance.added' and event_data = '{\"name\": \"Localhost\"}';" --format tsv) | cut -d " " -f 2)"