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

Lint checks in CI runs #183

Merged
merged 58 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
af34b9c
delete mock
shacharPash Aug 10, 2023
ff101b5
coverage
shacharPash Aug 10, 2023
c2b5fe6
fix test
shacharPash Aug 10, 2023
f8f2aec
indent
shacharPash Aug 13, 2023
dbe0b74
Merge branch 'master' into DeleteMoq
shacharPash Aug 14, 2023
27a69c0
change to var - check
shacharPash Aug 14, 2023
dc0d3c0
cluster test
shacharPash Aug 14, 2023
eeb2edf
add opthin to connect cluster with dotnet test
shacharPash Aug 15, 2023
0d100d7
use key in topk tests
shacharPash Aug 16, 2023
53c0163
Merge branch 'master' into ClusterSupport
shacharPash Aug 16, 2023
02d1837
get env vars inside RedisFixture
shacharPash Aug 22, 2023
5ace5b9
Merge branch 'master' into ClusterSupport
shacharPash Aug 22, 2023
65a49b6
skip if redis
shacharPash Aug 22, 2023
c7b6cd9
add skip where needed
shacharPash Aug 24, 2023
6e82630
Execute broadcast
shacharPash Aug 24, 2023
b5cdf87
delete cluster tests
shacharPash Aug 24, 2023
376ccdf
RedisFixture fix
shacharPash Aug 24, 2023
495dce1
add to contributing
shacharPash Aug 24, 2023
47e2d7f
run cluster on CI
shacharPash Aug 28, 2023
d87cec0
wip
shacharPash Aug 28, 2023
b933427
fix /
shacharPash Aug 28, 2023
ccb7625
-d
shacharPash Aug 28, 2023
908699d
delete restore
shacharPash Aug 28, 2023
b5318bf
return restore
shacharPash Aug 28, 2023
31bef69
add -RC3
shacharPash Aug 30, 2023
e544fe0
add RC3 to docker-compose
shacharPash Aug 30, 2023
5f67f42
try define both .net 6 and 7
shacharPash Aug 30, 2023
9724f9b
Skip if cluster where needed
shacharPash Aug 31, 2023
d998125
add names
shacharPash Aug 31, 2023
2842a29
skip configOnTimeout if cluster
shacharPash Aug 31, 2023
d07f225
try to fix win tests
shacharPash Aug 31, 2023
661cb1c
tests names +fix win version
shacharPash Aug 31, 2023
b4a5ff2
fix versions
shacharPash Aug 31, 2023
6c98a16
versions
shacharPash Aug 31, 2023
b1feed4
win verer
shacharPash Aug 31, 2023
3b79773
wording
shacharPash Aug 31, 2023
ad44131
Merge branch 'master' into ClusterSupport
chayim Sep 3, 2023
341161a
Merge branch 'master' into ClusterSupport
chayim Sep 10, 2023
36d32dd
Merge branch 'master' into ClusterSupport
shacharPash Sep 10, 2023
bff96ca
dotnet format
shacharPash Sep 10, 2023
3ad7a8d
Merge branch 'master' into Cleaning2
shacharPash Sep 19, 2023
f0f4f3d
format
shacharPash Sep 20, 2023
87a8549
format
shacharPash Sep 20, 2023
9309d40
add linter.yaml
shacharPash Sep 20, 2023
abdf4b4
update linter
shacharPash Sep 20, 2023
5b35f84
lint on push
shacharPash Sep 20, 2023
204e2be
change linter
shacharPash Sep 21, 2023
50ce6cc
create lint problems to see what happen
shacharPash Sep 21, 2023
fe9f0dd
linter force and run
chayim Sep 27, 2023
3ebfead
try to fix yml
shacharPash Sep 27, 2023
1e998b9
dotnet format
shacharPash Sep 27, 2023
70b5624
tell the contributer to run dotnet format in the CONTRIBUTING.md
shacharPash Sep 27, 2023
ec38563
Merge branch 'master' into Cleaning2
shacharPash Sep 27, 2023
7c522be
Merge branch 'master' into Cleaning2
shacharPash Sep 27, 2023
9990e59
disable multi runs
chayim Sep 27, 2023
f4342d7
Merge branch 'master' into Cleaning2
shacharPash Sep 27, 2023
41ce42b
fix warnings
shacharPash Sep 27, 2023
60510b9
chayom changes
shacharPash Sep 27, 2023
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
32 changes: 32 additions & 0 deletions .github/workflows/linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Format check on pull request

