Skip to content

Commit

Permalink
2023.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
skardile-perforce committed Jun 23, 2023
1 parent 50f9a1f commit d511cb3
Show file tree
Hide file tree
Showing 10 changed files with 308 additions and 237 deletions.
27 changes: 16 additions & 11 deletions RELEASENOTES.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Release Notes for
P4API.NET, the Helix P4API for .NET

Version 2022.2
Version 2023.1

Introduction

Expand All @@ -19,14 +19,14 @@ Introduction

Important End-of-Life Notice

Cross platform support was provided with the previous release of P4API.NET.
Currently 4 different Nuget packages are published ('p4api.net.core',
'p4api.net', 'p4api.net.x64' and 'p4api.net.x86'). But as 'p4api.net'
Cross platform support was provided with the 2021.2 release of P4API.NET.
Since then, 4 different Nuget packages were published ('p4api.net.core',
'p4api.net', 'p4api.net.x64' and 'p4api.net.x86'). But as 'p4api.net'
contains all the necessary libraries to work on all these 4 platforms, there
is no need for 4 different packages. Hence, this major release of P4API.NET
would be the last to publish all these packages. Starting with the next
release, only the 'p4api.net' package would be published and
other packages would be deprecated
is no need for 4 different packages. Hence, this major release marks these
packages - 'p4api.net.core', 'p4api.net.x64' and 'p4api.net.x86' - as
deprecated. We recommend using the 'p4api.net' package to avoid deprecation
warnings

--------------------------------------------------------------------------

Expand Down Expand Up @@ -78,9 +78,9 @@ Compatibility Statements

API Compatibility

This release of P4API.NET requires the 2022.2 Helix Core
API (2022.2/2407422) for C/C++ (P4API), built with Visual Studio 2019
or later.
This release of P4API.NET requires the 2023.1 Helix Core API
(2023.1/2442900) for C/C++ (P4API), built with Visual Studio 2019 or
later.

C#/.NET Compatibility

Expand Down Expand Up @@ -131,7 +131,12 @@ Key to symbols used in change notes below.
*** -- requires new p4d server program

--------------------------------------------------------------------------
New functionality in 2023.1 (2023.1/2456134) (2023/06/20)

#2446898, #2447440, #2447458 (Job #115785) * **
Updated P4API.NET to support 2023.1 release of Helix Core

--------------------------------------------------------------------------
New functionality in 2022.2 Patch 1 (2022.2/2432799) (2023/04/24)

#2431166 (Job #115331) *
Expand Down
146 changes: 92 additions & 54 deletions p4api.net-unit-test/ClientOptionEnumTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,51 +25,53 @@ public void CleanupTest()
Utilities.LogTestFinish(TestContext);
}

private static string v0 = "noallwrite noclobber nocompress unlocked nomodtime normdir";
private static string v42 = "allwrite noclobber compress unlocked modtime normdir";
private static string v21 = "noallwrite clobber nocompress locked nomodtime rmdir";
private static string v64 = "allwrite clobber compress locked modtime rmdir";
private static string v0 = "noallwrite noclobber nocompress unlocked nomodtime normdir noaltsync";
private static string v42 = "allwrite noclobber compress unlocked modtime normdir noaltsync";
private static string v21 = "noallwrite clobber nocompress locked nomodtime rmdir noaltsync";
private static string v64 = "allwrite clobber compress locked modtime rmdir noaltsync";
private static string hex40 = "noallwrite noclobber nocompress unlocked nomodtime normdir altsync";

private static ClientOptionEnum e0 = new ClientOptionEnum(ClientOption.None);
private static ClientOptionEnum e0 = new ClientOptionEnum(ClientOption.None);
private static ClientOptionEnum e42 = new ClientOptionEnum(ClientOption.AllWrite | ClientOption.Compress | ClientOption.ModTime);
private static ClientOptionEnum e21 = new ClientOptionEnum(ClientOption.Clobber | ClientOption.Locked | ClientOption.RmDir);
private static ClientOptionEnum e64 = new ClientOptionEnum(ClientOption.AllWrite | ClientOption.Clobber | ClientOption.Compress | ClientOption.Locked | ClientOption.ModTime | ClientOption.RmDir);
private static ClientOptionEnum eHex40 = new ClientOptionEnum(ClientOption.AltSync);

