Skip to content

Commit

Permalink
Test Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib committed Oct 24, 2023
1 parent 5a52375 commit aeb7158
Show file tree
Hide file tree
Showing 5 changed files with 370 additions and 260 deletions.
39 changes: 36 additions & 3 deletions accept.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,45 @@
#!/bin/zsh

# Use a variable to keep track of whether any directories were found
found_mismatch=false

# Use a variable to check if the header has been printed
header_printed=false

# Find all __MISMATCH__ folders
find . -type d -name "__MISMATCH__" | while read mismatch_dir; do
# Mark that we found a mismatch directory
found_mismatch=true

# Get the parent __snapshots__ directory
snapshot_dir="$(dirname "$mismatch_dir")"

# Copy all files from __MISMATCH__ to __snapshots__
cp "$mismatch_dir"/* "$snapshot_dir/"
# If there are files in the directory, copy them
if [ "$(ls -A "$mismatch_dir")" ]; then
for file in "$mismatch_dir"/*; do
if [ -f "$file" ]; then
cp "$file" "$snapshot_dir/"

# Print the header only once
if [ "$header_printed" = false ]; then
echo "Found Updated Snapshots:"
header_printed=true
fi

# Extract relevant path details and print
relative_path="${snapshot_dir#./src/HotChocolate/}" # strip the common prefix
echo "- $relative_path/$(basename "$file")"
fi
done
fi

# Remove the __MISMATCH__ directory
rm -r "$mismatch_dir"
done

echo "Done!"
# Check if any directories were found
if [ "$found_mismatch" = false ]; then
echo "All snapshots are up to date!"
else
echo "\nDone!"
fi
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using System;
using System.Collections.Generic;
#if NET7_0_OR_GREATER
using System.Diagnostics.CodeAnalysis;
#endif
using System.Threading;
using System.Threading.Tasks;
using static HotChocolate.Execution.Properties.Resources;
Expand Down Expand Up @@ -30,7 +33,11 @@ public static Task<IExecutionResult> ExecuteAsync(

public static Task<IExecutionResult> ExecuteAsync(
this IRequestExecutor executor,
#if NET7_0_OR_GREATER
[StringSyntax("graphql")] string query)
#else
string query)
#endif
{
if (executor is null)
{
Expand All @@ -51,7 +58,11 @@ public static Task<IExecutionResult> ExecuteAsync(

public static Task<IExecutionResult> ExecuteAsync(
this IRequestExecutor executor,
#if NET7_0_OR_GREATER
[StringSyntax("graphql")] string query,
#else
string query,
#endif
CancellationToken cancellationToken)
{
if (executor is null)
Expand All @@ -73,7 +84,11 @@ public static Task<IExecutionResult> ExecuteAsync(

public static Task<IExecutionResult> ExecuteAsync(
this IRequestExecutor executor,
#if NET7_0_OR_GREATER
[StringSyntax("graphql")] string query,
#else
string query,
#endif
Dictionary<string, object?> variableValues)
{
if (executor is null)
Expand Down Expand Up @@ -103,7 +118,11 @@ public static Task<IExecutionResult> ExecuteAsync(

public static Task<IExecutionResult> ExecuteAsync(
this IRequestExecutor executor,
#if NET7_0_OR_GREATER
[StringSyntax("graphql")] string query,
#else
string query,
#endif
IReadOnlyDictionary<string, object?> variableValues,
CancellationToken cancellationToken)
{
Expand Down Expand Up @@ -155,7 +174,11 @@ public static IExecutionResult Execute(

public static IExecutionResult Execute(
this IRequestExecutor executor,
#if NET7_0_OR_GREATER
[StringSyntax("graphql")] string query)
#else
string query)
#endif
{
if (executor is null)
{
Expand All @@ -177,7 +200,11 @@ public static IExecutionResult Execute(

public static IExecutionResult Execute(
this IRequestExecutor executor,
#if NET7_0_OR_GREATER
[StringSyntax("graphql")] string query,
#else
string query,
#endif
IReadOnlyDictionary<string, object?> variableValues)
{
if (executor is null)
Expand Down
Loading

0 comments on commit aeb7158

Please sign in to comment.