[PR #412] [MERGED] envs in if: - take 2 #1438

Closed
opened 2026-03-01 21:51:11 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/412
Author: @torbjornvatn
Created: 11/9/2020
Status: Merged
Merged: 11/12/2020
Merged by: @cplee

Base: masterHead: if_env_take2


📝 Commits (8)

  • fbcf06e Test more if env variants
  • 3988f0b The correct negation syntax is !=
  • 001a926 Merge upstream/master into if_env_take2
  • 3c4e5fa Merge upstream/master into if_env_take2
  • c1ced5e Make the Interpolate function support negated booleans from envs
  • a1e6239 Move assert := a.New(t) into t.Run
  • b512f9e Merge upstream/master into if_env_take2
  • 76f50af Remove a stray logrus import

📊 Changes

5 files changed (+107 additions, -33 deletions)

View changed files

📝 go.mod (+1 -1)
📝 pkg/runner/expression.go (+18 -12)
📝 pkg/runner/expression_test.go (+16 -11)
📝 pkg/runner/run_context.go (+50 -4)
📝 pkg/runner/run_context_test.go (+22 -5)

📄 Description

I discovered that table based tests must have define assert := a.New(t) inside the t.Run internal func.
If not, the assert wasn't actually asserting correctly 🙈

This lead to the discovery of some test cases that wasn't actually working.
I had to make several changes to the EvalBool function support all the permutations of negations, envs and interpolations

Fixes #387


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/nektos/act/pull/412 **Author:** [@torbjornvatn](https://github.com/torbjornvatn) **Created:** 11/9/2020 **Status:** ✅ Merged **Merged:** 11/12/2020 **Merged by:** [@cplee](https://github.com/cplee) **Base:** `master` ← **Head:** `if_env_take2` --- ### 📝 Commits (8) - [`fbcf06e`](https://github.com/nektos/act/commit/fbcf06ededd3db6093e051f17dd0579b40266689) Test more if env variants - [`3988f0b`](https://github.com/nektos/act/commit/3988f0b050159d088999e9d4834da4a1846ecf6d) The correct negation syntax is != - [`001a926`](https://github.com/nektos/act/commit/001a92691381c2eb267311662489fd427172f852) Merge upstream/master into if_env_take2 - [`3c4e5fa`](https://github.com/nektos/act/commit/3c4e5faa46402f8b809a17ae32071a63d2a4519f) Merge upstream/master into if_env_take2 - [`c1ced5e`](https://github.com/nektos/act/commit/c1ced5e0a084e5345cfa1cf34ee548a5efe6f8ba) Make the Interpolate function support negated booleans from envs - [`a1e6239`](https://github.com/nektos/act/commit/a1e623916541d7fa8a0a309c006ea8784ef7427f) Move assert := a.New(t) into t.Run - [`b512f9e`](https://github.com/nektos/act/commit/b512f9e16ea7793f733fdad42a0bf76368a927e4) Merge upstream/master into if_env_take2 - [`76f50af`](https://github.com/nektos/act/commit/76f50afc555b7683d562ecd16503976d715d8ee5) Remove a stray logrus import ### 📊 Changes **5 files changed** (+107 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `go.mod` (+1 -1) 📝 `pkg/runner/expression.go` (+18 -12) 📝 `pkg/runner/expression_test.go` (+16 -11) 📝 `pkg/runner/run_context.go` (+50 -4) 📝 `pkg/runner/run_context_test.go` (+22 -5) </details> ### 📄 Description I discovered that table based tests must have define `assert := a.New(t)` inside the `t.Run` internal func. If not, the assert wasn't actually asserting correctly 🙈 This lead to the discovery of some test cases that wasn't actually working. I had to make several changes to the EvalBool function support all the permutations of negations, envs and interpolations Fixes #387 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 21:51:11 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#1438
No description provided.