Canonical Test Files not Found in Jenkins Build


Has anyone seen this error in Jenkins:

CanonicalTest Error: Import canonical cvs files failed. Server returned 404 for CanonicalName file CanonicalName.json
Loading meta://url-path/package/test/canonical/package/canonical/initial/CanonicalName/CanonicalName.json

A few folks from Services have looked into this. I have tried running tests locally with Canonical Test Runner with the default local development File Source System as well as with an overwritten File Source System for Azure. The file paths in the error in jenkins seems correct upon close examination. The I have no other canonical tests passing in this package, but I do have other canonical tests passing in other packages in the same repository.

I Am not sure if the file path in the Canonical test folder needs to match the FileSource Collection or something. Any ideas on why the file cannot be located by the CI/CD process?

Thank you for your help,



@ColumbusL Have you been provisioning with the -E option before running CanonicalTestRunner.



Yes, I have provisioned with -E



the file path in CI/CD should not match worry about FSC path because the files are place at the right location of the FileSourceCollection once they are picked up. Only issue could be it was not able to read the files from the package,(hence I suggested the -E option.) Could you provide the package details and the jenkins pipeline link in a ticket and I can take a look.

Also could you check if the path where the files are placed is correct
Some documentation is provided about the path on CanonicalTestRunner type.

     * 1. Provision the tenant you want to test. E.g. *myTenant*
     * 2. Find the path to the canonical test folder. A canonical test folder contains two folders named *canonical* and *expected*.
     *    E.g. "myTenant/test/canonical/folder1/canonical" and "myTenant/test/canonical/folder1/expected". In this example,
     *    "myTenant/test/canonical/folder1" is the canonical test folder. Remember the subpath "test/canonical/folder1"
     *    and move on to the next step.
     * 3. Go to workbench, switch to *myTenant*, then type
     *  ```js
     *  var testPackage = MetadataStore.current().package("myTenant", true);
     *  var testPath = MetadataPath.make({repository: testPackage.repository, package: testPackage.package, category: MetadataFileCategory.OTHER, encodedSubPath: "test/canonical/folder1"});
     *  var res = CanonicalTestRunner.testPath(testPath);
     *  ```
     * @param path
     *           Path to the folder where the canonical test exists.
     * @return The test result of the canonical test. The array will only have one item that represents the result of processing all files in the path.
    testPath: ~

1 Like