Visitar URL original
Full unit test suite isn't running on CI · Issue #1439 · microsoft/terraform-provider-azuredevops · GitHub
Skip to content

Full unit test suite isn't running on CI #1439

Open

Description

@andrwca

If you take a look at the unit tests running in CI, it appears that they aren't all run.

See this run as an example:

https://github.com/microsoft/terraform-provider-azuredevops/actions/runs/17143816385/job/48652393554?pr=1417

Firstly, is this intentional?

If it's not, perhaps we could update the make test command to provide the all tag that seems to be missing?

The other issue is that when it run all the tests locally, a few of them fail. I haven't dived into this yet to see if it's a legitimate failure or an issue with my environment.

Anyone else seeing this?

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and Azure DevOps Provider) Version

N/A

Affected Resource(s)

Unit tests are not being run - an example is: data_projects_test.go

Terraform Configuration Files

N/A

Debug Output

See CI test run here:

https://github.com/microsoft/terraform-provider-azuredevops/actions/runs/17143816385/job/48652393554?pr=1417

Panic Output

N/A

Expected Behavior

All tests apart from acceptance should run.

Actual Behavior

A subset of all tests are run.

Steps to Reproduce

  1. Clone and create a development environment
  2. Run make test

Or run CI on the latest main.

Important Factoids

N/A

References

N/A

Activity

  1. magodo commented on Sep 30, 2025

    @magodo
    Member

    Andrew Cardy (@andrwca) Thanks for raising this question! The test cases are split to unit test and acceptance test (e2e test). In the CI, we only cover the unit tests. The acceptance tests are only meant to run separately, on demand. Unfortunately, as you may have noticed, the quality of the acctests are not well maintained (actually for a while), therefore you won't expect all the tests are bug free.. The bottom line is that, once you changed a resource, you'll be responsible to pass the acctests of the impacted resource(s).

  2. andrwca commented on Sep 30, 2025

    @andrwca
    ContributorAuthor

    magodo (@magodo) thanks for the extra detail.

    I realise my original report wasn't too clear, sorry!.

    Essentially what I'm seeing is that make test is running a subset of the unit tests. This is aside from acceptance tests.

    To test this, I changed an assert in one of the project unit tests* to fail, ran make test, but all the tests still succeeded. Upon reviewing the output, the test didn't run. I manually ran the tests again using the command go test -v -tags="all" ./... and I could see that the project test was run.

    Can you reproduce this?

    * /workspaces/terraform-provider-azuredevops/azuredevops/internal/service/core/data_projects_test.go

  3. magodo commented on Sep 30, 2025

    @magodo
    Member

    Hi Andrew Cardy (@andrwca), thanks for the additional information! I overlooked these test cases when I remove those build tags in #1436. It takes time to fix all these broken UTs, and then it should be good to remove the build tags from these files as well.

  4. andrwca commented on Oct 2, 2025

    @andrwca
    ContributorAuthor

    magodo (@magodo), ah - I didn't see that PR - that explains explain a lot. :)

  5. saryn17 commented on Sep 16, 2026

    @saryn17

    I'd like to take this one, unless Andrew Cardy (@andrwca) is already on it.

    I have the two phases from your comment working locally. For the record on the original
    question: make test compiles 35 of the 536 unit tests in the repo. After repairing the
    broken ones and dropping the tags, 534 pass (two turned out to be exact duplicates).

    Two things I'd rather flag here than have you find in the diff:

    • azuredevops_build_definition has been sending "triggers": null instead of
      "triggers": [] since Move the PR CI from ADO to github action #1396, and the round-trip UT that asserts the old payload is one
      of the tests that never runs. I put the old behaviour back, but I can't verify against a
      real org, so say the word if you'd rather keep null and change the fixture instead.
    • Once these tests actually run, a couple of hard-coded sleeps dominate the suite — about
      320s of time.Sleep and StateChangeConf.Delay. I turned those intervals into package
      variables that TestMain zeroes, production values untouched. If you don't want that
      seam in the resource code I'll find another way.

    PR shortly. Could you assign the issue to me?

  6. andrwca commented on Sep 20, 2026

    @andrwca
    ContributorAuthor

    I'd like to take this one, unless Andrew Cardy (@andrwca) is already on it.

    Sounds good, I'm not working on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions