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(tests): Misc updates for tests, auth log level, and quickstart #6491

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions datahub-frontend/app/client/AuthServiceClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import com.datahub.authentication.Authentication;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;

import java.nio.charset.StandardCharsets;
import java.util.Objects;
import javax.annotation.Nonnull;
import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -150,9 +152,11 @@ public boolean signUp(@Nonnull final String userUrn, @Nonnull final String fullN
final String jsonStr = EntityUtils.toString(entity);
return getIsNativeUserCreatedFromJson(jsonStr);
} else {
String content = response.getEntity().getContent() == null ? "" : new String(
response.getEntity().getContent().readAllBytes(), StandardCharsets.UTF_8);
throw new RuntimeException(
String.format("Bad response from the Metadata Service: %s %s", response.getStatusLine().toString(),
response.getEntity().toString()));
String.format("Bad response from the Metadata Service: %s %s Body: %s", response.getStatusLine().toString(),
response.getEntity().toString(), content));
}
} catch (Exception e) {
throw new RuntimeException(String.format("Failed to create user %s", userUrn), e);
Expand Down
4 changes: 2 additions & 2 deletions datahub-frontend/app/security/AuthenticationManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ public void handle(@Nonnull Callback[] callbacks) {
NameCallback nc = null;
PasswordCallback pc = null;
for (Callback callback : callbacks) {
Logger.error("The submitted callback is of type: " + callback.getClass() + " : " + callback);
Logger.debug("The submitted callback is of type: " + callback.getClass() + " : " + callback);
if (callback instanceof NameCallback) {
nc = (NameCallback) callback;
nc.setName(this.username);
} else if (callback instanceof PasswordCallback) {
pc = (PasswordCallback) callback;
pc.setPassword(this.password.toCharArray());
} else {
Logger.warn("The submitted callback is unsupported! ", callback);
Logger.warn("The submitted callback is unsupported! type: " + callback.getClass(), callback);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions docker/datahub-gms/env/docker.cassandra.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ KAFKA_BOOTSTRAP_SERVER=broker:29092
KAFKA_SCHEMAREGISTRY_URL=http://schema-registry:8081
ELASTICSEARCH_HOST=elasticsearch
ELASTICSEARCH_PORT=9200
ES_BULK_REFRESH_POLICY=WAIT_UNTIL
NEO4J_HOST=http://neo4j:7474
NEO4J_URI=bolt://neo4j
NEO4J_USERNAME=neo4j
Expand Down
1 change: 1 addition & 0 deletions docker/datahub-gms/env/docker.mariadb.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ KAFKA_BOOTSTRAP_SERVER=broker:29092
KAFKA_SCHEMAREGISTRY_URL=http://schema-registry:8081
ELASTICSEARCH_HOST=elasticsearch
ELASTICSEARCH_PORT=9200
ES_BULK_REFRESH_POLICY=WAIT_UNTIL
NEO4J_HOST=http://neo4j:7474
NEO4J_URI=bolt://neo4j
NEO4J_USERNAME=neo4j
Expand Down
1 change: 1 addition & 0 deletions docker/datahub-gms/env/docker.postgres.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ KAFKA_BOOTSTRAP_SERVER=broker:29092
KAFKA_SCHEMAREGISTRY_URL=http://schema-registry:8081
ELASTICSEARCH_HOST=elasticsearch
ELASTICSEARCH_PORT=9200
ES_BULK_REFRESH_POLICY=WAIT_UNTIL
NEO4J_HOST=http://neo4j:7474
NEO4J_URI=bolt://neo4j
NEO4J_USERNAME=neo4j
Expand Down
1 change: 1 addition & 0 deletions docker/datahub-mae-consumer/env/docker-without-neo4j.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ KAFKA_BOOTSTRAP_SERVER=broker:29092
KAFKA_SCHEMAREGISTRY_URL=http://schema-registry:8081
ELASTICSEARCH_HOST=elasticsearch
ELASTICSEARCH_PORT=9200
ES_BULK_REFRESH_POLICY=WAIT_UNTIL
GRAPH_SERVICE_IMPL=elasticsearch
ENTITY_REGISTRY_CONFIG_PATH=/datahub/datahub-mae-consumer/resources/entity-registry.yml

Expand Down
1 change: 1 addition & 0 deletions docker/datahub-mae-consumer/env/docker.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ KAFKA_BOOTSTRAP_SERVER=broker:29092
KAFKA_SCHEMAREGISTRY_URL=http://schema-registry:8081
ELASTICSEARCH_HOST=elasticsearch
ELASTICSEARCH_PORT=9200
ES_BULK_REFRESH_POLICY=WAIT_UNTIL
NEO4J_HOST=http://neo4j:7474
NEO4J_URI=bolt://neo4j
NEO4J_USERNAME=neo4j
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ services:
- KAFKA_SCHEMAREGISTRY_URL=http://schema-registry:8081
- ELASTICSEARCH_HOST=elasticsearch
- ELASTICSEARCH_PORT=9200
- ES_BULK_REFRESH_POLICY=WAIT_UNTIL
- GRAPH_SERVICE_IMPL=elasticsearch
- ENTITY_REGISTRY_CONFIG_PATH=/datahub/datahub-mae-consumer/resources/entity-registry.yml
hostname: datahub-mae-consumer
Expand Down
1 change: 1 addition & 0 deletions docker/quickstart/docker-compose.consumers.quickstart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ services:
- KAFKA_SCHEMAREGISTRY_URL=http://schema-registry:8081
- ELASTICSEARCH_HOST=elasticsearch
- ELASTICSEARCH_PORT=9200
- ES_BULK_REFRESH_POLICY=WAIT_UNTIL
- NEO4J_HOST=http://neo4j:7474
- NEO4J_URI=bolt://neo4j
- NEO4J_USERNAME=neo4j
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ echo "--------------------------------------------------------------------"

pwd ../../../

../../../../docker/dev.sh -d
DATAHUB_TELEMETRY_ENABLED=false \
DOCKER_COMPOSE_BASE="file://$(cd "$(dirname "${DIR}/../../../../../")"; pwd)" \
datahub docker quickstart --build-locally --dump-logs-on-failure
is_healthy "datahub-gms" 60

echo "--------------------------------------------------------------------"
Expand Down
2 changes: 1 addition & 1 deletion smoke-test/tests/browse/browse_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_get_browse_paths(frontend_session, ingest_cleanup_data):
# /prod -- There should be one entity
get_browse_paths_json = {
"query": get_browse_paths_query,
"variables": {"input": { "type": "DATASET", "path": ["prod"], "start": 0, "count": 10 } },
"variables": {"input": { "type": "DATASET", "path": ["prod"], "start": 0, "count": 100 } },
jjoyce0510 marked this conversation as resolved.
Show resolved Hide resolved
}

response = frontend_session.post(
Expand Down
9 changes: 2 additions & 7 deletions smoke-test/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,8 @@ def is_k8s_enabled():


def wait_for_healthcheck_util():
if is_k8s_enabled():
# Simply assert that kubernetes endpoints are healthy, but don't wait.
assert not check_endpoint(f"{get_frontend_url()}/admin")
assert not check_endpoint(f"{get_gms_url()}/health")
else:
# Simply assert that docker is healthy, but don't wait.
assert not check_local_docker_containers()
assert not check_endpoint(f"{get_frontend_url()}/admin")
assert not check_endpoint(f"{get_gms_url()}/health")


def check_endpoint(url):
Expand Down