#region Additional test attributes
//
//You can use the following additional attributes as you write your tests:
//
//Use ClassInitialize to run code before running the first test in the class
//[ClassInitialize()]
//public static void MyClassInitialize(TestContext testContext)
//{
//}
//
//Use ClassCleanup to run code after all tests in a class have run
//[ClassCleanup()]
//public static void MyClassCleanup()
//{
//}
//
//Use TestInitialize to run code before running each test
//[TestInitialize()]
//public void MyTestInitialize()
//{
//}
//
//Use TestCleanup to run code after each test has run
//[TestCleanup()]
//public void MyTestCleanup()
//{
//}
//
#endregion
#region Additional test attributes
//
//You can use the following additional attributes as you write your tests:
//
//Use ClassInitialize to run code before running the first test in the class
//[ClassInitialize()]
//public static void MyClassInitialize(TestContext testContext)
//{
//}
//
//Use ClassCleanup to run code after all tests in a class have run
//[ClassCleanup()]
//public static void MyClassCleanup()
//{
//}
//
//Use TestInitialize to run code before running each test
//[TestInitialize()]
//public void MyTestInitialize()
//{
//}
//
//Use TestCleanup to run code after each test has run
//[TestCleanup()]
//public void MyTestCleanup()
//{
//}
//
#endregion


/// <summary>
///A test for ClientOptionEnum Constructor
///</summary>
[TestMethod()]
/// <summary>
///A test for ClientOptionEnum Constructor
///</summary>
[TestMethod()]
public void ClientOptionEnumConstructorTest()
{
ClientOptionEnum target = new ClientOptionEnum(v0);
Expand All @@ -80,39 +82,52 @@ public void ClientOptionEnumConstructorTest()
Assert.AreEqual(ClientOption.None, target & ClientOption.Locked);
Assert.AreEqual(ClientOption.None, target & ClientOption.ModTime);
Assert.AreEqual(ClientOption.None, target & ClientOption.RmDir);
Assert.AreEqual(ClientOption.None, target & ClientOption.AltSync);

target = new ClientOptionEnum(v42);
target = new ClientOptionEnum(v42);
Assert.AreNotEqual(ClientOption.None, target);
Assert.AreNotEqual(ClientOption.None, target & ClientOption.AllWrite);
Assert.AreEqual(ClientOption.None, target & ClientOption.Clobber);
Assert.AreNotEqual(ClientOption.None, target & ClientOption.Compress);
Assert.AreEqual(ClientOption.None, target & ClientOption.Locked);
Assert.AreNotEqual(ClientOption.None, target & ClientOption.ModTime);
Assert.AreEqual(ClientOption.None, target & ClientOption.RmDir);
Assert.AreEqual(ClientOption.None, target & ClientOption.AltSync);

target = new ClientOptionEnum(v21);
target = new ClientOptionEnum(v21);
Assert.AreNotEqual(ClientOption.None, target);
Assert.AreEqual(ClientOption.None, target & ClientOption.AllWrite);
Assert.AreNotEqual(ClientOption.None, target & ClientOption.Clobber);
Assert.AreEqual(ClientOption.None, target & ClientOption.Compress);
Assert.AreNotEqual(ClientOption.None, target & ClientOption.Locked);
Assert.AreEqual(ClientOption.None, target & ClientOption.ModTime);
Assert.AreNotEqual(ClientOption.None, target & ClientOption.RmDir);
Assert.AreEqual(ClientOption.None, target & ClientOption.AltSync);

target = new ClientOptionEnum(v64);
target = new ClientOptionEnum(v64);
Assert.AreNotEqual(ClientOption.None, target);
Assert.AreNotEqual(ClientOption.None, target & ClientOption.AllWrite);
Assert.AreNotEqual(ClientOption.None, target & ClientOption.Clobber);
Assert.AreNotEqual(ClientOption.None, target & ClientOption.Compress);
Assert.AreNotEqual(ClientOption.None, target & ClientOption.Locked);
Assert.AreNotEqual(ClientOption.None, target & ClientOption.ModTime);
Assert.AreNotEqual(ClientOption.None, target & ClientOption.RmDir);
}
Assert.AreEqual(ClientOption.None, target & ClientOption.AltSync);