on: pull_request

concurrency:
group: ${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
dotnet-format:
runs-on: windows-latest
steps:
- name: Install dotnet-format
run: dotnet tool install -g dotnet-format

- name: Checkout repo
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: lint
run: |
dotnet format

- name: Check for modified files
run: |
if (git status | Select-String -Pattern 'modified') {
Write-Host "Modified files found. Please run dotnet format and commit the changes."
exit 1
} else {
Write-Host "No modified files found."
}
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Here's how to get started with your code contribution:
3. Write your tests

4. Use the `docker run -p 6379:6379 -it redis/redis-stack-server:edge` as your local environment for running the functional tests. You can also use Development Container as described below.
5. Make sure your tests pass using `dotnet test`
6. Push your changes to GitHub
5. Run dotnet format to make sure your code is formatted
6. Make sure your tests pass using `dotnet test`
7. Open a pull request

## Development Container
Expand Down
4 changes: 2 additions & 2 deletions tests/NRedisStack.Tests/Search/SearchTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2438,13 +2438,13 @@ public async Task TestAddAndGetSuggestionAsync()
Assert.True(await ft.SugAddAsync(key, noMatch, 1d) > 0);

// test that with a partial part of that string will have the entire word returned
Assert.Single((await ft.SugGetAsync(key, suggestion.Substring(0, 3), true, max: 5)));
Assert.Single(await ft.SugGetAsync(key, suggestion.Substring(0, 3), true, max: 5));

// turn off fuzzy start at second word no hit
Assert.Empty((await ft.SugGetAsync(key, noMatch.Substring(1, 6), false, max: 5)));

// my attempt to trigger the fuzzy by 1 character
Assert.Single((await ft.SugGetAsync(key, noMatch.Substring(1, 6), true, max: 5)));
Assert.Single(await ft.SugGetAsync(key, noMatch.Substring(1, 6), true, max: 5));
}

[Fact]
Expand Down
3 changes: 2 additions & 1 deletion tests/NRedisStack.Tests/SkipIfRedisAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public override string? Skip
break;

case Is.Standalone:

if (!redisFixture.isOSSCluster)
{
skipReason = skipReason + " Redis server is not OSS cluster.";
Expand All @@ -74,7 +75,7 @@ public override string? Skip
break;
}
}
// Version check (if Is.Standalone/Is.Cluster is set then )
// Version check (if Is.Standalone/Is.OSSCluster is set then )

var serverVersion = redisFixture.Redis.GetServer(redisFixture.Redis.GetEndPoints()[0]).Version;
var targetVersion = new Version(_targetVersion);
Expand Down
1 change: 0 additions & 1 deletion tests/NRedisStack.Tests/TopK/TopKTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public void CreateTopKFilter()

var res = topk.Add(key, "bb", "cc");
Assert.True(res![0].IsNull && res[1].IsNull);

Assert.Equal(topk.Query(key, "bb", "gg", "cc"), new bool[] { true, false, true });
Assert.False(topk.Query(key, "notExists"));

Expand Down
4 changes: 2 additions & 2 deletions tests/NRedisStack.Tests/TransactionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void TestJsonTransaction()

[SkipIfRedis(Comparison.GreaterThanOrEqual, "7.1.242")]
[Obsolete]
public async Task TestModulsTransaction()
public void TestModulsTransaction()
{
IDatabase db = redisFixture.Redis.GetDatabase();
db.Execute("FLUSHALL");
Expand Down Expand Up @@ -82,7 +82,7 @@ public async Task TestModulsTransaction()

[SkipIfRedis(Is.OSSCluster)]
[Obsolete]
public async Task TestModulsTransactionWithoutGraph()
public void TestModulsTransactionWithoutGraph()
{
IDatabase db = redisFixture.Redis.GetDatabase();
db.Execute("FLUSHALL");
Expand Down
Loading