-
Notifications
You must be signed in to change notification settings - Fork 59
Support running tests with an older initial package version set #1014
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
Changes from 34 commits
33320a1
cc5f91a
33b8806
978b9eb
b687d30
ec7ca88
df5b9ec
fbda1fb
05e4b5d
20ba7e1
6fe06f9
ae2adc4
a6d23aa
706a970
25b195f
6b3c397
e17e35d
faeb54c
aa21251
c14edc3
09b6026
fc96944
c22e98c
06d3098
75ca5c7
e96e901
70475b5
77089ed
98e66f8
e9eeaaf
331aad0
4a1d614
4dd30cd
0a13a13
5136654
ef3a7b8
83fd8b4
cd495c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,6 +83,9 @@ inputs: | |
| failure_notifications_slack_channel: | ||
| description: "Slack channel for failure notifications (for failure notifications)" | ||
| required: true | ||
| daml_base_version: | ||
| type: string | ||
| required: true | ||
|
|
||
| runs: | ||
| using: "composite" | ||
|
|
@@ -133,6 +136,28 @@ runs: | |
| with: | ||
| cache_version: 4 | ||
|
|
||
| - name: Set Daml package versions | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not as precise as we probably should be: It relies on the version shipped to mainnet, not the versions vetted on mainnet. The latter is a bit of a mess since we also need a splitwell version which is not in the packageConfig, definitely solvable but annoying. So for now I'd suggest we keep it as is and open a separate issue for making the version we test against it more precise. This still gives us a two week compatibility window at a minimum which is much better than what we had so far.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| uses: ./.github/actions/nix/run_bash_command_in_nix | ||
| with: | ||
| cmd: | | ||
| if [[ "${{ inputs.daml_base_version }}" != "" ]]; then | ||
| echo "Running with initial package config from ${{ inputs.daml_base_version }}" | ||
| ./scripts/initial-package-config.py ${{ inputs.daml_base_version }} initial_package_config scala_test_tags | ||
| echo "Initial package config" $(cat initial_package_config) | ||
| echo "ScalaTest tags: $(cat scala_test_tags)" | ||
| else | ||
| echo "daml_base_version is not set, using the latest versions" | ||
| fi | ||
|
|
||
| - name: Export Daml package versions output | ||
| id: daml_package_versions | ||
| shell: bash | ||
| run: | | ||
| # We can't export from within run_bash_command_in_nix so we do it here. | ||
| if [[ "${{ inputs.daml_base_version }}" != "" ]]; then | ||
| echo "initial_package_versions='$(cat initial_package_config)'" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Prepare list of tests to run for sbt | ||
| uses: ./.github/actions/nix/run_bash_command_in_nix | ||
| with: | ||
|
|
@@ -147,7 +172,16 @@ runs: | |
| - name: Set RUN_SPLITTED_TESTS_CMD | ||
| id: list_tests | ||
| shell: bash | ||
| run: echo "RUN_SPLITTED_TESTS_CMD=\"testOnly $(cat /tmp/tests)\"" >> "$GITHUB_OUTPUT" | ||
| run: | | ||
| tags="" | ||
| if [ -f scala_test_tags ] | ||
| then | ||
| tags="$(cat scala_test_tags)" | ||
| echo "Using scalatest tags: $tags" | ||
| else | ||
| echo "No scala test tags configured" | ||
| fi | ||
| echo "RUN_SPLITTED_TESTS_CMD=\"testOnly $(cat /tmp/tests) -- $tags\"" >> "$GITHUB_OUTPUT" | ||
|
|
||
| # webpack uses inotify to watch for changes, and we need to increase the limit | ||
| - name: increase inotify limit | ||
|
|
@@ -191,7 +225,7 @@ runs: | |
| - name: Run tests | ||
| uses: ./.github/actions/sbt/execute_sbt_command | ||
| with: | ||
| extra_env_vars: POSTGRES_DB=postgres POSTGRES_HOST=localhost POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres | ||
| extra_env_vars: "POSTGRES_DB=postgres POSTGRES_HOST=localhost POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres INITIAL_PACKAGE_VERSIONS=${{ steps.daml_package_versions.outputs.initial_package_versions }}" | ||
| artifactory_user: ${{ inputs.artifactory_user }} | ||
| artifactory_password: ${{ inputs.artifactory_password }} | ||
| cmd: ${{ steps.list_tests.outputs.RUN_SPLITTED_TESTS_CMD }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: Integration tests against mainnet Daml version | ||
| on: | ||
| schedule: | ||
| - cron: '0 5 * * *' | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| id-token: write # Required for GCP Workload Identity for failure notifications | ||
| contents: read | ||
| pull-requests: read # Required for the static tests | ||
| issues: read # Required for the static tests | ||
| actions: write # To cancel itself if not opted in | ||
|
|
||
| jobs: | ||
| get_mainnet_version: | ||
| runs-on: self-hosted-docker-tiny | ||
| outputs: | ||
| version: ${{ steps.get_mainnet_version.outputs.version }} | ||
| steps: | ||
| - name: Get MainNet version | ||
| id: get_mainnet_version | ||
| run: | | ||
| set -eou pipefail | ||
| version="$(curl -sSL --fail-with-body https://docs.global.canton.network.sync.global/info | jq -r '.sv.version')" | ||
| echo "MainNet version is $version" | ||
| echo "version=$version" >> "$GITHUB_OUTPUT" | ||
|
|
||
| build: | ||
| needs: get_mainnet_version | ||
| uses: ./.github/workflows/build.yml | ||
| with: | ||
| daml_base_version: ${{ needs.get_mainnet_version.outputs.version }} | ||
| secrets: inherit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: can we add a description as to what is this used? Makes easier compared to having to read the action
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added