/// <summary>
///A test for Parse
///</summary>
[TestMethod()]
target = new ClientOptionEnum(hex40);
Assert.AreEqual(ClientOption.None, target & ClientOption.AllWrite);
Assert.AreEqual(ClientOption.None, target & ClientOption.Clobber);
Assert.AreEqual(ClientOption.None, target & ClientOption.Compress);
Assert.AreEqual(ClientOption.None, target & ClientOption.Locked);
Assert.AreEqual(ClientOption.None, target & ClientOption.ModTime);
Assert.AreEqual(ClientOption.None, target & ClientOption.RmDir);
Assert.AreEqual(ClientOption.AltSync, target & ClientOption.AltSync);
}

/// <summary>
///A test for Parse
///</summary>
[TestMethod()]
public void ParseTest()
{
ClientOptionEnum target = new ClientOptionEnum(ClientOption.None);
Expand Down Expand Up @@ -151,12 +166,21 @@ public void ParseTest()
Assert.AreNotEqual(ClientOption.None, target & ClientOption.Locked);
Assert.AreNotEqual(ClientOption.None, target & ClientOption.ModTime);
Assert.AreNotEqual(ClientOption.None, target & ClientOption.RmDir);
}

/// <summary>
///A test for ToString
///</summary>
[TestMethod()]
target.Parse(hex40);
Assert.AreEqual(ClientOption.None, target & ClientOption.AllWrite);
Assert.AreEqual(ClientOption.None, target & ClientOption.Clobber);
Assert.AreEqual(ClientOption.None, target & ClientOption.Compress);
Assert.AreEqual(ClientOption.None, target & ClientOption.Locked);
Assert.AreEqual(ClientOption.None, target & ClientOption.ModTime);
Assert.AreEqual(ClientOption.None, target & ClientOption.RmDir);
Assert.AreEqual(ClientOption.AltSync, target & ClientOption.AltSync);
}

/// <summary>
///A test for ToString
///</summary>
[TestMethod()]
public void ToStringTest()
{
ClientOptionEnum v = new ClientOptionEnum(ClientOption.None);
Expand All @@ -178,7 +202,12 @@ public void ToStringTest()
expected = v64;
actual = v.ToString();
Assert.AreEqual(expected, actual);
}

v = new ClientOptionEnum(ClientOption.AltSync);
expected = hex40;
actual = v.ToString();
Assert.AreEqual(expected, actual);
}

/// <summary>
///A test for op_Implicit
Expand Down Expand Up @@ -206,7 +235,12 @@ public void op_ImplicitTest()
expected = e64;
actual = s;
Assert.IsTrue(expected == actual);
}

s = hex40;
expected = eHex40;
actual = s;
Assert.IsTrue(expected == actual);
}

/// <summary>
///A test for op_Implicit
Expand All @@ -230,7 +264,11 @@ public void op_ImplicitTest1()
expected = v64;
actual = e64;
Assert.AreEqual(expected, actual);
}

expected = hex40;
actual = eHex40;
Assert.AreEqual(expected, actual);
}

