mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
# Backport This will backport the following commits from `main` to `7.17`: - [[Ops] Make a few tests agnostic of agents' umask (#177455)](https://github.com/elastic/kibana/pull/177455) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Alex Szabo","email":"alex.szabo@elastic.co"},"sourceCommit":{"committedDate":"2024-02-21T16:36:11Z","message":"[Ops] Make a few tests agnostic of agents' umask (#177455)\n\n## Summary\r\nThese tests in their current state would break on the new agents after\r\nwe migrate to the elastic-wide agents, due to a bit different file\r\npermissions. This problem remained even after setting the `umask` to\r\n`0x002` in our new agent images.\r\n\r\nIn this PR, I'm switching the tests, so that they compare reference file\r\npermissions to the to-be permissions, instead of pre-baked values.","sha":"4739e9dbbabc6af01d7c3105dc15ec3aabbc4e2a","branchLabelMapping":{"^v8.14.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Operations","release_note:skip","auto-backport","v8.14.0","v7.17.21","v8.13.3"],"number":177455,"url":"https://github.com/elastic/kibana/pull/177455","mergeCommit":{"message":"[Ops] Make a few tests agnostic of agents' umask (#177455)\n\n## Summary\r\nThese tests in their current state would break on the new agents after\r\nwe migrate to the elastic-wide agents, due to a bit different file\r\npermissions. This problem remained even after setting the `umask` to\r\n`0x002` in our new agent images.\r\n\r\nIn this PR, I'm switching the tests, so that they compare reference file\r\npermissions to the to-be permissions, instead of pre-baked values.","sha":"4739e9dbbabc6af01d7c3105dc15ec3aabbc4e2a"}},"sourceBranch":"main","suggestedTargetBranches":["7.17","8.13"],"targetPullRequestStates":[{"branch":"main","label":"v8.14.0","labelRegex":"^v8.14.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/177455","number":177455,"mergeCommit":{"message":"[Ops] Make a few tests agnostic of agents' umask (#177455)\n\n## Summary\r\nThese tests in their current state would break on the new agents after\r\nwe migrate to the elastic-wide agents, due to a bit different file\r\npermissions. This problem remained even after setting the `umask` to\r\n`0x002` in our new agent images.\r\n\r\nIn this PR, I'm switching the tests, so that they compare reference file\r\npermissions to the to-be permissions, instead of pre-baked values.","sha":"4739e9dbbabc6af01d7c3105dc15ec3aabbc4e2a"}},{"branch":"7.17","label":"v7.17.21","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.13","label":"v8.13.3","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Alex Szabo <alex.szabo@elastic.co>
This commit is contained in:
parent
f89b091734
commit
a9d7bd46b0
2 changed files with 15 additions and 12 deletions
|
@ -166,17 +166,16 @@ describe('copyAll()', () => {
|
|||
});
|
||||
|
||||
it('copies files and directories from source to dest, creating dest if necessary, respecting mode', async () => {
|
||||
const path777 = resolve(FIXTURES, 'bin/world_executable');
|
||||
const path644 = resolve(FIXTURES, 'foo_dir/bar.txt');
|
||||
const pathToExecutable = resolve(FIXTURES, 'bin/world_executable');
|
||||
const pathToNonExecutable = resolve(FIXTURES, 'foo_dir/bar.txt');
|
||||
|
||||
// we're seeing flaky failures because the resulting files sometimes have
|
||||
// 755 permissions. Unless there's a bug in vinyl-fs I can't figure out
|
||||
// where the issue might be, so trying to validate the mode first to narrow
|
||||
// down where the issue might be
|
||||
expect(getCommonMode(path777)).toBe(isWindows ? '666' : '777');
|
||||
expect(getCommonMode(path644)).toBe(isWindows ? '666' : '644');
|
||||
const modeExecutable = getCommonMode(pathToExecutable);
|
||||
const modeNonExecutable = getCommonMode(pathToNonExecutable);
|
||||
|
||||
const destination = resolve(TMP, 'a/b/c');
|
||||
const newPathExecutable = resolve(destination, 'bin/world_executable');
|
||||
const newPathNonExecutable = resolve(destination, 'foo_dir/bar.txt');
|
||||
|
||||
await copyAll(FIXTURES, destination);
|
||||
|
||||
expect((await getChildPaths(resolve(destination, 'foo_dir'))).sort()).toEqual([
|
||||
|
@ -184,8 +183,8 @@ describe('copyAll()', () => {
|
|||
resolve(destination, 'foo_dir/foo'),
|
||||
]);
|
||||
|
||||
expect(getCommonMode(path777)).toBe(isWindows ? '666' : '777');
|
||||
expect(getCommonMode(path644)).toBe(isWindows ? '666' : '644');
|
||||
expect(getCommonMode(newPathExecutable)).toBe(isWindows ? '666' : modeExecutable);
|
||||
expect(getCommonMode(newPathNonExecutable)).toBe(isWindows ? '666' : modeNonExecutable);
|
||||
});
|
||||
|
||||
it('applies select globs if specified, ignores dot files', async () => {
|
||||
|
|
|
@ -70,6 +70,8 @@ it('copies files and directories from source to dest, including dot files, creat
|
|||
source: FIXTURES,
|
||||
destination,
|
||||
});
|
||||
const executableMode = getCommonMode(resolve(FIXTURES, 'bin/world_executable'));
|
||||
const textFileMode = getCommonMode(resolve(FIXTURES, 'foo_dir/bar.txt'));
|
||||
|
||||
expect((await getChildPaths(resolve(destination, 'foo_dir'))).sort()).toEqual([
|
||||
resolve(destination, 'foo_dir/.bar'),
|
||||
|
@ -78,10 +80,12 @@ it('copies files and directories from source to dest, including dot files, creat
|
|||
]);
|
||||
|
||||
expect(getCommonMode(resolve(destination, 'bin/world_executable'))).toBe(
|
||||
IS_WINDOWS ? '666' : '777'
|
||||
IS_WINDOWS ? '666' : executableMode
|
||||
);
|
||||
|
||||
expect(getCommonMode(resolve(destination, 'foo_dir/bar.txt'))).toBe(IS_WINDOWS ? '666' : '644');
|
||||
expect(getCommonMode(resolve(destination, 'foo_dir/bar.txt'))).toBe(
|
||||
IS_WINDOWS ? '666' : textFileMode
|
||||
);
|
||||
});
|
||||
|
||||
it('applies filter function specified', async () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue