Skip to content

Commit

Permalink
it cant't be so hard, or can it?
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianoc committed Oct 22, 2024
1 parent cfe6578 commit fcdddfd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cecilifier-ci-alltests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Run Tests
run-name: Verifying ${{ github.ref }} 🚀
run-name: Verifying ${{ github.ref }} (push to test-env branch) 🚀
on:
push:
branches:
Expand All @@ -8,4 +8,4 @@ jobs:
RunTests:
uses: ./.github/workflows/run_tests_base.yml
with:
run-outputbased-tests: true
run_outputbased_tests: true
3 changes: 2 additions & 1 deletion .github/workflows/cecilifier-ci-onpush.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Run Tests
run-name: Verifying ${{ github.ref }} 🚀
run-name: Verifying ${{ github.ref }} (push, any branch but test-env) 🚀
on: [push]
jobs:
RunTests:
if: github.ref != 'refs/heads/test-env'
uses: ./.github/workflows/run_tests_base.yml
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ run-name: Verifying ${{ github.ref }} 🚀
on:
workflow_call:
inputs:
run-outputbased-tests:
run_outputbased_tests:
required: false
type: boolean
jobs:
Expand Down
9 changes: 4 additions & 5 deletions Cecilifier.Core.Tests/Tests/Unit/ForEachStatementTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ class CecilifierTestContext : IDisposable
public void Dispose()
{
var testMethod = TestContext.CurrentContext.Test.Method?.MethodInfo;
var shouldRun = (Environment.GetEnvironmentVariable("CECILIFIER_TESTS_VERIFY_OUTPUT")
?? SingleOrDefault(testMethod)?.Constructor.Name
?? SingleOrDefault(testMethod?.DeclaringType)?.Constructor.Name
) != null;
var shouldRun = Environment.GetEnvironmentVariable("CECILIFIER_TESTS_VERIFY_OUTPUT") == "true"
|| SingleOrDefault(testMethod)?.Constructor.Name != null
|| SingleOrDefault(testMethod?.DeclaringType)?.Constructor.Name != null;

if (shouldRun)
{
Expand All @@ -41,7 +40,7 @@ CustomAttributeData SingleOrDefault(MemberInfo? member)
public void Foo()
{
using var x = new CecilifierTestContext();
Assert.That(1, Is.EqualTo(2));
Assert.That(1, Is.EqualTo(1));
// // Arrange
// using var testContext = ContextFor(
// "foreach(var i in M()) { Console.Write(i); } int[] M() => {1, 2, 3};",
Expand Down

0 comments on commit fcdddfd

Please sign in to comment.