/// <summary>
///A test for op_Implicit
Expand Down
8 changes: 4 additions & 4 deletions p4api.net-unit-test/ClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void FromTaggedOutputTest()
workspaceInfo["Update"] = "2010/01/02 03:04:05"; // DateTime(2010, 1, 2, 3, 4, 5);
workspaceInfo["Access"] = "2011/02/03 04:05:06"; // DateTime(2011, 2, 3, 4, 5, 6);
workspaceInfo["Owner"] = "JoeOwner";
workspaceInfo["Options"] = "allwrite noclobber compress unlocked modtime normdir";
workspaceInfo["Options"] = "allwrite noclobber compress unlocked modtime normdir noaltsync";
//new ClientOptionEnum(ClientOption.AllWrite | ClientOption.Compress | ClientOption.ModTime);
workspaceInfo["SubmitOptions"] = "revertunchanged+reopen";
//new ClientSubmitOptions(true, SubmitType.RevertUnchanged);
Expand Down Expand Up @@ -183,7 +183,7 @@ public void ParseTest()
{
Client target = new Client(); // TODO: Initialize to an appropriate value
string spec =
"Client:\tclientName\r\n\r\nUpdate:\t2010/01/02 03:04:05\r\n\r\nAccess:\t2011/02/03 04:05:06\r\n\r\nOwner:\tJoeOwner\r\n\r\nHost:\tMissManners\r\n\r\nDescription:\r\n\tMiss Manners client\r\n\r\nRoot:\tC:\\clientname\r\n\r\nAltRoots:\r\n\tC:\\alt0\r\n\tC:\\alt1\r\n\r\nChangeView:\r\n\t//depot/main/p4/changeview1@1\r\n\t//depot/main/p4/changeview2@1\r\n\r\nOptions:\tallwrite noclobber compress unlocked modtime normdir\r\n\r\nSubmitOptions:\trevertunchanged+reopen\r\n\r\nLineEnd:\tLocal\r\n\r\nView:\r\n\t//depot/main/p4/... //dbarbee_win-dbarbee/main/p4/...\r\n\t-//usr/... //dbarbee_win-dbarbee/usr/...\r\n\t+//spec/... //dbarbee_win-dbarbee/spec/...\r\n";
"Client:\tclientName\r\n\r\nUpdate:\t2010/01/02 03:04:05\r\n\r\nAccess:\t2011/02/03 04:05:06\r\n\r\nOwner:\tJoeOwner\r\n\r\nHost:\tMissManners\r\n\r\nDescription:\r\n\tMiss Manners client\r\n\r\nRoot:\tC:\\clientname\r\n\r\nAltRoots:\r\n\tC:\\alt0\r\n\tC:\\alt1\r\n\r\nChangeView:\r\n\t//depot/main/p4/changeview1@1\r\n\t//depot/main/p4/changeview2@1\r\n\r\nOptions:\tallwrite noclobber compress unlocked modtime normdir noaltsync\r\n\r\nSubmitOptions:\trevertunchanged+reopen\r\n\r\nLineEnd:\tLocal\r\n\r\nView:\r\n\t//depot/main/p4/... //dbarbee_win-dbarbee/main/p4/...\r\n\t-//usr/... //dbarbee_win-dbarbee/usr/...\r\n\t+//spec/... //dbarbee_win-dbarbee/spec/...\r\n";
bool expected = true;
bool actual;
actual = target.Parse(spec);
Expand Down Expand Up @@ -248,7 +248,7 @@ public void ToStringTestjob084053()
});

string expected =
"Client:\tclientName\n\nUpdate:\t2010/01/02 03:04:05\n\nAccess:\t2011/02/03 04:05:06\n\nOwner:\tJoeOwner\n\nHost:\tMissManners\n\nDescription:\n\tMiss Manners client\n\nRoot:\tC:\\clientname\n\nAltRoots:\n\tC:\\alt0\n\tC:\\alt1\n\nOptions:\tnoallwrite noclobber nocompress unlocked nomodtime normdir\n\nSubmitOptions:\tsubmitunchanged\n\nLineEnd:\tLocal\n\nType:\twriteable\n\nStream:\t//Stream/main\n\nStreamAtChange:\t111\n\nServerID:\t"+ configuration.ServerPort +"\n\nView:\n\t//depot/main/p4/... //dbarbee_win-dbarbee/main/p4/...\n\t-//usr/... //dbarbee_win-dbarbee/usr/...\n\t+//spec/... //dbarbee_win-dbarbee/spec/...\n";
"Client:\tclientName\n\nUpdate:\t2010/01/02 03:04:05\n\nAccess:\t2011/02/03 04:05:06\n\nOwner:\tJoeOwner\n\nHost:\tMissManners\n\nDescription:\n\tMiss Manners client\n\nRoot:\tC:\\clientname\n\nAltRoots:\n\tC:\\alt0\n\tC:\\alt1\n\nOptions:\tnoallwrite noclobber nocompress unlocked nomodtime normdir noaltsync\n\nSubmitOptions:\tsubmitunchanged\n\nLineEnd:\tLocal\n\nType:\twriteable\n\nStream:\t//Stream/main\n\nStreamAtChange:\t111\n\nServerID:\t" + configuration.ServerPort +"\n\nView:\n\t//depot/main/p4/... //dbarbee_win-dbarbee/main/p4/...\n\t-//usr/... //dbarbee_win-dbarbee/usr/...\n\t+//spec/... //dbarbee_win-dbarbee/spec/...\n";

string actual;
actual = target.ToString();
Expand Down Expand Up @@ -289,7 +289,7 @@ public void ToStringTest()
});

string expected =
"Client:\tclientName\n\nUpdate:\t2010/01/02 03:04:05\n\nAccess:\t2011/02/03 04:05:06\n\nOwner:\tJoeOwner\n\nHost:\tMissManners\n\nDescription:\n\tMiss Manners client\n\nRoot:\tC:\\clientname\n\nAltRoots:\n\tC:\\alt0\n\tC:\\alt1\n\nOptions:\tallwrite noclobber compress unlocked modtime normdir\n\nSubmitOptions:\trevertunchanged+reopen\n\nLineEnd:\tLocal\n\nType:\twriteable\n\nStream:\t//Stream/main\n\nStreamAtChange:\t111\n\nServerID:\t"+ configuration.ServerPort + "\n\nChangeView:\t//dbarbee_win-dbarbee/main/p4/test@2\n\nView:\n\t//depot/main/p4/... //dbarbee_win-dbarbee/main/p4/...\n\t-//usr/... //dbarbee_win-dbarbee/usr/...\n\t+//spec/... //dbarbee_win-dbarbee/spec/...\n";
"Client:\tclientName\n\nUpdate:\t2010/01/02 03:04:05\n\nAccess:\t2011/02/03 04:05:06\n\nOwner:\tJoeOwner\n\nHost:\tMissManners\n\nDescription:\n\tMiss Manners client\n\nRoot:\tC:\\clientname\n\nAltRoots:\n\tC:\\alt0\n\tC:\\alt1\n\nOptions:\tallwrite noclobber compress unlocked modtime normdir noaltsync\n\nSubmitOptions:\trevertunchanged+reopen\n\nLineEnd:\tLocal\n\nType:\twriteable\n\nStream:\t//Stream/main\n\nStreamAtChange:\t111\n\nServerID:\t"+ configuration.ServerPort + "\n\nChangeView:\t//dbarbee_win-dbarbee/main/p4/test@2\n\nView:\n\t//depot/main/p4/... //dbarbee_win-dbarbee/main/p4/...\n\t-//usr/... //dbarbee_win-dbarbee/usr/...\n\t+//spec/... //dbarbee_win-dbarbee/spec/...\n";
string actual;
actual = target.ToString();
Assert.AreEqual(expected, actual);
Expand Down
2 changes: 1 addition & 1 deletion p4api.net-unit-test/RepositoryTest.Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Created by xp1.
c:\XP1_dev_A1
c:\XP1_dev_A2
Options: noallwrite noclobber nocompress unlocked nomodtime normdir
Options: noallwrite noclobber nocompress unlocked nomodtime normdir noaltsync
SubmitOptions: submitunchanged
Expand Down
5 changes: 5 additions & 0 deletions p4api.net-unit-test/RepositoryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1270,6 +1270,11 @@ public void GetFileMetadataStaleRevTest(Utilities.CheckpointType cptype)
///A test for GetFileMetaDataFileCount
///</summary>
[TestMethod()]
[Ignore]
// Broken by a bug on server side P4-23337 (Discrepancy in the result of totalFileCount in fstat - with different values of -m).
// With -m value as 1, the server has made optimization to skip calculating totalFileCount
// Existing file count might be already wrong.But with 23.1 server the count started deviating when '-m' value was either 1 or greater than 1. So this issue got surfaced.
// Test can be made alive once the bug is fixed.
public void GetFileMetaDataFileCountTest()
{
string uri = configuration.ServerPort;
Expand Down
Loading

0 comments on commit d511cb3

Please sign in to comment.