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

chore: add type test #4651

Merged
merged 3 commits into from
Jan 30, 2025
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
1 change: 1 addition & 0 deletions apps/central/src/components/SchemaCreateModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export default {
"PROJECTMANAGER",
"GDI",
"DATA_CATALOGUE_AGGREGATES",
"TYPE_TEST",
],
includeDemoData: false,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public enum Profile {
GDI("_profiles/GDI.yaml"),
SHARED_STAGING("_profiles/SharedStaging.yaml"),
IMAGE_TEST("_profiles/ImageTest.yaml"),
PET_STORE("_profiles/PetStore.yaml");
PET_STORE("_profiles/PetStore.yaml"),
TYPE_TEST("_profiles/TypeTest.yaml");

public static boolean hasProfile(String nameOther) {
return Arrays.stream(values()).anyMatch(profile -> profile.name().equals(nameOther));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ public class RunMolgenisEmx2 {
public static final boolean EXCLUDE_PETSTORE_DEMO =
(Boolean)
EnvironmentProperty.getParameter(Constants.MOLGENIS_EXCLUDE_PETSTORE_DEMO, false, BOOL);
public static final boolean INCLUDE_TYPE_TEST_DEMO =
(Boolean)
EnvironmentProperty.getParameter(Constants.MOLGENIS_INCLUDE_TYPE_TEST_DEMO, false, BOOL);

public static void main(String[] args) {
logger.info("Starting MOLGENIS EMX2 Software Version=" + Version.getVersion());
Expand Down Expand Up @@ -62,6 +65,11 @@ public static void main(String[] args) {
DataModels.Profile.PET_STORE.getImportTask(schema, true).run();
}

if (INCLUDE_TYPE_TEST_DEMO && db.getSchema("type test") == null) {
Schema schema = db.createSchema("type test");
DataModels.Profile.TYPE_TEST.getImportTask(schema, true).run();
}

if (INCLUDE_CATALOGUE_DEMO && db.getSchema(CATALOGUE_DEMO) == null) {
Schema schema = db.createSchema(CATALOGUE_DEMO, "from DataCatalogue demo data loader");
DataModels.Profile.DATA_CATALOGUE.getImportTask(schema, true).run();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public class Constants {
public static final String MOLGENIS_INCLUDE_CATALOGUE_DEMO = "MOLGENIS_INCLUDE_CATALOGUE_DEMO";
public static final String MOLGENIS_INCLUDE_DIRECTORY_DEMO = "MOLGENIS_INCLUDE_DIRECTORY_DEMO";
public static final String MOLGENIS_EXCLUDE_PETSTORE_DEMO = "MOLGENIS_EXCLUDE_PETSTORE_DEMO";
public static final String MOLGENIS_INCLUDE_TYPE_TEST_DEMO = "MOLGENIS_INCLUDE_TYPE_TEST_DEMO";

public static final String MOLGENIS_JWT_SHARED_SECRET = "MOLGENIS_JWT_SHARED_SECRET";

Expand Down
2 changes: 1 addition & 1 deletion ci/create_or_update_k8s-azure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ helm upgrade --install ${NAME} ./helm-chart --namespace ${NAME} \
--set image.tag=${TAG_NAME} \
--set image.repository=${REPO} \
--set image.pullPolicy=Always \
--set catalogue.includeCatalogueDemo=true \
--set ssrCatalogue.image.tag=$TAG_NAME \
--set ssrCatalogue.image.repository=$REPO2 \
--set ssrCatalogue.environment.siteTitle="Preview Catalogue" \
--set ssrCatalogue.environment.apiBase=https://${NAME}.dev.molgenis.org/ \
--set includeTypeTestDemo=true \
--set catalogue.includeCatalogueDemo=true \
--set directory.includeDirectoryDemo=true \
--set oidc.enabled=true \
Expand Down
43 changes: 43 additions & 0 deletions data/_models/specific/typetest.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
tableName,tableExtends,tableType,columnName,columnType,key,required,refSchema,refTable,refLink,refBack,refLabel,defaultValue,validation,visible,computed,semantics,profiles,label,description
Types,,,,,,,,,,,,,,,,,TypeTest,,A table containing a column for each column type
Types,,,String types,heading,,,,,,,,,,,,,TypeTest,,
Types,,,string type,string,1,,,,,,,,,,,,TypeTest,,
Types,,,string array type,string_array,,,,,,,,,,,,,TypeTest,,
Types,,,text type,text,,,,,,,,,,,,,TypeTest,,
Types,,,text array type,text_array,,,,,,,,,,,,,TypeTest,,
Types,,,json type,json,,,,,,,,,,,,,TypeTest,,
Types,,,Simple types,heading,,,,,,,,,,,,,TypeTest,,
Types,,,bool type,bool,,,,,,,,,,,,,TypeTest,,
Types,,,bool array type,bool_array,,,,,,,,,,,,,TypeTest,,
Types,,,uuid type,uuid,,,,,,,,,,,,,TypeTest,,
Types,,,uuid array type,uuid_array,,,,,,,,,,,,,TypeTest,,
Types,,,file type,file,,,,,,,,,,,,,TypeTest,,
Types,,,Numeric types,heading,,,,,,,,,,,,,TypeTest,,
Types,,,int type,int,,,,,,,,,,,,,TypeTest,,
Types,,,int array type,int_array,,,,,,,,,,,,,TypeTest,,
Types,,,long type,long,,,,,,,,,,,,,TypeTest,,
Types,,,long array type,long_array,,,,,,,,,,,,,TypeTest,,
Types,,,decimal type,decimal,,,,,,,,,,,,,TypeTest,,
Types,,,decimal array type,decimal_array,,,,,,,,,,,,,TypeTest,,
Types,,,Date types,heading,,,,,,,,,,,,,TypeTest,,
Types,,,date type,date,,,,,,,,,,,,,TypeTest,,
Types,,,date array type,date_array,,,,,,,,,,,,,TypeTest,,
Types,,,datetime type,datetime,,,,,,,,,,,,,TypeTest,,
Types,,,datetime array type,datetime_array,,,,,,,,,,,,,TypeTest,,
Types,,,period type,period,,,,,,,,,,,,,TypeTest,,
Types,,,period array type,period_array,,,,,,,,,,,,,TypeTest,
Types,,,Relationship types,heading,,,,,,,,,,,,,TypeTest,,
Types,,,ref type,ref,,,,Options,,,,,,,,,TypeTest,,
Types,,,ref array type,ref_array,,,,Options,,,,,,,,,TypeTest,,
Types,,,ref back type,ref,,,,Options,,,,,,,,,TypeTest,,
Types,,,Extended types,heading,,,,,,,,,,,,,TypeTest,,
Types,,,auto id type,auto_id,1,,,,,,,,,,,,TypeTest,,
Types,,,ontology type,ontology,,,,Ontology,,,,,,,,,TypeTest,,
Types,,,ontology array type,ontology_array,,,,Ontology,,,,,,,,,TypeTest,,
Types,,,email type,email,,,,,,,,,,,,,TypeTest,,
Types,,,email array type,email_array,,,,,,,,,,,,,TypeTest,,
Types,,,hyperlink type,hyperlink,,,,,,,,,,,,,TypeTest,,
Types,,,hyperlink array type,hyperlink_array,,,,,,,,,,,,,TypeTest,,
Options,,,,,,,,,,,,,,,,,TypeTest,,A table options to test the ref column
Options,,,option key,string,1,,,,,,,,,,,,TypeTest,,
Options,,,option value,string,,,,,,,,,,,,,TypeTest,,
8 changes: 8 additions & 0 deletions data/_profiles/TypeTest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: Type Test
description: "a schema for testing the available column types"

profileTags: TypeTest

# special options
setViewPermission: anonymous
2 changes: 2 additions & 0 deletions helm-chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ spec:
key: databasepassword
- name: MOLGENIS_POSTGRES_URI
value: jdbc:postgresql://localhost/{{ .Values.database.name }}
- name: MOLGENIS_INCLUDE_TYPE_TEST_DEMO
value: {{ .Values.includeTypeTestDemo | quote }}
- name: MOLGENIS_INCLUDE_CATALOGUE_DEMO
value: {{ .Values.catalogue.includeCatalogueDemo | quote }}
- name: MOLGENIS_INCLUDE_DIRECTORY_DEMO
Expand Down
2 changes: 2 additions & 0 deletions helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ postgres:
password: postgres
database: postgres

includeTypeTestDemo: false

catalogue:
includeCatalogueDemo: false

Expand Down