diff --git a/tests/test-generate-files.sh b/tests/test-generate-files.sh index fd76fc7..01830c3 100755 --- a/tests/test-generate-files.sh +++ b/tests/test-generate-files.sh @@ -3,6 +3,7 @@ # Setup function to create necessary files before each test setup() { mkdir -p out + mkdir -p conf echo 'export AI_MEMORY_ELASTIC_SEARCH_URL="https://hw2nl.ddns.net/elasticsearch"' >conf/gpt-values-override-conf.default.sh echo 'export AI_MEMORY_ELASTIC_SEARCH_WRITE_INDEX="index-ai-memory-default"' >>conf/gpt-values-override-conf.default.sh echo 'export AI_MEMORY_PERSONAL_NAME="Test"' >>conf/gpt-values-override-conf.default.sh @@ -18,7 +19,8 @@ setup() { # Teardown function to clean up after each test teardown() { rm -rf out/ - rm gpt-values-override-conf.default.sh + rm -rf conf/ + rm gpt-values-override-conf.dist.sh rm gpt-schema.dist.yml @@ -35,13 +37,13 @@ teardown() { @test "Check if warnings are displayed for missing variables in dist file" { run bash ../generate-files.sh [ "$status" -eq 0 ] - [[ "$output" == *"Warning: The variable AI_MEMORY_PERSONAL_NAME is defined in gpt-values-override-conf.default.sh but not in gpt-values-override-conf.dist.sh."* ]] - [[ "$output" == *"Warning: The variable AI_MEMORY_EXTRA_PERSONAL_INFO is defined in gpt-values-override-conf.default.sh but not in gpt-values-override-conf.dist.sh."* ]] + [[ "$output" == *"Warning: The variable AI_MEMORY_PERSONAL_NAME is defined in conf/gpt-values-override-conf.default.sh but not in gpt-values-override-conf.dist.sh."* ]] + [[ "$output" == *"Warning: The variable AI_MEMORY_EXTRA_PERSONAL_INFO is defined in conf/gpt-values-override-conf.default.sh but not in gpt-values-override-conf.dist.sh."* ]] } @test "Check if fallback values are used when variables are not defined in override file" { - echo 'export AI_MEMORY_ELASTIC_SEARCH_WRITE_INDEX=""' >gpt-values-override-conf.default.sh + echo 'export AI_MEMORY_ELASTIC_SEARCH_WRITE_INDEX=""' >conf/gpt-values-override-conf.default.sh run bash ../generate-files.sh [ "$status" -eq 0 ] - [[ "$output" == *"Warning: The variable AI_MEMORY_ELASTIC_SEARCH_WRITE_INDEX is not defined in gpt-values-override-conf.default.sh. The fallback value will be used."* ]] + [[ "$output" == *"Warning: The variable AI_MEMORY_ELASTIC_SEARCH_WRITE_INDEX is not defined in conf/gpt-values-override-conf.default.sh. The fallback value will be used."* ]] }