Add skip-lts-prepass input to optimize .NET SDK installation process (#791)
- Introduced `skip-lts-prepass` input to allow users to skip the LTS runtime pre-pass during installation. - Updated documentation to explain the new input and its usage. - Enhanced tests to verify the behavior of the `skip-lts-prepass` functionality. Co-authored-by: chiranjib-swain <chiranjib-swain@github.com>
This commit is contained in:
1 parent
e2cf7c663b
commit
349aa191ae
8 files changed
+267
-42
No files matched your search
@@ -315,6 +315,44 @@ describe('setup-dotnet tests', () => {
|
||||
expect(capturedCheckLatest).toBe(false);
|
||||
});
|
||||
|
||||
it("should read the 'skip-lts-prepass' input and pass it to DotnetCoreInstaller", async () => {
|
||||
inputs['dotnet-version'] = ['10.0.101'];
|
||||
inputs['dotnet-quality'] = '';
|
||||
inputs['architecture'] = '';
|
||||
inputs['skip-lts-prepass'] = 'true';
|
||||
|
||||
let capturedSkipLtsPrepass: boolean | undefined;
|
||||
installDotnetSpy.mockImplementation(function (this: any) {
|
||||
capturedSkipLtsPrepass = this.skipLtsPrepass;
|
||||
return Promise.resolve('');
|
||||
});
|
||||
|
||||
await setup.run();
|
||||
|
||||
expect(getBooleanInputSpy).toHaveBeenCalledWith('skip-lts-prepass');
|
||||
expect(installDotnetSpy).toHaveBeenCalledTimes(1);
|
||||
expect(capturedSkipLtsPrepass).toBe(true);
|
||||
});
|
||||
|
||||
it("should default 'skip-lts-prepass' to false when the input isn't set", async () => {
|
||||
inputs['dotnet-version'] = ['10.0.101'];
|
||||
inputs['dotnet-quality'] = '';
|
||||
inputs['architecture'] = '';
|
||||
inputs['skip-lts-prepass'] = '';
|
||||
|
||||
let capturedSkipLtsPrepass: boolean | undefined;
|
||||
installDotnetSpy.mockImplementation(function (this: any) {
|
||||
capturedSkipLtsPrepass = this.skipLtsPrepass;
|
||||
return Promise.resolve('');
|
||||
});
|
||||
|
||||
await setup.run();
|
||||
|
||||
expect(getBooleanInputSpy).toHaveBeenCalledWith('skip-lts-prepass');
|
||||
expect(installDotnetSpy).toHaveBeenCalledTimes(1);
|
||||
expect(capturedSkipLtsPrepass).toBe(false);
|
||||
});
|
||||
|
||||
describe("'check-latest' resolution", () => {
|
||||
const captureCheckLatest = async () => {
|
||||
inputs['dotnet-version'] = ['10.0.101'];
|
||||
|
||||
Reference in new issue
Block a user