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

Ignore test_version on version bump PR #1655

Open
visr opened this issue Jul 23, 2024 · 4 comments · May be fixed by #1938
Open

Ignore test_version on version bump PR #1655

visr opened this issue Jul 23, 2024 · 4 comments · May be fixed by #1938
Assignees
Labels
CI/CD Continuous Integration/Continuous deployment python Relates to one of the Ribasim python packages test Relates to unit testing

Comments

@visr
Copy link
Member

visr commented Jul 23, 2024

When following the release process and creating #1654, it is impossible to bump the version numbers before we tag the new version and have the test_version in test_cli.py pass.

build.tests.test_cli.test_version
16:54:35       AssertionError: assert '2024.10.0' in 'ribasim 2024.9.0-57-g2e9e1db-dirty\n'
       +  where '2024.10.0' = ribasim.__version__
       +  and   'ribasim 2024.9.0-57-g2e9e1db-dirty\n' = CompletedProcess(args=[PosixPath('/opt/teamcityagent/work/ecd2b8f9b25b1609/ribasim/build/ribasim/ribasim'), '--version'], returncode=0, stdout='ribasim 2024.9.0-57-g2e9e1db-dirty\n', stderr='').stdout
16:54:35       def test_version():
              result = subprocess.run(
                  [executable, "--version"], check=True, capture_output=True, text=True
              )
          
      >       assert ribasim.__version__ in result.stdout
      E       AssertionError: assert '2024.10.0' in 'ribasim 2024.9.0-57-g2e9e1db-dirty\n'
      E        +  where '2024.10.0' = ribasim.__version__
      E        +  and   'ribasim 2024.9.0-57-g2e9e1db-dirty\n' = CompletedProcess(args=[PosixPath('/opt/teamcityagent/work/ecd2b8f9b25b1609/ribasim/build/ribasim/ribasim'), '--version'], returncode=0, stdout='ribasim 2024.9.0-57-g2e9e1db-dirty\n', stderr='').stdout
      
      build/tests/test_cli.py:33: AssertionError

We can ignore this error since the result of ribasim --version is picked up from the git tag. But it would be nice not to have failing tests on the PRs where it is essential that everything is ok.

This feature was added in #1479.

@visr visr added test Relates to unit testing CI/CD Continuous Integration/Continuous deployment python Relates to one of the Ribasim python packages labels Jul 23, 2024
@github-project-automation github-project-automation bot moved this to To do in Ribasim Jul 23, 2024
@SnippenE
Copy link

SnippenE commented Sep 3, 2024

Check if we can use environment variables to skip this test on a release branch.

@visr
Copy link
Member Author

visr commented Oct 8, 2024

Even though the binary builds pass, the test binary workflows are now configured such that they have to pass before the "Make GitHub Release" can start. I tried to adjust this in the TeamCity UI, which gave these two patches: 2750dca and 328efec

These patches didn't seem to help so they should be removed again.

@visr
Copy link
Member Author

visr commented Oct 8, 2024

The version that the rust wrapper gets seems to be wrong when building on tags. This is built on the v2024.11.0 tag:

❯ ribasim --version
ribasim 2024.10.0-128-ge09eeb5

C:\bin\ribasim
❯ ribasim d:\repo\ribasim\Ribasim\generated_testmodels\bucket\ribasim.toml
┌ Warning: The Ribasim version in the TOML config file does not match the used Ribasim CLI version.
│   config.ribasim_version = "something-else"
│   cli.ribasim_version = "2024.11.0"

So the cli.ribasim_version is ok but --version isn't. You can see e09eeb5 in there. If you click it you can see that's the tag.

@visr visr moved this from To do to Sprint backlog in Ribasim Nov 14, 2024
@evetion
Copy link
Member

evetion commented Nov 14, 2024

Man what a rabbithole. In your bump PR, you also update the Cargo.toml. So maybe make sure that in add_metadata, we don't allow to downgrade the version of the Cargo.toml again (which is what happens above I think).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/CD Continuous Integration/Continuous deployment python Relates to one of the Ribasim python packages test Relates to unit testing
Projects
Status: Sprint backlog
Development

Successfully merging a pull request may close this issue.

3 participants