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

[ADP-3224] Set LOCAL_CLUSTER_CONFIGS to fix unit tests on windows #4284

Merged
merged 5 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 17 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ on:
branch:
description: 'Run tests against branch'
default: 'master'
status:
description: 'Run tests against status (use `any` as wildcard)'
default: 'passed'
required: true
type: choice
options:
- passed
- any
build:
description: 'Run tests against build number'
required: false
default: 'latest'

jobs:
setup:
Expand All @@ -29,7 +41,9 @@ jobs:
working-directory: ${{ env.WORK_DIR }}
run: |
bundle install
rake get_latest_windows_tests[%BRANCH%,cardano-wallet-tests-win64]
echo "STATUS = ${{ github.event.inputs.status }}"
echo "BUILD = ${{ github.event.inputs.build }}"
rake get_latest_windows_tests[%BRANCH%,cardano-wallet-tests-win64,${{ github.event.inputs.status }},${{ github.event.inputs.build }}]

- name: Report version
working-directory: ${{ env.WORK_DIR }}
Expand All @@ -50,6 +64,8 @@ jobs:
with:
name: cardano-wallet-tests-win64
- run: '.\\cardano-wallet-test-unit.exe --color --jobs 1 --skip /Cardano.Wallet.DB.Sqlite/ +RTS -M2G -N2'
env:
LOCAL_CLUSTER_CONFIGS: test\data\cluster-configs

text-class-test-unit:
name: 'test-class:unit'
Expand Down
5 changes: 3 additions & 2 deletions lib/local-cluster/lib/Cardano/Wallet/Launch/Cluster.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1031,10 +1031,11 @@ clusterEraFromEnv =
_ -> die $ var ++ ": unknown era"
withDefault = fromMaybe maxBound

localClusterConfigsFromEnv :: IO (Tagged "cluster-configs" String)
localClusterConfigsFromEnv :: IO (Tagged "cluster-configs" FilePath)
localClusterConfigsFromEnv = lookupEnvNonEmpty "LOCAL_CLUSTER_CONFIGS"
<&> Tagged @"cluster-configs"
. fromMaybe "../local-cluster/test/data/cluster-configs"
. fromMaybe
(".." </> "local-cluster" </> "test" </> "data" </> "cluster-configs")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is now irrelevant to fixing the GH windows unit tests, but it shouldn't hurt. It might be good for people running cabal test on windows after checking the repo out.


clusterEraToString :: ClusterEra -> String
clusterEraToString = \case
Expand Down
1 change: 1 addition & 0 deletions nix/windows-testing-bundle.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
let
testData = {
wallet = ../lib/wallet/test/data;
local-cluster = ../lib/local-cluster/test/data;
};

name = "cardano-wallet-${cardano-wallet.version}-tests-win64";
Expand Down
10 changes: 7 additions & 3 deletions test/e2e/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,16 @@ task :display_versions, [:bin_dir] do |_task, args|
end
end

task :get_latest_windows_tests, [:branch, :destination] do |_task, args|
branch = args[:branch] || 'master'
task :get_latest_windows_tests, [:branch, :destination, :status, :build] do |_task, args|
destination = args[:destination] || 'cardano-wallet-tests-win64'
job_key = 'build-windows-tests'
bk = Buildkite.new
last_build = bk.last_build_number(branch: branch, state: 'passed')
status = args[:status]
branch = args[:branch] || 'master'
build = args[:build] || 'latest'
options = status == 'any' ? { branch: branch } : { branch: branch, state: status }
last_build =
build == 'latest' ? bk.last_build_number(options) : build
log "Latest passing buildkite '#{bk.pipeline}' pipeline for branch '#{branch}' is #{last_build}"
jobs = bk.jobs(last_build)
mk_dir(destination)
Expand Down
1 change: 1 addition & 0 deletions test/e2e/helpers/buildkite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def get_artifact_url(build_no, job_id)
end

def get_artifacts(build_no, job_id, target_dir, target_file = 'binary-dist', unzip: true)
log "Downloading artifacts for build #{build_no} job #{job_id} to #{target_dir}"
url = get_artifact_url(build_no, job_id)
wget(url, target_file)
unzip_artifact(target_file, target_dir) if unzip
Expand Down
Loading