Skip to content

Commit

Permalink
workaround testing for GitHub Action
Browse files Browse the repository at this point in the history
  • Loading branch information
ringabout committed Jun 24, 2024
1 parent f9a5433 commit 5f551ad
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci_gcc14.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ jobs:
shell: bash
run: echo "${{ github.workspace }}/bin" >> "${GITHUB_PATH}"

- name: 'NIM_TESTAMENT_DISABLE_SSL'
shell: bash
run: echo "NIM_TESTAMENT_DISABLE_SSL=1" >> $GITHUB_ENV

- name: 'System information'
shell: bash
run: . ci/funs.sh && nimCiSystemInfo
Expand Down
5 changes: 5 additions & 0 deletions testament/lib/stdtest/testutils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ template enableRemoteNetworking*: bool =
## a `nim` invocation (possibly via additional intermediate processes).
getEnv("NIM_TESTAMENT_REMOTE_NETWORKING") == "1"

template disableSSLTesting*: bool =
## TODO: workaround for GitHub Action gcc 14 matrix; remove this
## matrix and the flag after Azure agent supports ubuntu 24.04
getEnv("NIM_TESTAMENT_DISABLE_SSL") == "1"

template whenRuntimeJs*(bodyIf, bodyElse) =
##[
Behaves as `when defined(js) and not nimvm` (which isn't legal yet).
Expand Down
7 changes: 6 additions & 1 deletion tests/misc/trunner_special.nim
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ xxx test all tests/untestable/* here, possibly with adjustments to make running
import std/[strformat,os,unittest,compilesettings]
import stdtest/specialpaths


from stdtest/testutils import disableSSLTesting


const
nim = getCurrentCompilerExe()
mode = querySetting(backend)
Expand All @@ -29,4 +33,5 @@ proc main =
block: # SSL certificate check integration tests
runCmd fmt"{nim} r {options} -d:ssl --threads:on --mm:refc {testsDir}/untestable/thttpclient_ssl_remotenetwork.nim"

main()
when not disableSSLTesting():
main()
5 changes: 4 additions & 1 deletion tests/stdlib/thttpclient_ssl.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ discard """
## Test with:
## ./bin/nim c -d:ssl -p:. --threads:on -r tests/stdlib/thttpclient_ssl.nim

when not defined(windows):

from stdtest/testutils import disableSSLTesting

when not defined(windows) and not disableSSLTesting():
# Disabled on Windows due to old OpenSSL version
import std/[formatfloat, syncio]
import
Expand Down

0 comments on commit 5f551ad

Please sign in to comment.